FD.io VPP  v17.07-30-g839fa73
Vector Packet Processing
ip4_mfib.c File Reference
+ Include dependency graph for ip4_mfib.c:

Go to the source code of this file.

Macros

#define IPV4_MFIB_GRP_LEN(_len)   (_len > 32 ? 32 : _len)
 
#define IP4_MFIB_MK_KEY(_grp, _src, _len, _key)
 
#define IP4_MFIB_MK_GRP_KEY(_grp, _len, _key)
 

Functions

static u32 ip4_create_mfib_with_table_id (u32 table_id)
 
void ip4_mfib_table_destroy (ip4_mfib_t *mfib)
 
u32 ip4_mfib_table_find_or_create_and_lock (u32 table_id)
 Get or create an IPv4 fib. More...
 
u32 ip4_mfib_table_get_index_for_sw_if_index (u32 sw_if_index)
 
fib_node_index_t ip4_mfib_table_lookup_exact_match (const ip4_mfib_t *mfib, const ip4_address_t *grp, const ip4_address_t *src, u32 len)
 
fib_node_index_t ip4_mfib_table_lookup (const ip4_mfib_t *mfib, const ip4_address_t *src, const ip4_address_t *grp, u32 len)
 The IPv4 Multicast-FIB. More...
 
void ip4_mfib_table_entry_insert (ip4_mfib_t *mfib, const ip4_address_t *grp, const ip4_address_t *src, u32 len, fib_node_index_t fib_entry_index)
 
void ip4_mfib_table_entry_remove (ip4_mfib_t *mfib, const ip4_address_t *grp, const ip4_address_t *src, u32 len)
 
void ip4_mfib_table_walk (ip4_mfib_t *mfib, mfib_table_walk_fn_t fn, void *ctx)
 Walk the IP4 mfib table. More...
 
static void ip4_mfib_table_show_all (ip4_mfib_t *mfib, vlib_main_t *vm)
 
static void ip4_mfib_table_show_one (ip4_mfib_t *mfib, vlib_main_t *vm, ip4_address_t *src, ip4_address_t *grp, u32 mask_len)
 
static clib_error_tip4_show_mfib (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static const mfib_prefix_t ip4_specials []
 
static vlib_cli_command_t ip4_show_mfib_command
 (constructor) VLIB_CLI_COMMAND (ip4_show_mfib_command) More...
 

Macro Definition Documentation

#define IP4_MFIB_MK_GRP_KEY (   _grp,
  _len,
  _key 
)
Value:
{ \
_key = ((u64)(_grp->data_u32 & \
}
#define IPV4_MFIB_GRP_LEN(_len)
Definition: ip4_mfib.c:142
unsigned long u64
Definition: types.h:89
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1168
u32 fib_masks[33]
Definition: ip4.h:96

Definition at line 151 of file ip4_mfib.c.

#define IP4_MFIB_MK_KEY (   _grp,
  _src,
  _len,
  _key 
)
Value:
{ \
_key = ((u64)(_grp->data_u32 & \
_key |= _src->data_u32; \
}
#define IPV4_MFIB_GRP_LEN(_len)
Definition: ip4_mfib.c:142
unsigned long u64
Definition: types.h:89
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1168
u32 fib_masks[33]
Definition: ip4.h:96

Definition at line 145 of file ip4_mfib.c.

#define IPV4_MFIB_GRP_LEN (   _len)    (_len > 32 ? 32 : _len)

Definition at line 142 of file ip4_mfib.c.

Function Documentation

static u32 ip4_create_mfib_with_table_id ( u32  table_id)
static

Definition at line 36 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_mfib_table_destroy ( ip4_mfib_t mfib)

Definition at line 83 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_mfib_table_entry_insert ( ip4_mfib_t mfib,
const ip4_address_t grp,
const ip4_address_t src,
u32  len,
fib_node_index_t  fib_entry_index 
)

Definition at line 226 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_mfib_table_entry_remove ( ip4_mfib_t mfib,
const ip4_address_t grp,
const ip4_address_t src,
u32  len 
)

Definition at line 257 of file ip4_mfib.c.

+ Here is the caller graph for this function:

u32 ip4_mfib_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 116 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ip4_mfib_table_get_index_for_sw_if_index ( u32  sw_if_index)

Definition at line 129 of file ip4_mfib.c.

+ Here is the caller graph for this function:

fib_node_index_t ip4_mfib_table_lookup ( const ip4_mfib_t fib,
const ip4_address_t src,
const ip4_address_t grp,
u32  len 
)

The IPv4 Multicast-FIB.

FIXME

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 188 of file ip4_mfib.c.

+ Here is the caller graph for this function:

fib_node_index_t ip4_mfib_table_lookup_exact_match ( const ip4_mfib_t mfib,
const ip4_address_t grp,
const ip4_address_t src,
u32  len 
)

Definition at line 163 of file ip4_mfib.c.

+ Here is the caller graph for this function:

static void ip4_mfib_table_show_all ( ip4_mfib_t mfib,
vlib_main_t vm 
)
static

Definition at line 307 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ip4_mfib_table_show_one ( ip4_mfib_t mfib,
vlib_main_t vm,
ip4_address_t src,
ip4_address_t grp,
u32  mask_len 
)
static

Definition at line 345 of file ip4_mfib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ip4_mfib_table_walk ( ip4_mfib_t mfib,
mfib_table_walk_fn_t  fn,
void *  ctx 
)

Walk the IP4 mfib table.

Parameters
mfibthe table to walk
fnThe function to invoke on each entry visited
ctxA context passed in the visit function

Definition at line 284 of file ip4_mfib.c.

+ Here is the caller graph for this function:

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

Definition at line 358 of file ip4_mfib.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_cli_command_t ip4_show_mfib_command
static
Initial value:
= {
.path = "show ip mfib",
.short_help = "show ip mfib [summary] [table <table-id>] [index <fib-id>] [<grp-addr>[/<mask>]] [<grp-addr>] [<src-addr> <grp-addr>]",
.function = ip4_show_mfib,
}
static clib_error_t * ip4_show_mfib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip4_mfib.c:358

(constructor) VLIB_CLI_COMMAND (ip4_show_mfib_command)

Definition at line 487 of file ip4_mfib.c.

const mfib_prefix_t ip4_specials[]
static
Initial value:
= {
{
.fp_src_addr = {
.ip4.data_u32 = 0,
},
.fp_grp_addr = {
.ip4.data_u32 = 0,
},
.fp_len = 0,
.fp_proto = FIB_PROTOCOL_IP4,
},
}

Definition at line 21 of file ip4_mfib.c.