]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pim6d: Adding ipv6 mld last-member-query-count CLI
authorSai Gomathi N <nsaigomathi@vmware.com>
Tue, 18 Jan 2022 15:24:11 +0000 (07:24 -0800)
committerSai Gomathi N <nsaigomathi@vmware.com>
Tue, 5 Apr 2022 07:00:10 +0000 (00:00 -0700)
Adding the Interface level config command

ipv6 mld last-member-query-count (1-255)
This command can be use to tune the number of Multicast-Address- Specific Queries
sent before the router assumes there are no remaining listeners for an address on a link.

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 132ac59354af3617e64b3003a0eb0822d109971c..68d9239e5da0cd08a08c5baa12d25ad881cd0e68 100644 (file)
@@ -648,6 +648,29 @@ DEFPY (interface_no_ipv6_mld_query_max_response_time,
        return gm_process_no_query_max_response_time_cmd(vty);
 }
 
+DEFPY (interface_ipv6_mld_last_member_query_count,
+       interface_ipv6_mld_last_member_query_count_cmd,
+       "ipv6 mld last-member-query-count (1-255)$lmqc",
+       IPV6_STR
+       IFACE_MLD_STR
+       IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR
+       "Last member query count\n")
+{
+       return gm_process_last_member_query_count_cmd(vty, lmqc_str);
+}
+
+DEFPY (interface_no_ipv6_mld_last_member_query_count,
+       interface_no_ipv6_mld_last_member_query_count_cmd,
+       "no ipv6 mld last-member-query-count [(1-255)]",
+       NO_STR
+       IPV6_STR
+       IFACE_MLD_STR
+       IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR
+       IGNORED_IN_NO_STR)
+{
+       return gm_process_no_last_member_query_count_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]",
@@ -1528,6 +1551,10 @@ void pim_cmd_init(void)
                        &interface_ipv6_mld_query_max_response_time_cmd);
        install_element(INTERFACE_NODE,
                        &interface_no_ipv6_mld_query_max_response_time_cmd);
+       install_element(INTERFACE_NODE,
+                       &interface_ipv6_mld_last_member_query_count_cmd);
+       install_element(INTERFACE_NODE,
+                       &interface_no_ipv6_mld_last_member_query_count_cmd);
 
        install_element(VIEW_NODE, &show_ipv6_pim_rp_cmd);
        install_element(VIEW_NODE, &show_ipv6_pim_rp_vrf_all_cmd);
index dfa4780d02c9f847cc78976a427e394d57123a5d..b8929557416518829775a205fed3b52b6d23a09e 100644 (file)
@@ -5733,34 +5733,15 @@ DEFUN_HIDDEN (interface_no_ip_igmp_query_max_response_time_dsec,
                                    "frr-routing:ipv4");
 }
 
-DEFUN (interface_ip_igmp_last_member_query_count,
+DEFPY (interface_ip_igmp_last_member_query_count,
        interface_ip_igmp_last_member_query_count_cmd,
-       "ip igmp last-member-query-count (1-255)",
+       "ip igmp last-member-query-count (1-255)$lmqc",
        IP_STR
        IFACE_IGMP_STR
        IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR
        "Last member query count\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, "./robustness-variable", NB_OP_MODIFY,
-                             argv[3]->arg);
-
-       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
-                                   "frr-routing:ipv4");
+       return gm_process_last_member_query_count_cmd(vty, lmqc_str);
 }
 
 DEFUN (interface_no_ip_igmp_last_member_query_count,
@@ -5772,11 +5753,7 @@ DEFUN (interface_no_ip_igmp_last_member_query_count,
        IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR
        IGNORED_IN_NO_STR)
 {
-       nb_cli_enqueue_change(vty, "./robustness-variable", NB_OP_DESTROY,
-                             NULL);
-
-       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
-                                   "frr-routing:ipv4");
+       return gm_process_no_last_member_query_count_cmd(vty);
 }
 
 DEFUN (interface_ip_igmp_last_member_query_interval,
index 087448ab165c25bf13ad8b2060c5813e3c472462..86e750a9430d170a8d6381a8154401dd4f30c8ff 100644 (file)
@@ -2780,3 +2780,33 @@ int gm_process_no_query_max_response_time_cmd(struct vty *vty)
        return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
                                    FRR_PIM_AF_XPATH_VAL);
 }
+
+int gm_process_last_member_query_count_cmd(struct vty *vty,
+                                          const char *lmqc_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, "./robustness-variable", NB_OP_MODIFY,
+                             lmqc_str);
+       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
+                                   FRR_PIM_AF_XPATH_VAL);
+}
+
+int gm_process_no_last_member_query_count_cmd(struct vty *vty)
+{
+       nb_cli_enqueue_change(vty, "./robustness-variable", NB_OP_DESTROY,
+                             NULL);
+       return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
+                                   FRR_PIM_AF_XPATH_VAL);
+}
index 9f562d43b48defbbba04b001a829d641b68a1fbe..5bd8869ce440b5bab234bb20d632f8f503b7cbb0 100644 (file)
@@ -96,6 +96,9 @@ 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);
 int gm_process_no_query_max_response_time_cmd(struct vty *vty);
+int gm_process_last_member_query_count_cmd(struct vty *vty,
+                                          const char *lmqc_str);
+int gm_process_no_last_member_query_count_cmd(struct vty *vty);
 /*
  * Special Macro to allow us to get the correct pim_instance
  */
index 97d307d14c6b31abbe6ebc33878959276b66270b..5ea8ebc6d5e0cee24133fb3c44b605f16741937f 100644 (file)
@@ -2794,6 +2794,7 @@ int lib_interface_gmp_address_family_last_member_query_interval_modify(
 int lib_interface_gmp_address_family_robustness_variable_modify(
        struct nb_cb_modify_args *args)
 {
+#if PIM_IPV == 4
        struct interface *ifp;
        struct pim_interface *pim_ifp;
        int last_member_query_count;
@@ -2812,6 +2813,9 @@ int lib_interface_gmp_address_family_robustness_variable_modify(
 
                break;
        }
+#else
+       /* TBD Depends on MLD data structure changes */
+#endif
 
        return NB_OK;
 }