diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-25 07:49:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-25 07:49:21 -0500 |
| commit | d2ce19c9b5e2a707dd5620dc6bb3cb8562a06261 (patch) | |
| tree | e2633fa53dfdaa08c4d4eb59bcec754225de280f /lib/command.h | |
| parent | 9ffaae7a4f175db9f2ad907d2f423c24277bbf70 (diff) | |
| parent | 8fd8881c2951f166ca55095e0c01a9820a714e08 (diff) | |
Merge pull request #105 from opensourcerouting/cli_merge_step_prep
Prepare for split-off cli parser "merge" step
Diffstat (limited to 'lib/command.h')
| -rw-r--r-- | lib/command.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/command.h b/lib/command.h index 1e490cc4cd..ff1b1a0e83 100644 --- a/lib/command.h +++ b/lib/command.h @@ -177,11 +177,12 @@ enum cmd_token_type IPV6_PREFIX_TKN, // IPV6 network prefixes /* plumbing types */ - SELECTOR_TKN, // marks beginning of selector - OPTION_TKN, // marks beginning of option - NUL_TKN, // dummy token + FORK_TKN, // marks subgraph beginning + JOIN_TKN, // marks subgraph end START_TKN, // first token in line END_TKN, // last token in line + + SPECIAL_TKN = FORK_TKN, }; /* Command attributes */ @@ -203,6 +204,8 @@ struct cmd_token char *desc; // token description long long min, max; // for ranges char *arg; // user input that matches this token + + struct graph_node *forkjoin; // paired FORK/JOIN for JOIN/FORK }; /* Structure of command element. */ @@ -420,12 +423,16 @@ extern void cmd_terminate (void); extern void cmd_exit (struct vty *vty); extern int cmd_list_cmds (struct vty *vty, int do_permute); +/* NOT safe for general use; call this only if DEV_BUILD! */ +extern void grammar_sandbox_init (void); + /* memory management for cmd_token */ extern struct cmd_token *new_cmd_token (enum cmd_token_type, u_char attr, const char *text, const char *desc); extern void del_cmd_token (struct cmd_token *); extern struct cmd_token *copy_cmd_token (struct cmd_token *); +extern vector completions_to_vec (struct list *completions); extern void command_parse_format (struct graph *graph, struct cmd_element *cmd); /* Export typical functions. */ |
