diff options
| author | Abhishek N R <abnr@vmware.com> | 2022-07-18 06:08:19 -0700 |
|---|---|---|
| committer | Abhishek N R <abnr@vmware.com> | 2022-08-01 22:08:40 -0700 |
| commit | 8656814dacea84d5dd89b3c3ad867cafe56dde64 (patch) | |
| tree | 68fa0971482d99cd1c33ffa79c0a9f6a7a1bad8c /pimd/pim_cmd_common.c | |
| parent | ad9b47e65eda5a0fd33e3fc874457bf1fb1ccd7e (diff) | |
pim6d: Implementing "clear ipv6 pim interface traffic" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
Diffstat (limited to 'pimd/pim_cmd_common.c')
| -rw-r--r-- | pimd/pim_cmd_common.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index b7bd7375c5..ce1fb42773 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -4023,6 +4023,46 @@ void clear_pim_statistics(struct pim_instance *pim) } } +int clear_pim_interface_traffic(const char *vrf, struct vty *vty) +{ + struct interface *ifp = NULL; + struct pim_interface *pim_ifp = NULL; + + struct vrf *v = pim_cmd_lookup(vty, vrf); + + if (!v) + return CMD_WARNING; + + FOR_ALL_INTERFACES (v, ifp) { + pim_ifp = ifp->info; + + if (!pim_ifp) + continue; + + pim_ifp->pim_ifstat_hello_recv = 0; + pim_ifp->pim_ifstat_hello_sent = 0; + pim_ifp->pim_ifstat_join_recv = 0; + pim_ifp->pim_ifstat_join_send = 0; + pim_ifp->pim_ifstat_prune_recv = 0; + pim_ifp->pim_ifstat_prune_send = 0; + pim_ifp->pim_ifstat_reg_recv = 0; + pim_ifp->pim_ifstat_reg_send = 0; + pim_ifp->pim_ifstat_reg_stop_recv = 0; + pim_ifp->pim_ifstat_reg_stop_send = 0; + pim_ifp->pim_ifstat_assert_recv = 0; + pim_ifp->pim_ifstat_assert_send = 0; + pim_ifp->pim_ifstat_bsm_rx = 0; + pim_ifp->pim_ifstat_bsm_tx = 0; +#if PIM_IPV == 4 + pim_ifp->igmp_ifstat_joins_sent = 0; + pim_ifp->igmp_ifstat_joins_failed = 0; + pim_ifp->igmp_peak_group_count = 0; +#endif + } + + return CMD_SUCCESS; +} + int pim_debug_pim_cmd(void) { PIM_DO_DEBUG_PIM_EVENTS; |
