diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2021-10-18 11:51:09 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2021-10-18 19:48:11 +0200 |
commit | 0e06eb8b2ea1eff8c67752533d66e96bb9bebfdb (patch) | |
tree | e906e47b16d0b157368d8ad7b1af3cf65c2d9c7d /lib/command.h | |
parent | lib: assign CLI varnames while parsing (diff) | |
download | frr-0e06eb8b2ea1eff8c67752533d66e96bb9bebfdb.tar.xz frr-0e06eb8b2ea1eff8c67752533d66e96bb9bebfdb.zip |
vtysh: defer CLI tree building
We don't need the CLI tree until we actually enter the node.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command.h')
-rw-r--r-- | lib/command.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/command.h b/lib/command.h index e2eec1aac..e2086701a 100644 --- a/lib/command.h +++ b/lib/command.h @@ -210,6 +210,9 @@ struct cmd_node { /* Hashed index of command node list, for de-dupping primarily */ struct hash *cmd_hash; + + /* set as soon as any command is in cmdgraph */ + bool graph_built; }; /* Return value of the commands. */ @@ -526,6 +529,12 @@ extern void _install_element(enum node_type, const struct cmd_element *); * deprecated/hidden) are not reversed. */ extern void uninstall_element(enum node_type, const struct cmd_element *); +/* construct CLI tree only when entering nodes */ +extern void cmd_defer_tree(bool val); + +/* finish CLI tree for node when above is true (noop otherwise) */ +extern void cmd_finalize_node(struct cmd_node *node); + /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using XMALLOC(MTYPE_TMP)). Returns NULL if shift >= argc. */ |