|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
30 #include <vnet/ip-neighbor/ip_neighbor.api_enum.h>
31 #include <vnet/ip-neighbor/ip_neighbor.api_types.h>
34 #define REPLY_MSG_ID_BASE msg_id_base
40 static vl_api_ip_neighbor_flags_t
45 if (
f & IP_NEIGHBOR_FLAG_STATIC)
47 if (
f & IP_NEIGHBOR_FLAG_NO_FIB_ENTRY)
116 static f64 last_time;
123 clib_warning (
"neighbor event for %U to pid %d: queue stuffed!",
194 f |= IP_NEIGHBOR_FLAG_STATIC;
196 f |= IP_NEIGHBOR_FLAG_NO_FIB_ENTRY;
219 if (!(
flags & IP_NEIGHBOR_FLAG_STATIC) &&
220 !(
flags & IP_NEIGHBOR_FLAG_DYNAMIC))
221 flags |= IP_NEIGHBOR_FLAG_DYNAMIC;
249 vl_api_want_ip_neighbor_events_reply_t *rmp;
260 .ipw_api_version = 1,
269 REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_REPLY);
276 vl_api_want_ip_neighbor_events_reply_t *rmp;
287 .ipw_api_version = 2,
296 REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_V2_REPLY);
302 vl_api_ip_neighbor_config_reply_t *rmp;
320 vl_api_ip_neighbor_replace_begin_reply_t *rmp;
326 REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_BEGIN_REPLY);
333 vl_api_ip_neighbor_replace_end_reply_t *rmp;
339 REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_END_REPLY);
345 vl_api_ip_neighbor_flush_reply_t *rmp;
361 #define vl_msg_name_crc_list
362 #include <vnet/ip-neighbor/ip_neighbor.api.h>
363 #undef vl_msg_name_crc_list
365 #include <vnet/ip-neighbor/ip_neighbor.api.c>
VLIB_API_INIT_FUNCTION(ip_neighbor_api_init)
A representation of an IP neighbour/peer.
static walk_rc_t send_ip_neighbor_details(index_t ipni, void *arg)
void ip_neighbor_free(ip_neighbor_t *ipn)
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
void ip_neighbor_handle_event(ip_neighbor_event_t *ipne)
From the watcher to the API to publish a new neighbor.
vl_api_address_family_t af
IP neighbors dump response.
#define REPLY_MACRO2(t, body)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
int ip_neighbor_config(ip_address_family_t af, u32 limit, u32 age, bool recycle)
static f64 clib_host_to_net_f64(f64 x)
Enable/disable periodic IP neighbor scan.
ip_neighbor_t * ip_neighbor_get(index_t ipni)
@ IP_API_NEIGHBOR_FLAG_NONE
static void vl_api_ip_neighbor_flush_t_handler(vl_api_ip_neighbor_flush_t *mp)
vl_api_interface_index_t sw_if_index[default=0xffffffff]
static void vl_api_want_ip_neighbor_events_v2_t_handler(vl_api_want_ip_neighbor_events_v2_t *mp)
static void vl_api_ip_neighbor_replace_begin_t_handler(vl_api_ip_neighbor_replace_begin_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * ip_neighbor_api_init(vlib_main_t *vm)
IP neighbor flush request - removes all neighbours.
void ip_neighbor_unwatch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
static vl_api_ip_neighbor_flags_t ip_neighbor_flags_encode(ip_neighbor_flags_t f)
import vnet interface_types api
vl_api_ip_neighbor_t neighbor
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
IP neighbor add / del reply.
ip_neighbor_flags_t ipn_flags
Falgs for this object.
static void setup_message_id_table(api_main_t *am)
vl_api_ip_neighbor_t neighbor
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs.
int ip_address_family_decode(vl_api_address_family_t af, ip_address_family_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
@ IP_API_NEIGHBOR_FLAG_STATIC
IP neighbour replace end.
ip_neighbor_key_t * ipn_key
The idempotent key.
An API client registration, only in vpp/vlib.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u8 * format_ip_address(u8 *s, va_list *args)
int ip_neighbor_add(const ip_address_t *ip, const mac_address_t *mac, u32 sw_if_index, ip_neighbor_flags_t flags, u32 *stats_index)
void ip_neighbor_walk(ip_address_family_t af, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
vl_api_registration_t * reg
IP neighbor add / del request.
#define ip_address_initializer
f64 ipn_time_last_updated
Aging related data.
vl_api_ip_neighbor_event_flags_t flags
int ip_neighbor_del(const ip_address_t *ip, u32 sw_if_index)
#define REPLY_MSG_ID_BASE
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
#define BAD_SW_IF_INDEX_LABEL
void ip_neighbor_del_all(ip_address_family_t af, u32 sw_if_index)
Register for IP neighbour events creation.
IP neighbour replace begin.
void mac_address_encode(const mac_address_t *in, u8 *out)
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
void ip_neighbor_watch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
static int vl_api_can_send_msg(vl_api_registration_t *rp)
struct ip_neighbor_dump_ctx_t_ ip_neighbor_dump_ctx_t
void ip_neighbor_sweep(ip_address_family_t af)
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
vl_api_ip_neighbor_t neighbor
vl_api_address_family_t af
static void vl_api_want_ip_neighbor_events_t_handler(vl_api_want_ip_neighbor_events_t *mp)
static void vl_api_ip_neighbor_replace_end_t_handler(vl_api_ip_neighbor_replace_end_t *mp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_interface_index_t sw_if_index[default=0xffffffff]
static vlib_main_t * vlib_get_main(void)
void ip_neighbor_mark(ip_address_family_t af)
static void vl_api_ip_neighbor_dump_t_handler(vl_api_ip_neighbor_dump_t *mp)
vl_api_interface_index_t sw_if_index[default=0xffffffff]
#define clib_warning(format, args...)
ip_neighbor_event_flags_t ipne_flags
vl_api_interface_index_t sw_if_index[default=0xffffffff]
static f64 vlib_time_now(vlib_main_t *vm)
static void ip_neighbor_encode(vl_api_ip_neighbor_t *api, const ip_neighbor_t *ipn)
static ip_neighbor_flags_t ip_neighbor_flags_decode(vl_api_ip_neighbor_flags_t v)
static void vl_api_ip_neighbor_add_del_t_handler(vl_api_ip_neighbor_add_del_t *mp, vlib_main_t *vm)
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs.
Register for IP neighbour events (creation or deletion)
ip_neighbor_watcher_t ipne_watch
vl_api_interface_index_t sw_if_index
static void vl_api_ip_neighbor_config_t_handler(vl_api_ip_neighbor_config_t *mp)
mac_address_t ipn_mac
The learned MAC address of the neighbour.
enum walk_rc_t_ walk_rc_t
Walk return code.
vl_api_ip_neighbor_t neighbor
@ IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY
enum ip_address_family_t_ ip_address_family_t
void * vl_msg_api_alloc(int nbytes)
vl_api_address_family_t af
vl_api_wireguard_peer_flags_t flags