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 47 static vl_api_ip_neighbor_flags_t
52 if (f & IP_NEIGHBOR_FLAG_STATIC)
54 if (f & IP_NEIGHBOR_FLAG_NO_FIB_ENTRY)
124 static f64 last_time;
131 clib_warning (
"neighbor event for %U to pid %d: queue stuffed!",
205 f |= IP_NEIGHBOR_FLAG_STATIC;
207 f |= IP_NEIGHBOR_FLAG_NO_FIB_ENTRY;
231 if (!(flags & IP_NEIGHBOR_FLAG_STATIC) &&
232 !(flags & IP_NEIGHBOR_FLAG_DYNAMIC))
233 flags |= IP_NEIGHBOR_FLAG_DYNAMIC;
243 flags, &stats_index);
261 vl_api_want_ip_neighbor_events_reply_t *rmp;
273 .ipw_api_version = 1,
282 REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_REPLY);
289 vl_api_want_ip_neighbor_events_reply_t *rmp;
301 .ipw_api_version = 2,
310 REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_V2_REPLY);
316 vl_api_ip_neighbor_config_reply_t *rmp;
334 vl_api_ip_neighbor_replace_begin_reply_t *rmp;
340 REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_BEGIN_REPLY);
347 vl_api_ip_neighbor_replace_end_reply_t *rmp;
353 REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_END_REPLY);
359 vl_api_ip_neighbor_flush_reply_t *rmp;
375 #define vl_msg_name_crc_list 376 #include <vnet/ip-neighbor/ip_neighbor.api.h> 377 #undef vl_msg_name_crc_list 379 #include <vnet/ip-neighbor/ip_neighbor.api.c> 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.
Enable/disable periodic IP neighbor scan.
static void ip_neighbor_encode(vl_api_ip_neighbor_t *api, const ip_neighbor_t *ipn)
void ip_neighbor_handle_event(ip_neighbor_event_t *ipne)
From the watcher to the API to publish a new neighbor.
f64 ipn_time_last_updated
Aging related data.
vl_api_wireguard_peer_flags_t flags
vl_api_address_family_t af
void mac_address_encode(const mac_address_t *in, u8 *out)
vl_api_ip_neighbor_t neighbor
static ip_neighbor_flags_t ip_neighbor_flags_decode(vl_api_ip_neighbor_flags_t v)
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs...
void ip_neighbor_del_all(ip46_type_t type, u32 sw_if_index)
int ip_neighbor_add(const ip46_address_t *ip, ip46_type_t type, const mac_address_t *mac, u32 sw_if_index, ip_neighbor_flags_t flags, u32 *stats_index)
void ip_neighbor_sweep(ip46_type_t type)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
void ip_neighbor_free(ip_neighbor_t *ipn)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_ip_neighbor_t neighbor
static walk_rc_t send_ip_neighbor_details(index_t ipni, void *arg)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
vl_api_interface_index_t sw_if_index[default=0xffffffff]
int ip_neighbor_config(ip46_type_t type, u32 limit, u32 age, bool recycle)
ip_neighbor_event_flags_t ipne_flags
void * vl_msg_api_alloc(int nbytes)
int ip_neighbor_del(const ip46_address_t *ip, ip46_type_t type, u32 sw_if_index)
enum walk_rc_t_ walk_rc_t
Walk return code.
static int vl_api_can_send_msg(vl_api_registration_t *rp)
Register for IP neighbour events (creation or deletion)
static void vl_api_ip_neighbor_config_t_handler(vl_api_ip_neighbor_config_t *mp)
A representation of an IP neighbour/peer.
static void vl_api_ip_neighbor_add_del_t_handler(vl_api_ip_neighbor_add_del_t *mp, vlib_main_t *vm)
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
void ip_neighbor_watch(const ip46_address_t *ip, ip46_type_t type, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
vl_api_fib_path_type_t type
static clib_error_t * ip_neighbor_api_init(vlib_main_t *vm)
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)
void ip_neighbor_mark(ip46_type_t type)
VLIB_API_INIT_FUNCTION(ip_neighbor_api_init)
mac_address_t ipn_mac
The learned MAC address of the neighbour.
static void vl_api_ip_neighbor_flush_t_handler(vl_api_ip_neighbor_flush_t *mp)
format_function_t format_ip46_address
An API client registration, only in vpp/vlib.
static void vl_api_want_ip_neighbor_events_t_handler(vl_api_want_ip_neighbor_events_t *mp)
#define BAD_SW_IF_INDEX_LABEL
vl_api_interface_index_t sw_if_index[default=0xffffffff]
vl_api_registration_t * reg
void ip_neighbor_walk(ip46_type_t type, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
#define clib_warning(format, args...)
IP neighbor add / del reply.
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs...
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_ip_neighbor_replace_end_t_handler(vl_api_ip_neighbor_replace_end_t *mp)
static vl_api_ip_neighbor_flags_t ip_neighbor_flags_encode(ip_neighbor_flags_t f)
IP neighbor add / del request.
static f64 clib_host_to_net_f64(f64 x)
#define REPLY_MSG_ID_BASE
ip_neighbor_key_t * ipn_key
The idempotent key.
static void vl_api_ip_neighbor_dump_t_handler(vl_api_ip_neighbor_dump_t *mp)
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
IP neighbour replace end.
IP neighbors dump response.
static vlib_main_t * vlib_get_main(void)
enum ip_address_family_t_ ip_address_family_t
vl_api_ip_neighbor_t neighbor
Register for IP neighbour events creation.
vl_api_ip_neighbor_t neighbor
IP neighbor flush request - removes all neighbours.
struct ip_neighbor_dump_ctx_t_ ip_neighbor_dump_ctx_t
vl_api_interface_index_t sw_if_index[default=0xffffffff]
ip_neighbor_flags_t ipn_flags
Falgs for this object.
IP neighbour replace begin.
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static void vl_api_ip_neighbor_replace_begin_t_handler(vl_api_ip_neighbor_replace_begin_t *mp)
ip_neighbor_t * ip_neighbor_get(index_t ipni)
vl_api_address_family_t af
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
vl_api_address_family_t af
static ip46_type_t ip46_type_from_af(ip_address_family_t af)
vl_api_ip_neighbor_event_flags_t flags
import vnet interface_types api
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
#define ip46_address_initializer
vl_api_interface_index_t sw_if_index
ip_neighbor_watcher_t ipne_watch
#define VALIDATE_SW_IF_INDEX(mp)
void ip_neighbor_unwatch(const ip46_address_t *ip, ip46_type_t type, u32 sw_if_index, const ip_neighbor_watcher_t *watch)