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

Go to the source code of this file.

Data Structures

struct  teib_key_t_
 
struct  teib_entry_t_
 
struct  teib_db_t_
 
struct  teib_table_bind_ctx_t_
 

Macros

#define TEIB_NOTIFY(_te, _fn)
 
#define TEIB_DBG(...)   vlib_log_debug (teib_logger, __VA_ARGS__);
 
#define TEIB_INFO(...)   vlib_log_notice (teib_logger, __VA_ARGS__);
 
#define TEIB_TE_DBG(_te, _fmt, _args...)   vlib_log_debug (teib_logger, "[%U]: " _fmt, format_teib_entry(), _te - teib_pool, ##_args)
 
#define TEIB_TE_INFO(_te, _fmt, _args...)   vlib_log_notice (teib_logger, "[%U]: " _fmt, format_teib_entry(), _te - teib_pool, ##_args)
 

Typedefs

typedef struct teib_key_t_ teib_key_t
 
typedef struct teib_db_t_ teib_db_t
 
typedef struct teib_table_bind_ctx_t_ teib_table_bind_ctx_t
 

Functions

 STATIC_ASSERT_SIZEOF (teib_key_t, 24)
 
u32 teib_entry_get_sw_if_index (const teib_entry_t *te)
 accessors for the opaque struct More...
 
static ip_address_family_t teib_entry_get_af (const teib_entry_t *te)
 
u32 teib_entry_get_fib_index (const teib_entry_t *te)
 
const ip_address_tteib_entry_get_peer (const teib_entry_t *te)
 
const fib_prefix_tteib_entry_get_nh (const teib_entry_t *te)
 
void teib_entry_adj_stack (const teib_entry_t *te, adj_index_t ai)
 
teib_entry_tteib_entry_get (index_t tei)
 
teib_entry_tteib_entry_find (u32 sw_if_index, const ip_address_t *peer)
 
teib_entry_tteib_entry_find_46 (u32 sw_if_index, fib_protocol_t fproto, const ip46_address_t *peer)
 
static void teib_adj_fib_add (const ip_address_t *ip, u32 sw_if_index, u32 fib_index)
 
static void teib_adj_fib_remove (ip_address_t *ip, u32 sw_if_index, u32 fib_index)
 
int teib_entry_add (u32 sw_if_index, const ip_address_t *peer, u32 nh_table_id, const ip_address_t *nh)
 Create a new TEIB entry. More...
 
int teib_entry_del (u32 sw_if_index, const ip_address_t *peer)
 
u8format_teib_entry (u8 *s, va_list *args)
 
void teib_walk (teib_walk_cb_t fn, void *ctx)
 
void teib_walk_itf (u32 sw_if_index, teib_walk_cb_t fn, void *ctx)
 
static void teib_walk_itf_proto (u32 sw_if_index, ip_address_family_t af, teib_walk_cb_t fn, void *ctx)
 
static walk_rc_t teib_walk_table_bind (index_t tei, void *arg)
 
