From 11ca35875c8ee7316b47f6eeb422358212834615 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Tue, 3 Aug 2021 22:22:09 +0000 Subject: [PATCH] pimd: change ranges to 1..max, type align with IETF YANG. While defaults are good picks for "reasonable" guesses, min and max range values really aren't. Operators and experimenters often like to configure "unreasonable" values to stress test, tests boundary conditions and explore innovations. With that in mind, change all ranges to 1..max (of type). While we're here add optional ignored values in the "no" CLI forms. Signed-off-by: Christian Hopps --- doc/user/pim.rst | 38 ++++---- lib/command.h | 1 + pimd/pim_cmd.c | 223 ++++++++++++++++++++----------------------- pimd/pim_nb_config.c | 59 ++---------- yang/frr-igmp.yang | 14 +-- yang/frr-pim.yang | 42 ++++---- 6 files changed, 158 insertions(+), 219 deletions(-) diff --git a/doc/user/pim.rst b/doc/user/pim.rst index 6f9aa289b4..899a6b0078 100644 --- a/doc/user/pim.rst +++ b/doc/user/pim.rst @@ -93,7 +93,7 @@ Certain signals have special meanings to *pimd*. down. This command is vrf aware, to configure for a vrf, enter the vrf submode. -.. clicmd:: ip pim join-prune-interval (5-600) +.. clicmd:: ip pim join-prune-interval (1-65535) Modify the join/prune interval that pim uses to the new value. Time is specified in seconds. This command is vrf aware, to configure for a vrf, @@ -101,14 +101,14 @@ Certain signals have special meanings to *pimd*. a value smaller than 60 seconds be aware that this can and will affect convergence at scale. -.. clicmd:: ip pim keep-alive-timer (31-60000) +.. clicmd:: ip pim keep-alive-timer (1-65535) - Modify the time out value for a S,G flow from 31-60000 seconds. 31 seconds - is chosen for a lower bound because some hardware platforms cannot see data + Modify the time out value for a S,G flow from 1-60000 seconds. If choosing + a value below 31 seconds be aware that some hardware platforms cannot see data flowing in better than 30 second chunks. This command is vrf aware, to configure for a vrf, enter the vrf submode. -.. clicmd:: ip pim packets (1-100) +.. clicmd:: ip pim packets (1-255) When processing packets from a neighbor process the number of packets incoming at one time before moving on to the next task. The default value is @@ -116,7 +116,7 @@ Certain signals have special meanings to *pimd*. a large number of pim control packets flowing. This command is vrf aware, to configure for a vrf, enter the vrf submode. -.. clicmd:: ip pim register-suppress-time (5-60000) +.. clicmd:: ip pim register-suppress-time (1-65535) Modify the time that pim will register suppress a FHR will send register notifications to the kernel. This command is vrf aware, to configure for a @@ -162,7 +162,7 @@ Certain signals have special meanings to *pimd*. the existing IGMP general query timer.If no version is provided in the cli, it will be considered as default v2 query.This is a hidden command. -.. clicmd:: ip igmp watermark-warn (10-60000) +.. clicmd:: ip igmp watermark-warn (1-65535) Configure watermark warning generation for an igmp group limit. Generates warning once the configured group limit is reached while adding new groups. @@ -201,7 +201,7 @@ is in a vrf, enter the interface command with the vrf keyword at the end. Set the DR Priority for the interface. This command is useful to allow the user to influence what node becomes the DR for a lan segment. -.. clicmd:: ip pim hello (1-180) (1-630) +.. clicmd:: ip pim hello (1-65535) (1-65535) Set the pim hello and hold interval for a interface. @@ -227,11 +227,11 @@ is in a vrf, enter the interface command with the vrf keyword at the end. Join multicast group or source-group on an interface. -.. clicmd:: ip igmp query-interval (1-1800) +.. clicmd:: ip igmp query-interval (1-65535) Set the IGMP query interval that PIM will use. -.. clicmd:: ip igmp query-max-response-time (10-250) +.. clicmd:: ip igmp query-max-response-time (1-65535) Set the IGMP query response timeout value. If an report is not returned in the specified time we will assume the S,G or \*,G has timed out. @@ -246,12 +246,12 @@ is in a vrf, enter the interface command with the vrf keyword at the end. or IGMP report is received on this interface and the Group is denied by the prefix-list, PIM will ignore the join or report. -.. clicmd:: ip igmp last-member-query-count (1-7) +.. clicmd:: ip igmp last-member-query-count (1-255) Set the IGMP last member query count. The default value is 2. 'no' form of this command is used to to configure back to the default value. -.. clicmd:: ip igmp last-member-query-interval (1-255) +.. clicmd:: ip igmp last-member-query-interval (1-65535) Set the IGMP last member query interval in deciseconds. The default value is 10 deciseconds. 'no' form of this command is used to to configure back to the @@ -319,17 +319,17 @@ MSDP can be setup in different ways: Commands available for MSDP: -.. clicmd:: ip msdp timers (2-600) (3-600) [(1-600)] +.. clicmd:: ip msdp timers (1-65535) (1-65535) [(1-65535)] Configure global MSDP timers. - First value is the keep-alive interval and it must be less than the - second value which is hold-time. This configures the interval in - seconds between keep-alive messages. The default value is 60 seconds. + First value is the keep-alive interval. This configures the interval in + seconds between keep-alive messages. The default value is 60 seconds. It + should be less than the remote hold time. - Second value is the hold-time and it must be greater than the keep-alive - interval. This configures the interval in seconds before closing a non - responding connection. The default value is 75. + Second value is the hold-time. This configures the interval in seconds before + closing a non responding connection. The default value is 75. This value + should be greater than the remote keep alive time. Third value is the connection retry interval and it is optional. This configures the interval between connection attempts. The default value diff --git a/lib/command.h b/lib/command.h index 2b50bc2374..c76fc1e8eb 100644 --- a/lib/command.h +++ b/lib/command.h @@ -389,6 +389,7 @@ struct cmd_node { #define SRTE_STR "SR-TE information\n" #define SRTE_COLOR_STR "SR-TE Color information\n" #define NO_STR "Negate a command or set its defaults\n" +#define IGNORED_IN_NO_STR "Ignored value in no form\n" #define REDIST_STR "Redistribute information from another routing protocol\n" #define CLEAR_STR "Reset functions\n" #define RIP_STR "RIP information\n" diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 812c8c1449..1238e03a5b 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -7179,7 +7179,7 @@ DEFPY (pim_register_accept_list, DEFUN (ip_pim_joinprune_time, ip_pim_joinprune_time_cmd, - "ip pim join-prune-interval (5-600)", + "ip pim join-prune-interval (1-65535)", IP_STR "pim multicast routing\n" "Join Prune Send Interval\n" @@ -7193,27 +7193,22 @@ DEFUN (ip_pim_joinprune_time, DEFUN (no_ip_pim_joinprune_time, no_ip_pim_joinprune_time_cmd, - "no ip pim join-prune-interval (5-600)", + "no ip pim join-prune-interval [(1-65535)]", NO_STR IP_STR "pim multicast routing\n" "Join Prune Send Interval\n" - "Seconds\n") + IGNORED_IN_NO_STR) { - char jp_default_timer[5]; - - snprintf(jp_default_timer, sizeof(jp_default_timer), "%d", - PIM_DEFAULT_T_PERIODIC); - nb_cli_enqueue_change(vty, "/frr-pim:pim/join-prune-interval", - NB_OP_MODIFY, jp_default_timer); + NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, NULL); } DEFUN (ip_pim_register_suppress, ip_pim_register_suppress_cmd, - "ip pim register-suppress-time (5-60000)", + "ip pim register-suppress-time (1-65535)", IP_STR "pim multicast routing\n" "Register Suppress Timer\n" @@ -7227,27 +7222,22 @@ DEFUN (ip_pim_register_suppress, DEFUN (no_ip_pim_register_suppress, no_ip_pim_register_suppress_cmd, - "no ip pim register-suppress-time (5-60000)", + "no ip pim register-suppress-time [(1-65535)]", NO_STR IP_STR "pim multicast routing\n" "Register Suppress Timer\n" - "Seconds\n") + IGNORED_IN_NO_STR) { - char rs_default_timer[5]; - - snprintf(rs_default_timer, sizeof(rs_default_timer), "%d", - PIM_REGISTER_SUPPRESSION_TIME_DEFAULT); - nb_cli_enqueue_change(vty, "/frr-pim:pim/register-suppress-time", - NB_OP_MODIFY, rs_default_timer); + NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, NULL); } DEFUN (ip_pim_rp_keep_alive, ip_pim_rp_keep_alive_cmd, - "ip pim rp keep-alive-timer (31-60000)", + "ip pim rp keep-alive-timer (1-65535)", IP_STR "pim multicast routing\n" "Rendevous Point\n" @@ -7274,20 +7264,26 @@ DEFUN (ip_pim_rp_keep_alive, DEFUN (no_ip_pim_rp_keep_alive, no_ip_pim_rp_keep_alive_cmd, - "no ip pim rp keep-alive-timer (31-60000)", + "no ip pim rp keep-alive-timer [(1-65535)]", NO_STR IP_STR "pim multicast routing\n" "Rendevous Point\n" "Keep alive Timer\n" - "Seconds\n") + IGNORED_IN_NO_STR) { const char *vrfname; - char rp_ka_timer[5]; + char rp_ka_timer[6]; char rp_ka_timer_xpath[XPATH_MAXLEN]; + uint v; - snprintf(rp_ka_timer, sizeof(rp_ka_timer), "%d", - PIM_RP_KEEPALIVE_PERIOD); + /* RFC4601 */ + v = yang_dnode_get_uint16(vty->candidate_config->dnode, + "/frr-pim:pim/register-suppress-time"); + v = 3 * v + PIM_REGISTER_PROBE_TIME_DEFAULT; + if (v > UINT16_MAX) + v = UINT16_MAX; + snprintf(rp_ka_timer, sizeof(rp_ka_timer), "%u", v); vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) @@ -7306,7 +7302,7 @@ DEFUN (no_ip_pim_rp_keep_alive, DEFUN (ip_pim_keep_alive, ip_pim_keep_alive_cmd, - "ip pim keep-alive-timer (31-60000)", + "ip pim keep-alive-timer (1-65535)", IP_STR "pim multicast routing\n" "Keep alive Timer\n" @@ -7331,19 +7327,16 @@ DEFUN (ip_pim_keep_alive, DEFUN (no_ip_pim_keep_alive, no_ip_pim_keep_alive_cmd, - "no ip pim keep-alive-timer (31-60000)", + "no ip pim keep-alive-timer [(1-65535)]", NO_STR IP_STR "pim multicast routing\n" "Keep alive Timer\n" - "Seconds\n") + IGNORED_IN_NO_STR) { const char *vrfname; - char ka_timer[5]; char ka_timer_xpath[XPATH_MAXLEN]; - snprintf(ka_timer, sizeof(ka_timer), "%d", PIM_KEEPALIVE_PERIOD); - vrfname = pim_cli_get_vrf_name(vty); if (vrfname == NULL) return CMD_WARNING_CONFIG_FAILED; @@ -7352,15 +7345,14 @@ DEFUN (no_ip_pim_keep_alive, "frr-pim:pimd", "pim", vrfname); strlcat(ka_timer_xpath, "/keep-alive-timer", sizeof(ka_timer_xpath)); - nb_cli_enqueue_change(vty, ka_timer_xpath, NB_OP_MODIFY, - ka_timer); + nb_cli_enqueue_change(vty, ka_timer_xpath, NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, NULL); } DEFUN (ip_pim_packets, ip_pim_packets_cmd, - "ip pim packets (1-100)", + "ip pim packets (1-255)", IP_STR "pim multicast routing\n" "packets to process at one time per fd\n" @@ -7374,27 +7366,21 @@ DEFUN (ip_pim_packets, DEFUN (no_ip_pim_packets, no_ip_pim_packets_cmd, - "no ip pim packets (1-100)", + "no ip pim packets [(1-255)]", NO_STR IP_STR "pim multicast routing\n" "packets to process at one time per fd\n" - "Number of packets\n") + IGNORED_IN_NO_STR) { - char default_packet[3]; - - snprintf(default_packet, sizeof(default_packet), "%d", - PIM_DEFAULT_PACKET_PROCESS); - - nb_cli_enqueue_change(vty, "/frr-pim:pim/packets", NB_OP_MODIFY, - default_packet); + nb_cli_enqueue_change(vty, "/frr-pim:pim/packets", NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, NULL); } DEFPY (igmp_group_watermark, igmp_group_watermark_cmd, - "ip igmp watermark-warn (10-60000)$limit", + "ip igmp watermark-warn (1-65535)$limit", IP_STR IGMP_STR "Configure group limit for watermark warning\n" @@ -7408,12 +7394,12 @@ DEFPY (igmp_group_watermark, DEFPY (no_igmp_group_watermark, no_igmp_group_watermark_cmd, - "no ip igmp watermark-warn [(10-60000)$limit]", + "no ip igmp watermark-warn [(1-65535)$limit]", NO_STR IP_STR IGMP_STR "Unconfigure group limit for watermark warning\n" - "Group count to generate watermark warning\n") + IGNORED_IN_NO_STR) { PIM_DECLVAR_CONTEXT(vrf, pim); pim->igmp_watermark_limit = 0; @@ -8146,7 +8132,7 @@ DEFUN (interface_no_ip_igmp_join, DEFUN (interface_ip_igmp_query_interval, interface_ip_igmp_query_interval_cmd, - "ip igmp query-interval (1-1800)", + "ip igmp query-interval (1-65535)", IP_STR IFACE_IGMP_STR IFACE_IGMP_QUERY_INTERVAL_STR @@ -8174,19 +8160,14 @@ DEFUN (interface_ip_igmp_query_interval, DEFUN (interface_no_ip_igmp_query_interval, interface_no_ip_igmp_query_interval_cmd, - "no ip igmp query-interval", + "no ip igmp query-interval [(1-65535)]", NO_STR IP_STR IFACE_IGMP_STR - IFACE_IGMP_QUERY_INTERVAL_STR) + IFACE_IGMP_QUERY_INTERVAL_STR + IGNORED_IN_NO_STR) { - char default_query_interval[5]; - - snprintf(default_query_interval, sizeof(default_query_interval), "%d", - IGMP_GENERAL_QUERY_INTERVAL); - - nb_cli_enqueue_change(vty, "./query-interval", NB_OP_MODIFY, - default_query_interval); + nb_cli_enqueue_change(vty, "./query-interval", NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, "./frr-igmp:igmp"); } @@ -8222,7 +8203,7 @@ DEFUN (interface_no_ip_igmp_version, DEFUN (interface_ip_igmp_query_max_response_time, interface_ip_igmp_query_max_response_time_cmd, - "ip igmp query-max-response-time (10-250)", + "ip igmp query-max-response-time (1-65535)", IP_STR IFACE_IGMP_STR IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR @@ -8251,27 +8232,21 @@ DEFUN (interface_ip_igmp_query_max_response_time, DEFUN (interface_no_ip_igmp_query_max_response_time, interface_no_ip_igmp_query_max_response_time_cmd, - "no ip igmp query-max-response-time (10-250)", + "no ip igmp query-max-response-time [(1-65535)]", NO_STR IP_STR IFACE_IGMP_STR IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR - "Time for response in deci-seconds\n") + IGNORED_IN_NO_STR) { - char default_query_max_response_time[4]; - - snprintf(default_query_max_response_time, - sizeof(default_query_max_response_time), - "%d", IGMP_QUERY_MAX_RESPONSE_TIME_DSEC); - - nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_MODIFY, - default_query_max_response_time); + nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_DESTROY, + NULL); return nb_cli_apply_changes(vty, "./frr-igmp:igmp"); } DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec, interface_ip_igmp_query_max_response_time_dsec_cmd, - "ip igmp query-max-response-time-dsec (10-250)", + "ip igmp query-max-response-time-dsec (1-65535)", IP_STR IFACE_IGMP_STR IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR @@ -8299,27 +8274,22 @@ DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec, DEFUN_HIDDEN (interface_no_ip_igmp_query_max_response_time_dsec, interface_no_ip_igmp_query_max_response_time_dsec_cmd, - "no ip igmp query-max-response-time-dsec", + "no ip igmp query-max-response-time-dsec [(1-65535)]", NO_STR IP_STR IFACE_IGMP_STR - IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR) + IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR + IGNORED_IN_NO_STR) { - char default_query_max_response_time[4]; - - snprintf(default_query_max_response_time, - sizeof(default_query_max_response_time), - "%d", IGMP_QUERY_MAX_RESPONSE_TIME_DSEC); - - nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_MODIFY, - default_query_max_response_time); + nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_DESTROY, + NULL); return nb_cli_apply_changes(vty, "./frr-igmp:igmp"); } DEFUN (interface_ip_igmp_last_member_query_count, interface_ip_igmp_last_member_query_count_cmd, - "ip igmp last-member-query-count (1-7)", + "ip igmp last-member-query-count (1-255)", IP_STR IFACE_IGMP_STR IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR @@ -8347,27 +8317,22 @@ DEFUN (interface_ip_igmp_last_member_query_count, DEFUN (interface_no_ip_igmp_last_member_query_count, interface_no_ip_igmp_last_member_query_count_cmd, - "no ip igmp last-member-query-count [(1-7)]", + "no ip igmp last-member-query-count [(1-255)]", NO_STR IP_STR IFACE_IGMP_STR IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR - "Last member query count\n") + IGNORED_IN_NO_STR) { - char default_robustness[2]; - - snprintf(default_robustness, sizeof(default_robustness), "%d", - IGMP_DEFAULT_ROBUSTNESS_VARIABLE); - - nb_cli_enqueue_change(vty, "./robustness-variable", NB_OP_MODIFY, - default_robustness); + nb_cli_enqueue_change(vty, "./robustness-variable", NB_OP_DESTROY, + NULL); return nb_cli_apply_changes(vty, "./frr-igmp:igmp"); } DEFUN (interface_ip_igmp_last_member_query_interval, interface_ip_igmp_last_member_query_interval_cmd, - "ip igmp last-member-query-interval (1-255)", + "ip igmp last-member-query-interval (1-65535)", IP_STR IFACE_IGMP_STR IFACE_IGMP_LAST_MEMBER_QUERY_INTERVAL_STR @@ -8395,21 +8360,15 @@ DEFUN (interface_ip_igmp_last_member_query_interval, DEFUN (interface_no_ip_igmp_last_member_query_interval, interface_no_ip_igmp_last_member_query_interval_cmd, - "no ip igmp last-member-query-interval [(1-255)]", + "no ip igmp last-member-query-interval [(1-65535)]", NO_STR IP_STR IFACE_IGMP_STR IFACE_IGMP_LAST_MEMBER_QUERY_INTERVAL_STR - "Last member query interval in deciseconds\n") + IGNORED_IN_NO_STR) { - char default_last_member_query_count[4]; - - snprintf(default_last_member_query_count, - sizeof(default_last_member_query_count), - "%d", IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC); - - nb_cli_enqueue_change(vty, "./last-member-query-interval", NB_OP_MODIFY, - default_last_member_query_count); + nb_cli_enqueue_change(vty, "./last-member-query-interval", + NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, "./frr-igmp:igmp"); } @@ -8439,13 +8398,7 @@ DEFUN (interface_no_ip_pim_drprio, "Revert the Designated Router Priority to default\n" "Old Value of the Priority\n") { - char default_priority[10]; - - snprintf(default_priority, sizeof(default_priority), "%d", - PIM_DEFAULT_DR_PRIORITY); - - nb_cli_enqueue_change(vty, "./dr-priority", NB_OP_MODIFY, - default_priority); + nb_cli_enqueue_change(vty, "./dr-priority", NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, "./frr-pim:pim"); } @@ -8780,7 +8733,7 @@ DEFUN (interface_no_ip_mroute, DEFUN (interface_ip_pim_hello, interface_ip_pim_hello_cmd, - "ip pim hello (1-180) [(1-630)]", + "ip pim hello (1-65535) [(1-65535)]", IP_STR PIM_STR IFACE_PIM_HELLO_STR @@ -8815,21 +8768,15 @@ DEFUN (interface_ip_pim_hello, DEFUN (interface_no_ip_pim_hello, interface_no_ip_pim_hello_cmd, - "no ip pim hello [(1-180) [(1-630)]]", + "no ip pim hello [(1-65535) [(1-65535)]]", NO_STR IP_STR PIM_STR IFACE_PIM_HELLO_STR - IFACE_PIM_HELLO_TIME_STR - IFACE_PIM_HELLO_HOLD_STR) + IGNORED_IN_NO_STR + IGNORED_IN_NO_STR) { - char hello_default_timer[3]; - - snprintf(hello_default_timer, sizeof(hello_default_timer), "%d", - PIM_DEFAULT_HELLO_PERIOD); - - nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_MODIFY, - hello_default_timer); + nb_cli_enqueue_change(vty, "./hello-interval", NB_OP_DESTROY, NULL); nb_cli_enqueue_change(vty, "./hello-holdtime", NB_OP_DESTROY, NULL); return nb_cli_apply_changes(vty, "./frr-pim:pim"); @@ -9636,10 +9583,10 @@ DEFUN (no_ip_pim_ucast_bsm, } #if HAVE_BFDD > 0 -DEFUN_HIDDEN( +DEFUN_HIDDEN ( ip_pim_bfd_param, ip_pim_bfd_param_cmd, - "ip pim bfd (2-255) (50-60000) (50-60000)", + "ip pim bfd (2-255) (1-65535) (1-65535)", IP_STR PIM_STR "Enables BFD support\n" @@ -9650,7 +9597,7 @@ DEFUN_HIDDEN( DEFUN( ip_pim_bfd_param, ip_pim_bfd_param_cmd, - "ip pim bfd (2-255) (50-60000) (50-60000)", + "ip pim bfd (2-255) (1-65535) (1-65535)", IP_STR PIM_STR "Enables BFD support\n" @@ -9689,7 +9636,10 @@ DEFUN_HIDDEN( #if HAVE_BFDD == 0 ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd, - "no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR + "no ip pim bfd (2-255) (1-65535) (1-65535)", + NO_STR + IP_STR + PIM_STR "Enables BFD support\n" "Detect Multiplier\n" "Required min receive interval\n" @@ -9728,7 +9678,7 @@ DEFPY(ip_msdp_peer, ip_msdp_peer_cmd, } DEFPY(ip_msdp_timers, ip_msdp_timers_cmd, - "ip msdp timers (2-600)$keepalive (3-600)$holdtime [(1-600)$connretry]", + "ip msdp timers (1-65535)$keepalive (1-65535)$holdtime [(1-65535)$connretry]", IP_STR CFG_MSDP_STR "MSDP timers configuration\n" @@ -9759,6 +9709,35 @@ DEFPY(ip_msdp_timers, ip_msdp_timers_cmd, return CMD_SUCCESS; } +DEFPY(no_ip_msdp_timers, no_ip_msdp_timers_cmd, + "no ip msdp timers [(1-65535) (1-65535) [(1-65535)]]", + NO_STR + IP_STR + CFG_MSDP_STR + "MSDP timers configuration\n" + IGNORED_IN_NO_STR + IGNORED_IN_NO_STR + IGNORED_IN_NO_STR) +{ + const char *vrfname; + char xpath[XPATH_MAXLEN]; + + vrfname = pim_cli_get_vrf_name(vty); + if (vrfname == NULL) + return CMD_WARNING_CONFIG_FAILED; + + snprintf(xpath, sizeof(xpath), FRR_PIM_MSDP_XPATH, "frr-pim:pimd", + "pim", vrfname, "frr-routing:ipv4"); + + nb_cli_enqueue_change(vty, "./hold-time", NB_OP_DESTROY, NULL); + nb_cli_enqueue_change(vty, "./keep-alive", NB_OP_DESTROY, NULL); + nb_cli_enqueue_change(vty, "./connection-retry", NB_OP_DESTROY, NULL); + + nb_cli_apply_changes(vty, xpath); + + return CMD_SUCCESS; +} + DEFUN (no_ip_msdp_peer, no_ip_msdp_peer_cmd, "no ip msdp peer A.B.C.D", @@ -11383,6 +11362,8 @@ void pim_cmd_init(void) install_element(CONFIG_NODE, &ip_msdp_timers_cmd); install_element(VRF_NODE, &ip_msdp_timers_cmd); + install_element(CONFIG_NODE, &no_ip_msdp_timers_cmd); + install_element(VRF_NODE, &no_ip_msdp_timers_cmd); install_element(CONFIG_NODE, &ip_msdp_mesh_group_member_cmd); install_element(VRF_NODE, &ip_msdp_mesh_group_member_cmd); install_element(CONFIG_NODE, &no_ip_msdp_mesh_group_member_cmd); diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index bd5e215027..5940c94570 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -956,21 +956,13 @@ int pim_msdp_hold_time_modify(struct nb_cb_modify_args *args) switch (args->event) { case NB_EV_VALIDATE: - if (yang_dnode_get_uint32(args->dnode, NULL) - <= yang_dnode_get_uint32(args->dnode, "../keep-alive")) { - snprintf( - args->errmsg, args->errmsg_len, - "Hold time must be greater than keep alive interval"); - return NB_ERR_VALIDATION; - } - break; case NB_EV_PREPARE: case NB_EV_ABORT: break; case NB_EV_APPLY: vrf = nb_running_get_entry(args->dnode, NULL, true); pim = vrf->info; - pim->msdp.hold_time = yang_dnode_get_uint32(args->dnode, NULL); + pim->msdp.hold_time = yang_dnode_get_uint16(args->dnode, NULL); break; } @@ -988,21 +980,13 @@ int pim_msdp_keep_alive_modify(struct nb_cb_modify_args *args) switch (args->event) { case NB_EV_VALIDATE: - if (yang_dnode_get_uint32(args->dnode, NULL) - >= yang_dnode_get_uint32(args->dnode, "../hold-time")) { - snprintf( - args->errmsg, args->errmsg_len, - "Keep alive must be less than hold time interval"); - return NB_ERR_VALIDATION; - } - break; case NB_EV_PREPARE: case NB_EV_ABORT: break; case NB_EV_APPLY: vrf = nb_running_get_entry(args->dnode, NULL, true); pim = vrf->info; - pim->msdp.keep_alive = yang_dnode_get_uint32(args->dnode, NULL); + pim->msdp.keep_alive = yang_dnode_get_uint16(args->dnode, NULL); break; } @@ -1027,7 +1011,7 @@ int pim_msdp_connection_retry_modify(struct nb_cb_modify_args *args) vrf = nb_running_get_entry(args->dnode, NULL, true); pim = vrf->info; pim->msdp.connection_retry = - yang_dnode_get_uint32(args->dnode, NULL); + yang_dnode_get_uint16(args->dnode, NULL); break; } @@ -2636,9 +2620,7 @@ int lib_interface_igmp_version_destroy(struct nb_cb_destroy_args *args) int lib_interface_igmp_query_interval_modify(struct nb_cb_modify_args *args) { struct interface *ifp; - struct pim_interface *pim_ifp; int query_interval; - int query_interval_dsec; switch (args->event) { case NB_EV_VALIDATE: @@ -2647,18 +2629,8 @@ int lib_interface_igmp_query_interval_modify(struct nb_cb_modify_args *args) break; case NB_EV_APPLY: ifp = nb_running_get_entry(args->dnode, NULL, true); - pim_ifp = ifp->info; query_interval = yang_dnode_get_uint16(args->dnode, NULL); - query_interval_dsec = 10 * query_interval; - if (query_interval_dsec <= - pim_ifp->igmp_query_max_response_time_dsec) { - snprintf(args->errmsg, args->errmsg_len, - "Can't set general query interval %d dsec <= query max response time %d dsec.", - query_interval_dsec, - pim_ifp->igmp_query_max_response_time_dsec); - return NB_ERR_INCONSISTENCY; - } - change_query_interval(pim_ifp, query_interval); + change_query_interval(ifp->info, query_interval); } return NB_OK; @@ -2671,9 +2643,7 @@ int lib_interface_igmp_query_max_response_time_modify( struct nb_cb_modify_args *args) { struct interface *ifp; - struct pim_interface *pim_ifp; int query_max_response_time_dsec; - int default_query_interval_dsec; switch (args->event) { case NB_EV_VALIDATE: @@ -2682,22 +2652,9 @@ int lib_interface_igmp_query_max_response_time_modify( break; case NB_EV_APPLY: ifp = nb_running_get_entry(args->dnode, NULL, true); - pim_ifp = ifp->info; query_max_response_time_dsec = - yang_dnode_get_uint8(args->dnode, NULL); - default_query_interval_dsec = - 10 * pim_ifp->igmp_default_query_interval; - - if (query_max_response_time_dsec - >= default_query_interval_dsec) { - snprintf(args->errmsg, args->errmsg_len, - "Can't set query max response time %d sec >= general query interval %d sec", - query_max_response_time_dsec, - pim_ifp->igmp_default_query_interval); - return NB_ERR_INCONSISTENCY; - } - - change_query_max_response_time(pim_ifp, + yang_dnode_get_uint16(args->dnode, NULL); + change_query_max_response_time(ifp->info, query_max_response_time_dsec); } @@ -2722,8 +2679,8 @@ int lib_interface_igmp_last_member_query_interval_modify( case NB_EV_APPLY: ifp = nb_running_get_entry(args->dnode, NULL, true); pim_ifp = ifp->info; - last_member_query_interval = yang_dnode_get_uint8(args->dnode, - NULL); + last_member_query_interval = + yang_dnode_get_uint16(args->dnode, NULL); pim_ifp->igmp_specific_query_max_response_time_dsec = last_member_query_interval; diff --git a/yang/frr-igmp.yang b/yang/frr-igmp.yang index e2971dc5cf..8d151e430d 100644 --- a/yang/frr-igmp.yang +++ b/yang/frr-igmp.yang @@ -84,9 +84,10 @@ module frr-igmp { leaf query-interval { type uint16 { - range "1..1800"; + range "1..max"; } units seconds; + must ". * 10 >= ../query-max-response-time"; default "125"; description "The Query Interval is the interval between General Queries @@ -94,10 +95,11 @@ module frr-igmp { } leaf query-max-response-time { - type uint8 { - range "10..250"; + type uint16 { + range "1..max"; } units deciseconds; + must ". <= ../query-interval * 10"; default "100"; description "Query maximum response time specifies the maximum time @@ -105,8 +107,8 @@ module frr-igmp { } leaf last-member-query-interval { - type uint8 { - range "1..255"; + type uint16 { + range "1..max"; } units deciseconds; default "10"; @@ -117,7 +119,7 @@ module frr-igmp { leaf robustness-variable { type uint8 { - range "1..7"; + range "1..max"; } default "2"; description diff --git a/yang/frr-pim.yang b/yang/frr-pim.yang index e846ffa1f8..109ce22309 100644 --- a/yang/frr-pim.yang +++ b/yang/frr-pim.yang @@ -97,7 +97,7 @@ module frr-pim { leaf keep-alive-timer { type uint16 { - range "31..60000"; + range "1..max"; } default "210"; description @@ -106,7 +106,7 @@ module frr-pim { leaf rp-keep-alive-timer { type uint16 { - range "31..60000"; + range "1..max"; } default "210"; description @@ -116,36 +116,34 @@ module frr-pim { grouping msdp-timers { leaf hold-time { - type uint32 { - range 3..600; + type uint16 { + range "1..max"; } units seconds; default 75; description "Hold period is started at the MSDP peer connection establishment and is reset every new message. When the period expires the - connection is closed. - - This value needs to be greater than `keep-alive-period`."; + connection is closed. This value should be greater than the + remote keep-alive time."; } leaf keep-alive { - type uint32 { - range 2..600; + type uint16 { + range "1..max"; } units seconds; default 60; description "To maintain a connection established it is necessary to send keep alive messages in a certain frequency and this allows its - configuration. - - This value needs to be lesser than `hold-time-period`."; + configuration. This value should be less than the remote + hold time."; } leaf connection-retry { - type uint32 { - range 1..600; + type uint16 { + range "1..max"; } units seconds; default 30; @@ -343,7 +341,7 @@ module frr-pim { leaf hello-interval { type uint8 { - range "1..180"; + range "1..max"; } default "30"; description @@ -352,7 +350,7 @@ module frr-pim { leaf hello-holdtime { type uint16 { - range "1..630"; + range "1..max"; } must ". > ./../hello-interval" { error-message "HoldTime must be greater than Hello"; @@ -367,7 +365,7 @@ module frr-pim { leaf min-rx-interval { type uint16 { - range "50..60000"; + range "1..max"; } default "300"; description @@ -376,7 +374,7 @@ module frr-pim { leaf min-tx-interval { type uint16 { - range "50..60000"; + range "1..max"; } default "300"; description @@ -422,7 +420,7 @@ module frr-pim { leaf dr-priority { type uint32 { - range "1..4294967295"; + range "1..max"; } default 1; description @@ -521,7 +519,7 @@ module frr-pim { "PIM router parameters."; leaf packets { type uint8 { - range "1..100"; + range "1..max"; } default "3"; description @@ -529,7 +527,7 @@ module frr-pim { } leaf join-prune-interval { type uint16 { - range "5..600"; + range "1..max"; } default "60"; description @@ -537,7 +535,7 @@ module frr-pim { } leaf register-suppress-time { type uint16 { - range "5..60000"; + range "1..max"; } default "60"; description -- 2.39.5