16 #ifndef __FIB_NODE_H__ 17 #define __FIB_NODE_H__ 48 #define FIB_NODE_TYPE_MAX (FIB_NODE_TYPE_LAST + 1) 50 #define FIB_NODE_TYPES { \ 51 [FIB_NODE_TYPE_ENTRY] = "entry", \ 52 [FIB_NODE_TYPE_WALK] = "walk", \ 53 [FIB_NODE_TYPE_PATH_LIST] = "path-list", \ 54 [FIB_NODE_TYPE_PATH] = "path", \ 55 [FIB_NODE_TYPE_MPLS_ENTRY] = "mpls-entry", \ 56 [FIB_NODE_TYPE_ADJ] = "adj", \ 57 [FIB_NODE_TYPE_LISP_GPE_FWD_ENTRY] = "lisp-gpe-fwd-entry", \ 58 [FIB_NODE_TYPE_LISP_ADJ] = "lisp-adj", \ 59 [FIB_NODE_TYPE_GRE_TUNNEL] = "gre-tunnel", \ 104 #define FIB_NODE_BW_REASONS { \ 105 [FIB_NODE_BW_REASON_RESOLVE] = "resolve" \ 106 [FIB_NODE_BW_REASON_EVALUATE] = "evaluate" \ 107 [FIB_NODE_BW_REASON_INTERFACE_UP] = "if-up" \ 108 [FIB_NODE_BW_REASON_INTERFACE_DOWN] = "if-down" \ 109 [FIB_NODE_BW_REASON_INTERFACE_DELETE] = "if-delete" \ 110 [FIB_NODE_BW_REASON_ADJ_UPDATE] = "adj-update" \ 126 _Static_assert(sizeof(fib_node_bw_reason_flag_t) < 2,
127 "BW Reason enum < 2 byte. Consequences for cover_upd_res_t");
181 #define FIB_NODE_GRAPH_MAX_DEPTH ((u32)32) 317 fib_node_type_t child_type,
const fib_node_vft_t * fn_vft
The node's VFT.
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
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.
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
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.
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)
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.
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)
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.
See the respective fib_*.h files for descriptions of these objects.
static int fib_node_index_is_valid(fib_node_index_t ni)
A FIB graph nodes virtual function table.
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