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

Go to the source code of this file.

Macros

#define ip4_fibs   ip4_fib_8s
 
#define ip4_fib_table_lookup   ip4_fib_8_table_lookup
 
#define ip4_fib_table_lookup_exact_match   ip4_fib_8_table_lookup_exact_match
 
#define ip4_fib_table_entry_remove   ip4_fib_8_table_entry_remove
 
#define ip4_fib_table_entry_insert   ip4_fib_8_table_entry_insert
 
#define ip4_fib_table_fwding_dpo_update   ip4_fib_8_table_fwding_dpo_update
 
#define ip4_fib_table_fwding_dpo_remove   ip4_fib_8_table_fwding_dpo_remove
 
#define ip4_fib_table_lookup_lb   ip4_fib_8_table_lookup_lb
 
#define ip4_fib_table_walk   ip4_fib_8_table_walk
 
#define ip4_fib_table_sub_tree_walk   ip4_fib_8_table_sub_tree_walk
 
#define ip4_fib_table_init   ip4_fib_8_table_init
 
#define ip4_fib_table_free   ip4_fib_8_table_free
 
#define ip4_mtrie_memory_usage   ip4_mtrie_8_memory_usage
 
#define format_ip4_mtrie   format_ip4_mtrie_8
 

Typedefs

typedef ip4_fib_8_t ip4_fib_t
 The IPv4 FIB. More...
 

Functions

static ip4_fib_tip4_fib_get (u32 index)
 Get the FIB at the given index. More...
 
static u32 ip4_fib_lookup (ip4_main_t *im, u32 sw_if_index, ip4_address_t *dst)
 
u32 ip4_fib_table_find_or_create_and_lock (u32 table_id, fib_source_t src)
 Get or create an IPv4 fib. More...
 
u32 ip4_fib_table_create_and_lock (fib_source_t src)
 
void ip4_fib_table_destroy (u32 fib_index)
 
u8format_ip4_fib_table_memory (u8 *s, va_list *args)
 
static u32 ip4_fib_index_from_table_id (u32 table_id)
 
u32 ip4_fib_table_get_index_for_sw_if_index (u32 sw_if_index)
 
static index_t ip4_fib_forwarding_lookup (u32 fib_index, const ip4_address_t *addr)
 
static_always_inline void ip4_fib_forwarding_lookup_x2 (u32 fib_index0, u32 fib_index1, const ip4_address_t *addr0, const ip4_address_t *addr1, index_t *lb0, index_t *lb1)
 
static_always_inline void ip4_fib_forwarding_lookup_x4 (u32 fib_index0, u32 fib_index1, u32 fib_index2, u32 fib_index3, const ip4_address_t *addr0, const ip4_address_t *addr1, const ip4_address_t *addr2, const ip4_address_t *addr3, index_t *lb0, index_t *lb1, index_t *lb2, index_t *lb3)
 

Macro Definition Documentation

◆ format_ip4_mtrie

#define format_ip4_mtrie   format_ip4_mtrie_8

Definition at line 80 of file ip4_fib.h.

◆ ip4_fib_table_entry_insert

#define ip4_fib_table_entry_insert   ip4_fib_8_table_entry_insert

Definition at line 71 of file ip4_fib.h.

◆ ip4_fib_table_entry_remove

#define ip4_fib_table_entry_remove   ip4_fib_8_table_entry_remove

Definition at line 70 of file ip4_fib.h.

◆ ip4_fib_table_free

#define ip4_fib_table_free   ip4_fib_8_table_free

Definition at line 78 of file ip4_fib.h.

◆ ip4_fib_table_fwding_dpo_remove

#define ip4_fib_table_fwding_dpo_remove   ip4_fib_8_table_fwding_dpo_remove

Definition at line 73 of file ip4_fib.h.

◆ ip4_fib_table_fwding_dpo_update

#define ip4_fib_table_fwding_dpo_update   ip4_fib_8_table_fwding_dpo_update

Definition at line 72 of file ip4_fib.h.

◆ ip4_fib_table_init

#define ip4_fib_table_init   ip4_fib_8_table_init

Definition at line 77 of file ip4_fib.h.

