42 memset (adj, 0xfe,
sizeof (adj[0]));
60 adj->rewrite_header.sw_if_index = ~0;
101 adj_index = va_arg (*args,
u32);
126 s =
format (s,
" node:[%d]:%U",
127 adj->rewrite_header.node_index,
129 adj->rewrite_header.node_index);
130 s =
format (s,
" next:[%d]:%U",
131 adj->rewrite_header.next_index,
134 adj->rewrite_header.node_index,
135 adj->rewrite_header.next_index);
136 s =
format(s,
"\n children:\n ");
154 ADJ_DBG(adj,
"last-lock-gone");
172 adj->rewrite_header.sw_if_index);
176 adj->rewrite_header.sw_if_index);
281 return (adj->rewrite_header.sw_if_index);
290 vnet_rewrite_header_t *rw;
294 rw = &adj->rewrite_header;
296 ASSERT (rw->data_bytes != 0xfefe);
298 return (rw->data - rw->data_bytes);
311 #define ADJ_FROM_NODE(_node) \ 312 ((ip_adjacency_t*)((char*)_node - STRUCT_OFFSET_OF(ip_adjacency_t, ia_node))) 366 u32 sw_if_index = ~0;
398 if (~0 != sw_if_index &&
430 .short_help =
"show adj [<adj_index>] [interface]",
441 u32 * adj_index_return)
void adj_glean_remove(fib_protocol_t proto, u32 sw_if_index)
ip_adjacency_t * adj_pool
The global adjacnecy pool.
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
ip_adjacency_t * adjacency_heap
format_function_t format_vlib_node_name
u8 * format_adj_nbr(u8 *s, va_list *ap)
Format a neigbour (REWRITE) adjacency.
static int adj_index_is_special(adj_index_t adj_index)
void adj_lock(adj_index_t adj_index)
An adjacency is a representation of an attached L3 peer.
static vlib_main_t * vlib_get_main(void)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
const u8 * adj_get_rewrite(adj_index_t ai)
Return the link type of the adjacency.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
void fib_node_deinit(fib_node_t *node)
ip_lookup_main_t lookup_main
unformat_function_t unformat_vnet_sw_interface
u8 * format_adj_nbr_incomplete(u8 *s, va_list *ap)
Format aa incomplete neigbour (ARP) adjacency.
ip_adjacency_t * ip_add_adjacency(ip_lookup_main_t *lm, ip_adjacency_t *copy_adj, u32 n_adj, u32 *adj_index_return)
void adj_child_remove(adj_index_t adj_index, u32 sibling_index)
Remove a child dependent.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
union ip_adjacency_t_::@175 sub_type
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u32 fib_node_child_add(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t type, fib_node_index_t index)
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
vnet_main_t * vnet_get_main(void)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define VLIB_INIT_FUNCTION(x)
ip_adjacency_flags_t ia_flags
Flags on the adjacency.
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
format_function_t format_vlib_next_node_name
void adj_nbr_remove(adj_index_t ai, fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
#define ADJ_DBG(_e, _fmt, _args...)
big switch to turn on Adjacency debugging
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
u32 adj_get_sw_if_index(adj_index_t ai)
Return the sw interface index of the adjacency.
void fib_node_lock(fib_node_t *node)
void adj_midchain_module_init(void)
Module initialisation.
#define ADJ_FROM_NODE(_node)
static adj_index_t adj_get_index(ip_adjacency_t *adj)
Get a pointer to an adjacency object from its index.
#define pool_put(P, E)
Free an object E in pool P.
static fib_node_back_walk_rc_t adj_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
An node in the FIB graph.
void adj_nbr_module_init(void)
Module initialisation.
void fib_node_unlock(fib_node_t *node)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
void adj_glean_module_init(void)
Module initialisation.
static clib_error_t * adj_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
fib_node_list_t fn_children
Vector of nodes that depend upon/use/share this node.
static void adj_last_lock_gone(ip_adjacency_t *adj)
u16 mcast_group_index
Force re-lookup in a different FIB.
struct ip_adjacency_t_::@175::@176 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
u8 * format_adj_glean(u8 *s, va_list *ap)
Format/display a glean adjacency.
u32 fib_node_index_t
A typedef of a node index.
static void adj_poison(ip_adjacency_t *adj)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
u32 adj_index_t
An index for adjacencies.
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
Context passed between object during a back walk.
#define VLIB_CLI_COMMAND(x,...)
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
u32 fib_node_list_get_size(fib_node_list_t list)
static fib_node_t * adj_get_node(fib_node_index_t index)
ip_lookup_main_t lookup_main
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
This packets follow a mid-chain adjacency.
void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
u16 n_adj
Number of adjecencies in block.
ip_lookup_next_t lookup_next_index
u32 fn_locks
Number of dependents on this node.
u32 adj_child_add(adj_index_t adj_index, fib_node_type_t child_type, fib_node_index_t child_index)
Add a child dependent to an adjacency.
u8 * format_ip_adjacency(u8 *s, va_list *args)
Pretty print helper function for formatting specific adjacencies.
ip_adjacency_t * adj_alloc(fib_protocol_t proto)
A collection of combined counters.
u16 saved_lookup_next_index
Highest possible perf subgraph arc interposition, e.g.
static void adj_node_last_lock_gone(fib_node_t *node)
A FIB graph nodes virtual function table.
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
ip4_main_t ip4_main
Global ip4 main structure.
This packet is to be rewritten and forwarded to the next processing node.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
static ip_adjacency_t * special_v4_miss_adj_with_index_zero
static clib_error_t * adj_module_init(vlib_main_t *vm)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
u8 * fib_node_children_format(fib_node_list_t list, u8 *s)
struct ip_adjacency_t_::@175::@177 midchain
IP_LOOKUP_NEXT_MIDCHAIN.