mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 01:40:16 +00:00
pim6d: Adding ipv6 pim spt-switchover CLI
Adding the below CLIs for ipv6: [no] ipv6 pim spt-switchover infinity-and-beyond [no] ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
parent
c73113ea9a
commit
fb991ce9d4
@ -66,10 +66,64 @@ DEFPY (no_ipv6_pim_joinprune_time,
|
|||||||
return pim_process_no_join_prune_cmd(vty);
|
return pim_process_no_join_prune_cmd(vty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY (ipv6_pim_spt_switchover_infinity,
|
||||||
|
ipv6_pim_spt_switchover_infinity_cmd,
|
||||||
|
"ipv6 pim spt-switchover infinity-and-beyond",
|
||||||
|
IPV6_STR
|
||||||
|
PIM_STR
|
||||||
|
"SPT-Switchover\n"
|
||||||
|
"Never switch to SPT Tree\n")
|
||||||
|
{
|
||||||
|
return pim_process_spt_switchover_infinity_cmd(vty);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (ipv6_pim_spt_switchover_infinity_plist,
|
||||||
|
ipv6_pim_spt_switchover_infinity_plist_cmd,
|
||||||
|
"ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD$plist",
|
||||||
|
IPV6_STR
|
||||||
|
PIM_STR
|
||||||
|
"SPT-Switchover\n"
|
||||||
|
"Never switch to SPT Tree\n"
|
||||||
|
"Prefix-List to control which groups to switch\n"
|
||||||
|
"Prefix-List name\n")
|
||||||
|
{
|
||||||
|
return pim_process_spt_switchover_prefixlist_cmd(vty, plist);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (no_ipv6_pim_spt_switchover_infinity,
|
||||||
|
no_ipv6_pim_spt_switchover_infinity_cmd,
|
||||||
|
"no ipv6 pim spt-switchover infinity-and-beyond",
|
||||||
|
NO_STR
|
||||||
|
IPV6_STR
|
||||||
|
PIM_STR
|
||||||
|
"SPT_Switchover\n"
|
||||||
|
"Never switch to SPT Tree\n")
|
||||||
|
{
|
||||||
|
return pim_process_no_spt_switchover_cmd(vty);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFPY (no_ipv6_pim_spt_switchover_infinity_plist,
|
||||||
|
no_ipv6_pim_spt_switchover_infinity_plist_cmd,
|
||||||
|
"no ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD",
|
||||||
|
NO_STR
|
||||||
|
IPV6_STR
|
||||||
|
PIM_STR
|
||||||
|
"SPT_Switchover\n"
|
||||||
|
"Never switch to SPT Tree\n"
|
||||||
|
"Prefix-List to control which groups to switch\n"
|
||||||
|
"Prefix-List name\n")
|
||||||
|
{
|
||||||
|
return pim_process_no_spt_switchover_cmd(vty);
|
||||||
|
}
|
||||||
|
|
||||||
void pim_cmd_init(void)
|
void pim_cmd_init(void)
|
||||||
{
|
{
|
||||||
if_cmd_init(pim_interface_config_write);
|
if_cmd_init(pim_interface_config_write);
|
||||||
|
|
||||||
install_element(CONFIG_NODE, &ipv6_pim_joinprune_time_cmd);
|
install_element(CONFIG_NODE, &ipv6_pim_joinprune_time_cmd);
|
||||||
install_element(CONFIG_NODE, &no_ipv6_pim_joinprune_time_cmd);
|
install_element(CONFIG_NODE, &no_ipv6_pim_joinprune_time_cmd);
|
||||||
|
install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_cmd);
|
||||||
|
install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_plist_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_cmd);
|
||||||
|
install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_plist_cmd);
|
||||||
}
|
}
|
||||||
|
111
pimd/pim_cmd.c
111
pimd/pim_cmd.c
@ -6724,38 +6724,12 @@ DEFUN (ip_pim_spt_switchover_infinity,
|
|||||||
"SPT-Switchover\n"
|
"SPT-Switchover\n"
|
||||||
"Never switch to SPT Tree\n")
|
"Never switch to SPT Tree\n")
|
||||||
{
|
{
|
||||||
const char *vrfname;
|
return pim_process_spt_switchover_infinity_cmd(vty);
|
||||||
char spt_plist_xpath[XPATH_MAXLEN];
|
|
||||||
char spt_action_xpath[XPATH_MAXLEN];
|
|
||||||
|
|
||||||
vrfname = pim_cli_get_vrf_name(vty);
|
|
||||||
if (vrfname == NULL)
|
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
|
||||||
|
|
||||||
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
|
||||||
sizeof(spt_plist_xpath));
|
|
||||||
|
|
||||||
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
|
||||||
sizeof(spt_action_xpath));
|
|
||||||
|
|
||||||
if (yang_dnode_exists(vty->candidate_config->dnode, spt_plist_xpath))
|
|
||||||
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_DESTROY,
|
|
||||||
NULL);
|
|
||||||
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
|
||||||
"PIM_SPT_INFINITY");
|
|
||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (ip_pim_spt_switchover_infinity_plist,
|
DEFPY (ip_pim_spt_switchover_infinity_plist,
|
||||||
ip_pim_spt_switchover_infinity_plist_cmd,
|
ip_pim_spt_switchover_infinity_plist_cmd,
|
||||||
"ip pim spt-switchover infinity-and-beyond prefix-list WORD",
|
"ip pim spt-switchover infinity-and-beyond prefix-list WORD$plist",
|
||||||
IP_STR
|
IP_STR
|
||||||
PIM_STR
|
PIM_STR
|
||||||
"SPT-Switchover\n"
|
"SPT-Switchover\n"
|
||||||
@ -6763,32 +6737,7 @@ DEFUN (ip_pim_spt_switchover_infinity_plist,
|
|||||||
"Prefix-List to control which groups to switch\n"
|
"Prefix-List to control which groups to switch\n"
|
||||||
"Prefix-List name\n")
|
"Prefix-List name\n")
|
||||||
{
|
{
|
||||||
const char *vrfname;
|
return pim_process_spt_switchover_prefixlist_cmd(vty, plist);
|
||||||
char spt_plist_xpath[XPATH_MAXLEN];
|
|
||||||
char spt_action_xpath[XPATH_MAXLEN];
|
|
||||||
|
|
||||||
vrfname = pim_cli_get_vrf_name(vty);
|
|
||||||
if (vrfname == NULL)
|
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
|
||||||
|
|
||||||
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
|
||||||
sizeof(spt_plist_xpath));
|
|
||||||
|
|
||||||
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
|
||||||
sizeof(spt_action_xpath));
|
|
||||||
|
|
||||||
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
|
||||||
"PIM_SPT_INFINITY");
|
|
||||||
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_MODIFY,
|
|
||||||
argv[5]->arg);
|
|
||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (no_ip_pim_spt_switchover_infinity,
|
DEFUN (no_ip_pim_spt_switchover_infinity,
|
||||||
@ -6800,31 +6749,7 @@ DEFUN (no_ip_pim_spt_switchover_infinity,
|
|||||||
"SPT_Switchover\n"
|
"SPT_Switchover\n"
|
||||||
"Never switch to SPT Tree\n")
|
"Never switch to SPT Tree\n")
|
||||||
{
|
{
|
||||||
const char *vrfname;
|
return pim_process_no_spt_switchover_cmd(vty);
|
||||||
char spt_plist_xpath[XPATH_MAXLEN];
|
|
||||||
char spt_action_xpath[XPATH_MAXLEN];
|
|
||||||
|
|
||||||
vrfname = pim_cli_get_vrf_name(vty);
|
|
||||||
if (vrfname == NULL)
|
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
|
||||||
|
|
||||||
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
|
||||||
sizeof(spt_plist_xpath));
|
|
||||||
|
|
||||||
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
|
||||||
sizeof(spt_action_xpath));
|
|
||||||
|
|
||||||
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_DESTROY, NULL);
|
|
||||||
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
|
||||||
"PIM_SPT_IMMEDIATE");
|
|
||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (no_ip_pim_spt_switchover_infinity_plist,
|
DEFUN (no_ip_pim_spt_switchover_infinity_plist,
|
||||||
@ -6838,31 +6763,7 @@ DEFUN (no_ip_pim_spt_switchover_infinity_plist,
|
|||||||
"Prefix-List to control which groups to switch\n"
|
"Prefix-List to control which groups to switch\n"
|
||||||
"Prefix-List name\n")
|
"Prefix-List name\n")
|
||||||
{
|
{
|
||||||
const char *vrfname;
|
return pim_process_no_spt_switchover_cmd(vty);
|
||||||
char spt_plist_xpath[XPATH_MAXLEN];
|
|
||||||
char spt_action_xpath[XPATH_MAXLEN];
|
|
||||||
|
|
||||||
vrfname = pim_cli_get_vrf_name(vty);
|
|
||||||
if (vrfname == NULL)
|
|
||||||
return CMD_WARNING_CONFIG_FAILED;
|
|
||||||
|
|
||||||
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
|
||||||
sizeof(spt_plist_xpath));
|
|
||||||
|
|
||||||
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
|
||||||
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
|
||||||
"frr-routing:ipv4");
|
|
||||||
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
|
||||||
sizeof(spt_action_xpath));
|
|
||||||
|
|
||||||
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_DESTROY, NULL);
|
|
||||||
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
|
||||||
"PIM_SPT_IMMEDIATE");
|
|
||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFPY (pim_register_accept_list,
|
DEFPY (pim_register_accept_list,
|
||||||
|
@ -88,3 +88,94 @@ int pim_process_no_join_prune_cmd(struct vty *vty)
|
|||||||
|
|
||||||
return nb_cli_apply_changes(vty, NULL);
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pim_process_spt_switchover_infinity_cmd(struct vty *vty)
|
||||||
|
{
|
||||||
|
const char *vrfname;
|
||||||
|
char spt_plist_xpath[XPATH_MAXLEN];
|
||||||
|
char spt_action_xpath[XPATH_MAXLEN];
|
||||||
|
|
||||||
|
vrfname = pim_cli_get_vrf_name(vty);
|
||||||
|
if (vrfname == NULL)
|
||||||
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
|
|
||||||
|
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
||||||
|
sizeof(spt_plist_xpath));
|
||||||
|
|
||||||
|
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
||||||
|
sizeof(spt_action_xpath));
|
||||||
|
|
||||||
|
if (yang_dnode_exists(vty->candidate_config->dnode, spt_plist_xpath))
|
||||||
|
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_DESTROY,
|
||||||
|
NULL);
|
||||||
|
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
||||||
|
"PIM_SPT_INFINITY");
|
||||||
|
|
||||||
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int pim_process_spt_switchover_prefixlist_cmd(struct vty *vty,
|
||||||
|
const char *plist)
|
||||||
|
{
|
||||||
|
const char *vrfname;
|
||||||
|
char spt_plist_xpath[XPATH_MAXLEN];
|
||||||
|
char spt_action_xpath[XPATH_MAXLEN];
|
||||||
|
|
||||||
|
vrfname = pim_cli_get_vrf_name(vty);
|
||||||
|
if (vrfname == NULL)
|
||||||
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
|
|
||||||
|
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
||||||
|
sizeof(spt_plist_xpath));
|
||||||
|
|
||||||
|
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
||||||
|
sizeof(spt_action_xpath));
|
||||||
|
|
||||||
|
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
||||||
|
"PIM_SPT_INFINITY");
|
||||||
|
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_MODIFY,
|
||||||
|
plist);
|
||||||
|
|
||||||
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int pim_process_no_spt_switchover_cmd(struct vty *vty)
|
||||||
|
{
|
||||||
|
const char *vrfname;
|
||||||
|
char spt_plist_xpath[XPATH_MAXLEN];
|
||||||
|
char spt_action_xpath[XPATH_MAXLEN];
|
||||||
|
|
||||||
|
vrfname = pim_cli_get_vrf_name(vty);
|
||||||
|
if (vrfname == NULL)
|
||||||
|
return CMD_WARNING_CONFIG_FAILED;
|
||||||
|
|
||||||
|
snprintf(spt_plist_xpath, sizeof(spt_plist_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_plist_xpath, "/spt-switchover/spt-infinity-prefix-list",
|
||||||
|
sizeof(spt_plist_xpath));
|
||||||
|
|
||||||
|
snprintf(spt_action_xpath, sizeof(spt_action_xpath),
|
||||||
|
FRR_PIM_VRF_XPATH, "frr-pim:pimd", "pim", vrfname,
|
||||||
|
FRR_PIM_AF_XPATH_VAL);
|
||||||
|
strlcat(spt_action_xpath, "/spt-switchover/spt-action",
|
||||||
|
sizeof(spt_action_xpath));
|
||||||
|
|
||||||
|
nb_cli_enqueue_change(vty, spt_plist_xpath, NB_OP_DESTROY, NULL);
|
||||||
|
nb_cli_enqueue_change(vty, spt_action_xpath, NB_OP_MODIFY,
|
||||||
|
"PIM_SPT_IMMEDIATE");
|
||||||
|
|
||||||
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
|
}
|
||||||
|
@ -23,5 +23,9 @@
|
|||||||
const char *pim_cli_get_vrf_name(struct vty *vty);
|
const char *pim_cli_get_vrf_name(struct vty *vty);
|
||||||
int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
|
int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
|
||||||
int pim_process_no_join_prune_cmd(struct vty *vty);
|
int pim_process_no_join_prune_cmd(struct vty *vty);
|
||||||
|
int pim_process_spt_switchover_infinity_cmd(struct vty *vty);
|
||||||
|
int pim_process_spt_switchover_prefixlist_cmd(struct vty *vty,
|
||||||
|
const char *plist);
|
||||||
|
int pim_process_no_spt_switchover_cmd(struct vty *vty);
|
||||||
|
|
||||||
#endif /* PIM_CMD_COMMON_H */
|
#endif /* PIM_CMD_COMMON_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user