FD.io VPP  v16.09
Vector Packet Processing
parse.c File Reference
+ Include dependency graph for parse.c:

Go to the source code of this file.

Macros

#define PARSE_DEBUG   0
 
#define foreach_token_type
 

Functions

u8format_vlib_parse_value (u8 *s, va_list *args)
 
static u8format_vlib_parse_match (u8 *s, va_list *args)
 
static u8format_vlib_parse_item (u8 *s, va_list *args)
 
static u8format_vlib_parse_graph (u8 *s, va_list *args)
 
void dump_parse_graph (void)
 
static void parse_cleanup_value (vlib_parse_main_t *pm, vlib_parse_value_t *pv)
 
static void parse_reset (vlib_parse_main_t *pm, u8 *input)
 
static void parse_help (vlib_parse_main_t *pm, u32 index)
 
static vlib_parse_match_t parse_eval_internal (vlib_parse_main_t *pm, u32 index)
 
vlib_parse_match_t rule_match (vlib_parse_main_t *pm, vlib_parse_type_t *type, vlib_lex_token_t *t, vlib_parse_value_t *valuep)
 
static int parse_eval (vlib_parse_main_t *pm, u8 *input)
 
vlib_parse_match_t vlib_parse_eval (u8 *input)
 
u16 parse_type_find_or_create (vlib_parse_main_t *pm, vlib_parse_type_t *t)
 
u16 parse_type_find_by_name (vlib_parse_main_t *pm, char *name)
 
u32 parse_item_find_or_create (vlib_parse_main_t *pm, vlib_parse_item_t *item)
 
static void parse_type_and_graph_init (vlib_parse_main_t *pm)
 
static void tokenize (vlib_parse_main_t *pm, parse_registration_t *pr)
 
static int is_typed_rule (vlib_parse_main_t *pm)
 
static int token_matches_graph_node (vlib_parse_main_t *pm, vlib_lex_token_t *t, vlib_parse_graph_t *node, vlib_parse_item_t *item, vlib_parse_type_t *type, u32 *token_increment)
 
u32 generate_subgraph_from_tokens (vlib_parse_main_t *pm, vlib_lex_token_t *t, u32 *new_subgraph_depth, parse_registration_t *pr, int not_a_rule)
 
static u32 measure_depth (vlib_parse_main_t *pm, u32 index)
 
static void add_subgraph_to_graph (vlib_parse_main_t *pm, u32 last_matching_index, u32 graph_root_index, u32 new_subgraph_index, u32 new_subgraph_depth)
 
static clib_error_tparse_register_one (vlib_parse_main_t *pm, parse_registration_t *pr)
 
static clib_error_tparse_register (vlib_main_t *vm, parse_registration_t *lo, parse_registration_t *hi, vlib_parse_main_t *pm)
 
static clib_error_tparse_register_one_type (vlib_parse_main_t *pm, vlib_parse_type_t *rp)
 
static clib_error_tparse_type_register (vlib_main_t *vm, vlib_parse_type_t *lo, vlib_parse_type_t *hi, vlib_parse_main_t *pm)
 
clib_error_tvlib_stdlex_init (vlib_main_t *vm)
 
static int compute_rule_length (parse_registration_t *r)
 
static int rule_length_compare (parse_registration_t *r1, parse_registration_t *r2)
 
static clib_error_tparse_init (vlib_main_t *vm)
 

Variables

u16 word_type_index
 
u16 number_type_index
 
u16 eof_type_index
 
u16 rule_eof_type_index
 
u16 plus_type_index
 
u16 minus_type_index
 
u16 star_type_index
 
u16 slash_type_index
 
u16 lpar_type_index
 
u16 rpar_type_index
 

Macro Definition Documentation

#define foreach_token_type
Value:
_ (eof) \
_ (rule_eof) \
_ (word) \
_ (number) \
_ (plus) \
_ (minus) \
_ (star) \
_ (slash) \
_ (lpar) \
_ (rpar)
i64 word
Definition: types.h:111
#define PARSE_DEBUG   0

Definition at line 17 of file parse.c.

Function Documentation

static void add_subgraph_to_graph ( vlib_parse_main_t pm,
u32  last_matching_index,
u32  graph_root_index,
u32  new_subgraph_index,
u32  new_subgraph_depth 
)
static

Definition at line 698 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int compute_rule_length ( parse_registration_t r)
static

Definition at line 888 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void dump_parse_graph ( void  )

Definition at line 119 of file parse.c.

