FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
adj_glean.c File Reference
+ Include dependency graph for adj_glean.c:

Go to the source code of this file.

Functions

static u32 adj_get_glean_node (fib_protocol_t proto)
 
static adj_index_t adj_glean_db_lookup (fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr)
 
static void adj_glean_db_insert (fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr, adj_index_t ai)
 
static void adj_glean_db_remove (fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr)
 
adj_index_t adj_glean_add_or_lock (fib_protocol_t proto, vnet_link_t linkt, u32 sw_if_index, const fib_prefix_t *conn)
 Glean Adjacency. More...
 
void adj_glean_update_rewrite (adj_index_t adj_index)
 adj_glean_update_rewrite More...
 
static adj_walk_rc_t adj_glean_update_rewrite_walk (adj_index_t ai, void *data)
 
void adj_glean_walk (u32 sw_if_index, adj_walk_cb_t cb, void *data)
 Walk all the gleans on an interface. More...
 
adj_index_t adj_glean_get (fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
 Get an existing glean. More...
 
const ip46_address_t * adj_glean_get_src (fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
 Return the source address from the glean. More...
 
void adj_glean_remove (ip_adjacency_t *adj)
 
static adj_walk_rc_t adj_glean_start_backwalk (adj_index_t ai, void *data)
 
static clib_error_tadj_glean_interface_state_change (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (adj_glean_interface_state_change)
 
static walk_rc_t adj_nbr_hw_sw_interface_state_change (vnet_main_t *vnm, u32 sw_if_index, void *arg)
 Invoked on each SW interface of a HW interface when the HW interface state changes. More...
 
static clib_error_tadj_glean_hw_interface_state_change (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 Registered callback for HW interface state changes. More...
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (adj_glean_hw_interface_state_change)
 
static clib_error_tadj_glean_interface_delete (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (adj_glean_interface_delete)
 
static void adj_glean_ethernet_change_mac (ethernet_main_t *em, u32 sw_if_index, uword opaque)
 Callback function invoked when an interface's MAC Address changes. More...
 
u8format_adj_glean (u8 *s, va_list *ap)
 Format/display a glean adjacency. More...
 
u32 adj_glean_db_size (void)
 Return the size of the adjacency database. More...
 
static void adj_dpo_lock (dpo_id_t *dpo)
 
static void adj_dpo_unlock (dpo_id_t *dpo)
 
void adj_glean_module_init (void)
 Module initialisation. More...
 

Variables

static uword ** adj_gleans [FIB_PROTOCOL_IP_MAX]
 
const static dpo_vft_t adj_glean_dpo_vft
 
const static char *const glean_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a glean object. More...
 
const static char *const glean_ip6_nodes []
 
const static char *const *const glean_nodes [DPO_PROTO_NUM]
 

Function Documentation

◆ adj_dpo_lock()

static void adj_dpo_lock ( dpo_id_t dpo)
static

Definition at line 469 of file adj_glean.c.

+ Here is the call graph for this function:

◆ adj_dpo_unlock()

static void adj_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 474 of file adj_glean.c.

+ Here is the call graph for this function:

◆ adj_get_glean_node()

static u32 adj_get_glean_node ( fib_protocol_t  proto)
inlinestatic

Definition at line 27 of file adj_glean.c.

+ Here is the caller graph for this function:

◆ adj_glean_add_or_lock()

adj_index_t adj_glean_add_or_lock ( fib_protocol_t  proto,
vnet_link_t  linkt,
u32  sw_if_index,
const fib_prefix_t conn 
)

Glean Adjacency.

A gleean adjacency represent the need to discover new peers on an attached link. Packets that hit a glean adjacency will generate an ARP/ND packet addessesed to the packet's destination address. Note this is different to an incomplete neighbour adjacency, which does not send ARP/ND requests to the packet's destination address, but instead to the next-hop address of the adjacency itself.

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

Parameters
protoThe protocol for the neighbours that we wish to glean
sw_if_indexThe interface on which to glean
nh_addrthe address applied to the interface on which to glean. This as the source address in packets when the ARP/ND packet is sent

Definition at line 112 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_db_insert()

static void adj_glean_db_insert ( fib_protocol_t  proto,
u32  sw_if_index,
const ip46_address_t *  nh_addr,
adj_index_t  ai 
)
static

Definition at line 60 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_db_lookup()

static adj_index_t adj_glean_db_lookup ( fib_protocol_t  proto,
u32  sw_if_index,
const ip46_address_t *  nh_addr 
)
static

Definition at line 42 of file adj_glean.c.

+ Here is the caller graph for this function:

◆ adj_glean_db_remove()

static void adj_glean_db_remove ( fib_protocol_t  proto,
u32  sw_if_index,
const ip46_address_t *  nh_addr 
)
static

Definition at line 84 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_db_size()

u32 adj_glean_db_size ( void  )

Return the size of the adjacency database.

for testing purposes

Definition at line 449 of file adj_glean.c.

+ Here is the call graph for this function:

◆ adj_glean_ethernet_change_mac()

static void adj_glean_ethernet_change_mac ( ethernet_main_t em,
u32  sw_if_index,
uword  opaque 
)
static

Callback function invoked when an interface's MAC Address changes.

Definition at line 426 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_get()

adj_index_t adj_glean_get ( fib_protocol_t  proto,
u32  sw_if_index,
const ip46_address_t *  nh_addr 
)

Get an existing glean.

Returns
INVALID if it does not exist

Definition at line 225 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_get_src()

const ip46_address_t* adj_glean_get_src ( fib_protocol_t  proto,
u32  sw_if_index,
const ip46_address_t *  nh 
)

Return the source address from the glean.

Definition at line 251 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_hw_interface_state_change()

static clib_error_t* adj_glean_hw_interface_state_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Registered callback for HW interface state changes.

Definition at line 362 of file adj_glean.c.

+ Here is the call graph for this function:

◆ adj_glean_interface_delete()

static clib_error_t* adj_glean_interface_delete ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 386 of file adj_glean.c.

+ Here is the call graph for this function:

◆ adj_glean_interface_state_change()

static clib_error_t* adj_glean_interface_state_change ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)
static

Definition at line 324 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_module_init()

void adj_glean_module_init ( void  )

Module initialisation.

Definition at line 513 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_remove()

void adj_glean_remove ( ip_adjacency_t adj)

Definition at line 301 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_start_backwalk()

static adj_walk_rc_t adj_glean_start_backwalk ( adj_index_t  ai,
void *  data 
)
static

Definition at line 313 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_update_rewrite()

void adj_glean_update_rewrite ( adj_index_t  adj_index)

adj_glean_update_rewrite

Called by an adjacency provider (an interface type) to configure a glean adj (i.e. and adjacency linked to a connected prefix) to its default behaviour. Other interface types (i.e. 6RD tunnels) can can choose not to use glean behaviour on an adjacency liked to a connected prefix.

Definition at line 163 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_update_rewrite_walk()

static adj_walk_rc_t adj_glean_update_rewrite_walk ( adj_index_t  ai,
void *  data 
)
static

Definition at line 181 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_glean_walk()

void adj_glean_walk ( u32  sw_if_index,
adj_walk_cb_t  cb,
void *  data 
)

Walk all the gleans on an interface.

Definition at line 190 of file adj_glean.c.

+ Here is the caller graph for this function:

◆ adj_nbr_hw_sw_interface_state_change()

static walk_rc_t adj_nbr_hw_sw_interface_state_change ( vnet_main_t vnm,
u32  sw_if_index,
void *  arg 
)
static

Invoked on each SW interface of a HW interface when the HW interface state changes.

Definition at line 349 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_adj_glean()

u8* format_adj_glean ( u8 s,
va_list *  ap 
)

Format/display a glean adjacency.

Definition at line 433 of file adj_glean.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION()

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( adj_glean_hw_interface_state_change  )

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( adj_glean_interface_delete  )

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( adj_glean_interface_state_change  )

Variable Documentation

◆ adj_glean_dpo_vft

const static dpo_vft_t adj_glean_dpo_vft
static
Initial value:
= {
.dv_lock = adj_dpo_lock,
.dv_unlock = adj_dpo_unlock,
.dv_format = format_adj_glean,
.dv_get_urpf = adj_dpo_get_urpf,
.dv_get_mtu = adj_dpo_get_mtu,
}

Definition at line 479 of file adj_glean.c.

◆ adj_gleans

uword** adj_gleans[FIB_PROTOCOL_IP_MAX]
static

Definition at line 24 of file adj_glean.c.

◆ glean_ip4_nodes

const static char* const glean_ip4_nodes[]
static
Initial value:
=
{
"ip4-glean",
NULL,
}

The per-protocol VLIB graph nodes that are assigned to a glean object.

this means that these graph nodes are ones from which a glean is the parent object in the DPO-graph.

Definition at line 494 of file adj_glean.c.

◆ glean_ip6_nodes

const static char* const glean_ip6_nodes[]
static
Initial value:
=
{
"ip6-glean",
NULL,
}

Definition at line 499 of file adj_glean.c.

◆ glean_nodes

const static char* const * const glean_nodes[DPO_PROTO_NUM]
static
Initial value:

Definition at line 505 of file adj_glean.c.

adj_dpo_get_urpf
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
Definition: adj.c:321
adj_dpo_get_mtu
u16 adj_dpo_get_mtu(const dpo_id_t *dpo)
Definition: adj.c:331
adj_dpo_unlock
static void adj_dpo_unlock(dpo_id_t *dpo)
Definition: adj_glean.c:474
adj_dpo_lock
static void adj_dpo_lock(dpo_id_t *dpo)
Definition: adj_glean.c:469
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
DPO_PROTO_MPLS
@ DPO_PROTO_MPLS
Definition: dpo.h:66
glean_ip6_nodes
const static char *const glean_ip6_nodes[]
Definition: adj_glean.c:499
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
glean_ip4_nodes
const static char *const glean_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Definition: adj_glean.c:494
format_adj_glean
u8 * format_adj_glean(u8 *s, va_list *ap)
Format/display a glean adjacency.
Definition: adj_glean.c:433