FD.io VPP  v21.01.1
Vector Packet Processing
ip6_fib.c File Reference
+ Include dependency graph for ip6_fib.c:

Go to the source code of this file.

Data Structures

struct  ip6_fib_walk_ctx_t_
 Context when walking the IPv6 table. More...
 
struct  ip6_fib_show_ctx_t_
 
struct  count_routes_in_fib_at_prefix_length_arg_t
 

Typedefs

typedef struct ip6_fib_walk_ctx_t_ ip6_fib_walk_ctx_t
 Context when walking the IPv6 table. More...
 
typedef struct ip6_fib_show_ctx_t_ ip6_fib_show_ctx_t
 

Functions

static void vnet_ip6_fib_init (u32 fib_index)
 
static u32 create_fib_with_table_id (u32 table_id, fib_source_t src, fib_table_flags_t flags, u8 *desc)
 
u32 ip6_fib_table_find_or_create_and_lock (u32 table_id, fib_source_t src)
 Get or create an IPv6 fib. More...
 
u32 ip6_fib_table_create_and_lock (fib_source_t src, fib_table_flags_t flags, u8 *desc)
 
void ip6_fib_table_destroy (u32 fib_index)
 
fib_node_index_t ip6_fib_table_lookup (u32 fib_index, const ip6_address_t *addr, u32 len)
 
fib_node_index_t ip6_fib_table_lookup_exact_match (u32 fib_index, const ip6_address_t *addr, u32 len)
 
static void compute_prefix_lengths_in_search_order (ip6_fib_table_instance_t *table)
 
void ip6_fib_table_entry_remove (u32 fib_index, const ip6_address_t *addr, u32 len)
 
void ip6_fib_table_entry_insert (u32 fib_index, const ip6_address_t *addr, u32 len, fib_node_index_t fib_entry_index)
 
u32 ip6_fib_table_fwding_lookup_with_if_index (ip6_main_t *im, u32 sw_if_index, const ip6_address_t *dst)
 
u32 ip6_fib_table_get_index_for_sw_if_index (u32 sw_if_index)
 
