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);
114 const ip46_address_t *
172 ipn_key->ipnk_type]);
189 ipn_key->ipnk_sw_if_index]
334 ipn_key->ipnk_sw_if_index,
348 rewrite_header.sw_if_index,
397 if (!ip_neighbor_db[type].ipndb_recycle)
443 if (!(ipn->
ipn_flags & IP_NEIGHBOR_FLAG_NO_FIB_ENTRY))
486 if (!(flags & IP_NEIGHBOR_FLAG_STATIC) &&
487 (ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STATIC))
491 goto check_customers;
502 goto check_customers;
510 if ((flags & IP_NEIGHBOR_FLAG_STATIC) &&
511 !(ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STATIC))
514 ipn->
ipn_flags |= IP_NEIGHBOR_FLAG_STATIC;
515 ipn->
ipn_flags &= ~IP_NEIGHBOR_FLAG_DYNAMIC;
529 return VNET_API_ERROR_LIMIT_EXCEEDED;
572 return (VNET_API_ERROR_NO_SUCH_ENTRY);
624 .ipnk_sw_if_index = adj->rewrite_header.sw_if_index,
650 adj->rewrite_header.sw_if_index,
691 IP_NEIGHBOR_FLAG_DYNAMIC, NULL);
706 flags = IP_NEIGHBOR_FLAG_DYNAMIC;
718 else if (
unformat (input,
"static"))
720 flags |= IP_NEIGHBOR_FLAG_STATIC;
721 flags &= ~IP_NEIGHBOR_FLAG_DYNAMIC;
723 else if (
unformat (input,
"no-fib-entry"))
724 flags |= IP_NEIGHBOR_FLAG_NO_FIB_ENTRY;
725 else if (
unformat (input,
"count %d", &count))
731 if (sw_if_index == ~0 ||
734 "specify interface, IP address and MAC: `%U'",
784 .path =
"set ip neighbor",
786 "set ip neighbor [del] <intfc> <ip-address> <mac-address> [static] [no-fib-entry] [count <count>] [fib-id <fib-id>] [proxy <lo-addr> - <hi-addr>]",
790 .path =
"ip neighbor",
792 "ip neighbor [del] <intfc> <ip-address> <mac-address> [static] [no-fib-entry] [count <count>] [fib-id <fib-id>] [proxy <lo-addr> - <hi-addr>]",
800 index_t *ipni1 = a1, *ipni2 = a2;
824 if ((sw_if_index == ~0 ||
850 "Flags",
"Ethernet",
"Interface");
882 "Flags",
"Ethernet",
"Interface");
944 .path =
"show ip neighbors",
946 .short_help =
"show ip neighbors [interface]",
949 .path =
"show ip4 neighbors",
951 .short_help =
"show ip4 neighbors [interface]",
954 .path =
"show ip6 neighbors",
956 .short_help =
"show ip6 neighbors [interface]",
959 .path =
"show ip neighbor",
961 .short_help =
"show ip neighbor [interface]",
964 .path =
"show ip4 neighbor",
966 .short_help =
"show ip4 neighbor [interface]",
969 .path =
"show ip6 neighbor",
971 .short_help =
"show ip6 neighbor [interface]",
974 .path =
"show ip4 neighbor-sorted",
976 .short_help =
"show ip4 neighbor-sorted",
979 .path =
"show ip6 neighbor-sorted",
981 .short_help =
"show ip6 neighbor-sorted",
990 ip_nbr_vfts[
type] = *vft;
997 adj->rewrite_header.sw_if_index))
1040 if (~0 == sw_if_index)
1044 vec_foreach (hash, ip_neighbor_db[type].ipndb_hash)
1059 if (
vec_len (ip_neighbor_db[type].ipndb_hash) <= sw_if_index)
1081 (fib_index, start, end));
1095 (fib_index, start, end));
1105 return (ip_nbr_vfts[
IP46_TYPE_IP4].inv_proxy4_enable (sw_if_index));
1115 return (ip_nbr_vfts[
IP46_TYPE_IP4].inv_proxy4_disable (sw_if_index));
1125 return (ip_nbr_vfts[
IP46_TYPE_IP6].inv_proxy6_add (sw_if_index, addr));
1135 return (ip_nbr_vfts[
IP46_TYPE_IP6].inv_proxy6_del (sw_if_index, addr));
1184 vec_add1 (ipnis, ipn - ip_neighbor_pool);
1216 vec_add1 (ipnis, ipn - ip_neighbor_pool);
1231 ipn->
ipn_flags |= IP_NEIGHBOR_FLAG_STALE;
1255 if (ipn->
ipn_flags & IP_NEIGHBOR_FLAG_STALE)
1292 if (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP)
1316 sw_if_index, (is_add ?
"add" :
"del"));
1318 if (!is_add && sw_if_index != ~0)
1372 u32 if_address_index,
u32 is_del)
1379 (is_del ?
"del" :
"add"),
1388 .length = address_length,
1411 u32 if_address_index,
u32 is_del)
1420 (is_del ?
"del" :
"add"));
1427 .length = address_length,
1464 u32 new_fib_index,
u32 old_fib_index)
1467 .old_fib_index = old_fib_index,
1468 .new_fib_index = new_fib_index,
1479 u32 new_fib_index,
u32 old_fib_index)
1482 .old_fib_index = old_fib_index,
1483 .new_fib_index = new_fib_index,
1497 #define IP_NEIGHBOR_PROCESS_SLEEP_LONG (0) 1511 if (ttl > ipndb_age)
1540 *wait = ipndb_age - ttl + 1;
1557 uword event_type, *event_data = NULL;
1602 timeout =
clib_min (wait, timeout);
1612 timeout =
clib_min (wait, timeout);
1620 if (!ip_neighbor_db[type].ipndb_age)
1665 .name =
"ip4-neighbor-age-process",
1670 .name =
"ip6-neighbor-age-process",
1700 ip_neighbor_db[type].ipndb_limit,
1701 ip_neighbor_db[type].ipndb_age,
1702 ip_neighbor_db[type].ipndb_recycle);
1711 .path =
"show ip neighbor-config",
1713 .short_help =
"show ip neighbor-config",
1747 .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)
void ip_neighbor_flush(ip46_type_t type, u32 sw_if_index)
#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.
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...
void ip46_address_increment(ip46_type_t type, ip46_address_t *ip)
void ip_neighbor_probe_dst(const ip_adjacency_t *adj, const ip46_address_t *dst)
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.
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
static clib_error_t * ip6_neighbor_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void ip_neighbor_del_all(ip46_type_t type, u32 sw_if_index)
const ip46_address_t * ip_neighbor_get_ip(const ip_neighbor_t *ipn)
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)
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.
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).
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
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)
int ip_neighbor_config(ip46_type_t type, u32 limit, u32 age, bool recycle)
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)
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index)
Get an existing glean.
#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)
union ip_adjacency_t_::@137 sub_type
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)
static ip46_type_t ip46_address_get_type(const ip46_address_t *ip)
static void ip_neighbor_list_remove(ip_neighbor_t *ipn)
void ip4_neighbor_probe_dst(const ip_adjacency_t *adj, const ip4_address_t *dst)
static vlib_node_registration_t ip4_neighbor_age_process_node
(constructor) VLIB_REGISTER_NODE (ip4_neighbor_age_process_node)
static clib_error_t * ip_neighbor_interface_admin_change(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
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)
int ip_neighbor_del(const ip46_address_t *ip, ip46_type_t type, u32 sw_if_index)
#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.
void adj_glean_update_rewrite(adj_index_t adj_index)
adj_glean_update_rewrite
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)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#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...
static void ip_neighbor_db_remove(const ip_neighbor_key_t *key)
static int ip46_address_cmp(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
void ip_neighbor_publish(index_t ipni)
int ip4_neighbor_proxy_delete(u32 fib_index, const ip4_address_t *start, const ip4_address_t *end)
index_t ip_neighbor_list_head[IP46_N_TYPES]
protocol specific lists of time sorted neighbors
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.
static bool ip_neighbor_force_reuse(ip46_type_t type)
Aggregate type for a prefix.
#define clib_error_return(e, args...)
static uword ip4_neighbor_age_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
void ip_neighbor_populate(ip46_type_t type, u32 sw_if_index)
u16 fp_len
The mask length.
u8 * format_ip_neighbor(u8 *s, va_list *va)
walk_rc_t(* ip_neighbor_walk_cb_t)(index_t ipni, void *ctx)
void ip6_neighbor_advertise(vlib_main_t *vm, vnet_main_t *vnm, u32 sw_if_index, const ip6_address_t *addr)
vl_api_fib_path_type_t type
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
#define hash_create_mem(elts, key_bytes, value_bytes)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#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_neighbor_mark(ip46_type_t type)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
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)
static u8 ip46_address_is_zero(const ip46_address_t *ip46)
u32 ipndb_age
max age of a neighbor before it's forcibly evicted
void ip_neighbor_register(ip46_type_t type, const ip_neighbor_vft_t *vft)
static clib_error_t * ip_neighbor_show_i(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, ip46_type_t type)
#define IP_NEIGHBOR_INFO(...)
#define pool_put(P, E)
Free an object E in pool P.
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 ...
static index_t * ip_neighbor_entries(u32 sw_if_index, ip46_type_t type)
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
format_function_t format_ip46_address
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).
void ip_neighbor_walk(ip46_type_t type, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
ip4_add_del_interface_address_function_t * function
Multicast Midchain Adjacency.
static uword ip_neighbor_age_loop(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f, ip46_type_t type)
struct ip_neighbor_del_all_ctx_t_ ip_neighbor_del_all_ctx_t
static ip_neighbor_t * ip_neighbor_db_find(const ip_neighbor_key_t *key)
Virtual function Table for neighbor protocol implementations to register.
void ip4_neighbor_advertise(vlib_main_t *vm, vnet_main_t *vnm, u32 sw_if_index, const ip4_address_t *addr)
#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.
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.
ip6_add_del_interface_address_function_t * function
static adj_walk_rc_t ip_neighbor_mk_incomplete_walk(adj_index_t ai, void *ctx)
struct ip_adjacency_t_::@137::@138 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
static u8 ip46_type_pfx_len(ip46_type_t type)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
manual_print typedef address
const mac_address_t ZERO_MAC_ADDRESS
#define FOREACH_IP46_TYPE(_type)
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)
Aggregate type for a prefix in the IPv6 Link-local table.
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
int ip4_neighbor_proxy_disable(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.
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 void ip_neighbor_free(ip_neighbor_t *ipn)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
int ip4_neighbor_proxy_enable(u32 sw_if_index)
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 FIB_NODE_INDEX_INVALID
static void ip_neighbor_touch(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)
void ip_neighbor_advertise(vlib_main_t *vm, ip46_type_t type, const ip46_address_t *addr, u32 sw_if_index)
#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.
void ip6_neighbor_probe_dst(const ip_adjacency_t *adj, const ip6_address_t *dst)
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)
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)
static clib_error_t * ip_neighbor_show_sorted_i(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, ip46_type_t type)
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)
static walk_rc_t ip_neighbor_mark_one(index_t ipni, void *ctx)
enum ip_neighbor_process_event_t_ ip_neighbor_process_event_t
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)
u8 * format_ip46_type(u8 *s, va_list *args)
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.
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
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)
static bool ip_neighbor_is_dynamic(const ip_neighbor_t *ipn)
#define ip46_address_initializer
#define clib_llist_prev(LP, name, E)
Get previous pool entry.
static void ip_neighbor_mk_incomplete(adj_index_t ai)
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.