pim6d: Adding ipv6 mld last-member-query-count CLI

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>
This commit is contained in:
Sai Gomathi N 2022-01-18 07:24:11 -08:00
parent c8b3d45de2
commit c889adcb26
5 changed files with 68 additions and 27 deletions

View 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);

View 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,

View 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);
}

View 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
*/

View 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;
}