#define IFACE_PIM_HELLO_TIME_STR "Time in seconds for Hello Interval\n"
#define IFACE_PIM_HELLO_HOLD_STR "Time in seconds for Hold Interval\n"
#define MROUTE_STR "IP multicast routing table\n"
+#define CLEAR_IP_PIM_STR "PIM clear commands\n"
#define DEBUG_MLD_STR "MLD protocol activity\n"
#define DEBUG_MLD_EVENTS_STR "MLD protocol events\n"
#define DEBUG_MLD_PACKETS_STR "MLD protocol packets\n"
vty_json(vty, json);
}
-static void clear_pim_statistics(struct pim_instance *pim)
-{
- struct interface *ifp;
-
- pim->bsm_rcvd = 0;
- pim->bsm_sent = 0;
- pim->bsm_dropped = 0;
-
- /* scan interfaces */
- FOR_ALL_INTERFACES (pim->vrf, ifp) {
- struct pim_interface *pim_ifp = ifp->info;
-
- if (!pim_ifp)
- continue;
-
- pim_ifp->pim_ifstat_bsm_cfg_miss = 0;
- pim_ifp->pim_ifstat_ucast_bsm_cfg_miss = 0;
- pim_ifp->pim_ifstat_bsm_invalid_sz = 0;
- }
-}
-
static void igmp_show_groups(struct pim_instance *pim, struct vty *vty, bool uj)
{
struct interface *ifp;
return CMD_SUCCESS;
}
-static void clear_mroute(struct pim_instance *pim)
-{
- struct pim_upstream *up;
- struct interface *ifp;
-
- /* scan interfaces */
- FOR_ALL_INTERFACES (pim->vrf, ifp) {
- struct pim_interface *pim_ifp = ifp->info;
- struct pim_ifchannel *ch;
-
- if (!pim_ifp)
- continue;
-
- /* deleting all ifchannels */
- while (!RB_EMPTY(pim_ifchannel_rb, &pim_ifp->ifchannel_rb)) {
- ch = RB_ROOT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb);
-
- pim_ifchannel_delete(ch);
- }
-
-#if PIM_IPV == 4
- /* clean up all igmp groups */
- struct gm_group *grp;
-
- if (pim_ifp->gm_group_list) {
- while (pim_ifp->gm_group_list->count) {
- grp = listnode_head(pim_ifp->gm_group_list);
- igmp_group_delete(grp);
- }
- }
-#endif
- }
-
- /* clean up all upstreams*/
- while ((up = rb_pim_upstream_first(&pim->upstream_head)))
- pim_upstream_del(pim, up, __func__);
-
-}
-
DEFUN (clear_ip_mroute,
clear_ip_mroute_cmd,
"clear ip mroute [vrf NAME]",
sg_hw_mroute_cnt);
}
}
+
+void clear_mroute(struct pim_instance *pim)
+{
+ struct pim_upstream *up;
+ struct interface *ifp;
+
+ /* scan interfaces */
+ FOR_ALL_INTERFACES (pim->vrf, ifp) {
+ struct pim_interface *pim_ifp = ifp->info;
+ struct pim_ifchannel *ch;
+
+ if (!pim_ifp)
+ continue;
+
+ /* deleting all ifchannels */
+ while (!RB_EMPTY(pim_ifchannel_rb, &pim_ifp->ifchannel_rb)) {
+ ch = RB_ROOT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb);
+
+ pim_ifchannel_delete(ch);
+ }
+
+#if PIM_IPV == 4
+ /* clean up all igmp groups */
+ struct gm_group *grp;
+
+ if (pim_ifp->gm_group_list) {
+ while (pim_ifp->gm_group_list->count) {
+ grp = listnode_head(pim_ifp->gm_group_list);
+ igmp_group_delete(grp);
+ }
+ }
+#endif
+ }
+
+ /* clean up all upstreams*/
+ while ((up = rb_pim_upstream_first(&pim->upstream_head)))
+ pim_upstream_del(pim, up, __func__);
+}
+
+void clear_pim_statistics(struct pim_instance *pim)
+{
+ struct interface *ifp;
+
+ pim->bsm_rcvd = 0;
+ pim->bsm_sent = 0;
+ pim->bsm_dropped = 0;
+
+ /* scan interfaces */
+ FOR_ALL_INTERFACES (pim->vrf, ifp) {
+ struct pim_interface *pim_ifp = ifp->info;
+
+ if (!pim_ifp)
+ continue;
+
+ pim_ifp->pim_ifstat_bsm_cfg_miss = 0;
+ pim_ifp->pim_ifstat_ucast_bsm_cfg_miss = 0;
+ pim_ifp->pim_ifstat_bsm_invalid_sz = 0;
+ }
+}
json_object *json);
void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
json_object *json);
+void clear_mroute(struct pim_instance *pim);
+void clear_pim_statistics(struct pim_instance *pim);
/*
* Special Macro to allow us to get the correct pim_instance;