summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-16 15:00:52 +0900
committerDavid Lamparter <equinox@opensourcerouting.org>2016-12-01 17:25:56 +0100
commit0b84f294904959a4be58db6fe0e89d71b2c1f401 (patch)
treef52c765644294f314ede33506f29b6888439b904 /lib/if.c
parent0577b824e137f143c899a567b1bbeb109841c796 (diff)
*: make DEFUN installations file-local
This moves all install_element calls into the file where the DEFUNs are located. This fixes several small related bugs: - ospf6d wasn't installing a "no interface FOO" command - zebra had a useless copy of "interface FOO" - pimd's copy of "interface FOO" was not setting qobj_index, which means "description LINE" commands would fail with an error The next commit will do the actual act of making "foo_cmd" static. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index dadf35574e..c323ae9da2 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -832,6 +832,17 @@ DEFUN_NOSH (no_interface,
return CMD_SUCCESS;
}
+void
+if_cmd_init (void)
+{
+ install_element (CONFIG_NODE, &interface_cmd);
+ install_element (CONFIG_NODE, &no_interface_cmd);
+
+ install_default (INTERFACE_NODE);
+ install_element (INTERFACE_NODE, &interface_desc_cmd);
+ install_element (INTERFACE_NODE, &no_interface_desc_cmd);
+}
+
DEFUN (vrf,
vrf_cmd,
"vrf NAME",
@@ -890,6 +901,13 @@ DEFUN_NOSH (no_vrf,
return CMD_SUCCESS;
}
+void
+vrf_cmd_init (void)
+{
+ install_element (CONFIG_NODE, &vrf_cmd);
+ install_element (CONFIG_NODE, &no_vrf_cmd);
+ install_default (VRF_NODE);
+}
/* For debug purpose. */
DEFUN (show_address,