|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __FIB_TABLE_H__
17 #define __FIB_TABLE_H__
47 #define FIB_TABLE_ATTRIBUTE_MAX (FIB_TABLE_ATTRIBUTE_LAST+1)
49 #define FIB_TABLE_ATTRIBUTES { \
50 [FIB_TABLE_ATTRIBUTE_IP6_LL] = "ip6-ll", \
51 [FIB_TABLE_ATTRIBUTE_RESYNC] = "resync", \
54 #define FOR_EACH_FIB_TABLE_ATTRIBUTE(_item) \
55 for (_item = FIB_TABLE_ATTRIBUTE_FIRST; \
56 _item < FIB_TABLE_ATTRIBUTE_MAX; \
345 const ip46_address_t *next_hop,
346 u32 next_hop_sw_if_index,
347 u32 next_hop_fib_index,
421 const ip46_address_t *next_hop,
422 u32 next_hop_sw_if_index,
423 u32 next_hop_fib_index,
528 const ip46_address_t *next_hop,
529 u32 next_hop_sw_if_index,
530 u32 next_hop_fib_index,
802 const char *
const fmt,
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_label_stack, fib_route_path_flags_t pf)
Add one path to an entry (aka route) in the FIB.
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
@ FIB_TABLE_ATTRIBUTE_IP6_LL
the table is for IP6 link local addresses
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
u32 ft_epoch
Epoch - number of resyncs performed.
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
void fib_table_entry_local_label_remove(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
remove a MPLS local label for the prefix/route.
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *paths)
Update an entry to have a new set of paths.
u8 * format_fib_table_flags(u8 *s, va_list *args)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t source)
Get the index of the FIB for a Table-ID.
fib_node_index_t fib_table_get_less_specific(u32 fib_index, const fib_prefix_t *prefix)
Get the less specific (covering) prefix.
u32 fib_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.
enum fib_table_flags_t_ fib_table_flags_t
fib_node_index_t fib_table_entry_local_label_add(u32 fib_index, const fib_prefix_t *prefix, mpls_label_t label)
Add a MPLS local label for the prefix/route.
fib_table_attribute_t_
Flags for the source data.
struct fib_table_t_ fib_table_t
A protocol Independent FIB table.
A protocol Independent FIB table.
enum fib_entry_flag_t_ fib_entry_flag_t
flow_hash_config_t fib_table_get_default_flow_hash_config(fib_protocol_t proto)
Get the flow hash configured used by the protocol.
fib_node_index_t ft_index
Index into FIB vector.
u32 ft_table_id
Table ID (hash key) for this FIB.
u32 ft_total_route_counts
Total route counters.
u8 * ft_desc
Table description.
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
u32 * ft_locks
per-source number of locks on the table
void fib_table_entry_delete_index(fib_node_index_t entry_index, fib_source_t source)
Delete a FIB entry.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
u32 fib_node_index_t
A typedef of a node index.
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t stype, const dpo_id_t *dpo)
Update a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the...
u8 * format_fib_table_memory(u8 *s, va_list *args)
format (display) the memory used by the FIB tables
u32 fib_table_entry_get_stats_index(u32 fib_index, const fib_prefix_t *prefix)
Return the stats index for a FIB entry.
void fib_table_mark(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Resync all entries from a table for the source this is the mark part of the mark and sweep algorithm.
fib_table_flags_t ft_flags
Table flags.
void fib_table_sub_tree_walk(u32 fib_index, fib_protocol_t proto, const fib_prefix_t *root, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a sub-tree FIB table.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
u8 * format_fib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
fib_table_walk_rc_t(* fib_table_walk_fn_t)(fib_node_index_t fei, void *ctx)
Call back function when walking entries in a FIB table.
void fib_table_walk_w_src(u32 fib_index, fib_protocol_t proto, fib_source_t src, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
u32 fib_table_get_num_entries(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Return the number of entries in the FIB added by a given source.
@ FIB_TABLE_WALK_SUB_TREE_STOP
Do no traverse down this sub-tree.
void fib_table_assert_empty(const fib_table_t *fib_table)
Debug function.
u32 ft_flow_hash_config
flow hash configuration
enum fib_table_attribute_t_ fib_table_attribute_t
Flags for the source data.
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
@ FIB_TABLE_WALK_STOP
Stop the walk completely.
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
fib_table_walk_rc_t_
return code controlling how a table walk proceeds
A representation of a path as described by a route producer.
void fib_table_set_flow_hash_config(u32 fib_index, fib_protocol_t proto, flow_hash_config_t hash_config)
Set the flow hash configured used by the table.
@ FIB_TABLE_ATTRIBUTE_LAST
Marker.
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t pf)
remove one path to an entry (aka route) in the FIB.
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_label_stack, fib_route_path_flags_t pf)
Update the entry to have just one path.
@ FIB_TABLE_WALK_CONTINUE
Continue on to the next entry.
u32 fib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, fib_source_t source, const u8 *name)
Get the index of the FIB for a Table-ID.
Configuration for each label value in the output-stack.
void fib_table_walk(u32 fib_index, fib_protocol_t proto, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
flow_hash_config_t fib_table_get_flow_hash_config(u32 fib_index, fib_protocol_t proto)
Get the flow hash configured used by the table.
enum fib_route_path_flags_t_ fib_route_path_flags_t
Path flags from the control plane.
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
enum fib_source_t_ fib_source_t
The different sources that can create a route.
void fib_table_sweep(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Signal that the table has converged, i.e.
u32 mpls_label_t
A label value only, i.e.
fib_protocol_t ft_proto
Which protocol this table serves.
u32 fib_table_create_and_lock(fib_protocol_t proto, fib_source_t source, const char *const fmt,...)
Create a new table with no table ID.
@ FIB_TABLE_ATTRIBUTE_RESYNC
the table is currently resync-ing
u32 * ft_src_route_counts
Per-source route counters.
vl_api_interface_index_t sw_if_index
void fib_table_entry_path_remove2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_route_path_t *paths)
Remove n paths to an entry (aka route) in the FIB.
Aggregate type for a prefix.
@ FIB_TABLE_ATTRIBUTE_FIRST
Marker.
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t stype, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
fib_node_index_t fib_table_entry_path_add2(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *rpath)
Add n paths to an entry (aka route) in the FIB.
vl_api_wireguard_peer_flags_t flags