summaryrefslogtreecommitdiffstats
path: root/babeld
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-04-17 01:24:56 +0200
committerGitHub <noreply@github.com>2020-04-17 01:24:56 +0200
commit2ff99507ad97fed3c2a0910605bd72524f497441 (patch)
treebb013e5a0ce2068d41ef6497b66449a4a5921a16 /babeld
parentMerge pull request #6239 from ton31337/fix/uint8_t_to_bool_for_any (diff)
parentlib: #define FRR_CMD_NODE_20200416 (diff)
downloadfrr-2ff99507ad97fed3c2a0910605bd72524f497441.tar.xz
frr-2ff99507ad97fed3c2a0910605bd72524f497441.zip
Merge pull request #6135 from opensourcerouting/cli-node-cleanup
*: clean up the mess that is CLI command nodes
Diffstat (limited to 'babeld')
-rw-r--r--babeld/babel_interface.c14
-rw-r--r--babeld/babeld.c7
2 files changed, 13 insertions, 8 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 7f9a13c27..21fb48163 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -58,11 +58,13 @@ static void babel_interface_free (babel_interface_nfo *bi);
static vector babel_enable_if; /* enable interfaces (by cmd). */
-static struct cmd_node babel_interface_node = /* babeld's interface node. */
-{
- INTERFACE_NODE,
- "%s(config-if)# ",
- 1 /* VTYSH */
+static int interface_config_write(struct vty *vty);
+static struct cmd_node babel_interface_node = {
+ .name = "interface",
+ .node = INTERFACE_NODE,
+ .parent_node = CONFIG_NODE,
+ .prompt = "%s(config-if)# ",
+ .config_write = interface_config_write,
};
@@ -1247,7 +1249,7 @@ babel_if_init(void)
babel_enable_if = vector_init (1);
/* install interface node and commands */
- install_node (&babel_interface_node, interface_config_write);
+ install_node(&babel_interface_node);
if_cmd_init();
install_element(BABEL_NODE, &babel_network_cmd);
diff --git a/babeld/babeld.c b/babeld/babeld.c
index a7a348199..906f48564 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -69,11 +69,14 @@ static time_t expiry_time;
static time_t source_expiry_time;
/* Babel node structure. */
+static int babel_config_write (struct vty *vty);
static struct cmd_node cmd_babel_node =
{
+ .name = "babel",
.node = BABEL_NODE,
+ .parent_node = CONFIG_NODE,
.prompt = "%s(config-router)# ",
- .vtysh = 1,
+ .config_write = babel_config_write,
};
/* print current babel configuration on vty */
@@ -719,7 +722,7 @@ void
babeld_quagga_init(void)
{
- install_node(&cmd_babel_node, &babel_config_write);
+ install_node(&cmd_babel_node);
install_element(CONFIG_NODE, &router_babel_cmd);
install_element(CONFIG_NODE, &no_router_babel_cmd);