FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lcp_interface.h File Reference
+ Include dependency graph for lcp_interface.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lcp_itf_phy_adj
 
struct  lcp_itf_pair_t_
 A pair of interfaces. More...
 
struct  lcp_itf_pair_vft
 

Macros

#define foreach_lcp_itf_pair_flag   _ (STALE, 0, "stale")
 
#define N_LCP_ITF_HOST   (LCP_ITF_HOST_TUN + 1)
 

Typedefs

typedef enum lip_flag_t_ lip_flag_t
 
typedef struct lcp_itf_phy_adj lcp_itf_phy_adj_t
 
typedef struct lcp_itf_pair_t_ lcp_itf_pair_t
 A pair of interfaces. More...
 
typedef walk_rc_t(* lcp_itf_pair_walk_cb_t) (index_t index, void *ctx)
 Callback function invoked during a walk of all interface-pairs. More...
 
typedef void(* lcp_itf_pair_add_cb_t) (lcp_itf_pair_t *)
 
typedef void(* lcp_itf_pair_del_cb_t) (lcp_itf_pair_t *)
 
typedef struct lcp_itf_pair_vft lcp_itf_pair_vft_t
 

Enumerations

enum  lip_flag_t_ { foreach_lcp_itf_pair_flag }
 
enum  lip_host_type_t { LCP_ITF_HOST_TAP = 0, LCP_ITF_HOST_TUN = 1 }
 

Functions

u8format_lcp_itf_pair (u8 *s, va_list *args)
 
void lcp_itf_pair_show (u32 phy_sw_if_index)
 
u32 lcp_itf_num_pairs (void)
 
lcp_itf_pair_tlcp_itf_pair_get (index_t index)
 Get an interface-pair object from its VPP index. More...
 
index_t lcp_itf_pair_find_by_vif (u32 vif_index)
 Find a interface-pair object from the host interface. More...
 
int lcp_itf_pair_add (u32 host_sw_if_index, u32 phy_sw_if_index, u8 *host_name, u32 host_index, lip_host_type_t host_type, u8 *ns)
 Create an interface-pair. More...
 
int lcp_itf_pair_add_sub (u32 vif, u8 *host_name, u32 sub_sw_if_index, u32 phy_sw_if_index, u8 *ns)
 
int lcp_itf_pair_del (u32 phy_sw_if_index)
 
int lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name, lip_host_type_t host_if_type, u8 *ns, u32 *host_sw_if_indexp)
 Create an interface-pair from PHY sw_if_index and tap name. More...
 
int lcp_itf_pair_delete (u32 phy_sw_if_index)
 Delete a LCP_ITF_PAIR. More...
 
void lcp_itf_pair_walk (lcp_itf_pair_walk_cb_t cb, void *ctx)
 Walk/visit each of the interface pairs. More...
 
int lcp_itf_pair_replace_begin (void)
 Begin and End the replace process. More...
 
int lcp_itf_pair_replace_end (void)
 
static index_t lcp_itf_pair_find_by_phy (u32 phy_sw_if_index)
 
static index_t lcp_itf_pair_find_by_host (u32 host_sw_if_index)
 
void lcp_set_auto_intf (u8 is_auto)
 manage interface auto creation More...
 
int lcp_auto_intf (void)
 
void lcp_itf_pair_register_vft (lcp_itf_pair_vft_t *lcp_itf_vft)
 

Variables

lcp_itf_pair_tlcp_itf_pair_pool
 Pool of LIP objects. More...
 
vlib_node_registration_t lcp_ethernet_node
 
index_tlip_db_by_phy
 Retreive the pair in the DP. More...
 
u32lip_db_by_host
 

Macro Definition Documentation

◆ foreach_lcp_itf_pair_flag

#define foreach_lcp_itf_pair_flag   _ (STALE, 0, "stale")

Definition at line 24 of file lcp_interface.h.

◆ N_LCP_ITF_HOST

#define N_LCP_ITF_HOST   (LCP_ITF_HOST_TUN + 1)

Definition at line 39 of file lcp_interface.h.

Typedef Documentation

◆ lcp_itf_pair_add_cb_t

typedef void(* lcp_itf_pair_add_cb_t) (lcp_itf_pair_t *)

Definition at line 153 of file lcp_interface.h.

◆ lcp_itf_pair_del_cb_t

typedef void(* lcp_itf_pair_del_cb_t) (lcp_itf_pair_t *)

Definition at line 154 of file lcp_interface.h.

◆ lcp_itf_pair_t

A pair of interfaces.

◆ lcp_itf_pair_vft_t

◆ lcp_itf_pair_walk_cb_t

typedef walk_rc_t(* lcp_itf_pair_walk_cb_t) (index_t index, void *ctx)

Callback function invoked during a walk of all interface-pairs.

Definition at line 112 of file lcp_interface.h.

◆ lcp_itf_phy_adj_t

◆ lip_flag_t

typedef enum lip_flag_t_ lip_flag_t

Enumeration Type Documentation

