mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 13:30:21 +00:00
Merge pull request #11644 from AbhishekNR/clear_cmd_interface
pim6d: Implementing "clear ipv6 pim interfaces" command.
This commit is contained in:
commit
a145324acf
@ -385,6 +385,10 @@ Clear commands reset various variables.
|
|||||||
packet count, byte count and wrong interface to 0 and start count
|
packet count, byte count and wrong interface to 0 and start count
|
||||||
up from this spot.
|
up from this spot.
|
||||||
|
|
||||||
|
.. clicmd:: clear ipv6 pim interfaces
|
||||||
|
|
||||||
|
Reset PIMv6 interfaces.
|
||||||
|
|
||||||
.. clicmd:: clear ipv6 pim oil
|
.. clicmd:: clear ipv6 pim oil
|
||||||
|
|
||||||
Rescan PIMv6 OIL (output interface list).
|
Rescan PIMv6 OIL (output interface list).
|
||||||
|
@ -1309,6 +1309,25 @@ DEFPY (clear_ipv6_mroute_count,
|
|||||||
return clear_ip_mroute_count_command(vty, name);
|
return clear_ip_mroute_count_command(vty, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFPY (clear_ipv6_pim_interfaces,
|
||||||
|
clear_ipv6_pim_interfaces_cmd,
|
||||||
|
"clear ipv6 pim [vrf NAME] interfaces",
|
||||||
|
CLEAR_STR
|
||||||
|
IPV6_STR
|
||||||
|
CLEAR_IP_PIM_STR
|
||||||
|
VRF_CMD_HELP_STR
|
||||||
|
"Reset PIM interfaces\n")
|
||||||
|
{
|
||||||
|
struct vrf *v = pim_cmd_lookup(vty, vrf);
|
||||||
|
|
||||||
|
if (!v)
|
||||||
|
return CMD_WARNING;
|
||||||
|
|
||||||
|
clear_pim_interfaces(v->info);
|
||||||
|
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
DEFPY (clear_ipv6_pim_bsr_db,
|
DEFPY (clear_ipv6_pim_bsr_db,
|
||||||
clear_ipv6_pim_bsr_db_cmd,
|
clear_ipv6_pim_bsr_db_cmd,
|
||||||
"clear ipv6 pim [vrf NAME] bsr-data",
|
"clear ipv6 pim [vrf NAME] bsr-data",
|
||||||
@ -1599,6 +1618,7 @@ void pim_cmd_init(void)
|
|||||||
install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
|
install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
|
||||||
install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
|
install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
|
||||||
install_element(ENABLE_NODE, &clear_ipv6_pim_bsr_db_cmd);
|
install_element(ENABLE_NODE, &clear_ipv6_pim_bsr_db_cmd);
|
||||||
|
install_element(ENABLE_NODE, &clear_ipv6_pim_interfaces_cmd);
|
||||||
|
|
||||||
install_element(ENABLE_NODE, &debug_pimv6_cmd);
|
install_element(ENABLE_NODE, &debug_pimv6_cmd);
|
||||||
install_element(ENABLE_NODE, &debug_pimv6_nht_cmd);
|
install_element(ENABLE_NODE, &debug_pimv6_nht_cmd);
|
||||||
|
@ -1521,17 +1521,6 @@ static void clear_igmp_interfaces(struct pim_instance *pim)
|
|||||||
pim_if_addr_add_all(ifp);
|
pim_if_addr_add_all(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clear_pim_interfaces(struct pim_instance *pim)
|
|
||||||
{
|
|
||||||
struct interface *ifp;
|
|
||||||
|
|
||||||
FOR_ALL_INTERFACES (pim->vrf, ifp) {
|
|
||||||
if (ifp->info) {
|
|
||||||
pim_neighbor_delete_all(ifp, "interface cleared");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void clear_interfaces(struct pim_instance *pim)
|
static void clear_interfaces(struct pim_instance *pim)
|
||||||
{
|
{
|
||||||
clear_igmp_interfaces(pim);
|
clear_igmp_interfaces(pim);
|
||||||
@ -1670,7 +1659,7 @@ DEFPY (clear_ip_mroute,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (clear_ip_pim_interfaces,
|
DEFPY (clear_ip_pim_interfaces,
|
||||||
clear_ip_pim_interfaces_cmd,
|
clear_ip_pim_interfaces_cmd,
|
||||||
"clear ip pim [vrf NAME] interfaces",
|
"clear ip pim [vrf NAME] interfaces",
|
||||||
CLEAR_STR
|
CLEAR_STR
|
||||||
@ -1679,13 +1668,12 @@ DEFUN (clear_ip_pim_interfaces,
|
|||||||
VRF_CMD_HELP_STR
|
VRF_CMD_HELP_STR
|
||||||
"Reset PIM interfaces\n")
|
"Reset PIM interfaces\n")
|
||||||
{
|
{
|
||||||
int idx = 2;
|
struct vrf *v = pim_cmd_lookup(vty, vrf);
|
||||||
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
|
|
||||||
|
|
||||||
if (!vrf)
|
if (!v)
|
||||||
return CMD_WARNING;
|
return CMD_WARNING;
|
||||||
|
|
||||||
clear_pim_interfaces(vrf->info);
|
clear_pim_interfaces(v->info);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -4902,3 +4902,13 @@ int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
|
|||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear_pim_interfaces(struct pim_instance *pim)
|
||||||
|
{
|
||||||
|
struct interface *ifp;
|
||||||
|
|
||||||
|
FOR_ALL_INTERFACES (pim->vrf, ifp) {
|
||||||
|
if (ifp->info)
|
||||||
|
pim_neighbor_delete_all(ifp, "interface cleared");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -184,6 +184,7 @@ void pim_show_interface_traffic(struct pim_instance *pim, struct vty *vty,
|
|||||||
bool uj);
|
bool uj);
|
||||||
int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
|
int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
|
||||||
struct vty *vty, bool uj);
|
struct vty *vty, bool uj);
|
||||||
|
void clear_pim_interfaces(struct pim_instance *pim);
|
||||||
/*
|
/*
|
||||||
* Special Macro to allow us to get the correct pim_instance;
|
* Special Macro to allow us to get the correct pim_instance;
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user