void ip6_fib_table_fwding_dpo_update (u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
 
void ip6_fib_table_fwding_dpo_remove (u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
 
static int ip6_fib_walk_cb (clib_bihash_kv_24_8_t *kvp, void *arg)
 
void ip6_fib_table_walk (u32 fib_index, fib_table_walk_fn_t fn, void *arg)
 Walk all entries in a FIB table N.B: This is NOT safe to deletes. More...
 
void ip6_fib_table_sub_tree_walk (u32 fib_index, const fib_prefix_t *root, fib_table_walk_fn_t fn, void *arg)
 Walk all entries in a sub-tree of the FIB table N.B: This is NOT safe to deletes. More...
 
static fib_table_walk_rc_t ip6_fib_table_show_walk (fib_node_index_t fib_entry_index, void *arg)
 
static void ip6_fib_table_show_all (ip6_fib_t *fib, vlib_main_t *vm)
 
static void ip6_fib_table_show_one (ip6_fib_t *fib, vlib_main_t *vm, ip6_address_t *address, u32 mask_len, int detail)
 
u8format_ip6_fib_table_memory (u8 *s, va_list *args)
 
static int count_routes_in_fib_at_prefix_length (clib_bihash_kv_24_8_t *kvp, void *arg)
 
static clib_error_tip6_show_fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tip6_config (vlib_main_t *vm, unformat_input_t *input)
 
static clib_error_tip6_fib_init (vlib_main_t *vm)
 

Variables

ip6_fib_table_instance_t ip6_fib_table [IP6_FIB_NUM_TABLES]
 The two FIB tables; fwding and non-fwding. More...
 
u32 ip6_fib_table_nbuckets
 
uword ip6_fib_table_size
 
static vlib_cli_command_t ip6_show_fib_command
 (constructor) VLIB_CLI_COMMAND (ip6_show_fib_command) More...
 

Typedef Documentation

◆ ip6_fib_show_ctx_t

◆ ip6_fib_walk_ctx_t

Context when walking the IPv6 table.

Since all VRFs are in the same hash table, we need to filter only those we need as we walk

Function Documentation

◆ compute_prefix_lengths_in_search_order()

static void compute_prefix_lengths_in_search_order ( ip6_fib_table_instance_t table)
static

Definition at line 255 of file ip6_fib.c.

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

◆ count_routes_in_fib_at_prefix_length()

static int count_routes_in_fib_at_prefix_length ( clib_bihash_kv_24_8_t kvp,
void *  arg 
)
static

Definition at line 620 of file ip6_fib.c.

+ Here is the caller graph for this function:

◆ create_fib_with_table_id()

static u32 create_fib_with_table_id ( u32  table_id,
fib_source_t  src,
fib_table_flags_t  flags,
u8 desc 
)
static

Definition at line 64 of file ip6_fib.c.

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

◆ format_ip6_fib_table_memory()

u8* format_ip6_fib_table_memory ( u8 s,
va_list *  args 
)

Definition at line 600 of file ip6_fib.c.

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

◆ ip6_config()

static clib_error_t* ip6_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 873 of file ip6_fib.c.

+ Here is the call graph for this function:

◆ ip6_fib_init()

static clib_error_t* ip6_fib_init ( vlib_main_t vm)
static

Definition at line 899 of file ip6_fib.c.

+ Here is the call graph for this function:

◆ ip6_fib_table_create_and_lock()

u32 ip6_fib_table_create_and_lock ( fib_source_t  src,
fib_table_flags_t  flags,
u8 desc 
)

Definition at line 119 of file ip6_fib.c.

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

◆ ip6_fib_table_destroy()

void ip6_fib_table_destroy ( u32  fib_index)

Definition at line 127 of file ip6_fib.c.

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

◆ ip6_fib_table_entry_insert()

void ip6_fib_table_entry_insert ( u32  fib_index,
const ip6_address_t *  addr,
u32  len,
fib_node_index_t  fib_entry_index 
)

Definition at line 314 of file ip6_fib.c.

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

◆ ip6_fib_table_entry_remove()

void ip6_fib_table_entry_remove ( u32  fib_index,
const ip6_address_t *  addr,
u32  len 
)

Definition at line 283 of file ip6_fib.c.

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

◆ ip6_fib_table_find_or_create_and_lock()

u32 ip6_fib_table_find_or_create_and_lock ( u32  table_id,
fib_source_t  src 
)

Get or create an IPv6 fib.

Get or create an IPv4 fib with the provided table ID.

Parameters
imip4_main pointer.
table_idWhen set to ~0, an arbitrary and unused fib ID is picked and can be retrieved with ret->table_id. Otherwise, the fib ID to be used to retrieve or create the desired fib.
Returns
A pointer to the retrieved or created fib.

Definition at line 102 of file ip6_fib.c.

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

◆ ip6_fib_table_fwding_dpo_remove()

void ip6_fib_table_fwding_dpo_remove ( u32  fib_index,
const ip6_address_t *  addr,
u32  len,
const dpo_id_t dpo 
)

Definition at line 398 of file ip6_fib.c.

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

◆ ip6_fib_table_fwding_dpo_update()

void ip6_fib_table_fwding_dpo_update ( u32  fib_index,
const ip6_address_t *  addr,
u32  len,
const dpo_id_t dpo 
)

Definition at line 367 of file ip6_fib.c.

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

◆ ip6_fib_table_fwding_lookup_with_if_index()

u32 ip6_fib_table_fwding_lookup_with_if_index ( ip6_main_t im,
u32  sw_if_index,
const ip6_address_t *  dst 
)

Definition at line 344 of file ip6_fib.c.

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

◆ ip6_fib_table_get_index_for_sw_if_index()

u32 ip6_fib_table_get_index_for_sw_if_index ( u32  sw_if_index)

Definition at line 353 of file ip6_fib.c.

+ Here is the caller graph for this function:

◆ ip6_fib_table_lookup()

fib_node_index_t ip6_fib_table_lookup ( u32  fib_index,
const ip6_address_t *  addr,
u32  len 
)

Definition at line 183 of file ip6_fib.c.

+ Here is the caller graph for this function:

◆ ip6_fib_table_lookup_exact_match()

fib_node_index_t ip6_fib_table_lookup_exact_match ( u32  fib_index,
const ip6_address_t *  addr,
u32  len 
)

Definition at line 229 of file ip6_fib.c.

+ Here is the caller graph for this function:

◆ ip6_fib_table_show_all()

static void ip6_fib_table_show_all ( ip6_fib_t fib,
vlib_main_t vm 
)
static

Definition at line 562 of file ip6_fib.c.

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

◆ ip6_fib_table_show_one()

static void ip6_fib_table_show_one ( ip6_fib_t fib,
vlib_main_t vm,
ip6_address_t *  address,
u32  mask_len,
int  detail 
)
static

Definition at line 585 of file ip6_fib.c.

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

◆ ip6_fib_table_show_walk()

static fib_table_walk_rc_t ip6_fib_table_show_walk ( fib_node_index_t  fib_entry_index,
void *  arg 
)
static

Definition at line 551 of file ip6_fib.c.

+ Here is the caller graph for this function:

◆ ip6_fib_table_sub_tree_walk()

void ip6_fib_table_sub_tree_walk ( u32  fib_index,
const fib_prefix_t root,
fib_table_walk_fn_t  fn,
void *  ctx 
)

Walk all entries in a sub-tree of the FIB table N.B: This is NOT safe to deletes.

If you need to delete walk the whole table and store elements in a vector, then delete the elements

Definition at line 528 of file ip6_fib.c.

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

◆ ip6_fib_table_walk()

void ip6_fib_table_walk ( u32  fib_index,
fib_table_walk_fn_t  fn,
void *  ctx 
)

Walk all entries in a FIB table N.B: This is NOT safe to deletes.

If you need to delete walk the whole table and store elements in a vector, then delete the elements

Definition at line 505 of file ip6_fib.c.

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

◆ ip6_fib_walk_cb()

static int ip6_fib_walk_cb ( clib_bihash_kv_24_8_t kvp,
void *  arg 
)
static

Definition at line 444 of file ip6_fib.c.

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

◆ ip6_show_fib()

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

Definition at line 637 of file ip6_fib.c.

+ Here is the call graph for this function:

◆ vnet_ip6_fib_init()

static void vnet_ip6_fib_init ( u32  fib_index)
static

Definition at line 30 of file ip6_fib.c.

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

Variable Documentation

◆ ip6_fib_table

The two FIB tables; fwding and non-fwding.

Definition at line 23 of file ip6_fib.c.

◆ ip6_fib_table_nbuckets

u32 ip6_fib_table_nbuckets

Definition at line 26 of file ip6_fib.c.

◆ ip6_fib_table_size

uword ip6_fib_table_size

Definition at line 27 of file ip6_fib.c.

◆ ip6_show_fib_command

vlib_cli_command_t ip6_show_fib_command
static
Initial value:
= {
.path = "show ip6 fib",
.short_help = "show ip6 fib [summary] [table <table-id>] [index <fib-id>] [<ip6-addr>[/<width>]] [detail]",
.function = ip6_show_fib,
}
static clib_error_t * ip6_show_fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip6_fib.c:637

(constructor) VLIB_CLI_COMMAND (ip6_show_fib_command)

Definition at line 865 of file ip6_fib.c.