FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
adj.h File Reference
+ Include dependency graph for adj.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void adj_lock (adj_index_t adj_index)
 An adjacency is a representation of an attached L3 peer. More...
 
void adj_unlock (adj_index_t adj_index)
 Release a reference counting lock on the adjacency. More...
 
u32 adj_child_add (adj_index_t adj_index, fib_node_type_t type, fib_node_index_t child_index)
 Add a child dependent to an adjacency. More...
 
void adj_child_remove (adj_index_t adj_index, u32 sibling_index)
 Remove a child dependent. More...
 
void adj_walk (u32 sw_if_index, adj_walk_cb_t cb, void *ctx)
 Walk the Adjacencies on a given interface. More...
 
vnet_link_t adj_get_link_type (adj_index_t ai)
 Return the link type of the adjacency. More...
 
u32 adj_get_sw_if_index (adj_index_t ai)
 Return the sw interface index of the adjacency. More...
 
const u8adj_get_rewrite (adj_index_t ai)
 Return the link type of the adjacency. More...
 
static ip_adjacency_tadj_get (adj_index_t adj_index)
 Get a pointer to an adjacency object from its index. More...
 

Variables

ip_adjacency_tadj_pool
 The global adjacnecy pool. More...
 
vlib_combined_counter_main_t adjacency_counters
 Adjacency packet counters. More...
 

Function Documentation

u32 adj_child_add ( adj_index_t  adj_index,
fib_node_type_t  type,
fib_node_index_t  child_index 
)

Add a child dependent to an adjacency.

The child will thus be informed via its registerd back-walk function when the adjacency state changes.

Definition at line 228 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_child_remove ( adj_index_t  adj_index,
u32  sibling_index 
)

Remove a child dependent.

Definition at line 245 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ip_adjacency_t* adj_get ( adj_index_t  adj_index)
inlinestatic

Get a pointer to an adjacency object from its index.

Definition at line 117 of file adj.h.

+ Here is the caller graph for this function:

vnet_link_t adj_get_link_type ( adj_index_t  ai)

Return the link type of the adjacency.

Definition at line 262 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const u8* adj_get_rewrite ( adj_index_t  ai)

Return the link type of the adjacency.

Definition at line 288 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 adj_get_sw_if_index ( adj_index_t  ai)

Return the sw interface index of the adjacency.

Definition at line 275 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_lock ( adj_index_t  adj_index)

An adjacency is a representation of an attached L3 peer.

Adjacency Sub-types:

  • neighbour: a representation of an attached L3 peer. Key:{addr,interface,link/ether-type} SHARED
  • glean: used to drive ARP/ND for packets destined to a local sub-net. 'glean' mean use the packet's destination address as the target address in the ARP packet. UNSHARED. Only one per-interface.
  • midchain: a nighbour adj on a virtual/tunnel interface.
  • rewrite: an adj with no key, but with a rewrite string.

The API to create and update the adjacency is very sub-type specific. This is intentional as it encourages the user to carefully consider which adjacency sub-type they are really using, and hence assign it data in the appropriate sub-type space in the union of sub-types. This prevents the adj becoming a disorganised dumping group for 'my features needs a u16 somewhere' data. It is important to enforce this approach as space in the adjacency is a premium, as we need it to fit in 1 cache line.

the API is also based around an index to an ajdacency not a raw pointer. This is so the user doesn't suffer the same limp inducing firearm injuries that the author suffered as the adjacenices can realloc.

Take a reference counting lock on the adjacency

Definition at line 192 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_unlock ( adj_index_t  adj_index)

Release a reference counting lock on the adjacency.

Definition at line 209 of file adj.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_walk ( u32  sw_if_index,
adj_walk_cb_t  cb,
void *  ctx 
)

Walk the Adjacencies on a given interface.

Variable Documentation

ip_adjacency_t* adj_pool

The global adjacnecy pool.

Exposed for fast/inline data-plane access

Definition at line 35 of file adj.c.

vlib_combined_counter_main_t adjacency_counters

Adjacency packet counters.

Definition at line 30 of file adj.c.