FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
fib_node.c File Reference
+ Include dependency graph for fib_node.c:

Go to the source code of this file.

Functions

const char * fib_node_type_get_name (fib_node_type_t type)
 
void fib_node_register_type (fib_node_type_t type, const fib_node_vft_t *vft)
 fib_node_register_type More...
 
fib_node_type_t fib_node_register_new_type (const fib_node_vft_t *vft)
 Create a new FIB node type and Register the function table for it. More...
 
static u8fib_node_format (fib_node_ptr_t *fnp, u8 *s)
 
u32 fib_node_child_add (fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t type, fib_node_index_t index)
 
void fib_node_child_remove (fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
 
u32 fib_node_get_n_children (fib_node_type_t parent_type, fib_node_index_t parent_index)
 
fib_node_back_walk_rc_t fib_node_back_walk_one (fib_node_ptr_t *ptr, fib_node_back_walk_ctx_t *ctx)
 
static int fib_node_ptr_format_one_child (fib_node_ptr_t *ptr, void *arg)
 
u8fib_node_children_format (fib_node_list_t list, u8 *s)
 
void fib_node_init (fib_node_t *node, fib_node_type_t type)
 
void fib_node_deinit (fib_node_t *node)
 
void fib_node_lock (fib_node_t *node)
 
void fib_node_unlock (fib_node_t *node)
 
void fib_show_memory_usage (const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
 Show the memory usage for a type. More...
 
static clib_error_tfib_memory_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static fib_node_vft_tfn_vfts
 
static fib_node_type_t last_new_type = FIB_NODE_TYPE_LAST
 The last registered new type. More...
 
static const char * fn_type_names [] = FIB_NODE_TYPES
 
static vlib_cli_command_t show_fib_memory
 (constructor) VLIB_CLI_COMMAND (show_fib_memory) More...
 

Function Documentation

static clib_error_t* fib_memory_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 233 of file fib_node.c.

+ Here is the call graph for this function:

fib_node_back_walk_rc_t fib_node_back_walk_one ( fib_node_ptr_t ptr,
fib_node_back_walk_ctx_t ctx 
)

Definition at line 152 of file fib_node.c.

+ Here is the caller graph for this function:

u32 fib_node_child_add ( fib_node_type_t  parent_type,
fib_node_index_t  parent_index,
fib_node_type_t  type,
fib_node_index_t  index 
)

Definition at line 96 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fib_node_child_remove ( fib_node_type_t  parent_type,
fib_node_index_t  parent_index,
fib_node_index_t  sibling_index 
)

Definition at line 121 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* fib_node_children_format ( fib_node_list_t  list,
u8 s 
)

Definition at line 174 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fib_node_deinit ( fib_node_t node)

Definition at line 198 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* fib_node_format ( fib_node_ptr_t fnp,
u8 s 
)
static

Definition at line 90 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 fib_node_get_n_children ( fib_node_type_t  parent_type,
fib_node_index_t  parent_index 
)

Definition at line 140 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fib_node_init ( fib_node_t node,
fib_node_type_t  type 
)

The node's type. make sure we are dynamic/down casting correctly

Definition at line 183 of file fib_node.c.

+ Here is the caller graph for this function:

void fib_node_lock ( fib_node_t node)

Definition at line 204 of file fib_node.c.

+ Here is the caller graph for this function:

static int fib_node_ptr_format_one_child ( fib_node_ptr_t ptr,
void *  arg 
)
static

Definition at line 163 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fib_node_type_t fib_node_register_new_type ( const fib_node_vft_t vft)

Create a new FIB node type and Register the function table for it.

Parameters
vftvirtual function table
Returns
new FIB node type

Definition at line 78 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fib_node_register_type ( fib_node_type_t  type,
const fib_node_vft_t vft 
)

fib_node_register_type

Register the function table for a given type.

Register the function table for a given type

Definition at line 58 of file fib_node.c.

+ Here is the caller graph for this function:

const char* fib_node_type_get_name ( fib_node_type_t  type)

Definition at line 35 of file fib_node.c.

+ Here is the caller graph for this function:

void fib_node_unlock ( fib_node_t node)

Definition at line 210 of file fib_node.c.

+ Here is the caller graph for this function:

void fib_show_memory_usage ( const char *  name,
u32  in_use_elts,
u32  allocd_elts,
size_t  size_elt 
)

Show the memory usage for a type.

This should be invoked by the type in response to the infra calling its registered memory show function

Parameters
namethe name of the type
in_use_eltsThe number of elements in use
allocd_eltsThe number of allocated pool elemenets
size_eltThe size of one element

Definition at line 221 of file fib_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const char* fn_type_names[] = FIB_NODE_TYPES
static

Definition at line 32 of file fib_node.c.

fib_node_vft_t* fn_vfts
static

Definition at line 22 of file fib_node.c.

fib_node_type_t last_new_type = FIB_NODE_TYPE_LAST
static

The last registered new type.

Definition at line 27 of file fib_node.c.

vlib_cli_command_t show_fib_memory
static
Initial value:
= {
.path = "show fib memory",
.function = fib_memory_show,
.short_help = "show fib memory",
}
static clib_error_t * fib_memory_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: fib_node.c:233

(constructor) VLIB_CLI_COMMAND (show_fib_memory)

Definition at line 272 of file fib_node.c.