|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
23 #include <vnet/ip-neighbor/ip_neighbor.api_enum.h>
24 #include <vnet/ip-neighbor/ip_neighbor.api_types.h>
45 uword event_type = ~0;
73 .name =
"ip-neighbor-event",
90 watchers = (ip_neighbor_watcher_t*) *v;
92 vec_foreach_index_backwards (pos, watchers) {
93 if (watchers[pos].ipw_client == client_index)
94 vec_del1(watchers, pos);
189 0, 1,
sizeof(*ipne));
222 key.ipnk_sw_if_index = ~0;
242 watchers = (ip_neighbor_watcher_t*) *v;
244 ASSERT(vec_len(watchers));
245 vlib_cli_output (vm,
"Key: %U", format_ip_neighbor_key, key);
247 vec_foreach (watcher, watchers)
248 vlib_cli_output (vm,
" %U", format_ip_neighbor_watcher, watcher);
256 .path =
"show ip neighbor-watcher",
258 .short_help =
"show ip neighbors-watcher",
A representation of an IP neighbour/peer.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static int ip_neighbor_watch_cmp(const ip_neighbor_watcher_t *w1, const ip_neighbor_watcher_t *w2)
static clib_error_t * want_ip_neighbor_events_reaper(u32 client_index)
#define clib_memcpy(d, s, n)
static clib_error_t * ip_neighbor_watch_init(vlib_main_t *vm)
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
#define clib_memcmp(s1, s2, m1)
ip_neighbor_t * ip_neighbor_get(index_t ipni)
static uword ip_neighbor_event_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
vlib_node_registration_t ip_neighbor_event_process_node
(constructor) VLIB_REGISTER_NODE (ip_neighbor_event_process_node)
static uword * mhash_get(mhash_t *h, const void *key)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void ip_neighbor_clone(const ip_neighbor_t *ipn, ip_neighbor_t *clone)
__clib_export void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
#define vec_search_with_function(v, E, fn)
Search a vector for the index of the entry that matches.
void ip_neighbor_unwatch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
static void ip_neighbor_signal(ip_neighbor_watcher_t *watchers, index_t ipni, ip_neighbor_event_flags_t flags)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void * vlib_process_get_event_data(vlib_main_t *vm, uword *return_event_type_opaque)
ip_neighbor_key_t * ipn_key
The idempotent key.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static void * vlib_process_signal_event_data(vlib_main_t *vm, uword node_index, uword type_opaque, uword n_data_elts, uword n_data_elt_bytes)
void ip_neighbor_publish(index_t ipni, ip_neighbor_event_flags_t flags)
#define VLIB_CLI_COMMAND(x,...)
Database of registered watchers The key for a watcher is {type, sw_if_index, addreess} interface=~0 /...
static vlib_cli_command_t show_ip_neighbor_watchers_cmd_node
(constructor) VLIB_CLI_COMMAND (show_ip_neighbor_watchers_cmd_node)
static ip_neighbor_watch_db_t ipnw_db
VL_MSG_API_REAPER_FUNCTION(want_ip_neighbor_events_reaper)
void ip_neighbor_handle_event(ip_neighbor_event_t *ipne)
From the watcher to the API to publish a new neighbor.
struct _vlib_node_registration vlib_node_registration_t
#define vec_free(V)
Free vector's memory (no header).
void ip_neighbor_watch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
#define VLIB_INIT_FUNCTION(x)
struct ip_neighbor_watch_db_t_ ip_neighbor_watch_db_t
Database of registered watchers The key for a watcher is {type, sw_if_index, addreess} interface=~0 /...
#define vec_foreach(var, vec)
Vector iterator.
static vlib_main_t * vlib_get_main(void)
vnet_interface_output_runtime_t * rt
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
ip_neighbor_event_flags_t ipne_flags
#define mhash_foreach(k, v, mh, body)
static clib_error_t * ip_neighbor_watchers_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ip_neighbor_watcher_t ipne_watch
vl_api_interface_index_t sw_if_index
void ip_address_reset(ip_address_t *ip)
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
#define vec_del1(v, i)
Delete the element at index I.
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
enum ip_neighbor_event_flags_t_ ip_neighbor_event_flags_t
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags