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,
302 #define IPV6_MFIB_GRP_LEN(_len) \ 303 (_len > 128 ? 128 : _len) 305 #define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key) \ 307 _key.key[0] = (_grp->as_u64[0] & \ 308 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[0]); \ 309 _key.key[1] = (_grp->as_u64[1] & \ 310 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[1]); \ 312 _key.key[2] = _src->as_u64[0]; \ 313 _key.key[3] = _src->as_u64[1]; \ 318 _key.key[4] = _mfib->index; \ 319 _key.key[4] = (_key.key[4] << 32) | len; \ 329 const ip6_address_t *grp,
330 const ip6_address_t *
src,
338 rv = clib_bihash_search_inline_2_40_8(&ip6_mfib_table.
ip6_mhash,
353 const ip6_address_t *
src,
354 const ip6_address_t *grp)
364 for (i = 0; i < n; i++)
368 ASSERT(len >= 0 && len <= 256);
370 rv = clib_bihash_search_inline_2_40_8(&table->
ip6_mhash, &key, &value);
381 const ip6_address_t *
src,
382 const ip6_address_t *grp,
418 const ip6_address_t *
src,
419 const ip6_address_t *grp,
434 while (i < n && table->prefix_lengths_in_search_order[i] > len)
446 rv = clib_bihash_search_inline_2_40_8(&table->
ip6_mhash, &key, &value);
468 const ip6_address_t *grp,
469 const ip6_address_t *
src,
478 key.
value = mfib_entry_index;
480 clib_bihash_add_del_40_8(&table->
ip6_mhash, &key, 1);
493 const ip6_address_t *grp,
494 const ip6_address_t *
src,
503 clib_bihash_add_del_40_8(&table->
ip6_mhash, &key, 0);
528 bytes_inuse = alloc_arena_next(&(ip6_mfib_table.
ip6_mhash));
530 s =
format(s,
"%=30s %=6d %=12ld\n",
624 return (BIHASH_WALK_CONTINUE);
633 .i6w_mfib_index = mfib->
index,
638 clib_bihash_foreach_key_value_pair_40_8(
651 int verbose, matching;
652 ip6_address_t grp,
src = {{0}};
684 else if (
unformat (input,
"table %d", &table_id))
686 else if (
unformat (input,
"index %d", &fib_index))
698 if (table_id >= 0 && table_id != (
int)mfib->
table_id)
700 if (fib_index != ~0 && fib_index != (
int)mfib->
index)
778 .path =
"show ip6 mfib",
779 .short_help =
"show ip mfib [summary] [table <table-id>] [index <fib-id>] [<grp-addr>[/<mask>]] [<grp-addr>] [<src-addr> <grp-addr>]",
787 clib_bihash_init_40_8 (&ip6_mfib_table.
ip6_mhash,
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define MFIB_ENTRY_FORMAT_DETAIL
ip6_mfib_special_type_t ims_type
solicited or not
ip46_address_t fp_src_addr
#define hash_set(h, key, value)
enum ip6_mfib_special_type_t_ ip6_mfib_special_type_t
#define hash_unset(h, key)
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
A representation of a path as described by a route producer.
fib_node_index_t * entries
#define pool_foreach(VAR, POOL)
Iterate through pool.
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.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
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)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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)
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. ...
i32 dst_address_length_refcounts[257]
fib_node_index_t ip6_mfib_table_fwd_lookup(const ip6_mfib_t *mfib, const ip6_address_t *src, const ip6_address_t *grp)
u32 mft_total_route_counts
Total route counters.
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.
dpo_proto_t frp_proto
The protocol of the address below.
void ip6_mfib_table_destroy(ip6_mfib_t *mfib)
#define MFIB_ENTRY_FORMAT_BRIEF
static int ip6_mfib_walk_cb(clib_bihash_kv_40_8_t *kvp, void *arg)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
enum walk_rc_t_ walk_rc_t
Walk return code.
u32 ip6_mfib_table_find_or_create_and_lock(u32 table_id, mfib_source_t src)
Get or create an IPv4 fib.
clib_bihash_kv_40_8_t ip6_mfib_key_t
Key and mask for radix.
enum mfib_source_t_ mfib_source_t
Possible [control plane] sources of MFIB entries.
u8 ims_len
the Prefix length
static clib_error_t * ip6_show_mfib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
fib_node_index_t mft_index
Index into FIB vector.
void mfib_table_entry_delete_index(fib_node_index_t mfib_entry_index, mfib_source_t source)
Delete a FIB entry.
description fragment has unexpected format
A representation of a single IP6 mfib table.
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)
struct ip6_mfib_show_ctx_t_ ip6_mfib_show_ctx_t
uword * mfib_index_by_table_id
Hash table mapping table id to multicast fib index.
u8 * format_ip6_mfib_table_memory(u8 *s, va_list *args)
format (display) ipv6 MFIB mempry usage
struct ip6_mfib_walk_ctx_t_ ip6_mfib_walk_ctx_t
Context when walking the IPv6 table.
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 pool_put(P, E)
Free an object E in pool P.
int mfib_entry_cmp_for_sort(void *i1, void *i2)
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
u8 ims_byte
The last byte of the mcast address.
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
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.
u32 ip6_mfib_table_get_index_for_sw_if_index(u32 sw_if_index)
static void ip6_mfib_table_show_all(ip6_mfib_t *mfib, vlib_main_t *vm)
sll srl srl sll sra u16x4 i
u8 * format_mfib_entry(u8 *s, va_list *args)
#define vec_free(V)
Free vector's memory (no header).
static u32 ip6_create_mfib_with_table_id(u32 table_id, mfib_source_t src)
u32 fib_node_index_t
A typedef of a node index.
Aggregate type for a prefix.
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define IP6_MFIB_DEFAULT_HASH_NUM_BUCKETS
The IPv4 Multicast-FIB.
static clib_error_t * ip6_mfib_module_init(vlib_main_t *vm)
u8 ims_scope
The scope of the address.
uword * non_empty_dst_address_length_bitmap
u16 * prefix_lengths_in_search_order
ip6_mfib_table_instance_t ip6_mfib_table
the single MFIB table
mfib_table_walk_fn_t i6w_fn
static u32 ip6_mfib_index_from_table_id(u32 table_id)
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.
struct mfib_table_t_ * mfibs
Vector of MFIBs.
fib_protocol_t mft_proto
Which protocol this table serves.
struct ip6_mfib_special_t_ ip6_mfib_special_t
static walk_rc_t ip6_mfib_table_collect_entries(fib_node_index_t mfei, void *arg)
u32 mft_table_id
Table ID (hash key) for this FIB.
static clib_error_t * ip6_mfib_init(vlib_main_t *vm)
fib_protocol_t fp_proto
protocol type
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)
#define FIB_NODE_INDEX_INVALID
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
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 vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
void ip6_mfib_table_walk(ip6_mfib_t *mfib, mfib_table_walk_fn_t fn, void *arg)
Walk the IP6 mfib table.
void ip6_mfib_table_entry_remove(ip6_mfib_t *mfib, const ip6_address_t *grp, const ip6_address_t *src, u32 len)
A protocol Independent IP multicast FIB table.
#define IP6_MFIB_DEFAULT_HASH_MEMORY_SIZE
Context when walking the IPv6 table.
#define vec_foreach(var, vec)
Vector iterator.
static void compute_prefix_lengths_in_search_order(ip6_mfib_table_instance_t *table)
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.
#define CLIB_CACHE_LINE_BYTES
u8 * format_mfib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
#define FOR_EACH_IP6_SPECIAL(_pfx, _body)
#define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key)
const ip46_address_t zero_addr
#include <vnet/feature/feature.h>
vl_api_interface_index_t sw_if_index
clib_bihash_40_8_t ip6_mhash
static uword pool_elts(void *v)
Number of active elements in a pool.