|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
82 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
83 .ims_byte = IP6_MULTICAST_GROUP_ID_all_routers,
91 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
92 .ims_byte = IP6_MULTICAST_GROUP_ID_all_hosts,
101 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
102 .ims_byte = IP6_MULTICAST_GROUP_ID_mldv2_routers,
106 #define FOR_EACH_IP6_SPECIAL(_pfx, _body) \
108 const ip6_mfib_special_t *_spec; \
111 _ii < ARRAY_LEN(ip6_mfib_specials); \
114 _spec = &ip6_mfib_specials[_ii]; \
115 if (IP6_MFIB_SPECIAL_TYPE_SOLICITED == _spec->ims_type) \
117 ip6_set_solicited_node_multicast_address( \
118 &(_pfx)->fp_grp_addr.ip6, 0); \
122 ip6_set_reserved_multicast_address ( \
123 &(_pfx)->fp_grp_addr.ip6, \
127 (_pfx)->fp_len = _spec->ims_len; \
128 do { _body; } while (0); \
144 .frp_sw_if_index = 0xffffffff,
203 .frp_sw_if_index = 0xffffffff,
301 #define IPV6_MFIB_GRP_LEN(_len) \
302 (_len > 128 ? 128 : _len)
304 #define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key) \
306 _key.key[0] = (_grp->as_u64[0] & \
307 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[0]); \
308 _key.key[1] = (_grp->as_u64[1] & \
309 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[1]); \
311 _key.key[2] = _src->as_u64[0]; \
312 _key.key[3] = _src->as_u64[1]; \
317 _key.key[4] = _mfib->index; \
318 _key.key[4] = (_key.key[4] << 32) | len; \
328 const ip6_address_t *grp,
329 const ip6_address_t *
src,
352 const ip6_address_t *
src,
353 const ip6_address_t *grp)
363 for (
i = 0;
i < n;
i++)
380 const ip6_address_t *
src,
381 const ip6_address_t *grp,
417 const ip6_address_t *
src,
418 const ip6_address_t *grp,
433 while (i < n && table->prefix_lengths_in_search_order[
i] >
len)
467 const ip6_address_t *grp,
468 const ip6_address_t *
src,
477 key.value = mfib_entry_index;
492 const ip6_address_t *grp,
493 const ip6_address_t *
src,
529 s =
format(s,
"%=30s %=6d %=12ld\n",
619 if ((kvp->
key[4] >> 32) ==
ctx->i6w_mfib_index)
623 return (BIHASH_WALK_CONTINUE);
632 .i6w_mfib_index = mfib->
index,
637 clib_bihash_foreach_key_value_pair_40_8(
650 int verbose, matching;
651 ip6_address_t grp,
src = {{0}};
685 else if (
unformat (input,
"index %d", &fib_index))
699 if (fib_index != ~0 && fib_index != (
int)mfib->
index)
777 .path =
"show ip6 mfib",
778 .short_help =
"show ip mfib [summary] [table <table-id>] [index <fib-id>] [<grp-addr>[/<mask>]] [<grp-addr>] [<src-addr> <grp-addr>]",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
void ip6_mfib_table_destroy(ip6_mfib_t *mfib)
#define hash_set(h, key, value)
static vlib_cli_command_t ip6_show_fib_command
(constructor) VLIB_CLI_COMMAND (ip6_show_fib_command)
const ip46_address_t zero_addr
#include <vnet/feature/feature.h>
ip6_mfib_table_instance_t ip6_mfib_table
the single MFIB table
clib_bihash_kv_40_8_t ip6_mfib_key_t
Key and mask for radix.
fib_node_index_t ip6_mfib_table_lookup(const ip6_mfib_t *mfib, const ip6_address_t *src, const ip6_address_t *grp, u32 len)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
u32 mft_total_route_counts
Total route counters.
Aggregate type for a prefix.
u16 * prefix_lengths_in_search_order
static const mfib_prefix_t all_zeros
void mfib_table_entry_delete_index(fib_node_index_t mfib_entry_index, mfib_source_t source)
Delete a FIB entry.
A representation of a single IP6 mfib table.
#define FIB_NODE_INDEX_INVALID
#define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key)
#define pool_put(P, E)
Free an object E in pool P.
void ip6_mfib_table_entry_insert(ip6_mfib_t *mfib, const ip6_address_t *grp, const ip6_address_t *src, u32 len, fib_node_index_t mfib_entry_index)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static void ip6_mfib_table_show_one(ip6_mfib_t *mfib, vlib_main_t *vm, ip6_address_t *src, ip6_address_t *grp, u32 mask_len, u32 cover)
#define MFIB_ENTRY_FORMAT_BRIEF
dpo_proto_t frp_proto
The protocol of the address below.
A protocol Independent IP multicast FIB table.
@ IP6_MFIB_SPECIAL_TYPE_NONE
#define hash_unset(h, key)
ip46_address_t fp_src_addr
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define IP6_MFIB_DEFAULT_HASH_MEMORY_SIZE
enum mfib_source_t_ mfib_source_t
Possible [control plane] sources of MFIB entries.
fib_node_index_t mft_index
Index into FIB vector.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void ip6_mfib_interface_enable_disable(u32 sw_if_index, int is_enable)
Add/remove the interface from the accepting list of the special MFIB entries.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u8 * format_ip6_mfib_table_memory(u8 *s, va_list *args)
format (display) ipv6 MFIB mempry usage
uword * non_empty_dst_address_length_bitmap
walk_rc_t(* mfib_table_walk_fn_t)(fib_node_index_t fei, void *ctx)
Call back function when walking entries in a FIB table.
u32 fib_node_index_t
A typedef of a node index.
static int ip6_mfib_walk_cb(clib_bihash_kv_40_8_t *kvp, void *arg)
static u32 ip6_mfib_index_from_table_id(u32 table_id)
@ MFIB_SOURCE_DEFAULT_ROUTE
struct mfib_table_t_ * mfibs
Vector of MFIBs.
uword * mfib_index_by_table_id
Hash table mapping table id to multicast fib index.
struct ip6_mfib_show_ctx_t_ ip6_mfib_show_ctx_t
u8 ims_byte
The last byte of the mcast address.
u32 ip6_mfib_table_find_or_create_and_lock(u32 table_id, mfib_source_t src)
Get or create an IPv4 fib.
static void compute_prefix_lengths_in_search_order(ip6_mfib_table_instance_t *table)
#define VLIB_CLI_COMMAND(x,...)
fib_node_index_t * entries
u8 * format_mfib_entry(u8 *s, va_list *args)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
#define CLIB_CACHE_LINE_BYTES
clib_bihash_40_8_t ip6_mhash
static const ip6_mfib_special_t ip6_mfib_specials[]
fib_protocol_t fp_proto
protocol type
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
mfib_table_walk_fn_t i6w_fn
fib_node_index_t mfib_table_lookup_exact_match(u32 fib_index, const mfib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
#define vec_free(V)
Free vector's memory (no header).
int mfib_entry_cmp_for_sort(void *i1, void *i2)
fib_protocol_t mft_proto
Which protocol this table serves.
description fragment has unexpected format
u32 mft_table_id
Table ID (hash key) for this FIB.
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
#define VLIB_INIT_FUNCTION(x)
A representation of a path as described by a route producer.
static clib_error_t * ip6_mfib_module_init(vlib_main_t *vm)
static clib_error_t * ip6_show_mfib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
enum ip6_mfib_special_type_t_ ip6_mfib_special_type_t
#define vec_foreach(var, vec)
Vector iterator.
fib_node_index_t ip6_mfib_table_get_less_specific(const ip6_mfib_t *mfib, const ip6_address_t *src, const ip6_address_t *grp, u32 len)
u8 ims_len
the Prefix length
static uword pool_elts(void *v)
Number of active elements in a pool.
fib_node_index_t ip6_mfib_table_lookup_exact_match(const ip6_mfib_t *mfib, const ip6_address_t *grp, const ip6_address_t *src, u32 len)
fib_node_index_t ip6_mfib_table_fwd_lookup(const ip6_mfib_t *mfib, const ip6_address_t *src, const ip6_address_t *grp)
static walk_rc_t ip6_mfib_table_collect_entries(fib_node_index_t mfei, void *arg)
ip6_mfib_special_type_t ims_type
solicited or not
static u32 ip6_create_mfib_with_table_id(u32 table_id, mfib_source_t src)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
void mfib_table_entry_path_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath)
Remove n paths to an entry (aka route) in the FIB.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
i32 dst_address_length_refcounts[257]
static clib_error_t * ip6_mfib_init(vlib_main_t *vm)
struct ip6_mfib_special_t_ ip6_mfib_special_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
fib_node_index_t mfib_table_entry_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, fib_rpf_id_t rpf_id, mfib_entry_flags_t entry_flags)
Add a new (with no replication) or lock an existing entry.
Context when walking the IPv6 table.
fib_node_index_t mfib_table_entry_path_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpath)
Add n paths to an entry (aka route) in the FIB.
#define IP6_MFIB_DEFAULT_HASH_NUM_BUCKETS
The IPv4 Multicast-FIB.
void ip6_mfib_table_entry_remove(ip6_mfib_t *mfib, const ip6_address_t *grp, const ip6_address_t *src, u32 len)
void ip6_mfib_table_walk(ip6_mfib_t *mfib, mfib_table_walk_fn_t fn, void *arg)
Walk the IP6 mfib table.
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
u8 ims_scope
The scope of the address.
u8 * format_mfib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
struct ip6_mfib_walk_ctx_t_ ip6_mfib_walk_ctx_t
Context when walking the IPv6 table.
vl_api_interface_index_t sw_if_index
@ IP6_MFIB_SPECIAL_TYPE_SOLICITED
enum walk_rc_t_ walk_rc_t
Walk return code.
@ FIB_ROUTE_PATH_LOCAL
A for-us/local path.
static void ip6_mfib_table_show_all(ip6_mfib_t *mfib, vlib_main_t *vm)
#define MFIB_ENTRY_FORMAT_DETAIL
u32 ip6_mfib_table_get_index_for_sw_if_index(u32 sw_if_index)
#define FOR_EACH_IP6_SPECIAL(_pfx, _body)