diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-08-21 19:35:27 -0400 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-09-03 16:29:09 +0100 |
commit | 22e0224d4148e0e4fd5952020fd6ae74efd1bf93 (patch) | |
tree | 152c51f12832812c84ffdb1b8cce9208abfe3f46 /pimd/pim_cmd.c | |
parent | d2c6da209cec42c05941eff52d88f0ed7eabad48 (diff) | |
download | quagga-22e0224d4148e0e4fd5952020fd6ae74efd1bf93.tar.bz2 quagga-22e0224d4148e0e4fd5952020fd6ae74efd1bf93.tar.xz |
pimd: Create ability to modify hell and hold timers per interface
Create new per interface command:
'ip pim hello <1-180> {<1-180>}'
The first number is the Hello Timer for this interface
The second number is the Hold Timer to pass to neighbors on this interface.
The second number is optional.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 33644540..55545c15 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3169,7 +3169,7 @@ DEFUN (interface_no_ip_pim_drprio, pim_ifp = ifp->info; if (!pim_ifp) { - vty_out(vty, "Pim no enabled on this interface%s", VTY_NEWLINE); + vty_out(vty, "Pim not enabled on this interface%s", VTY_NEWLINE); return CMD_WARNING; } @@ -3445,6 +3445,70 @@ DEFUN (interface_no_ip_mroute_source, return CMD_SUCCESS; } +DEFUN (interface_ip_pim_hello, + interface_ip_pim_hello_cmd, + "ip pim hello <1-180>", + IP_STR + PIM_STR + IFACE_PIM_HELLO_STR + IFACE_PIM_HELLO_TIME_STR) +{ + struct interface *ifp; + struct pim_interface *pim_ifp; + + ifp = vty->index; + pim_ifp = ifp->info; + + if (!pim_ifp) { + vty_out(vty, "Pim not enabled on this interface%s", VTY_NEWLINE); + return CMD_WARNING; + } + + pim_ifp->pim_hello_period = strtol(argv[0], NULL, 10); + + if (argc == 2) + pim_ifp->pim_default_holdtime = strtol(argv[1], NULL, 10); + + return CMD_SUCCESS; +} + +ALIAS (interface_ip_pim_hello, + interface_ip_pim_hello_hold_cmd, + "ip pim hello <1-180> <1-180>", + IP_STR + PIM_STR + IFACE_PIM_HELLO_STR + IFACE_PIM_HELLO_TIME_STR + IFACE_PIM_HELLO_HOLD_STR) + + +DEFUN (interface_no_ip_pim_hello, + interface_no_ip_pim_hello_cmd, + "no ip pim hello {<1-180> <1-180>}", + NO_STR + IP_STR + PIM_STR + IFACE_PIM_HELLO_STR + IFACE_PIM_HELLO_TIME_STR + IFACE_PIM_HELLO_HOLD_STR) +{ + struct interface *ifp; + struct pim_interface *pim_ifp; + + ifp = vty->index; + pim_ifp = ifp->info; + + if (!pim_ifp) { + vty_out(vty, "Pim not enabled on this interface%s", VTY_NEWLINE); + return CMD_WARNING; + } + + pim_ifp->pim_hello_period = PIM_DEFAULT_HELLO_PERIOD; + pim_ifp->pim_default_holdtime = -1; + + return CMD_SUCCESS; +} + DEFUN (debug_igmp, debug_igmp_cmd, "debug igmp", @@ -4746,6 +4810,9 @@ void pim_cmd_init() install_element (INTERFACE_NODE, &interface_no_ip_pim_ssm_cmd); install_element (INTERFACE_NODE, &interface_ip_pim_drprio_cmd); install_element (INTERFACE_NODE, &interface_no_ip_pim_drprio_cmd); + install_element (INTERFACE_NODE, &interface_ip_pim_hello_cmd); + install_element (INTERFACE_NODE, &interface_ip_pim_hello_hold_cmd); + install_element (INTERFACE_NODE, &interface_no_ip_pim_hello_cmd); // Static mroutes NEB install_element (INTERFACE_NODE, &interface_ip_mroute_cmd); |