◆ lip_flag_t_

Enumerator
foreach_lcp_itf_pair_flag 

Definition at line 26 of file lcp_interface.h.

◆ lip_host_type_t

Enumerator
LCP_ITF_HOST_TAP 
LCP_ITF_HOST_TUN 

Definition at line 33 of file lcp_interface.h.

Function Documentation

◆ format_lcp_itf_pair()

u8* format_lcp_itf_pair ( u8 s,
va_list *  args 
)

Definition at line 85 of file lcp_interface.c.

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

◆ lcp_auto_intf()

int lcp_auto_intf ( void  )

◆ lcp_itf_num_pairs()

u32 lcp_itf_num_pairs ( void  )

Definition at line 50 of file lcp_interface.c.

+ Here is the call graph for this function:

◆ lcp_itf_pair_add()

int lcp_itf_pair_add ( u32  host_sw_if_index,
u32  phy_sw_if_index,
u8 host_name,
u32  host_index,
lip_host_type_t  host_type,
u8 ns 
)

Create an interface-pair.

Returns
error code

Definition at line 245 of file lcp_interface.c.

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

◆ lcp_itf_pair_add_sub()

int lcp_itf_pair_add_sub ( u32  vif,
u8 host_name,
u32  sub_sw_if_index,
u32  phy_sw_if_index,
u8 ns 
)

Definition at line 178 of file lcp_interface.c.

+ Here is the call graph for this function:

◆ lcp_itf_pair_create()

int lcp_itf_pair_create ( u32  phy_sw_if_index,
u8 host_if_name,
lip_host_type_t  host_if_type,
u8 ns,
u32 host_sw_if_indexp 
)

Create an interface-pair from PHY sw_if_index and tap name.

Returns
error code

Definition at line 727 of file lcp_interface.c.

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

◆ lcp_itf_pair_del()

int lcp_itf_pair_del ( u32  phy_sw_if_index)

Definition at line 410 of file lcp_interface.c.

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

◆ lcp_itf_pair_delete()

int lcp_itf_pair_delete ( u32  phy_sw_if_index)

Delete a LCP_ITF_PAIR.

Definition at line 499 of file lcp_interface.c.

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

◆ lcp_itf_pair_find_by_host()

static index_t lcp_itf_pair_find_by_host ( u32  host_sw_if_index)
inlinestatic

Definition at line 140 of file lcp_interface.h.

+ Here is the caller graph for this function:

◆ lcp_itf_pair_find_by_phy()

static index_t lcp_itf_pair_find_by_phy ( u32  phy_sw_if_index)
inlinestatic

Definition at line 132 of file lcp_interface.h.

+ Here is the caller graph for this function:

◆ lcp_itf_pair_find_by_vif()

index_t lcp_itf_pair_find_by_vif ( u32  vif_index)

Find a interface-pair object from the host interface.

Parameters
host_sw_if_indexhost interface
Returns
VPP's object index

Definition at line 165 of file lcp_interface.c.

+ Here is the caller graph for this function:

◆ lcp_itf_pair_get()

lcp_itf_pair_t* lcp_itf_pair_get ( index_t  index)

Get an interface-pair object from its VPP index.

Definition at line 156 of file lcp_interface.c.

+ Here is the caller graph for this function:

◆ lcp_itf_pair_register_vft()

void lcp_itf_pair_register_vft ( lcp_itf_pair_vft_t lcp_itf_vft)

Definition at line 71 of file lcp_interface.c.

◆ lcp_itf_pair_replace_begin()

int lcp_itf_pair_replace_begin ( void  )

Begin and End the replace process.

Definition at line 1049 of file lcp_interface.c.

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

◆ lcp_itf_pair_replace_end()

int lcp_itf_pair_replace_end ( void  )

Definition at line 1076 of file lcp_interface.c.

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

◆ lcp_itf_pair_show()

void lcp_itf_pair_show ( u32  phy_sw_if_index)

Definition at line 132 of file lcp_interface.c.

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

◆ lcp_itf_pair_walk()

void lcp_itf_pair_walk ( lcp_itf_pair_walk_cb_t  cb,
void *  ctx 
)

Walk/visit each of the interface pairs.

Definition at line 514 of file lcp_interface.c.

+ Here is the caller graph for this function:

◆ lcp_set_auto_intf()

void lcp_set_auto_intf ( u8  is_auto)

manage interface auto creation

+ Here is the caller graph for this function:

Variable Documentation

◆ lcp_ethernet_node

vlib_node_registration_t lcp_ethernet_node

◆ lcp_itf_pair_pool

lcp_itf_pair_t* lcp_itf_pair_pool

Pool of LIP objects.

Definition at line 47 of file lcp_interface.c.

◆ lip_db_by_host

u32* lip_db_by_host

Definition at line 63 of file lcp_interface.c.

◆ lip_db_by_phy

index_t* lip_db_by_phy

Retreive the pair in the DP.

Definition at line 62 of file lcp_interface.c.