summaryrefslogtreecommitdiff
path: root/lib/command.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-04-16 19:24:56 -0400
committerGitHub <noreply@github.com>2020-04-16 19:24:56 -0400
commit2ff99507ad97fed3c2a0910605bd72524f497441 (patch)
treebb013e5a0ce2068d41ef6497b66449a4a5921a16 /lib/command.h
parentedf7eff0778fbde82932b11246d41c62773934ac (diff)
parentd1b221f696b4d3ed3cd7f5b0ae1f19a07f87fd80 (diff)
Merge pull request #6135 from opensourcerouting/cli-node-cleanup
*: clean up the mess that is CLI command nodes
Diffstat (limited to 'lib/command.h')
-rw-r--r--lib/command.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/command.h b/lib/command.h
index 190e0e93af..725a201446 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -146,6 +146,7 @@ enum node_type {
MPLS_NODE, /* MPLS config node */
PW_NODE, /* Pseudowire config node */
VTY_NODE, /* Vty node. */
+ FPM_NODE, /* Dataplane FPM node. */
LINK_PARAMS_NODE, /* Link-parameters node */
BGP_EVPN_VNI_NODE, /* BGP EVPN VNI */
RPKI_NODE, /* RPKI node for configuration of RPKI cache server
@@ -162,22 +163,29 @@ enum node_type {
extern vector cmdvec;
extern const struct message tokennames[];
-extern const char *const node_names[];
+
+/* for external users depending on struct layout */
+#define FRR_CMD_NODE_20200416
/* Node which has some commands and prompt string and configuration
function pointer . */
struct cmd_node {
+ const char *name;
+
/* Node index. */
enum node_type node;
+ enum node_type parent_node;
/* Prompt character at vty interface. */
const char *prompt;
- /* Is this node's configuration goes to vtysh ? */
- int vtysh;
-
/* Node's configuration write function */
- int (*func)(struct vty *);
+ int (*config_write)(struct vty *);
+
+ /* called when leaving the node on a VTY session.
+ * return 1 if normal exit processing should happen, 0 to suppress
+ */
+ int (*node_exit)(struct vty *);
/* Node's command graph */
struct graph *cmdgraph;
@@ -431,7 +439,7 @@ struct cmd_node {
#define NO_GR_NEIGHBOR_HELPER_CMD "Undo Graceful Restart Helper command for a neighbor\n"
/* Prototypes. */
-extern void install_node(struct cmd_node *node, int (*)(struct vty *));
+extern void install_node(struct cmd_node *node);
extern void install_default(enum node_type);
extern void install_element(enum node_type, const struct cmd_element *);