◆ ip4_fib_table_lookup

#define ip4_fib_table_lookup   ip4_fib_8_table_lookup

Definition at line 68 of file ip4_fib.h.

◆ ip4_fib_table_lookup_exact_match

#define ip4_fib_table_lookup_exact_match   ip4_fib_8_table_lookup_exact_match

Definition at line 69 of file ip4_fib.h.

◆ ip4_fib_table_lookup_lb

#define ip4_fib_table_lookup_lb   ip4_fib_8_table_lookup_lb

Definition at line 74 of file ip4_fib.h.

◆ ip4_fib_table_sub_tree_walk

#define ip4_fib_table_sub_tree_walk   ip4_fib_8_table_sub_tree_walk

Definition at line 76 of file ip4_fib.h.

◆ ip4_fib_table_walk

#define ip4_fib_table_walk   ip4_fib_8_table_walk

Definition at line 75 of file ip4_fib.h.

◆ ip4_fibs

#define ip4_fibs   ip4_fib_8s

Definition at line 67 of file ip4_fib.h.

◆ ip4_mtrie_memory_usage

#define ip4_mtrie_memory_usage   ip4_mtrie_8_memory_usage

Definition at line 79 of file ip4_fib.h.

Typedef Documentation

◆ ip4_fib_t

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 the FIB module uses the 16-8-8 stride trie

Definition at line 65 of file ip4_fib.h.

Function Documentation

◆ format_ip4_fib_table_memory()

u8* format_ip4_fib_table_memory ( u8 s,
va_list *  args 
)

Definition at line 322 of file ip4_fib.c.

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

◆ ip4_fib_forwarding_lookup()

static index_t ip4_fib_forwarding_lookup ( u32  fib_index,
const ip4_address_t addr 
)
inlinestatic

Definition at line 223 of file ip4_fib.h.

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

◆ ip4_fib_forwarding_lookup_x2()

static_always_inline void ip4_fib_forwarding_lookup_x2 ( u32  fib_index0,
u32  fib_index1,
const ip4_address_t addr0,
const ip4_address_t addr1,
index_t lb0,
index_t lb1 
)

Definition at line 240 of file ip4_fib.h.

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

◆ ip4_fib_forwarding_lookup_x4()

static_always_inline void ip4_fib_forwarding_lookup_x4 ( u32  fib_index0,
u32  fib_index1,
u32  fib_index2,
u32  fib_index3,
const ip4_address_t addr0,
const ip4_address_t addr1,
const ip4_address_t addr2,
const ip4_address_t addr3,
index_t lb0,
index_t lb1,
index_t lb2,
index_t lb3 
)

Definition at line 267 of file ip4_fib.h.

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

◆ ip4_fib_get()

static ip4_fib_t* ip4_fib_get ( u32  index)
inlinestatic

Get the FIB at the given index.

Definition at line 88 of file ip4_fib.h.

+ Here is the caller graph for this function:

◆ ip4_fib_index_from_table_id()

static u32 ip4_fib_index_from_table_id ( u32  table_id)
inlinestatic

Definition at line 121 of file ip4_fib.h.

+ Here is the caller graph for this function:

◆ ip4_fib_lookup()

static u32 ip4_fib_lookup ( ip4_main_t im,
u32  sw_if_index,
ip4_address_t dst 
)
inlinestatic

Definition at line 94 of file ip4_fib.h.

+ Here is the call graph for this function:

◆ ip4_fib_table_create_and_lock()

u32 ip4_fib_table_create_and_lock ( fib_source_t  src)

Definition at line 243 of file ip4_fib.c.

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

◆ ip4_fib_table_destroy()

void ip4_fib_table_destroy ( u32  fib_index)

Definition at line 189 of file ip4_fib.c.

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

◆ ip4_fib_table_find_or_create_and_lock()

u32 ip4_fib_table_find_or_create_and_lock ( u32  table_id,
fib_source_t  src 
)

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

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

◆ ip4_fib_table_get_index_for_sw_if_index()

u32 ip4_fib_table_get_index_for_sw_if_index ( u32  sw_if_index)

Definition at line 21 of file pnat_test_stubs.h.

+ Here is the caller graph for this function: