summaryrefslogtreecommitdiff
path: root/babeld
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-07-29 21:34:56 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-07-29 21:35:25 +0300
commit9da01b0b7b6bc9a5cc129f850ff4f459ec33eb49 (patch)
tree05933a71eadb8313ace4088f2cce576f43fc1a1a /babeld
parent7543016dbc01093d5fbc7e94bbc9bc24344b3efc (diff)
*: cleanup interface node installation
The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'babeld')
-rw-r--r--babeld/babel_interface.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 43ed97cf17..c1e5ffde3c 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -59,15 +59,6 @@ static void babel_interface_free (babel_interface_nfo *bi);
static vector babel_enable_if; /* enable interfaces (by cmd). */
-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,
-};
-
int
babel_interface_up (ZAPI_CALLBACK_ARGS)
@@ -1257,8 +1248,7 @@ babel_if_init(void)
babel_enable_if = vector_init (1);
/* install interface node and commands */
- install_node(&babel_interface_node);
- if_cmd_init();
+ if_cmd_init(interface_config_write);
install_element(BABEL_NODE, &babel_network_cmd);
install_element(BABEL_NODE, &no_babel_network_cmd);