]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pim6d: Adding "ipv6 mld query-max-response-time" CLI
authorSai Gomathi N <nsaigomathi@vmware.com>
Tue, 18 Jan 2022 15:16:51 +0000 (07:16 -0800)
committerSai Gomathi N <nsaigomathi@vmware.com>
Tue, 5 Apr 2022 07:00:01 +0000 (00:00 -0700)
Adding the Interface level config command

ipv6 mld query-max-response-time <1-65535>
This command can be use to tune the max response time for general queries.
The number of seconds represented by the [Query Response Interval] must be less than the [Query Interval]

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
pimd/pim6_cmd.c
pimd/pim_cmd.c
pimd/pim_cmd_common.c
pimd/pim_cmd_common.h
pimd/pim_nb_config.c

index 6e12b7fd39370a3125dbf04f9e32bde26384cc64..132ac59354af3617e64b3003a0eb0822d109971c 100644 (file)
@@ -625,6 +625,29 @@ DEFPY (interface_no_ipv6_mld_query_interval,
                                    "frr-routing:ipv6");
 }
 
+DEFPY (interface_ipv6_mld_query_max_response_time,
+       interface_ipv6_mld_query_max_response_time_cmd,
+       "ipv6 mld query-max-response-time (1-65535)$qmrt",
+       IPV6_STR
+       IFACE_MLD_STR
+       IFACE_MLD_QUERY_MAX_RESPONSE_TIME_STR
+       "Query response value in deci-seconds\n")
+{
+       return gm_process_query_max_response_time_cmd(vty, qmrt_str);
+}
+
+DEFPY (interface_no_ipv6_mld_query_max_response_time,
+       interface_no_ipv6_mld_query_max_response_time_cmd,
+       "no ipv6 mld query-max-response-time [(1-65535)]",
+       NO_STR
+       IPV6_STR
+       IFACE_MLD_STR
+       IFACE_MLD_QUERY_MAX_RESPONSE_TIME_STR
+       IGNORED_IN_NO_STR)
+{
+       return gm_process_no_query_max_response_time_cmd(vty);
+}
+
 DEFPY (show_ipv6_pim_rp,
        show_ipv6_pim_rp_cmd,
        "show ipv6 pim [vrf NAME] rp-info [X:X::X:X/M$group] [json$json]",
@@ -1501,6 +1524,11 @@ void pim_cmd_init(void)
        install_element(INTERFACE_NODE, &interface_ipv6_mld_query_interval_cmd);
        install_element(INTERFACE_NODE,
                        &interface_no_ipv6_mld_query_interval_cmd);
+       install_element(INTERFACE_NODE,
+                       &interface_ipv6_mld_query_max_response_time_cmd);
+       install_element(INTERFACE_NODE,
+                       &interface_no_ipv6_mld_query_max_response_time_cmd);
+
        install_element(VIEW_NODE, &show_ipv6_pim_rp_cmd);
        install_element(VIEW_NODE, &show_ipv6_pim_rp_vrf_all_cmd);
        install_element(VIEW_NODE, &show_ipv6_pim_rpf_cmd);
index 3f2e24848132416e3981f7c3803c170a0778599a..dfa4780d02c9f847cc78976a427e394d57123a5d 100644 (file)
@@ -5664,35 +5664,15 @@ DEFUN (interface_no_ip_igmp_version,
                                    "frr-routing:ipv4");
 }
 
-DEFUN (interface_ip_igmp_query_max_response_time,
+DEFPY (interface_ip_igmp_query_max_response_time,
        interface_ip_igmp_query_max_response_time_cmd,
-       "ip igmp query-max-response-time (1-65535)",
+       "ip igmp query-max-response-time (1-65535)$qmrt",
        IP_STR
        IFACE_IGMP_STR
        IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
        "Query response value in deci-seconds\n")
 {
-       const struct lyd_node *pim_enable_dnode;
-
-       pim_enable_dnode =
-               yang_dnode_getf(vty->candidate_config->dnode,
-                               FRR_PIM_ENABLE_XPATH, VTY_CURR_XPATH,
-                               "frr-routing:ipv4");
-
-       if (!pim_enable_dnode) {
-               nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY,
-                                     "true");
-       } else {
-               if (!yang_dnode_get_bool(pim_enable_dnode, "."))
-                       nb_cli_enqueue_change(vty, "./enable",
-                                             NB_OP_MODIFY, "true");
-       }
-
-       nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_MODIFY,
-                             argv[3]->arg);
-
-       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
-                                   "frr-routing:ipv4");
+       return gm_process_query_max_response_time_cmd(vty, qmrt_str);
 }
 
 DEFUN (interface_no_ip_igmp_query_max_response_time,
@@ -5704,10 +5684,7 @@ DEFUN (interface_no_ip_igmp_query_max_response_time,
        IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
        IGNORED_IN_NO_STR)
 {
-       nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_DESTROY,
-                             NULL);
-       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
-                                   "frr-routing:ipv4");
+       return gm_process_no_query_max_response_time_cmd(vty);
 }
 
 DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec,
