FD.io VPP  v18.07-34-g55fbdb9
Vector Packet Processing
adj_nbr.h File Reference
+ Include dependency graph for adj_nbr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum adj_nbr_rewrite_flag_t_ adj_nbr_rewrite_flag_t
 When adding a rewrite to an adjacency these are flags that apply to that rewrite. More...
 

Enumerations

enum  adj_nbr_rewrite_flag_t_ { ADJ_NBR_REWRITE_FLAG_NONE, ADJ_NBR_REWRITE_FLAG_INCOMPLETE = ADJ_NBR_REWRITE_FLAG_NONE, ADJ_NBR_REWRITE_FLAG_COMPLETE = (1 << 0) }
 When adding a rewrite to an adjacency these are flags that apply to that rewrite. More...
 

Functions

adj_index_t adj_nbr_add_or_lock (fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
 Neighbour Adjacency sub-type. More...
 
adj_index_t adj_nbr_add_or_lock_w_rewrite (fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index, u8 *rewrite)
 Add (and lock) a new or lock an existing neighbour adjacency. More...
 
void adj_nbr_update_rewrite (adj_index_t adj_index, adj_nbr_rewrite_flag_t flags, u8 *rewrite)
 Update the rewrite string for an existing adjacecny. More...
 
u8format_adj_nbr_incomplete (u8 *s, va_list *ap)
 Format aa incomplete neigbour (ARP) adjacency. More...
 
u8format_adj_nbr (u8 *s, va_list *ap)
 Format a neigbour (REWRITE) adjacency. More...
 
void adj_nbr_walk (u32 sw_if_index, fib_protocol_t adj_nh_proto, adj_walk_cb_t cb, void *ctx)
 Walk the neighbour Adjacencies on a given interface. More...
 
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 the neighbour Adjacencies on a given interface with a given next-hop. More...
 
void adj_nbr_walk_nh4 (u32 sw_if_index, const ip4_address_t *addr, adj_walk_cb_t cb, void *ctx)
 Walk adjacencies on a link with a given v4 next-hop. More...
 
void adj_nbr_walk_nh6 (u32 sw_if_index, const ip6_address_t *addr, adj_walk_cb_t cb, void *ctx)
 Walk adjacencies on a link with a given v6 next-hop. More...
 
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. More...
 
void adj_nbr_module_init (void)
 Module initialisation. More...
 
u32 adj_nbr_db_size (void)
 Return the size of the adjacency database. More...
 

Typedef Documentation

When adding a rewrite to an adjacency these are flags that apply to that rewrite.

Enumeration Type Documentation

When adding a rewrite to an adjacency these are flags that apply to that rewrite.

Enumerator
ADJ_NBR_REWRITE_FLAG_NONE 
ADJ_NBR_REWRITE_FLAG_INCOMPLETE 

An indication that the rewrite is incomplete, i.e.

that it describes the ARP/ND rewrite when probing.

ADJ_NBR_REWRITE_FLAG_COMPLETE 

An indication that the rewrite is complete, i.e.

that it fully describes the link-layer addressing for the desintation. The opposite of this is an incomplete rewrite that describes the ARP/ND rewrite when probing.

Definition at line 82 of file adj_nbr.h.

Function Documentation

adj_index_t adj_nbr_add_or_lock ( fib_protocol_t  nh_proto,
vnet_link_t  link_type,
const ip46_address_t *  nh_addr,
u32  sw_if_index 
)

Neighbour Adjacency sub-type.

These adjs represent an L3 peer on a connected link.

Add (and lock) a new or lock an existing neighbour adjacency

Parameters
nh_protoThe protocol for the next-hop address (v4 or v6)
link_typeA description of the protocol of the packets that will forward through this adj. On an ethernet interface this is the MAC header's ether-type
nh_addrThe address of the next-hop/peer to send the packet to
sw_if_indexThe interface on which the peer resides

Definition at line 214 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

adj_index_t adj_nbr_add_or_lock_w_rewrite ( fib_protocol_t  nh_proto,
vnet_link_t  link_type,
const ip46_address_t *  nh_addr,
u32  sw_if_index,
u8 rewrite 
)

Add (and lock) a new or lock an existing neighbour adjacency.

Parameters
nh_protoThe protocol for the next-hop address (v4 or v6)
link_typeA description of the protocol of the packets that will forward through this adj. On an ethernet interface this is the MAC header's ether-type
nh_addrThe address of the next-hop/peer to send the packet to
sw_if_indexThe interface on which the peer resides
rewriteThe rewrite to prepend to packets

Definition at line 254 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 adj_nbr_db_size ( void  )

Return the size of the adjacency database.

for testing purposes

Definition at line 523 of file adj_nbr.c.

+ Here is the call graph for this function:

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.

Definition at line 97 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_nbr_module_init ( void  )

Module initialisation.

Definition at line 1086 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_nbr_update_rewrite ( adj_index_t  adj_index,
adj_nbr_rewrite_flag_t  flags,
u8 rewrite 
)

Update the rewrite string for an existing adjacecny.

Parameters
Theindex of the adj to update
Thenew rewrite

Update the rewrite string for an existing adjacecny.

Update the adjacency's rewrite string. A NULL string implies the rewirte is reset (i.e. when ARP/ND etnry is gone). NB: the adj being updated may be handling traffic in the DP.

Definition at line 291 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_nbr_walk ( u32  sw_if_index,
fib_protocol_t  adj_nh_proto,
adj_walk_cb_t  cb,
void *  ctx 
)

Walk the neighbour Adjacencies on a given interface.

Definition at line 567 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 the neighbour Adjacencies on a given interface with a given next-hop.

Walk the neighbour Adjacencies on a given interface with a given next-hop.

that is visit the adjacencies with different link types.

Definition at line 647 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_nbr_walk_nh4 ( u32  sw_if_index,
const ip4_address_t addr,
adj_walk_cb_t  cb,
void *  ctx 
)

Walk adjacencies on a link with a given v4 next-hop.

that is visit the adjacencies with different link types.

Definition at line 591 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void adj_nbr_walk_nh6 ( u32  sw_if_index,
const ip6_address_t addr,
adj_walk_cb_t  cb,
void *  ctx 
)

Walk adjacencies on a link with a given v6 next-hop.

that is visit the adjacencies with different link types.

Definition at line 619 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_adj_nbr ( u8 s,
va_list *  ap 
)

Format a neigbour (REWRITE) adjacency.

Definition at line 976 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_adj_nbr_incomplete ( u8 s,
va_list *  ap 
)

Format aa incomplete neigbour (ARP) adjacency.

Definition at line 957 of file adj_nbr.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: