+/* Comamand token struct. */
+struct cmd_token {
+ enum cmd_token_type type; // token type
+ uint8_t attr; // token attributes
+ bool allowrepeat; // matcher allowed to match token repetively?
+ uint32_t refcnt;
+
+ char *text; // token text
+ char *desc; // token description
+ long long min, max; // for ranges
+ char *arg; // user input that matches this token
+ char *varname;
+
+ struct graph_node *forkjoin; // paired FORK/JOIN for JOIN/FORK
+};
+
+/* Structure of command element. */
+struct cmd_element {
+ const char *string; /* Command specification by string. */
+ const char *doc; /* Documentation of this command. */
+ int daemon; /* Daemon to which this command belong. */
+ uint8_t attr; /* Command attributes */
+
+ /* handler function for command */
+ int (*func)(const struct cmd_element *, struct vty *, int,
+ struct cmd_token *[]);
+
+ const char *name; /* symbol name for debugging */
+};
+
+/* text for <cr> command */
+#define CMD_CR_TEXT "<cr>"
+
+/* memory management for cmd_token */
+extern struct cmd_token *cmd_token_new(enum cmd_token_type, uint8_t attr,
+ const char *text, const char *desc);
+extern struct cmd_token *cmd_token_dup(struct cmd_token *);
+extern void cmd_token_del(struct cmd_token *);
+extern void cmd_token_varname_set(struct cmd_token *token, const char *varname);
+
+extern void cmd_graph_parse(struct graph *graph, struct cmd_element *cmd);
+extern void cmd_graph_names(struct graph *graph);
+extern void cmd_graph_merge(struct graph *old, struct graph *new,
+ int direction);