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;
231 flags, &stats_index);
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> 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.
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
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...
#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]
ip_neighbor_event_flags_t ipne_flags
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 * vl_msg_api_alloc(int nbytes)
int ip_neighbor_del(const ip_address_t *ip, 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)
#define ip_address_initializer
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)
void ip_neighbor_del_all(ip_address_family_t af, u32 sw_if_index)
void ip_neighbor_unwatch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
void ip_neighbor_mark(ip_address_family_t af)
void ip_neighbor_sweep(ip_address_family_t af)
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)
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)
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
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)
static void setup_message_id_table(api_main_t *am)
#define BAD_SW_IF_INDEX_LABEL
vl_api_interface_index_t sw_if_index[default=0xffffffff]
vl_api_registration_t * reg
#define clib_warning(format, args...)
u8 * format_ip_address(u8 *s, va_list *args)
void ip_neighbor_watch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
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)
void ip_neighbor_walk(ip_address_family_t af, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
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.
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
vl_api_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.
int ip_neighbor_config(ip_address_family_t af, u32 limit, u32 age, bool recycle)
vl_api_interface_index_t sw_if_index
ip_neighbor_watcher_t ipne_watch
#define VALIDATE_SW_IF_INDEX(mp)