static u8* format_vlib_parse_graph ( u8 s,
va_list *  args 
)
static

Definition at line 81 of file parse.c.

+ Here is the call graph for this function:

static u8* format_vlib_parse_item ( u8 s,
va_list *  args 
)
static

Definition at line 67 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_vlib_parse_match ( u8 s,
va_list *  args 
)
static

Definition at line 46 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_vlib_parse_value ( u8 s,
va_list *  args 
)

Definition at line 24 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 generate_subgraph_from_tokens ( vlib_parse_main_t pm,
vlib_lex_token_t t,
u32 new_subgraph_depth,
parse_registration_t pr,
int  not_a_rule 
)

Definition at line 590 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int is_typed_rule ( vlib_parse_main_t pm)
static

Definition at line 522 of file parse.c.

+ Here is the caller graph for this function:

static u32 measure_depth ( vlib_parse_main_t pm,
u32  index 
)
static

Definition at line 669 of file parse.c.

+ Here is the caller graph for this function:

static void parse_cleanup_value ( vlib_parse_main_t pm,
vlib_parse_value_t *  pv 
)
inlinestatic

Definition at line 132 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int parse_eval ( vlib_parse_main_t pm,
u8 input 
)
static

Definition at line 387 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_parse_match_t parse_eval_internal ( vlib_parse_main_t pm,
u32  index 
)
static

Definition at line 203 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void parse_help ( vlib_parse_main_t pm,
u32  index 
)
static

Definition at line 157 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* parse_init ( vlib_main_t vm)
static

Definition at line 934 of file parse.c.

+ Here is the call graph for this function:

u32 parse_item_find_or_create ( vlib_parse_main_t pm,
vlib_parse_item_t item 
)

Definition at line 446 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* parse_register ( vlib_main_t vm,
parse_registration_t lo,
parse_registration_t hi,
vlib_parse_main_t pm 
)
static

Definition at line 841 of file parse.c.

+ Here is the caller graph for this function:

static clib_error_t* parse_register_one ( vlib_parse_main_t pm,
parse_registration_t pr 
)
static

Definition at line 760 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* parse_register_one_type ( vlib_parse_main_t pm,
vlib_parse_type_t rp 
)
static

Definition at line 854 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void parse_reset ( vlib_parse_main_t pm,
u8 input 
)
static

Definition at line 140 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void parse_type_and_graph_init ( vlib_parse_main_t pm)
static

Definition at line 464 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u16 parse_type_find_by_name ( vlib_parse_main_t pm,
char *  name 
)

Definition at line 434 of file parse.c.

+ Here is the caller graph for this function:

u16 parse_type_find_or_create ( vlib_parse_main_t pm,
vlib_parse_type_t t 
)

Definition at line 413 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* parse_type_register ( vlib_main_t vm,
vlib_parse_type_t lo,
vlib_parse_type_t hi,
vlib_parse_main_t pm 
)
static

Definition at line 861 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int rule_length_compare ( parse_registration_t r1,
parse_registration_t r2 
)
static

Definition at line 924 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_parse_match_t rule_match ( vlib_parse_main_t pm,
vlib_parse_type_t type,
vlib_lex_token_t t,
vlib_parse_value_t *  valuep 
)

Definition at line 356 of file parse.c.

+ Here is the call graph for this function:

static int token_matches_graph_node ( vlib_parse_main_t pm,
vlib_lex_token_t t,
vlib_parse_graph_t node,
vlib_parse_item_t item,
vlib_parse_type_t type,
u32 token_increment 
)
static

Definition at line 536 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tokenize ( vlib_parse_main_t pm,
parse_registration_t pr 
)
static

Definition at line 504 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_parse_match_t vlib_parse_eval ( u8 input)

Definition at line 407 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t * vlib_stdlex_init ( vlib_main_t vm)

Definition at line 881 of file parse.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

u16 eof_type_index

Definition at line 19 of file parse.c.

u16 lpar_type_index

Definition at line 19 of file parse.c.

u16 minus_type_index

Definition at line 19 of file parse.c.

u16 number_type_index

Definition at line 19 of file parse.c.

u16 plus_type_index

Definition at line 19 of file parse.c.

u16 rpar_type_index

Definition at line 19 of file parse.c.

u16 rule_eof_type_index

Definition at line 19 of file parse.c.

u16 slash_type_index

Definition at line 19 of file parse.c.

u16 star_type_index

Definition at line 19 of file parse.c.

u16 word_type_index

Definition at line 19 of file parse.c.