|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __FIB_NODE_H__
17 #define __FIB_NODE_H__
60 #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1)
62 #define FIB_NODE_TYPES { \
63 [FIB_NODE_TYPE_ENTRY] = "entry", \
64 [FIB_NODE_TYPE_MFIB_ENTRY] = "mfib-entry", \
65 [FIB_NODE_TYPE_WALK] = "walk", \
66 [FIB_NODE_TYPE_PATH_LIST] = "path-list", \
67 [FIB_NODE_TYPE_PATH] = "path", \
68 [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry", \
69 [FIB_NODE_TYPE_MPLS_TUNNEL] = "mpls-tunnel", \
70 [FIB_NODE_TYPE_ADJ] = "adj", \
71 [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \
72 [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj", \
73 [FIB_NODE_TYPE_VXLAN_TUNNEL] = "vxlan-tunnel", \
74 [FIB_NODE_TYPE_MAP_E] = "map-e", \
75 [FIB_NODE_TYPE_VXLAN_GPE_TUNNEL] = "vxlan-gpe-tunnel", \
76 [FIB_NODE_TYPE_UDP_ENCAP] = "udp-encap", \
77 [FIB_NODE_TYPE_BIER_FMASK] = "bier-fmask", \
78 [FIB_NODE_TYPE_BIER_ENTRY] = "bier-entry", \
79 [FIB_NODE_TYPE_VXLAN_GBP_TUNNEL] = "vxlan-gbp-tunnel", \
80 [FIB_NODE_TYPE_IPSEC_SA] = "ipsec-sa", \
81 [FIB_NODE_TYPE_IP_PUNT_REDIRECT] = "ip-punt-redirect", \
82 [FIB_NODE_TYPE_ENTRY_TRACK] = "fib-entry-track" \
135 #define FIB_NODE_BW_REASONS { \
136 [FIB_NODE_BW_REASON_RESOLVE] = "resolve", \
137 [FIB_NODE_BW_REASON_EVALUATE] = "evaluate", \
138 [FIB_NODE_BW_REASON_INTERFACE_UP] = "if-up", \
139 [FIB_NODE_BW_REASON_INTERFACE_DOWN] = "if-down", \
140 [FIB_NODE_BW_REASON_INTERFACE_DELETE] = "if-delete", \
141 [FIB_NODE_BW_REASON_ADJ_UPDATE] = "adj-update", \
142 [FIB_NODE_BW_REASON_ADJ_MTU] = "adj-mtu", \
143 [FIB_NODE_BW_REASON_ADJ_DOWN] = "adj-down", \
146 #define FOR_EACH_FIB_NODE_BW_REASON(_item) \
147 for (_item = FIB_NODE_BW_REASON_FIRST; \
148 _item <= FIB_NODE_BW_REASON_LAST; \
167 "BW Reason enum < 2 byte. Consequences for cover_upd_res_t");
240 #define FIB_NODE_GRAPH_MAX_DEPTH ((u32)32)
@ FIB_NODE_TYPE_GENEVE_TUNNEL
@ FIB_NODE_BW_REASON_LAST
Marker.
@ FIB_NODE_BW_REASON_FLAG_ADJ_DOWN
@ FIB_NODE_BW_REASON_RESOLVE
Walk to re-resolve the child.
@ FIB_NODE_BW_REASON_INTERFACE_DOWN
A resolving interface has gone down.
void(* fib_node_memory_show_t)(void)
Function definition to display the amount of memory used by a type.
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_UP
@ FIB_NODE_BW_REASON_EVALUATE
Walk to re-evaluate the forwarding contributed by the parent.
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
@ FIB_NODE_BW_REASON_FLAG_NONE
fib_node_last_lock_gone_t fnv_last_lock
@ FIB_NODE_BW_REASON_FLAG_ADJ_MTU
void fib_node_deinit(fib_node_t *node)
fib_node_type_t fnp_type
node type
u32 fib_node_list_t
A list of FIB nodes.
fib_node_bw_flags_t fnbw_flags
additional flags for the walk
vlib_main_t vlib_node_runtime_t * node
fib_node_list_t fn_children
Vector of nodes that depend upon/use/share this node.
A FIB graph nodes virtual function table.
@ FIB_NODE_BW_REASON_INTERFACE_UP
A resolving interface has come up.
u8 * fib_node_children_format(fib_node_list_t list, u8 *s)
#define FIB_NODE_INDEX_INVALID
struct fib_node_t_ fib_node_t
An node in the FIB graph.
format_function_t * fnv_format
u32 fn_locks
Number of dependents on this node.
enum fib_node_bw_reason_flag_t_ fib_node_bw_reason_flag_t
Flags enum constructed from the reaons.
struct fib_node_back_walk_ctx_t_ fib_node_back_walk_ctx_t
Context passed between object during a back walk.
void fib_node_init(fib_node_t *node, fib_node_type_t ft)
u32 fib_node_get_n_children(fib_node_type_t parent_type, fib_node_index_t parent_index)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
u32 fib_node_child_add(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t child_type, fib_node_index_t child_index)
int(* fib_node_ptr_walk_t)(fib_node_ptr_t *depend, void *ctx)
A callback function for walking a node dependency list.
@ FIB_NODE_TYPE_BIER_FMASK
fib_node_bw_reason_flag_t fnbw_reason
The reason/trigger for the backwalk.
@ FIB_NODE_BW_REASON_FLAG_EVALUATE
@ FIB_NODE_BW_REASON_FIRST
Marker.
@ FIB_NODE_TYPE_MPLS_TUNNEL
@ FIB_NODE_BW_REASON_INTERFACE_DELETE
A resolving interface has been deleted.
fib_node_memory_show_t fnv_mem_show
fib_node_type_t fn_type
The node's type.
struct fib_node_vft_t_ fib_node_vft_t
A FIB graph nodes virtual function table.
void fib_node_unlock(fib_node_t *node)
fib_node_back_walk_rc_t fib_node_back_walk_one(fib_node_ptr_t *ptr, fib_node_back_walk_ctx_t *ctx)
@ FIB_NODE_TYPE_MPLS_ENTRY
@ FIB_NODE_TYPE_PATH_LIST
@ FIB_NODE_BW_REASON_FLAG_RESOLVE
void(* fib_node_last_lock_gone_t)(struct fib_node_t_ *node)
Function definition to inform the FIB node that its last lock has gone.
u32 fib_node_index_t
A typedef of a node index.
struct fib_node_t_ *(* fib_node_get_t)(fib_node_index_t index)
Function definition to get a FIB node from its index.
fib_node_bw_flags_t_
Flags on the walk.
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
@ FIB_NODE_BW_REASON_FLAG_ADJ_UPDATE
@ FIB_NODE_TYPE_FIRST
Marker.
u16 fn_pad
Some pad space the concrete/derived type is free to use.
@ FIB_NODE_BACK_WALK_CONTINUE
A representation of one pointer to another node.
@ FIB_NODE_BW_REASON_ADJ_UPDATE
Walk to re-collapse the multipath adjs when the rewrite of a unipath adjacency changes.
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_DOWN
fib_node_back_walk_rc_t(* fib_node_back_walk_t)(struct fib_node_t_ *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
@ FIB_NODE_TYPE_MFIB_ENTRY
fib_node_ptr_t fib_node_ptr_list_t
A list of dependent nodes.
@ FIB_NODE_TYPE_WALK
See the respective fib_*.h files for descriptions of these objects.
STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t)< 2, "BW Reason enum < 2 byte. Consequences for cover_upd_res_t")
@ FIB_NODE_BACK_WALK_MERGE
void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
void fib_node_register_type(fib_node_type_t ft, const fib_node_vft_t *vft)
Register the function table for a given type.
fib_node_index_t fnp_index
node's index
fib_node_bw_reason_flag_t_
Flags enum constructed from the reaons.
@ FIB_NODE_TYPE_UDP_ENCAP
@ FIB_NODE_TYPE_TEST
Marker.
@ FIB_NODE_TYPE_VXLAN_GPE_TUNNEL
@ FIB_NODE_TYPE_IP_PUNT_REDIRECT
@ FIB_NODE_TYPE_VXLAN_GBP_TUNNEL
@ FIB_NODE_TYPE_VXLAN_TUNNEL
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE
An node in the FIB graph.
fib_node_type_t_
The types of nodes in a FIB graph.
u32 fnbw_depth
the number of levels the walk has already traversed.
enum fib_node_back_walk_reason_t_ fib_node_back_walk_reason_t
Reasons for backwalking the FIB object graph.
static int fib_node_index_is_valid(fib_node_index_t ni)
@ FIB_NODE_BW_REASON_ADJ_MTU
Walk update the adjacency MTU.
fib_node_back_walk_rc_t_
Return code from a back walk function.
@ FIB_NODE_BW_REASON_ADJ_DOWN
Walk to update children to inform them the adjacency is now down.
Context passed between object during a back walk.
fib_node_back_walk_t fnv_back_walk
@ FIB_NODE_BW_FLAG_FORCE_SYNC
Force the walk to be synchronous.
@ FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY
const char * fib_node_type_get_name(fib_node_type_t type)
@ FIB_NODE_TYPE_ENTRY_TRACK
enum fib_node_bw_flags_t_ fib_node_bw_flags_t
Flags on the walk.
fib_node_back_walk_reason_t_
Reasons for backwalking the FIB object graph.
@ FIB_NODE_TYPE_BIER_ENTRY
struct fib_node_ptr_t_ fib_node_ptr_t
A representation of one pointer to another node.
u8 * format_fib_node_bw_reason(u8 *s, va_list *args)
vl_api_fib_path_type_t type
void fib_node_lock(fib_node_t *node)
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.