70 .ipndb_recycle =
false,
76 .ipndb_recycle =
false,
81 #define IP_NEIGHBOR_DBG(...) \ 82 vlib_log_debug (ipn_logger, __VA_ARGS__); 84 #define IP_NEIGHBOR_INFO(...) \ 85 vlib_log_notice (ipn_logger, __VA_ARGS__); 99 return (ipn - ip_neighbor_pool);
105 ipn->
ipn_flags &= ~IP_NEIGHBOR_FLAG_STALE;
111 return (ipn->
ipn_flags & IP_NEIGHBOR_FLAG_DYNAMIC);
197 vec_validate (ip_neighbor_db[af].ipndb_hash, sw_if_index);
199 if (!ip_neighbor_db[af].ipndb_hash[sw_if_index])
203 hash_set_mem (ip_neighbor_db[af].ipndb_hash[sw_if_index],
218 vec_validate (ip_neighbor_db[af].ipndb_hash, sw_if_index);
248 return (type ==
AF_IP4 ? 32 : 128);
289 vec_validate (ip_neighbor_db[af].ipndb_n_elts_per_fib, fib_index);
293 if (1 == ip_neighbor_db[af].ipndb_n_elts_per_fib[fib_index])
339 if (0 == ip_neighbor_db[af].ipndb_n_elts_per_fib[fib_index])
351 ipn_key->ipnk_sw_if_index,
365 rewrite_header.sw_if_index,
420 if (!ip_neighbor_db[af].ipndb_recycle)
446 if (ip_neighbor_db[af].ipndb_limit &&
447 (ip_neighbor_db[af].ipndb_n_elts >= ip_neighbor_db[af].ipndb_limit))
467 if (!(ipn->
ipn_flags & IP_NEIGHBOR_FLAG_NO_FIB_ENTRY))
507 if (!(flags & IP_NEIGHBOR_FLAG_STATIC) &&
508 (ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STATIC))
512 goto check_customers;
519 if ((flags & IP_NEIGHBOR_FLAG_STATIC) &&
520 !(ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STATIC))
523 ipn->
ipn_flags |= IP_NEIGHBOR_FLAG_STATIC;
524 ipn->
ipn_flags &= ~IP_NEIGHBOR_FLAG_DYNAMIC;
534 goto check_customers;
550 return VNET_API_ERROR_LIMIT_EXCEEDED;
592 return (VNET_API_ERROR_NO_SUCH_ENTRY);
643 .ipnk_sw_if_index = adj->rewrite_header.sw_if_index,
673 adj->rewrite_header.sw_if_index,
714 IP_NEIGHBOR_FLAG_DYNAMIC, NULL);
729 flags = IP_NEIGHBOR_FLAG_DYNAMIC;
740 else if (
unformat (input,
"static"))
742 flags |= IP_NEIGHBOR_FLAG_STATIC;
743 flags &= ~IP_NEIGHBOR_FLAG_DYNAMIC;
745 else if (
unformat (input,
"no-fib-entry"))
746 flags |= IP_NEIGHBOR_FLAG_NO_FIB_ENTRY;
747 else if (
unformat (input,
"count %d", &count))
753 if (sw_if_index == ~0 ||
756 "specify interface, IP address and MAC: `%U'",
805 .path =
"set ip neighbor",
807 "set ip neighbor [del] <intfc> <ip-address> <mac-address> [static] [no-fib-entry] [count <count>] [fib-id <fib-id>] [proxy <lo-addr> - <hi-addr>]",
811 .path =
"ip neighbor",
813 "ip neighbor [del] <intfc> <ip-address> <mac-address> [static] [no-fib-entry] [count <count>] [fib-id <fib-id>] [proxy <lo-addr> - <hi-addr>]",
821 index_t *ipni1 = a1, *ipni2 = a2;
845 if ((sw_if_index == ~0 ||
870 "Flags",
"Ethernet",
"Interface");
902 "Flags",
"Ethernet",
"Interface");
964 .path =
"show ip neighbors",
966 .short_help =
"show ip neighbors [interface]",
969 .path =
"show ip4 neighbors",
971 .short_help =
"show ip4 neighbors [interface]",
974 .path =
"show ip6 neighbors",
976 .short_help =
"show ip6 neighbors [interface]",
979 .path =
"show ip neighbor",
981 .short_help =
"show ip neighbor [interface]",
984 .path =
"show ip4 neighbor",
986 .short_help =
"show ip4 neighbor [interface]",
989 .path =
"show ip6 neighbor",
991 .short_help =
"show ip6 neighbor [interface]",
994 .path =
"show ip4 neighbor-sorted",
996 .short_help =
"show ip4 neighbor-sorted",
999 .path =
"show ip6 neighbor-sorted",
1001 .short_help =
"show ip6 neighbor-sorted",
1010 ip_nbr_vfts[af] = *vft;
1046 if (~0 == sw_if_index)
1065 if (
vec_len (ip_neighbor_db[af].ipndb_hash) <= sw_if_index)
1084 if (ip_nbr_vfts[
AF_IP4].inv_proxy4_add)
1086 return (ip_nbr_vfts[
AF_IP4].inv_proxy4_add (fib_index, start, end));
1097 if (ip_nbr_vfts[
AF_IP4].inv_proxy4_del)
1099 return (ip_nbr_vfts[
AF_IP4].inv_proxy4_del (fib_index, start, end));
1107 if (ip_nbr_vfts[
AF_IP4].inv_proxy4_enable)
1109 return (ip_nbr_vfts[
AF_IP4].inv_proxy4_enable (sw_if_index));
1117 if (ip_nbr_vfts[
AF_IP4].inv_proxy4_disable)
1119 return (ip_nbr_vfts[
AF_IP4].inv_proxy4_disable (sw_if_index));
1127 if (ip_nbr_vfts[
AF_IP6].inv_proxy6_add)
1129 return (ip_nbr_vfts[
AF_IP6].inv_proxy6_add (sw_if_index, addr));
1137 if (ip_nbr_vfts[
AF_IP6].inv_proxy6_del)
1139 return (ip_nbr_vfts[
AF_IP6].inv_proxy6_del (sw_if_index, addr));
1184 vec_add1 (ipnis, ipn - ip_neighbor_pool);
1218 vec_add1 (ipnis, ipn - ip_neighbor_pool);
1233 ipn->
ipn_flags |= IP_NEIGHBOR_FLAG_STALE;
1257 if (ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STALE)
1294 if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
1318 sw_if_index, (is_add ?
"add" :
"del"));
1320 if (!is_add && sw_if_index != ~0)
1382 u32 if_address_index,
u32 is_del)
1389 (is_del ?
"del" :
"add"),
1401 .length = address_length,
1424 u32 if_address_index,
u32 is_del)
1433 (is_del ?
"del" :
"add"));
1443 .length = address_length,
1480 u32 new_fib_index,
u32 old_fib_index)
1483 .old_fib_index = old_fib_index,
1484 .new_fib_index = new_fib_index,
1494 u32 new_fib_index,
u32 old_fib_index)
1497 .old_fib_index = old_fib_index,
1498 .new_fib_index = new_fib_index,
1511 #define IP_NEIGHBOR_PROCESS_SLEEP_LONG (0) 1523 ipndb_age = ip_neighbor_db[af].
ipndb_age;
1527 if (ttl > ipndb_age)
1551 *wait = ipndb_age - ttl + 1;
1568 uword event_type, *event_data = NULL;
1613 timeout =
clib_min (wait, timeout);
1623 timeout =
clib_min (wait, timeout);
1631 if (!ip_neighbor_db[af].ipndb_age)
1676 .name =
"ip4-neighbor-age-process",
1681 .name =
"ip6-neighbor-age-process",
1711 ip_neighbor_db[af].ipndb_limit,
1712 ip_neighbor_db[af].ipndb_age,
1713 ip_neighbor_db[af].ipndb_recycle);
1722 .path =
"show ip neighbor-config",
1724 .short_help =
"show ip neighbor-config",
1758 .function_opaque = 0,
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
ethernet_address_change_ctx_t * address_change_callbacks
Functions to call when interface hw address changes.
static walk_rc_t ip_neighbor_walk_table_bind(index_t ipni, void *arg)
static index_t ip_neighbor_get_index(const ip_neighbor_t *ipn)
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Add one path to an entry (aka route) in the FIB.
void mac_address_increment(mac_address_t *mac)
void adj_nbr_walk_nh(u32 sw_if_index, fib_protocol_t adj_nh_proto, const ip46_address_t *nh, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given next-hop.
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
const mac_address_t * ip_neighbor_get_mac(const ip_neighbor_t *ipn)
#define clib_llist_is_empty(LP, name, H)
Check is list is empty.
static void ip_neighbor_add_del_interface_address_v4(ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
ip4_table_bind_function_t * function
f64 ipn_time_last_updated
Aging related data.
struct ip_neighbor_db_t_ ip_neighbor_db_t
ip_neighbor_elt_t * ip_neighbor_elt_pool
Pool of linked list elemeents.
static void ip_neighbor_adj_fib_add(ip_neighbor_t *ipn, u32 fib_index)
static ip_neighbor_t * ip_neighbor_pool
Pool for All IP neighbors.
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
ip4_add_del_interface_address_callback_t * add_del_interface_address_callbacks
Functions to call when interface address changes.
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
vl_api_wireguard_peer_flags_t flags
An indication that the rewrite is incomplete, i.e.
static uword * vlib_process_wait_for_event(vlib_main_t *vm)
An indication that the rewrite is complete, i.e.
vnet_main_t * vnet_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static clib_error_t * ip6_neighbor_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_node_registration_t ip6_neighbor_age_process_node
(constructor) VLIB_REGISTER_NODE (ip6_neighbor_age_process_node)
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
void ip_neighbor_probe_dst(u32 sw_if_index, ip_address_family_t af, const ip46_address_t *dst)
static f64 vlib_time_now(vlib_main_t *vm)
static clib_error_t * ip_neighbor_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static void ip_neighbor_add_del_interface_address_v6(ip6_main_t *im, uword opaque, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
#define IP_NEIGHBOR_DBG(...)
This packet is to be rewritten and forwarded to the next processing node.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
ip_address_family_t ip_neighbor_get_af(const ip_neighbor_t *ipn)
static void ip_neighbor_table_bind_v4(ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
static ip_neighbor_age_state_t ip_neighbour_age_out(index_t ipni, f64 now, f64 *wait)
u32 * ipndb_n_elts_per_fib
per-protocol number of elements per-fib-index
static_always_inline void mac_address_copy(mac_address_t *dst, const mac_address_t *src)
#define hash_set_mem(h, key, value)
static uword ip4_destination_matches_route(const ip4_main_t *im, const ip4_address_t *key, const ip4_address_t *dest, uword dest_length)
static_always_inline int mac_address_is_zero(const mac_address_t *mac)
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * ip4_neighbor_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
index_t ip_neighbor_list_head[N_AF]
protocol specific lists of time sorted neighbors
static void ip_neighbor_list_remove(ip_neighbor_t *ipn)
static void ip_neighbor_db_remove(const ip_neighbor_t *ipn)
static vlib_node_registration_t ip4_neighbor_age_process_node
(constructor) VLIB_REGISTER_NODE (ip4_neighbor_age_process_node)
void adj_glean_update_rewrite_itf(u32 sw_if_index)
static clib_error_t * ip_neighbor_interface_admin_change(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
#define ip_addr_version(_a)
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)
int ip_neighbor_del(const ip_address_t *ip, u32 sw_if_index)
format_function_t format_vnet_sw_if_index_name
u32 ipndb_n_elts
per-protocol number of elements
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static void ip_neighbor_mk_complete(adj_index_t ai, ip_neighbor_t *ipn)
#define clib_memcpy(d, s, n)
Adjacency to punt this packet.
enum walk_rc_t_ walk_rc_t
Walk return code.
static void ip_neighbor_adj_fib_remove(ip_neighbor_t *ipn, u32 fib_index)
#define clib_llist_add(LP, name, E, H)
Add entry after head.
int ip4_neighbor_proxy_add(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
The set of function that vnet requires from the IP neighbour module.
ethernet_main_t ethernet_main
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define clib_llist_make_head(LP, name)
Initialize llist head.
void ip_neighbor_probe(const ip_adjacency_t *adj)
struct ip_adjacency_t_::@161::@162 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
#define VLIB_INIT_FUNCTION(x)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
int ip4_neighbor_proxy_delete(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
static uword ip6_destination_matches_route(const ip6_main_t *im, const ip6_address_t *key, const ip6_address_t *dest, uword dest_length)
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
struct ip_neighbor_table_bind_ctx_t_ ip_neighbor_table_bind_ctx_t
#define hash_foreach(key_var, value_var, h, body)
A representation of an IP neighbour/peer.
Aggregate type for a prefix.
const ip_address_t * ip_neighbor_get_ip(const ip_neighbor_t *ipn)
#define clib_error_return(e, args...)
void ip_neighbor_publish(index_t ipni, ip_neighbor_event_flags_t flags)
static uword ip4_neighbor_age_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
void ip_neighbor_del_all(ip_address_family_t af, u32 sw_if_index)
u16 fp_len
The mask length.
void ip_neighbor_mark(ip_address_family_t af)
u8 * format_ip_neighbor(u8 *s, va_list *va)
void ip_neighbor_sweep(ip_address_family_t af)
walk_rc_t(* ip_neighbor_walk_cb_t)(index_t ipni, void *ctx)
vl_api_fib_path_type_t type
#define hash_create_mem(elts, key_bytes, value_bytes)
static index_t * ip_neighbor_entries(u32 sw_if_index, ip_address_family_t af)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
clib_llist_anchor_t ipne_anchor
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
void ip_address_from_46(const ip46_address_t *nh, fib_protocol_t fproto, ip_address_t *ip)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
void ip4_neighbor_probe_dst(u32 sw_if_index, const ip4_address_t *dst)
ip_neighbor_process_event_t_
static clib_error_t * ip6_neighbor_show_sorted(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 ipndb_age
max age of a neighbor before it's forcibly evicted
#define IP_NEIGHBOR_INFO(...)
#define pool_put(P, E)
Free an object E in pool P.
bool ip_address_is_zero(const ip_address_t *ip)
ip6_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
static walk_rc_t ip_neighbor_del_all_walk_cb(index_t ipni, void *arg)
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
uword unformat_ip_address(unformat_input_t *input, va_list *args)
u8 * format_ip_address_family(u8 *s, va_list *args)
mac_address_t ipn_mac
The learned MAC address of the neighbour.
static uword ip6_neighbor_age_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
ip6_add_del_interface_address_callback_t * add_del_interface_address_callbacks
static walk_rc_t ip_neighbor_sweep_one(index_t ipni, void *arg)
uword unformat_mac_address_t(unformat_input_t *input, va_list *args)
#define IP_NEIGHBOR_PROCESS_SLEEP_LONG
static clib_error_t * ip_neighbor_config_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 ipndb_limit
per-protocol limit - max number of neighbors
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
static int ip_neighbor_sort(void *a1, void *a2)
Adjacency to drop this packet.
#define VLIB_REGISTER_NODE(x,...)
static clib_error_t * ip_neighbor_init(vlib_main_t *vm)
struct ip_neighbor_walk_covered_ctx_t_ ip_neighbor_walk_covered_ctx_t
static_always_inline uword vlib_get_thread_index(void)
static void ip_neighbor_table_bind_v6(ip6_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
fib_node_index_t ipn_fib_entry_index
The index of the adj fib created for this neighbour.
static void ip_neighbor_ethernet_change_mac(ethernet_main_t *em, u32 sw_if_index, uword opaque)
static adj_walk_rc_t ip_neighbor_mk_complete_walk(adj_index_t ai, void *ctx)
#define vec_free(V)
Free vector's memory (no header).
ip4_add_del_interface_address_function_t * function
Multicast Midchain Adjacency.
struct ip_neighbor_del_all_ctx_t_ ip_neighbor_del_all_ctx_t
u8 * format_ip_address(u8 *s, va_list *args)
static ip_neighbor_t * ip_neighbor_db_find(const ip_neighbor_key_t *key)
Virtual function Table for neighbor protocol implementations to register.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
struct ip_neighbor_elt_t_ ip_neighbor_elt_t
static walk_rc_t ip_neighbor_walk_covered(index_t ipni, void *arg)
u32 adj_index_t
An index for adjacencies.
void ip6_neighbor_probe_dst(u32 sw_if_index, const ip6_address_t *dst)
fib_protocol_t ip_address_family_to_fib_proto(ip_address_family_t af)
ip6_address_t ilp_addr
the IP6 address
u8 * format_ip_neighbor_flags(u8 *s, va_list *args)
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
static void ip_neighbor_db_add(const ip_neighbor_t *ipn)
#define VLIB_CLI_COMMAND(x,...)
This packets follow a mid-chain adjacency.
void ip_neighbor_walk(ip_address_family_t af, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
ip6_add_del_interface_address_function_t * function
static uword ip_neighbor_age_loop(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f, ip_address_family_t af)
static adj_walk_rc_t ip_neighbor_mk_incomplete_walk(adj_index_t ai, void *ctx)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
manual_print typedef address
const mac_address_t ZERO_MAC_ADDRESS
struct ip_neighbor_sweep_ctx_t_ ip_neighbor_sweep_ctx_t
void ip_neighbor_learn(const ip_neighbor_learn_t *l)
int ip6_neighbor_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
static void clib_mem_free(void *p)
#define FOR_EACH_IP_ADDRESS_FAMILY(_af)
Aggregate type for a prefix in the IPv6 Link-local table.
int ip_address_cmp(const ip_address_t *ip1, const ip_address_t *ip2)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
int ip4_neighbor_proxy_disable(u32 sw_if_index)
void ip_neighbor_flush(ip_address_family_t af, u32 sw_if_index)
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t path_flags)
remove one path to an entry (aka route) in the FIB.
ip_neighbor_key_t * ipn_key
The idempotent key.
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
static void * clib_mem_alloc(uword size)
enum ip_neighbor_age_state_t_ ip_neighbor_age_state_t
static vlib_main_t * vlib_get_main(void)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
enum ip_address_family_t_ ip_address_family_t
int ip4_neighbor_proxy_enable(u32 sw_if_index)
union ip_adjacency_t_::@161 sub_type
ip4_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
This packets needs to go to ICMP error.
This packet is for one of our own IP addresses.
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
static void ip_neighbor_refresh(ip_neighbor_t *ipn)
#define IP_ADDRESS_V6_ALL_0S
#define FIB_NODE_INDEX_INVALID
static void ip_neighbor_touch(ip_neighbor_t *ipn)
static void ip_neighbor_destroy(ip_neighbor_t *ipn)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
static clib_error_t * ip_neighbor_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 ip_af_type_pfx_len(ip_address_family_t type)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
ip6_table_bind_function_t * function
void ip6_ll_table_entry_delete(const ip6_ll_prefix_t *ilp)
Delete a IP6 link-local entry.
u8 * ethernet_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
build a rewrite string to use for sending packets of type 'link_type' to 'dst_address' ...
static ip_neighbor_t * ip_neighbor_alloc(const ip_neighbor_key_t *key, const mac_address_t *mac, ip_neighbor_flags_t flags)
static clib_error_t * ip_neighbor_show_sorted_i(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, ip_address_family_t af)
ip_neighbor_flags_t ipn_flags
Falgs for this object.
#define hash_get_mem(h, key)
ip4_main_t ip4_main
Global ip4 main structure.
bool ipndb_recycle
when the limit is reached and new neighbors are created, should we recycle an old one ...
static clib_error_t * ip4_neighbor_show_sorted(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_mac_address_t(u8 *s, va_list *args)
ip_neighbor_t * ip_neighbor_get(index_t ipni)
#define vec_foreach(var, vec)
Vector iterator.
f64 end
end of the time range
static clib_error_t * ip_neighbor_delete_sw_interface(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
vnet_link_t fib_proto_to_link(fib_protocol_t proto)
Convert from a protocol to a link type.
#define clib_llist_remove(LP, name, E)
Remove entry from list.
int ip6_neighbor_proxy_del(u32 sw_if_index, const ip6_address_t *addr)
void ip_neighbor_populate(ip_address_family_t af, u32 sw_if_index)
static walk_rc_t ip_neighbor_mark_one(index_t ipni, void *ctx)
static bool ip_neighbor_force_reuse(ip_address_family_t af)
enum ip_neighbor_process_event_t_ ip_neighbor_process_event_t
static clib_error_t * ip_neighbor_show_i(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, ip_address_family_t af)
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(ip_neighbor_delete_sw_interface)
#define clib_llist_foreach_reverse(LP, name, H, E, body)
Walk list starting at head in reverse order.
static_always_inline int mac_address_cmp(const mac_address_t *a, const mac_address_t *b)
fib_node_index_t ip6_ll_table_entry_update(const ip6_ll_prefix_t *ilp, fib_route_path_flags_t flags)
Update an entry in the table.
void ip_address_increment(ip_address_t *ip)
void adj_nbr_update_rewrite(adj_index_t adj_index, adj_nbr_rewrite_flag_t flags, u8 *rewrite)
adj_nbr_update_rewrite
static vlib_log_class_t ipn_logger
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(ip_neighbor_interface_admin_change)
int ip_neighbor_config(ip_address_family_t af, u32 limit, u32 age, bool recycle)
static bool ip_neighbor_is_dynamic(const ip_neighbor_t *ipn)
#define clib_llist_prev(LP, name, E)
Get previous pool entry.
static void ip_neighbor_mk_incomplete(adj_index_t ai)
void ip_neighbor_register(ip_address_family_t af, const ip_neighbor_vft_t *vft)
vl_api_interface_index_t sw_if_index
ip_address_family_t ip_address_family_from_fib_proto(fib_protocol_t fp)
void ip_neighbor_update(vnet_main_t *vnm, adj_index_t ai)
uword ** ipndb_hash
per interface hash
const u32 ip_neighbor_get_sw_if_index(const ip_neighbor_t *ipn)
adj_index_t adj_nbr_find(fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
Lookup neighbor adjancency.