16 #ifndef __FIB_ENTRY_H__ 17 #define __FIB_ENTRY_H__ 149 } __attribute__ ((packed)) fib_source_t;
152 "FIB too many sources");
157 #define FIB_SOURCE_MAX (FIB_SOURCE_LAST+1) 159 #define FIB_SOURCES { \ 160 [FIB_SOURCE_SPECIAL] = "special", \ 161 [FIB_SOURCE_INTERFACE] = "interface", \ 162 [FIB_SOURCE_PROXY] = "proxy", \ 163 [FIB_SOURCE_BIER] = "BIER", \ 164 [FIB_SOURCE_6RD] = "6RD", \ 165 [FIB_SOURCE_API] = "API", \ 166 [FIB_SOURCE_CLI] = "CLI", \ 167 [FIB_SOURCE_ADJ] = "adjacency", \ 168 [FIB_SOURCE_MAP] = "MAP", \ 169 [FIB_SOURCE_SR] = "SR", \ 170 [FIB_SOURCE_LISP] = "LISP", \ 171 [FIB_SOURCE_CLASSIFY] = "classify", \ 172 [FIB_SOURCE_DHCP] = "DHCP", \ 173 [FIB_SOURCE_IP6_ND_PROXY] = "IPv6-proxy-nd", \ 174 [FIB_SOURCE_IP6_ND] = "IPv6-nd", \ 175 [FIB_SOURCE_RR] = "recursive-resolution", \ 176 [FIB_SOURCE_AE] = "attached_export", \ 177 [FIB_SOURCE_MPLS] = "mpls", \ 178 [FIB_SOURCE_URPF_EXEMPT] = "urpf-exempt", \ 179 [FIB_SOURCE_DEFAULT_ROUTE] = "default-route", \ 180 [FIB_SOURCE_PLUGIN_HI] = "plugin-hi", \ 181 [FIB_SOURCE_PLUGIN_LOW] = "plugin-low", \ 182 [FIB_SOURCE_INTERPOSE] = "interpose", \ 185 #define FOR_EACH_FIB_SOURCE(_item) \ 186 for (_item = FIB_SOURCE_FIRST; _item < FIB_SOURCE_MAX; _item++) 255 #define FIB_ENTRY_ATTRIBUTES { \ 256 [FIB_ENTRY_ATTRIBUTE_CONNECTED] = "connected", \ 257 [FIB_ENTRY_ATTRIBUTE_ATTACHED] = "attached", \ 258 [FIB_ENTRY_ATTRIBUTE_IMPORT] = "import", \ 259 [FIB_ENTRY_ATTRIBUTE_DROP] = "drop", \ 260 [FIB_ENTRY_ATTRIBUTE_EXCLUSIVE] = "exclusive", \ 261 [FIB_ENTRY_ATTRIBUTE_LOCAL] = "local", \ 262 [FIB_ENTRY_ATTRIBUTE_URPF_EXEMPT] = "uRPF-exempt", \ 263 [FIB_ENTRY_ATTRIBUTE_MULTICAST] = "multicast", \ 264 [FIB_ENTRY_ATTRIBUTE_NO_ATTACHED_EXPORT] = "no-attached-export", \ 265 [FIB_ENTRY_ATTRIBUTE_COVERED_INHERIT] = "covered-inherit", \ 266 [FIB_ENTRY_ATTRIBUTE_INTERPOSE] = "interpose", \ 269 #define FOR_EACH_FIB_ATTRIBUTE(_item) \ 270 for (_item = FIB_ENTRY_ATTRIBUTE_FIRST; \ 271 _item <= FIB_ENTRY_ATTRIBUTE_LAST; \ 322 #define FIB_ENTRY_SRC_ATTRIBUTES { \ 323 [FIB_ENTRY_SRC_ATTRIBUTE_ADDED] = "added", \ 324 [FIB_ENTRY_SRC_ATTRIBUTE_CONTRIBUTING] = "contributing", \ 325 [FIB_ENTRY_SRC_ATTRIBUTE_ACTIVE] = "active", \ 326 [FIB_ENTRY_SRC_ATTRIBUTE_INHERITED] = "inherited", \ 329 #define FOR_EACH_FIB_SRC_ATTRIBUTE(_item) \ 330 for (_item = FIB_ENTRY_SRC_ATTRIBUTE_FIRST; \ 331 _item <= FIB_ENTRY_SRC_ATTRIBUTE_LAST; \ 513 #define FOR_EACH_FIB_ENTRY_FLAG(_item) \ 514 for (_item = FIB_ENTRY_FLAG_FIRST; _item < FIB_ENTRY_FLAG_MAX; _item++) 516 #define FIB_ENTRY_FORMAT_BRIEF (0x0) 517 #define FIB_ENTRY_FORMAT_DETAIL (0x1) 518 #define FIB_ENTRY_FORMAT_DETAIL2 (0x2) 552 fib_source_t source);
562 fib_source_t source);
576 fib_source_t source);
602 fib_source_t source);
612 fib_source_t source);
617 fib_source_t source);
620 fib_source_t source);
void fib_entry_special_add(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
the source is active/best
Recursive resolution source.
void fib_entry_contribute_urpf(fib_node_index_t path_index, index_t urpf)
Contribute the set of Adjacencies that this entry forwards with to build the uRPF list of its childre...
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t type, fib_node_index_t child_index)
A representation of a fib path for fib_path_encode to convey the information to the caller...
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
u32 fib_entry_get_resolving_interface_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
A representation of a path as described by a route producer.
The prefix/address exempted from loose uRPF check To be used with caution.
int fib_entry_is_host(fib_node_index_t fib_entry_index)
Return !0 is the entry represents a host prefix.
fib_entry_src_flag_t fib_entry_special_remove(fib_node_index_t fib_entry_index, fib_source_t source)
void fib_entry_cover_updated(fib_node_index_t fib_entry)
fib_source_t fib_entry_get_best_source(fib_node_index_t fib_entry_index)
Information related to the source of a FIB entry.
u32 mpls_label_t
A label value only, i.e.
fib_entry_src_flag_t fib_entry_path_remove(fib_node_index_t fib_entry_index, fib_source_t source, const fib_route_path_t *rpath)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
The prefix/address is local to this device.
fib_source_t_
The different sources that can create a route.
u32 fe_fib_index
The index of the FIB table this entry is in.
mpls_label_t fesm_label
This MPLS local label associated with the prefix.
fib_entry_src_t * fe_srcs
Vector of source infos.
void fib_entry_set_flow_hash_config(fib_node_index_t fib_entry_index, flow_hash_config_t hash_config)
fib_node_index_t fe_parent
the path-list for which this entry is a child.
u32 fib_entry_get_resolving_interface(fib_node_index_t fib_entry_index)
u32 fesi_sibling
This source's index in the cover's list.
u32 fe_sibling
index of this entry in the parent's child list.
enum fib_entry_src_attribute_t_ fib_entry_src_attribute_t
Flags for the source data.
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
A high priority source a plugin can use.
u32 fib_entry_pool_size(void)
int fib_entry_cmp_for_sort(void *i1, void *i2)
This FIB entry imposes its source information on all prefixes that is covers.
The route is attached cross tables and thus imports covered prefixes from the other table...
Aggregrate type for a prefix.
u32 fesa_sibling
This source's index in the cover's list.
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
void fib_entry_contribute_forwarding(fib_node_index_t fib_entry_index, fib_forward_chain_type_t type, dpo_id_t *dpo)
const int fib_entry_get_dpo_for_source(fib_node_index_t fib_entry_index, fib_source_t source, dpo_id_t *dpo)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
IPv6 ND (seen in the link-local tables)
u32 fesr_sibling
This source's index in the cover's list.
struct fib_entry_src_t_ fib_entry_src_t
Information related to the source of a FIB entry.
void fib_entry_unlock(fib_node_index_t fib_entry_index)
void fib_entry_update(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *paths)
fib_entry_update
fib_node_index_t fib_entry_get_index(const fib_entry_t *fib_entry)
int fib_entry_is_resolved(fib_node_index_t fib_entry_index)
Return !0 is the entry is reoslved, i.e.
fib_node_index_t fesl_fib_index
The source FIB index.
A list of path-extensions.
enum fib_entry_attribute_t_ fib_entry_attribute_t
The different sources that can create a route.
void fib_entry_cover_changed(fib_node_index_t fib_entry)
An node in the FIB graph.
struct fib_entry_t_ fib_entry_t
An entry in a FIB table.
The prefix/address exempted from attached export.
adj_index_t fib_entry_get_adj(fib_node_index_t fib_entry_index)
void fib_entry_encode(fib_node_index_t fib_entry_index, fib_route_path_encode_t **api_rpaths)
fib_node_index_t fib_entry_get_path_list(fib_node_index_t fib_entry_index)
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
fib_entry_attribute_t_
The different sources that can create a route.
the source is contributing forwarding
u32 fib_entry_get_stats_index(fib_node_index_t fib_entry_index)
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
fib_node_index_t fib_entry_create_special(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
enum fib_entry_flag_t_ fib_entry_flag_t
int fib_entry_recursive_loop_detect(fib_node_index_t entry_index, fib_node_index_t **entry_indicies)
void fib_entry_inherit(fib_node_index_t cover, fib_node_index_t covered)
fib_entry_inherit
fib_entry_flag_t fes_entry_flags
Flags the source contributes to the entry.
fib_source_t fes_src
Which source this info block is for.
fib_entry_src_flag_t fes_flags
Flags on the source.
const void * fib_entry_get_source_data(fib_node_index_t fib_entry_index, fib_source_t source)
adj_index_t fib_entry_get_adj_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
The default route source.
u8 * format_fib_source(u8 *s, va_list *args)
void fib_entry_special_update(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
fib_node_t fe_node
Base class.
fib_entry_src_flag_t fib_entry_delete(fib_node_index_t fib_entry_index, fib_source_t source)
fib_entry_delete
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
the source is inherited from its cover
fib_node_index_t fesr_cover
the index of the FIB entry that is the covering entry
dpo_id_t fesi_dpo
DPO type to interpose.
From the control plane API.
enum fib_entry_src_flag_t_ fib_entry_src_flag_t
Route added as a result of interface configuration.
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
fib_node_index_t fib_entry_create(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *paths)
dpo_id_t fe_lb
The load-balance used for forwarding.
fib_entry_delegate_t * fe_delegates
A vector of delegates.
fib_node_index_t fes_pl
The path-list created by the source.
fib_entry_t * fib_entry_get(fib_node_index_t fib_entry_index)
fib_entry_flag_t fib_entry_get_flags_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
void fib_entry_module_init(void)
u8 * format_fib_entry_src_flags(u8 *s, va_list *args)
fib_entry_src_attribute_t_
Flags for the source data.
the source has been added to the entry
A route the is being 'proxied' on behalf of another device.
STATIC_ASSERT(sizeof(fib_source_t)==1,"FIB too many sources")
void fib_entry_recalculate_forwarding(fib_node_index_t fib_entry_index)
u8 * format_fib_entry_flags(u8 *s, va_list *args)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
void fib_entry_path_add(fib_node_index_t fib_entry_index, fib_source_t source, fib_entry_flag_t flags, const fib_route_path_t *rpath)
void fib_entry_lock(fib_node_index_t fib_entry_index)
u8 * format_fib_entry(u8 *s, va_list *args)
fib_node_index_t fesa_cover
the index of the FIB entry that is the covering entry
fib_node_index_t fesi_cover
the index of the FIB entry that is the covering entry
u8 fes_ref_count
1 bytes ref count.
fib_path_ext_list_t fes_path_exts
A vector of path extensions.
The route is an explicit drop.
A Delagate is a means to implmenet the Delagation design pattern; the extension of an objects functio...
fib_entry_flag_t fib_entry_get_flags(fib_node_index_t fib_entry_index)
void fib_entry_set_source_data(fib_node_index_t fib_entry_index, fib_source_t source, const void *data)
A low (below routing) priority source a plugin can use.
const fib_prefix_t fe_prefix
The prefix of the route.
u32 fib_entry_get_fib_index(fib_node_index_t fib_entry_index)
The prefix/address is a multicast prefix.