FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
ip4_fib.c File Reference
+ Include dependency graph for ip4_fib.c:

Go to the source code of this file.

Data Structures

struct  ip4_fib_table_special_prefix_t_
 

Typedefs

typedef struct ip4_fib_table_special_prefix_t_ ip4_fib_table_special_prefix_t
 

Functions

static u32 ip4_create_fib_with_table_id (u32 table_id)
 
void ip4_fib_table_destroy (ip4_fib_t *fib)
 
u32 ip4_fib_table_find_or_create_and_lock (u32 table_id)
 Get or create an IPv4 fib. More...
 
u32 ip4_fib_table_create_and_lock (void)
 
u32 ip4_fib_table_get_index_for_sw_if_index (u32 sw_if_index)
 
flow_hash_config_t ip4_fib_table_get_flow_hash_config (u32 fib_index)
 
fib_node_index_t ip4_fib_table_lookup_exact_match (const ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
 
index_t ip4_fib_table_lookup_lb (ip4_fib_t *fib, const ip4_address_t *addr)
 
fib_node_index_t ip4_fib_table_lookup (const ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
 The IPv4 FIB. More...
 
void ip4_fib_table_entry_insert (ip4_fib_t *fib, const ip4_address_t *addr, u32 len, fib_node_index_t fib_entry_index)
 
void ip4_fib_table_entry_remove (ip4_fib_t *fib, const ip4_address_t *addr, u32 len)
 
void ip4_fib_table_fwding_dpo_update (ip4_fib_t *fib, const ip4_address_t *addr, u32 len, const dpo_id_t *dpo)
 
void ip4_fib_table_fwding_dpo_remove (ip4_fib_t *fib, const ip4_address_t *addr, u32 len, const dpo_id_t *dpo)
 
static void ip4_fib_table_show_all (ip4_fib_t *fib, vlib_main_t *vm)
 
static void ip4_fib_table_show_one (ip4_fib_t *fib, vlib_main_t *vm, ip4_address_t *address, u32 mask_len)
 
static clib_error_tip4_show_fib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static const ip4_fib_table_special_prefix_t ip4_specials []
 
static vlib_cli_command_t ip4_show_fib_command
 (constructor) VLIB_CLI_COMMAND (ip4_show_fib_command) More...
 

Typedef Documentation

Function Documentation

static u32 ip4_create_fib_with_table_id ( u32  table_id)
static

Definition at line 104 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ip4_fib_table_create_and_lock ( void  )

Definition at line 206 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_fib_table_destroy ( ip4_fib_t fib)

Definition at line 154 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_fib_table_entry_insert ( ip4_fib_t fib,
const ip4_address_t addr,
u32  len,
fib_node_index_t  fib_entry_index 
)

Definition at line 308 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_fib_table_entry_remove ( ip4_fib_t fib,
const ip4_address_t addr,
u32  len 
)

Definition at line 338 of file ip4_fib.c.

+ Here is the caller graph for this function:

u32 ip4_fib_table_find_or_create_and_lock ( u32  table_id)

Get or create an IPv4 fib.

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

Parameters
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 192 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_fib_table_fwding_dpo_remove ( ip4_fib_t fib,
const ip4_address_t addr,
u32  len,
const dpo_id_t dpo 
)

Definition at line 373 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_fib_table_fwding_dpo_update ( ip4_fib_t fib,
const ip4_address_t addr,
u32  len,
const dpo_id_t dpo 
)

Definition at line 364 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

flow_hash_config_t ip4_fib_table_get_flow_hash_config ( u32  fib_index)

Definition at line 226 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ip4_fib_table_get_index_for_sw_if_index ( u32  sw_if_index)

Definition at line 212 of file ip4_fib.c.

+ Here is the caller graph for this function:

fib_node_index_t ip4_fib_table_lookup ( const ip4_fib_t fib,
const ip4_address_t addr,
u32  len 
)

The IPv4 FIB.

FIBs are composed of two prefix data-bases (akak tables). The non-forwarding table contains all the routes that the control plane has programmed, the forwarding table contains the sub-set of those routes that can be used to forward packets. In the IPv4 FIB the non-forwarding table is an array of hash tables indexed by mask length, the forwarding table is an mtrie

This IPv4 FIB is used by the protocol independent FIB. So directly using this APIs in client code is not encouraged. However, this IPv4 FIB can be used if all the client wants is an IPv4 prefix data-base

Definition at line 285 of file ip4_fib.c.

+ Here is the caller graph for this function:

fib_node_index_t ip4_fib_table_lookup_exact_match ( const ip4_fib_t fib,
const ip4_address_t addr,
u32  len 
)

Definition at line 237 of file ip4_fib.c.

+ Here is the caller graph for this function:

index_t ip4_fib_table_lookup_lb ( ip4_fib_t fib,
const ip4_address_t addr 
)

Definition at line 261 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_fib_table_show_all ( ip4_fib_t fib,
vlib_main_t vm 
)
static

Definition at line 382 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_fib_table_show_one ( ip4_fib_t fib,
vlib_main_t vm,
ip4_address_t address,
u32  mask_len 
)
static

Definition at line 420 of file ip4_fib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 432 of file ip4_fib.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t ip4_show_fib_command
static
Initial value:
= {
.path = "show ip fib",
.short_help = "show ip fib [summary] [table <table-id>] [index <fib-id>] [<ip4-addr>[/<mask>]] [mtrie]",
.function = ip4_show_fib,
}
static clib_error_t * ip4_show_fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_fib.c:432

(constructor) VLIB_CLI_COMMAND (ip4_show_fib_command)

Definition at line 659 of file ip4_fib.c.

const ip4_fib_table_special_prefix_t ip4_specials[]
static

Definition at line 29 of file ip4_fib.c.