]>
git.proxmox.com Git - mirror_frr.git/blob - lib/grammar_sandbox.h
1 #ifndef _GRAMMAR_SANDBOX_H
2 #define _GRAMMAR_SANDBOX_H
5 * Houses functionality for testing shim as well as code that should go into
6 * command.h and command.c during integration.
10 #define CMD_CR_TEXT "<cr>"
13 grammar_sandbox_init (void);
18 * The type determines what kind of data the token can match (in the
19 * matching use case) or hold (in the argv use case).
24 NUMBER_TKN
, // integral numbers
25 VARIABLE_TKN
, // almost anything
26 RANGE_TKN
, // integer range
27 IPV4_TKN
, // IPV4 addresses
28 IPV4_PREFIX_TKN
, // IPV4 network prefixes
29 IPV6_TKN
, // IPV6 prefixes
30 IPV6_PREFIX_TKN
, // IPV6 network prefixes
33 SELECTOR_TKN
, // marks beginning of selector
34 OPTION_TKN
, // marks beginning of option
35 NUL_TKN
, // dummy token
36 START_TKN
, // first token in line
37 END_TKN
, // last token in line
45 enum cmd_token_type_t type
; // token type
47 char *text
; // token text
48 char *desc
; // token description
50 long long value
; // for numeric types
51 long long min
, max
; // for ranges
53 char *arg
; // user input that matches this token
57 new_cmd_token (enum cmd_token_type_t
, char *, char *);
60 del_cmd_token (struct cmd_token_t
*);
63 copy_cmd_token (struct cmd_token_t
*);
65 #endif /* _GRAMMAR_SANDBOX_H */