53 return (((
u16)fib_source_regs[src].fsr_prio.fsp_class << 8) |
62 return (fib_source_regs[src].fsr_behaviour);
72 return (
format(s,
"%s", fib_source_regs[src].fsr_name));
109 fsr = &fib_source_regs[
src];
149 s =
format(s,
"[%d] %U prio:%d.%d behaviour:%s",
192 fsrs =
vec_dup(fib_source_regs);
210 .path =
"show fib source",
212 .short_help =
"show fib source [prio]",
219 #define _(s,p,b) fib_source_register(s,p,b);
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
enum fib_source_t_ fib_source_t
The different sources that can create a route.
static fib_source_reg_t * fib_source_regs
u16 fib_source_get_prio(fib_source_t src)
static const char * fib_source_behaviour_names[]
static fib_source_priority_t fib_source_prio_by_class[0x100]
#define foreach_fib_source
The fixed source to priority mappings.
void fib_source_walk(fib_source_walk_t fn, void *ctx)
enum fib_source_behaviour_t_ fib_source_behaviour_t
Each source has a defined behaviour that controls how entries behave that have that source...
u8 fib_source_priority_t
Each source is assigned a priority.
fib_source_priority_cmp_t fib_source_cmp(fib_source_t s1, fib_source_t s2)
void fib_source_register(fib_source_t src, fib_source_priority_t prio, fib_source_behaviour_t bh)
struct fib_source_prio_t_ fib_source_prio_t
description fragment has unexpected format
#define FIB_SOURCE_BEHAVIOURS
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
void fib_source_module_init(void)
#define vec_free(V)
Free vector's memory (no header).
static clib_error_t * fib_source_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
fib_source_priority_t fsp_class
static u8 * format_fib_source_reg(u8 *s, va_list *a)
#define VLIB_CLI_COMMAND(x,...)
fib_source_behaviour_t fib_source_get_behaviour(fib_source_t src)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
fib_source_behaviour_t fsr_behaviour
u8 * format_fib_source(u8 *s, va_list *a)
fib_source_prio_t fsr_prio
static int fib_source_reg_cmp_for_sort(void *v1, void *v2)
struct fib_source_reg_t_ fib_source_reg_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
An invalid source This is not a real source, so don't use it to source a prefix.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static void fib_source_reg_init(fib_source_t src, const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
walk_rc_t(* fib_source_walk_t)(fib_source_t id, const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh, void *ctx)
#define vec_foreach(var, vec)
Vector iterator.
static fib_source_t fib_source_id
static const char * fib_source_names[]
STATIC_ASSERT_SIZEOF(fib_source_priority_t, 1)
for each client requested priority count the number pf uses of that prio so we can asign is usage a s...
enum fib_source_priority_cmp_t_ fib_source_priority_cmp_t
source comparison
fib_source_priority_t fsp_slot