static void teib_table_bind_v4 (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
static void teib_table_bind_v6 (ip6_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
void teib_register (const teib_vft_t *vft)
 
static clib_error_tteib_init (vlib_main_t *vm)
 

Variables

static teib_db_t teib_db
 
static teib_entry_tteib_pool
 
static teib_vft_tteib_vfts
 
static vlib_log_class_t teib_logger
 

Macro Definition Documentation

◆ TEIB_DBG

#define TEIB_DBG (   ...)    vlib_log_debug (teib_logger, __VA_ARGS__);

Definition at line 60 of file teib.c.

◆ TEIB_INFO

#define TEIB_INFO (   ...)    vlib_log_notice (teib_logger, __VA_ARGS__);

Definition at line 63 of file teib.c.

◆ TEIB_NOTIFY

#define TEIB_NOTIFY (   _te,
  _fn 
)
Value:
{ \
teib_vft_t *_vft; \
vec_foreach(_vft, teib_vfts) { \
if (_vft->_fn) { \
_vft->_fn(_te); \
} \
} \
}

Definition at line 51 of file teib.c.

◆ TEIB_TE_DBG

#define TEIB_TE_DBG (   _te,
  _fmt,
  _args... 
)    vlib_log_debug (teib_logger, "[%U]: " _fmt, format_teib_entry(), _te - teib_pool, ##_args)

Definition at line 66 of file teib.c.

◆ TEIB_TE_INFO

#define TEIB_TE_INFO (   _te,
  _fmt,
  _args... 
)    vlib_log_notice (teib_logger, "[%U]: " _fmt, format_teib_entry(), _te - teib_pool, ##_args)

Definition at line 68 of file teib.c.

Typedef Documentation

◆ teib_db_t

typedef struct teib_db_t_ teib_db_t

◆ teib_key_t

typedef struct teib_key_t_ teib_key_t

◆ teib_table_bind_ctx_t

Function Documentation

◆ format_teib_entry()

u8* format_teib_entry ( u8 s,
va_list *  args 
)

Definition at line 294 of file teib.c.

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

◆ STATIC_ASSERT_SIZEOF()

STATIC_ASSERT_SIZEOF ( teib_key_t  ,
24   
)

◆ teib_adj_fib_add()

static void teib_adj_fib_add ( const ip_address_t ip,
u32  sw_if_index,
u32  fib_index 
)
static

Definition at line 142 of file teib.c.

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

◆ teib_adj_fib_remove()

static void teib_adj_fib_remove ( ip_address_t ip,
u32  sw_if_index,
u32  fib_index 
)
static

Definition at line 172 of file teib.c.

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

◆ teib_entry_add()

int teib_entry_add ( u32  sw_if_index,
const ip_address_t peer,
u32  nh_table_id,
const ip_address_t nh 
)

Create a new TEIB entry.

Definition at line 200 of file teib.c.

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

◆ teib_entry_adj_stack()

void teib_entry_adj_stack ( const teib_entry_t te,
adj_index_t  ai 
)

Definition at line 102 of file teib.c.

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

◆ teib_entry_del()

int teib_entry_del ( u32  sw_if_index,
const ip_address_t peer 
)

Definition at line 258 of file teib.c.

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

◆ teib_entry_find()

teib_entry_t* teib_entry_find ( u32  sw_if_index,
const ip_address_t peer 
)

Definition at line 114 of file teib.c.

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

◆ teib_entry_find_46()

teib_entry_t* teib_entry_find_46 ( u32  sw_if_index,
fib_protocol_t  fproto,
const ip46_address_t *  peer 
)

Definition at line 131 of file teib.c.

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

◆ teib_entry_get()

teib_entry_t* teib_entry_get ( index_t  tei)

Definition at line 108 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_entry_get_af()

static ip_address_family_t teib_entry_get_af ( const teib_entry_t te)
static

Definition at line 78 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_entry_get_fib_index()

u32 teib_entry_get_fib_index ( const teib_entry_t te)

Definition at line 84 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_entry_get_nh()

const fib_prefix_t* teib_entry_get_nh ( const teib_entry_t te)

Definition at line 96 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_entry_get_peer()

const ip_address_t* teib_entry_get_peer ( const teib_entry_t te)

Definition at line 90 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_entry_get_sw_if_index()

u32 teib_entry_get_sw_if_index ( const teib_entry_t te)

accessors for the opaque struct

Definition at line 72 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_init()

static clib_error_t* teib_init ( vlib_main_t vm)
static

Definition at line 414 of file teib.c.

+ Here is the call graph for this function:

◆ teib_register()

void teib_register ( const teib_vft_t vft)

Definition at line 408 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_table_bind_v4()

static void teib_table_bind_v4 ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 382 of file teib.c.

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

◆ teib_table_bind_v6()

static void teib_table_bind_v6 ( ip6_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 395 of file teib.c.

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

◆ teib_walk()

void teib_walk ( teib_walk_cb_t  fn,
void *  ctx 
)

Definition at line 315 of file teib.c.

+ Here is the caller graph for this function:

◆ teib_walk_itf()

void teib_walk_itf ( u32  sw_if_index,
teib_walk_cb_t  fn,
void *  ctx 
)

Definition at line 328 of file teib.c.

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

◆ teib_walk_itf_proto()

static void teib_walk_itf_proto ( u32  sw_if_index,
ip_address_family_t  af,
teib_walk_cb_t  fn,
void *  ctx 
)
static

Definition at line 342 of file teib.c.

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

◆ teib_walk_table_bind()

static walk_rc_t teib_walk_table_bind ( index_t  tei,
void *  arg 
)
static

Definition at line 364 of file teib.c.

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

Variable Documentation

◆ teib_db

teib_db_t teib_db
static

Definition at line 46 of file teib.c.

◆ teib_logger

vlib_log_class_t teib_logger
static

Definition at line 49 of file teib.c.

◆ teib_pool

teib_entry_t* teib_pool
static

Definition at line 47 of file teib.c.

◆ teib_vfts

teib_vft_t* teib_vfts
static

Definition at line 48 of file teib.c.

teib_vfts
static teib_vft_t * teib_vfts
Definition: teib.c:48