diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-07-25 17:28:19 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-07-26 18:19:49 -0400 |
| commit | a83a533139f64434b68ebc3ae9a65a013b04cc34 (patch) | |
| tree | ea46224490e80c037fba4542786e9e649c9970a4 /lib/command.h | |
| parent | 0d510865ec4cc0d9cd54945647a274e18fa1898a (diff) | |
lib: add CLI node names
Adds an array of descriptive names for each CLI node, plus a runtime
check to make sure folks don't forget to update it.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.h')
| -rw-r--r-- | lib/command.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/command.h b/lib/command.h index 5d52fe3fc3..28aa1ac5dd 100644 --- a/lib/command.h +++ b/lib/command.h @@ -68,7 +68,7 @@ struct host { char *motdfile; }; -/* There are some command levels which called from command node. */ +/* List of CLI nodes. Please remember to update the names array below. */ enum node_type { AUTH_NODE, /* Authentication mode of vty interface. */ VIEW_NODE, /* View node. Default mode of vty interface. */ @@ -135,8 +135,11 @@ enum node_type { VTY_NODE, /* Vty node. */ LINK_PARAMS_NODE, /* Link-parameters node */ BGP_EVPN_VNI_NODE, /* BGP EVPN VNI */ + NODE_TYPE_MAX, /* maximum */ }; +extern const char *node_names[]; + /* Node which has some commands and prompt string and configuration function pointer . */ struct cmd_node { |
