185 if (mfib_entry_cover_index != mfib_entry_index)
288 return (mfib_entry_index);
320 return (mfib_entry_index);
339 return (mfib_entry_index);
459 return (mfib_entry_index);
551 return ((NULL != mfib_table ? mfib_table->
mft_table_id : ~0));
668 .mftf_entries = NULL,
669 .mftf_source = source,
703 .mftf_source = source,
736 .mftf_source = source,
859 if (1 << attr & flags) {
static clib_error_t * rn_module_init(vlib_main_t *vm)
void mfib_table_entry_delete(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source)
Delete a FIB entry.
#define MFIB_TABLE_ATTRIBUTES
u32 mfib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, mfib_source_t src)
Get the index of the FIB for a Table-ID.
ip46_address_t fp_src_addr
fib_node_index_t mfib_table_lookup(u32 fib_index, const mfib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
int mfib_entry_delete(fib_node_index_t mfib_entry_index, mfib_source_t source)
mfib_entry_delete
enum mfib_entry_flags_t_ mfib_entry_flags_t
vl_api_wireguard_peer_flags_t flags
A representation of a path as described by a route producer.
#define MFIB_TABLE_TOTAL_LOCKS
void mfib_signal_module_init(void)
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.
u32 ip4_mfib_table_get_index_for_sw_if_index(u32 sw_if_index)
void mfib_entry_unlock(fib_node_index_t mfib_entry_index)
fib_node_index_t mfib_table_entry_special_add(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, mfib_entry_flags_t entry_flags, index_t repi)
Add a 'special' entry to the mFIB that links to the DPO passed A special entry is an entry that the F...
void mfib_table_sweep(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Signal that the table has converged, i.e.
u8 * format_mfib_table_flags(u8 *s, va_list *args)
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)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#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)
enum mfib_table_flags_t_ mfib_table_flags_t
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.
void ip6_mfib_table_destroy(ip6_mfib_t *mfib)
fib_node_index_t * mftf_entries
The list of entries to flush.
static fib_node_index_t mfib_table_lookup_i(const mfib_table_t *mfib_table, const mfib_prefix_t *prefix)
fib_node_index_t ip4_mfib_table_get_less_specific(const ip4_mfib_t *mfib, const ip4_address_t *src, const ip4_address_t *grp, u32 len)
static void mfib_table_entry_remove(mfib_table_t *mfib_table, const mfib_prefix_t *prefix, fib_node_index_t mfib_entry_index)
struct mfib_table_flush_ctx_t_ mfib_table_flush_ctx_t
Table flush context.
static void vlib_smp_unsafe_warning(void)
u8 * format_fib_protocol(u8 *s, va_list *ap)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static ip4_mfib_t * ip4_mfib_get(u32 index)
Get the FIB at the given index.
static void mfib_table_entry_delete_i(u32 fib_index, fib_node_index_t mfib_entry_index, const mfib_prefix_t *prefix, mfib_source_t source)
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.
enum mfib_source_t_ mfib_source_t
Possible [control plane] sources of MFIB entries.
fib_node_index_t mfib_table_entry_paths_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
#define VLIB_INIT_FUNCTION(x)
u32 mfib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
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
u32 mfib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, mfib_source_t src, const u8 *name)
Get the index of the FIB for a Table-ID.
u32 mfib_table_get_n_routes(fib_node_index_t fib_index, fib_protocol_t proto)
To assit UT.
void mfib_entry_module_init(void)
void mfib_table_mark(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Resync all entries from a table for the source this is the mark part of the mark and sweep algorithm...
struct mfib_table_t_ * mfibs
Vector of MFIBs.
#define vlib_call_init_function(vm, x)
static void mfib_table_post_insert_actions(mfib_table_t *mfib_table, const mfib_prefix_t *prefix, fib_node_index_t mfib_entry_index)
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)
static walk_rc_t mfib_table_sweep_cb(fib_node_index_t fib_entry_index, void *arg)
u32 mfib_entry_get_fib_index(fib_node_index_t mfib_entry_index)
void ip4_mfib_table_walk(ip4_mfib_t *mfib, mfib_table_walk_fn_t fn, void *ctx)
Walk the IP4 mfib table.
int mfib_entry_update(fib_node_index_t mfib_entry_index, mfib_source_t source, mfib_entry_flags_t entry_flags, fib_rpf_id_t rpf_id, index_t repi)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int mfib_entry_path_remove(fib_node_index_t mfib_entry_index, mfib_source_t source, const fib_route_path_t *rpaths)
u8 * format_ip6_mfib_table_memory(u8 *s, va_list *args)
format (display) ipv6 MFIB mempry usage
static void mfib_table_entry_insert(mfib_table_t *mfib_table, const mfib_prefix_t *prefix, fib_node_index_t mfib_entry_index)
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
void mfib_entry_cover_change_notify(fib_node_index_t cover_index, fib_node_index_t covered)
void ip4_mfib_table_entry_remove(ip4_mfib_t *mfib, const ip4_address_t *grp, const ip4_address_t *src, u32 len)
int mfib_entry_is_host(fib_node_index_t mfib_entry_index)
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.
int mfib_entry_is_sourced(fib_node_index_t mfib_entry_index, mfib_source_t source)
int mfib_entry_special_add(fib_node_index_t mfib_entry_index, mfib_source_t source, mfib_entry_flags_t entry_flags, fib_rpf_id_t rpf_id, index_t repi)
#define FOR_EACH_MFIB_TABLE_ATTRIBUTE(_item)
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
u8 * mft_desc
Table description.
void mfib_entry_lock(fib_node_index_t mfib_entry_index)
void mfib_table_flush(u32 mfib_index, fib_protocol_t proto, mfib_source_t source)
Flush all entries from a table for the source.
u32 ip6_mfib_table_get_index_for_sw_if_index(u32 sw_if_index)
void mfib_entry_path_update(fib_node_index_t mfib_entry_index, mfib_source_t source, const fib_route_path_t *rpaths)
void mfib_table_walk(u32 fib_index, fib_protocol_t proto, mfib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
static const char * mfib_table_flags_strings[]
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)
u8 * format_mfib_table_memory(u8 *s, va_list *args)
format (display) the memory usage for mfibs
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
u32 fib_node_index_t
A typedef of a node index.
mfib_source_t mftf_source
The source we are flushing.
void mfib_entry_mark(fib_node_index_t fib_entry_index, mfib_source_t source)
u32 mft_epoch
resync epoch
Aggregate type for a prefix.
static void mfib_table_entry_paths_remove_i(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
int mfib_entry_is_marked(fib_node_index_t mfib_entry_index, mfib_source_t source)
enum mfib_table_attribute_t_ mfib_table_attribute_t
Flags for the source data.
fib_node_index_t mfib_table_get_less_specific(u32 fib_index, const mfib_prefix_t *prefix)
Get the less specific (covering) prefix.
static clib_error_t * fib_module_init(vlib_main_t *vm)
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_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.
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)
fib_protocol_t mft_proto
Which protocol this table serves.
u32 mft_table_id
Table ID (hash key) for this FIB.
u32 mfib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static u32 mfib_table_find_or_create_and_lock_i(fib_protocol_t proto, u32 table_id, mfib_source_t src, const u8 *name)
fib_protocol_t fp_proto
protocol type
static void mfib_table_destroy(mfib_table_t *mfib_table)
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)
mfib_table_t * mfib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
#define FIB_NODE_INDEX_INVALID
static fib_node_index_t mfib_table_get_less_specific_i(const mfib_table_t *mfib_table, const mfib_prefix_t *prefix)
fib_node_index_t mfib_entry_create(u32 fib_index, mfib_source_t source, const mfib_prefix_t *prefix, fib_rpf_id_t rpf_id, mfib_entry_flags_t entry_flags, index_t repi)
u32 ip4_mfib_table_find_or_create_and_lock(u32 table_id, mfib_source_t src)
Get or create an IPv4 fib.
const mfib_prefix_t * mfib_entry_get_prefix(fib_node_index_t mfib_entry_index)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
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)
static clib_error_t * mfib_module_init(vlib_main_t *vm)
static ip6_mfib_t * ip6_mfib_get(u32 index)
Get the FIB at the given index.
A protocol Independent IP multicast FIB table.
ip4_main_t ip4_main
Global ip4 main structure.
vl_api_mfib_entry_flags_t entry_flags
#define vec_foreach(var, vec)
Vector iterator.
void mfib_entry_src_module_init(void)
static fib_node_index_t mfib_table_lookup_exact_match_i(const mfib_table_t *mfib_table, const mfib_prefix_t *prefix)
u16 fp_len
The mask length.
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.
static u32 ip4_mfib_index_from_table_id(u32 table_id)
static walk_rc_t mfib_table_mark_cb(fib_node_index_t fib_entry_index, void *arg)
void mfib_table_entry_paths_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
static walk_rc_t mfib_table_flush_cb(fib_node_index_t mfib_entry_index, void *arg)
u8 * format_mfib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
mfib_table_flags_t mft_flags
table falgs
u32 mft_locks[MFIB_TABLE_N_LOCKS]
number of locks on the table
void ip4_mfib_table_destroy(ip4_mfib_t *mfib)
vl_api_interface_index_t sw_if_index
u8 * format_mfib_prefix(u8 *s, va_list *args)
static fib_node_index_t mfib_table_entry_paths_update_i(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
ip46_address_t fp_grp_addr
The address type is not deriveable from the fp_addr member.
u8 * format_ip4_mfib_table_memory(u8 *s, va_list *args)
format (display) the memory usage for IP4 mfibs