80 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
81 .ims_byte = IP6_MULTICAST_GROUP_ID_all_routers,
89 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
90 .ims_byte = IP6_MULTICAST_GROUP_ID_all_hosts,
99 .ims_scope = IP6_MULTICAST_SCOPE_link_local,
100 .ims_byte = IP6_MULTICAST_GROUP_ID_mldv2_routers,
104 #define FOR_EACH_IP6_SPECIAL(_pfx, _body) \ 106 const ip6_mfib_special_t *_spec; \ 109 _ii < ARRAY_LEN(ip6_mfib_specials); \ 112 _spec = &ip6_mfib_specials[_ii]; \ 113 if (IP6_MFIB_SPECIAL_TYPE_SOLICITED == _spec->ims_type) \ 115 ip6_set_solicited_node_multicast_address( \ 116 &(_pfx)->fp_grp_addr.ip6, 0); \ 120 ip6_set_reserved_multicast_address ( \ 121 &(_pfx)->fp_grp_addr.ip6, \ 125 (_pfx)->fp_len = _spec->ims_len; \ 126 do { _body; } while (0); \ 142 .frp_sw_if_index = 0xffffffff,
201 .frp_sw_if_index = 0xffffffff,
300 #define IPV6_MFIB_GRP_LEN(_len) \ 301 (_len > 128 ? 128 : _len) 303 #define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key) \ 305 _key.key[0] = (_grp->as_u64[0] & \ 306 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[0]); \ 307 _key.key[1] = (_grp->as_u64[1] & \ 308 ip6_main.fib_masks[IPV6_MFIB_GRP_LEN(_len)].as_u64[1]); \ 310 _key.key[2] = _src->as_u64[0]; \ 311 _key.key[3] = _src->as_u64[1]; \ 316 _key.key[4] = _mfib->index; \ 317 _key.key[4] = (_key.key[4] << 32) | len; \ 362 for (i = 0; i < n; i++)
366 ASSERT(len >= 0 && len <= 256);
368 rv = clib_bihash_search_inline_2_40_8(&table->
ip6_mhash, &key, &value);
432 while (i < n && table->prefix_lengths_in_search_order[i] > len)
444 rv = clib_bihash_search_inline_2_40_8(&table->
ip6_mhash, &key, &value);
460 vec_add1(table->prefix_lengths_in_search_order, (256 - i));
476 key.
value = mfib_entry_index;
478 clib_bihash_add_del_40_8(&table->
ip6_mhash, &key, 1);
501 clib_bihash_add_del_40_8(&table->
ip6_mhash, &key, 0);
528 s =
format(s,
"%=30s %=6d %=12ld\n",
622 return (BIHASH_WALK_CONTINUE);
631 .i6w_mfib_index = mfib->
index,
636 clib_bihash_foreach_key_value_pair_40_8(
649 int verbose, matching;
651 u32 mask = 128, cover;
682 else if (
unformat (input,
"table %d", &table_id))
684 else if (
unformat (input,
"index %d", &fib_index))
694 ip6_mfib_t *mfib = &mfib_table->v6;
696 if (table_id >= 0 && table_id != (int)mfib->table_id)
698 if (fib_index != ~0 && fib_index != (int)mfib->index)
701 vlib_cli_output (vm,
"%U, fib_index %d",
702 format_mfib_table_name, mfib->index, FIB_PROTOCOL_IP6,
776 .path =
"show ip6 mfib",
777 .short_help =
"show ip mfib [summary] [table <table-id>] [index <fib-id>] [<grp-addr>[/<mask>]] [<grp-addr>] [<src-addr> <grp-addr>]",
#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
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)
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)
The IPv4 Multicast-FIB.
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 pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#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.
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
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
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)
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,...)
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
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.
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)
ip6_mfib_table_instance_t ip6_mtable
the single MFIB table
A protocol Independent IP multicast FIB table.
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
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define FOR_EACH_IP6_SPECIAL(_pfx, _body)
#define IP6_MFIB_MK_KEY(_mfib, _grp, _src, _len, _key)
const ip46_address_t zero_addr
clib_bihash_40_8_t ip6_mhash
static uword pool_elts(void *v)
Number of active elements in a pool.