*/
typedef void (*fib_node_last_lock_gone_t)(struct fib_node_t_ *node);
+/**
+ * Function definition to display the amount of memory used by a type.
+ * Implementations should call fib_show_memory_usage()
+ */
+typedef void (*fib_node_memory_show_t)(void);
+
/**
* A FIB graph nodes virtual function table
*/
fib_node_last_lock_gone_t fnv_last_lock;
fib_node_back_walk_t fnv_back_walk;
format_function_t *fnv_format;
+ fib_node_memory_show_t fnv_mem_show;
} fib_node_vft_t;
/**
*/
extern fib_node_type_t fib_node_register_new_type (const fib_node_vft_t *vft);
+/**
+ * @brief Show the memory usage for a type
+ *
+ * This should be invoked by the type in response to the infra calling
+ * its registered memory show function
+ *
+ * @param name the name of the type
+ * @param in_use_elts The number of elements in use
+ * @param allocd_elts The number of allocated pool elemenets
+ * @param size_elt The size of one element
+ */
+extern void fib_show_memory_usage(const char *name,
+ u32 in_use_elts,
+ u32 allocd_elts,
+ size_t size_elt);
+
extern void fib_node_init(fib_node_t *node,
fib_node_type_t ft);
extern void fib_node_deinit(fib_node_t *node);