16 #ifndef __MFIB_TABLE_H__ 17 #define __MFIB_TABLE_H__ 28 #define MFIB_TABLE_N_LOCKS (MFIB_N_SOURCES+1) 29 #define MFIB_TABLE_TOTAL_LOCKS MFIB_N_SOURCES 49 #define MFIB_TABLE_ATTRIBUTE_MAX (MFIB_TABLE_ATTRIBUTE_LAST+1) 51 #define MFIB_TABLE_ATTRIBUTES { \ 52 [MFIB_TABLE_ATTRIBUTE_RESYNC] = "resync", \ 55 #define FOR_EACH_MFIB_TABLE_ATTRIBUTE(_item) \ 56 for (_item = MFIB_TABLE_ATTRIBUTE_FIRST; \ 57 _item < MFIB_TABLE_ATTRIBUTE_MAX; \ CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
Required for pool_get_aligned.
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u32 mfib_table_get_num_entries(u32 fib_index, fib_protocol_t proto)
Return the number of entries in the FIB added by a given source.
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.
void mfib_table_entry_paths_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *paths)
void mfib_table_entry_path_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *paths)
Remove n paths to an entry (aka route) in the FIB.
void mfib_table_flush(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Flush all entries from a table for the source.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u16 mft_locks[MFIB_TABLE_N_LOCKS]
number of locks on the table
the table is currently resync-ing
enum mfib_table_flags_t_ mfib_table_flags_t
u32 mft_total_route_counts
Total route counters.
u32 mfib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, mfib_source_t source)
Get the index of the FIB for a Table-ID.
mfib_table_t * mfib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
struct mfib_table_t_ mfib_table_t
A protocol Independent IP multicast FIB 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.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
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.
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
enum walk_rc_t_ walk_rc_t
Walk return code.
enum mfib_source_t_ mfib_source_t
Possible [control plane] sources of MFIB entries.
fib_node_index_t mft_index
Index into FIB vector.
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.
void mfib_table_entry_delete(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source)
Delete a FIB entry.
mfib_table_attribute_t_
Flags for the source data.
u8 * mft_desc
Table description.
u32 mfib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
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 flags)
Add a new (with no replication) or lock an existing entry.
#define MFIB_TABLE_N_LOCKS
Keep a lock per-source and a total.
u8 * format_mfib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
u32 fib_node_index_t
A typedef of a node index.
u32 mft_epoch
resync epoch
Aggregate type for a prefix.
vl_api_fib_path_t paths[n_paths]
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
enum mfib_table_attribute_t_ mfib_table_attribute_t
Flags for the source data.
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.
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.
fib_protocol_t mft_proto
Which protocol this table serves.
u32 mft_table_id
Table ID (hash key) for this FIB.
u8 * format_mfib_table_flags(u8 *s, va_list *args)
u32 mfib_table_get_n_routes(fib_node_index_t index, fib_protocol_t proto)
To assit UT.
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 *rpath)
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...
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.
u8 * format_mfib_table_memory(u8 *s, va_list *args)
format (display) the memory usage for mfibs
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 flags, index_t rep_dpo)
Add a 'special' entry to the mFIB that links to the DPO passed A special entry is an entry that the F...
A protocol Independent IP multicast FIB table.
void mfib_table_sweep(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Signal that the table has converged, i.e.
fib_node_index_t mfib_table_get_less_specific(u32 fib_index, const mfib_prefix_t *prefix)
Get the less specific (covering) prefix.
void mfib_table_entry_delete_index(fib_node_index_t entry_index, mfib_source_t source)
Delete a FIB entry.
mfib_table_flags_t mft_flags
table falgs
u32 mfib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, mfib_source_t source, const u8 *name)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index