16 #ifndef __FIB_NODE_H__ 17 #define __FIB_NODE_H__ 58 #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1) 60 #define FIB_NODE_TYPES { \ 61 [FIB_NODE_TYPE_ENTRY] = "entry", \ 62 [FIB_NODE_TYPE_MFIB_ENTRY] = "mfib-entry", \ 63 [FIB_NODE_TYPE_WALK] = "walk", \ 64 [FIB_NODE_TYPE_PATH_LIST] = "path-list", \ 65 [FIB_NODE_TYPE_PATH] = "path", \ 66 [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry", \ 67 [FIB_NODE_TYPE_MPLS_TUNNEL] = "mpls-tunnel", \ 68 [FIB_NODE_TYPE_ADJ] = "adj", \ 69 [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \ 70 [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj", \ 71 [FIB_NODE_TYPE_VXLAN_TUNNEL] = "vxlan-tunnel", \ 72 [FIB_NODE_TYPE_MAP_E] = "map-e", \ 73 [FIB_NODE_TYPE_VXLAN_GPE_TUNNEL] = "vxlan-gpe-tunnel", \ 74 [FIB_NODE_TYPE_UDP_ENCAP] = "udp-encap", \ 75 [FIB_NODE_TYPE_BIER_FMASK] = "bier-fmask", \ 76 [FIB_NODE_TYPE_BIER_ENTRY] = "bier-entry", \ 77 [FIB_NODE_TYPE_VXLAN_GBP_TUNNEL] = "vxlan-gbp-tunnel", \ 78 [FIB_NODE_TYPE_IPSEC_SA] = "ipsec-sa" \ 127 #define FIB_NODE_BW_REASONS { \ 128 [FIB_NODE_BW_REASON_RESOLVE] = "resolve", \ 129 [FIB_NODE_BW_REASON_EVALUATE] = "evaluate", \ 130 [FIB_NODE_BW_REASON_INTERFACE_UP] = "if-up", \ 131 [FIB_NODE_BW_REASON_INTERFACE_DOWN] = "if-down", \ 132 [FIB_NODE_BW_REASON_INTERFACE_DELETE] = "if-delete", \ 133 [FIB_NODE_BW_REASON_ADJ_UPDATE] = "adj-update", \ 134 [FIB_NODE_BW_REASON_ADJ_DOWN] = "adj-down", \ 137 #define FOR_EACH_FIB_NODE_BW_REASON(_item) \ 138 for (_item = FIB_NODE_BW_REASON_FIRST; \ 139 _item <= FIB_NODE_BW_REASON_LAST; \ 157 "BW Reason enum < 2 byte. Consequences for cover_upd_res_t");
230 #define FIB_NODE_GRAPH_MAX_DEPTH ((u32)32) 367 fib_node_type_t child_type,
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
Walk to update children to inform them the adjacency is now down.
const char * fib_node_type_get_name(fib_node_type_t type)
void fib_node_lock(fib_node_t *node)
Walk to re-collapse the multipath adjs when the rewrite of a unipath adjacency changes.
fib_node_back_walk_reason_t_
Reasons for backwalking the FIB object graph.
Walk to re-resolve the child.
fib_node_index_t fnp_index
node's index
fib_node_bw_reason_flag_t_
Flags enum constructed from the reaons.
fib_node_last_lock_gone_t fnv_last_lock
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_ptr_t fib_node_ptr_list_t
A list of dependent nodes.
A representation of one pointer to another node.
A resolving interface has gone down.
u32 fib_node_get_n_children(fib_node_type_t parent_type, fib_node_index_t parent_index)
struct fib_node_back_walk_ctx_t_ fib_node_back_walk_ctx_t
Context passed between object during a back walk.
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.
fib_node_bw_reason_flag_t fnbw_reason
The reason/trigger for the backwalk.
struct fib_node_t_ *(* fib_node_get_t)(fib_node_index_t index)
Function definition to get a FIB node from its index.
struct fib_node_ptr_t_ fib_node_ptr_t
A representation of one pointer to another node.
fib_node_type_t fnp_type
node type
u8 * format_fib_node_bw_reason(u8 *s, va_list *args)
u32 fnbw_depth
the number of levels the walk has already traversed.
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_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.
fib_node_bw_flags_t fnbw_flags
additional flags for the walk
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_type_t fn_type
The node's type.
An node in the FIB graph.
format_function_t * fnv_format
enum fib_node_bw_reason_flag_t_ fib_node_bw_reason_flag_t
Flags enum constructed from the reaons.
fib_node_back_walk_rc_t fib_node_back_walk_one(fib_node_ptr_t *ptr, fib_node_back_walk_ctx_t *ctx)
enum fib_node_bw_flags_t_ fib_node_bw_flags_t
Flags on the walk.
fib_node_list_t fn_children
Vector of nodes that depend upon/use/share this node.
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.
Force the walk to be synchronous.
fib_node_back_walk_t fnv_back_walk
u32 fib_node_index_t
A typedef of a node index.
A resolving interface has been deleted.
Context passed between object during a back walk.
u8 * fib_node_children_format(fib_node_list_t list, u8 *s)
fib_node_type_t_
The types of nodes in a FIB graph.
void fib_node_init(fib_node_t *node, fib_node_type_t ft)
enum fib_node_back_walk_reason_t_ fib_node_back_walk_reason_t
Reasons for backwalking the FIB object 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)
u16 fn_pad
Some pad space the concrete/derived type is free to use.
void(* fib_node_memory_show_t)(void)
Function definition to display the amount of memory used by a type.
#define FIB_NODE_INDEX_INVALID
u32 fn_locks
Number of dependents on this node.
Walk to re-evaluate the forwarding contributed by the parent.
A resolving interface has come up.
struct fib_node_vft_t_ fib_node_vft_t
A FIB graph nodes virtual function table.
fib_node_bw_flags_t_
Flags on the walk.
See the respective fib_*.h files for descriptions of these objects.
static int fib_node_index_is_valid(fib_node_index_t ni)
STATIC_ASSERT(sizeof(fib_node_bw_reason_flag_t)< 2, "BW Reason enum < 2 byte. Consequences for cover_upd_res_t")
A FIB graph nodes virtual function table.
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
u32 fib_node_list_t
A list of FIB nodes.
fib_node_back_walk_rc_t_
Return code from a back walk function.
void fib_node_unlock(fib_node_t *node)
void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
struct fib_node_t_ fib_node_t
An node in the FIB graph.
void fib_node_deinit(fib_node_t *node)
fib_node_memory_show_t fnv_mem_show