index 0d575a1456d664bd037d839d8680c81a3d1a51cd..087448ab165c25bf13ad8b2060c5813e3c472462 100644 (file)
@@ -2749,3 +2749,34 @@ void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
                }
        }
 }
+
+int gm_process_query_max_response_time_cmd(struct vty *vty,
+                                          const char *qmrt_str)
+{
+       const struct lyd_node *pim_enable_dnode;
+
+       pim_enable_dnode = yang_dnode_getf(vty->candidate_config->dnode,
+                                          FRR_PIM_ENABLE_XPATH, VTY_CURR_XPATH,
+                                          FRR_PIM_AF_XPATH_VAL);
+
+       if (!pim_enable_dnode) {
+               nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY, "true");
+       } else {
+               if (!yang_dnode_get_bool(pim_enable_dnode, "."))
+                       nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY,
+                                             "true");
+       }
+
+       nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_MODIFY,
+                             qmrt_str);
+       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
+                                   FRR_PIM_AF_XPATH_VAL);
+}
+
+int gm_process_no_query_max_response_time_cmd(struct vty *vty)
+{
+       nb_cli_enqueue_change(vty, "./query-max-response-time", NB_OP_DESTROY,
+                             NULL);
+       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
+                                   FRR_PIM_AF_XPATH_VAL);
+}
index 00a9a5673873bf1fc12729729de1de266f99f195..9f562d43b48defbbba04b001a829d641b68a1fbe 100644 (file)
@@ -93,6 +93,9 @@ void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
                               const char *neighbor, json_object *json);
 void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
                        json_object *json);
+int gm_process_query_max_response_time_cmd(struct vty *vty,
+                                          const char *qmrt_str);
+int gm_process_no_query_max_response_time_cmd(struct vty *vty);
 /*
  * Special Macro to allow us to get the correct pim_instance
  */
index 7fe7c0395f0b9ad7451428a2bd899ce4c5372987..97d307d14c6b31abbe6ebc33878959276b66270b 100644 (file)
@@ -409,7 +409,6 @@ static void igmp_sock_query_interval_reconfig(struct gm_sock *igmp)
         */
        igmp_startup_mode_on(igmp);
 }
-#endif
 
 static void igmp_sock_query_reschedule(struct gm_sock *igmp)
 {
@@ -439,6 +438,7 @@ static void igmp_sock_query_reschedule(struct gm_sock *igmp)
                assert(igmp->t_other_querier_timer);
        }
 }
+#endif /* PIM_IPV == 4 */
 
 #if PIM_IPV == 4
 static void change_query_interval(struct pim_interface *pim_ifp,
@@ -456,6 +456,7 @@ static void change_query_interval(struct pim_interface *pim_ifp,
 }
 #endif
 
+#if PIM_IPV == 4
 static void change_query_max_response_time(struct pim_interface *pim_ifp,
                int query_max_response_time_dsec)
 {
@@ -503,6 +504,7 @@ static void change_query_max_response_time(struct pim_interface *pim_ifp,
                }
        }
 }
+#endif
 
 int routing_control_plane_protocols_name_validate(
        struct nb_cb_create_args *args)
@@ -2733,6 +2735,7 @@ int lib_interface_gmp_address_family_query_interval_modify(
 int lib_interface_gmp_address_family_query_max_response_time_modify(
        struct nb_cb_modify_args *args)
 {
+#if PIM_IPV == 4
        struct interface *ifp;
        int query_max_response_time_dsec;
 
@@ -2748,6 +2751,10 @@ int lib_interface_gmp_address_family_query_max_response_time_modify(
                change_query_max_response_time(ifp->info,
                                query_max_response_time_dsec);
        }
+#else
+       /* TBD Depends on MLD data structure changes */
+#endif
+
 
        return NB_OK;
 }