Donald,

It seems to me it should be possible to change the hello interval without
touching holdtimer directly.

The reason is the holdtimer setting seems trickier:
1) its sensible default is 3.5 x the hello interval
2) it must be larger than the J/P_Override_Interval(I).

These make me to believe there should be an option to change "hello
interval" -- that would automatically reconfig the holdtimer.

And maybe another option to force an specific holdtimer (I don't know if
this is actually useful, but I don't oppose it.)

Everton


On Thu, Jul 2, 2015 at 11:08 PM, Donald Sharp <[email protected]>
wrote:

> Create new per interface command:
> 'ip pim hello <1-180> <1-180>'
>
> The first number is Hello Timer for this interface
> The second number is the Hold Timer to pass to neighbors on this interface
>
> Signed-off-by: Donald Sharp <[email protected]>
> ---
>  pimd/pim_cmd.c | 57
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  pimd/pim_cmd.h |  3 +++
>  pimd/pim_vty.c |  8 ++++++++
>  3 files changed, 67 insertions(+), 1 deletion(-)
>
> diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
> index 0f90d1d..f1d2e22 100644
> --- a/pimd/pim_cmd.c
> +++ b/pimd/pim_cmd.c
> @@ -3048,7 +3048,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;
>    }
>
> @@ -3130,6 +3130,59 @@ DEFUN (interface_no_ip_pim_ssm,
>    return CMD_SUCCESS;
>  }
>
> +DEFUN (interface_ip_pim_hello,
> +       interface_ip_pim_hello_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)
> +{
> +  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);
> +  pim_ifp->pim_default_holdtime = strtol(argv[1], NULL, 10);
> +
> +  return CMD_SUCCESS;
> +}
> +
> +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",
> @@ -4404,6 +4457,8 @@ 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_no_ip_pim_hello_cmd);
>
>    install_element (VIEW_NODE, &show_ip_igmp_interface_cmd);
>    install_element (VIEW_NODE, &show_ip_igmp_join_cmd);
> diff --git a/pimd/pim_cmd.h b/pimd/pim_cmd.h
> index c503740..3dcbce8 100644
> --- a/pimd/pim_cmd.h
> +++ b/pimd/pim_cmd.h
> @@ -30,6 +30,9 @@
>  #define CONF_SSMPINGD_STR                      "Enable ssmpingd
> operation\n"
>  #define SHOW_SSMPINGD_STR                      "ssmpingd operation\n"
>  #define IFACE_PIM_STR                          "Enable PIM SSM
> operation\n"
> +#define IFACE_PIM_HELLO_STR                    "Hello Interval\n"
> +#define IFACE_PIM_HELLO_TIME_STR               "Time in seconds for Hello
> Interval\n"
> +#define IFACE_PIM_HELLO_HOLD_STR               "Time in seconds for Hold
> Interval\n"
>  #define IFACE_IGMP_STR                         "Enable IGMP operation\n"
>  #define IFACE_IGMP_QUERY_INTERVAL_STR          "IGMP host query
> interval\n"
>  #define IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR      "IGMP max query
> response value (seconds)\n"
> diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
> index e31e2d6..512c0e6 100644
> --- a/pimd/pim_vty.c
> +++ b/pimd/pim_vty.c
> @@ -142,6 +142,14 @@ int pim_interface_config_write(struct vty *vty)
>         ++writes;
>        }
>
> +      /* IF ip pim hello */
> +      if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) {
> +       vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period);
> +       if (pim_ifp->pim_default_holdtime != -1)
> +         vty_out(vty, " %d", pim_ifp->pim_default_holdtime);
> +       vty_out(vty, "%s", VTY_NEWLINE);
> +      }
> +
>        /* IF ip igmp */
>        if (PIM_IF_TEST_IGMP(pim_ifp->options)) {
>         vty_out(vty, " ip igmp%s", VTY_NEWLINE);
> --
> 1.9.1
>
>
> _______________________________________________
> Quagga-dev mailing list
> [email protected]
> https://lists.quagga.net/mailman/listinfo/quagga-dev
>
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to