32 VLIB_LEX_eof ? VLIB_PARSE_MATCH_DONE : VLIB_PARSE_MATCH_FAIL;
44 return fp ? fp (pm, type, t, valuep) : VLIB_PARSE_MATCH_RULE;
56 if (t->
token != VLIB_LEX_word)
57 return VLIB_PARSE_MATCH_FAIL;
62 for (i = 0; tv[
i]; i++)
65 return VLIB_PARSE_MATCH_FAIL;
68 return iv[
i] == 0 ? VLIB_PARSE_MATCH_FULL : VLIB_PARSE_MATCH_PARTIAL;
78 if (t->
token == VLIB_LEX_number)
81 return VLIB_PARSE_MATCH_VALUE;
83 return VLIB_PARSE_MATCH_FAIL;
89 vlib_parse_value_t *v = va_arg (*args, vlib_parse_value_t *);
90 uword a = v->value.as_uword;
93 s =
format (s,
"%lld(0x%llx)", a, a);
95 s =
format (s,
"%ld(0x%lx)", a, a);
103 #define foreach_vanilla_lex_match_function \ 111 #define LEX_MATCH_DEBUG 0 114 vlib_parse_match_t name##_match (vlib_parse_main_t *pm, \ 115 vlib_parse_type_t *type, \ 116 vlib_lex_token_t *t, \ 117 vlib_parse_value_t *valuep) \ 119 if (LEX_MATCH_DEBUG > 0) \ 120 clib_warning ("against %U returns %s", \ 121 format_vlib_lex_token, pm->lex_main, t, \ 122 (t->token == VLIB_LEX_##name) \ 123 ? "VLIB_PARSE_MATCH_FULL" : \ 124 "VLIB_PARSE_MATCH_FAIL"); \ 125 if (t->token == VLIB_LEX_##name) \ 126 return VLIB_PARSE_MATCH_FULL; \ 127 return VLIB_PARSE_MATCH_FAIL; \ 130 PARSE_TYPE_INIT (name, name##_match, 0 , \
sll srl srl sll sra u16x4 i
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
vlib_parse_match_t eof_match(vlib_parse_main_t *pm, vlib_parse_type_t *type, vlib_lex_token_t *t, vlib_parse_value_t *valuep)
PARSE_TYPE_INIT(eof, eof_match, 0, 0)
#define VLIB_INIT_FUNCTION(x)
vlib_parse_item_t * parse_items
static void * parse_last_match_value(vlib_parse_main_t *pm)
#define foreach_vanilla_lex_match_function
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static foreach_vanilla_lex_match_function clib_error_t * parse_builtin_init(vlib_main_t *vm)
vlib_parse_match_t( vlib_parse_match_function_t)(struct vlib_parse_main *, struct vlib_parse_type *, vlib_lex_token_t *, vlib_parse_value_t *)
union vlib_parse_item_t::@30 value
union vlib_lex_token_t::@26 value
vlib_parse_match_t word_match(vlib_parse_main_t *pm, vlib_parse_type_t *type, vlib_lex_token_t *t, vlib_parse_value_t *valuep)
#define vec_elt(v, i)
Get vector value at index i.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static u8 * format_value_number(u8 *s, va_list *args)
vlib_parse_match_t number_match(vlib_parse_main_t *pm, vlib_parse_type_t *type, vlib_lex_token_t *t, vlib_parse_value_t *valuep)
vlib_parse_match_t rule_eof_match(vlib_parse_main_t *pm, vlib_parse_type_t *type, vlib_lex_token_t *t, vlib_parse_value_t *valuep)