summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.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 /pimd/pim_cmd.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 'pimd/pim_cmd.c')
-rw-r--r--pimd/pim_cmd.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index afc42a9561..8d7579aafc 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1527,47 +1527,6 @@ static void clear_interfaces()
clear_pim_interfaces();
}
-DEFUN (pim_interface,
- pim_interface_cmd,
- "interface IFNAME",
- "Select an interface to configure\n"
- "Interface's name\n")
-{
- int idx_ifname = 1;
- struct interface *ifp;
- const char *ifname = argv[idx_ifname]->arg;
- size_t sl;
-
- sl = strlen(ifname);
- if (sl > INTERFACE_NAMSIZ) {
- vty_out(vty, "%% Interface name %s is invalid: length exceeds "
- "%d characters%s",
- ifname, INTERFACE_NAMSIZ, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- ifp = if_lookup_by_name_len(ifname, sl);
- if (!ifp) {
- vty_out(vty, "%% Interface %s does not exist%s", ifname, VTY_NEWLINE);
-
- /* Returning here would prevent pimd from booting when there are
- interface commands in pimd.conf, since all interfaces are
- unknown at pimd boot time (the zebra daemon has not been
- contacted for interface discovery). */
-
- ifp = if_get_by_name_len(ifname, sl);
- if (!ifp) {
- vty_out(vty, "%% Could not create interface %s%s", ifname, VTY_NEWLINE);
- return CMD_WARNING;
- }
- }
-
- vty->index = ifp;
- vty->node = INTERFACE_NODE;
-
- return CMD_SUCCESS;
-}
-
DEFUN (clear_ip_interfaces,
clear_ip_interfaces_cmd,
"clear ip interfaces",
@@ -4832,6 +4791,7 @@ void pim_cmd_init()
{
install_node (&pim_global_node, pim_global_config_write); /* PIM_NODE */
install_node (&interface_node, pim_interface_config_write); /* INTERFACE_NODE */
+ if_cmd_init ();
install_element (CONFIG_NODE, &ip_multicast_routing_cmd);
install_element (CONFIG_NODE, &no_ip_multicast_routing_cmd);
@@ -4839,14 +4799,7 @@ void pim_cmd_init()
install_element (CONFIG_NODE, &no_ip_pim_rp_cmd);
install_element (CONFIG_NODE, &ip_ssmpingd_cmd);
install_element (CONFIG_NODE, &no_ip_ssmpingd_cmd);
-#if 0
- install_element (CONFIG_NODE, &interface_cmd); /* from if.h */
-#else
- install_element (CONFIG_NODE, &pim_interface_cmd);
-#endif
- install_element (CONFIG_NODE, &no_interface_cmd); /* from if.h */
-
- install_default (INTERFACE_NODE);
+
install_element (INTERFACE_NODE, &interface_ip_igmp_cmd);
install_element (INTERFACE_NODE, &interface_no_ip_igmp_cmd);
install_element (INTERFACE_NODE, &interface_ip_igmp_join_cmd);