summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r--pimd/pim_cmd.c78
1 files changed, 23 insertions, 55 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 9681493808..c2f7396c18 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1129,11 +1129,11 @@ static void igmp_show_groups(struct pim_instance *pim, struct vty *vty, bool uj)
if (uj) {
json = json_object_new_object();
- json_object_int_add(json, "totalGroups", pim->igmp_group_count);
+ json_object_int_add(json, "totalGroups", pim->gm_group_count);
json_object_int_add(json, "watermarkLimit",
pim->gm_watermark_limit);
} else {
- vty_out(vty, "Total IGMP groups: %u\n", pim->igmp_group_count);
+ vty_out(vty, "Total IGMP groups: %u\n", pim->gm_group_count);
vty_out(vty, "Watermark warn limit(%s): %u\n",
pim->gm_watermark_limit ? "Set" : "Not Set",
pim->gm_watermark_limit);
@@ -1678,50 +1678,17 @@ DEFPY (clear_ip_pim_interfaces,
return CMD_SUCCESS;
}
-DEFUN (clear_ip_pim_interface_traffic,
+DEFPY (clear_ip_pim_interface_traffic,
clear_ip_pim_interface_traffic_cmd,
"clear ip pim [vrf NAME] interface traffic",
- "Reset functions\n"
- "IP information\n"
- "PIM clear commands\n"
+ CLEAR_STR
+ IP_STR
+ CLEAR_IP_PIM_STR
VRF_CMD_HELP_STR
"Reset PIM interfaces\n"
"Reset Protocol Packet counters\n")
{
- int idx = 2;
- struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- struct interface *ifp = NULL;
- struct pim_interface *pim_ifp = NULL;
-
- if (!vrf)
- return CMD_WARNING;
-
- FOR_ALL_INTERFACES (vrf, 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;
- pim_ifp->igmp_ifstat_joins_sent = 0;
- pim_ifp->igmp_ifstat_joins_failed = 0;
- pim_ifp->igmp_peak_group_count = 0;
- }
-
- return CMD_SUCCESS;
+ return clear_pim_interface_traffic(vrf, vty);
}
DEFPY (clear_ip_pim_oil,
@@ -4391,9 +4358,9 @@ DEFUN (debug_igmp,
DEBUG_STR
DEBUG_IGMP_STR)
{
- PIM_DO_DEBUG_IGMP_EVENTS;
- PIM_DO_DEBUG_IGMP_PACKETS;
- PIM_DO_DEBUG_IGMP_TRACE;
+ PIM_DO_DEBUG_GM_EVENTS;
+ PIM_DO_DEBUG_GM_PACKETS;
+ PIM_DO_DEBUG_GM_TRACE;
return CMD_SUCCESS;
}
@@ -4404,9 +4371,9 @@ DEFUN (no_debug_igmp,
DEBUG_STR
DEBUG_IGMP_STR)
{
- PIM_DONT_DEBUG_IGMP_EVENTS;
- PIM_DONT_DEBUG_IGMP_PACKETS;
- PIM_DONT_DEBUG_IGMP_TRACE;
+ PIM_DONT_DEBUG_GM_EVENTS;
+ PIM_DONT_DEBUG_GM_PACKETS;
+ PIM_DONT_DEBUG_GM_TRACE;
return CMD_SUCCESS;
}
@@ -4418,7 +4385,7 @@ DEFUN (debug_igmp_events,
DEBUG_IGMP_STR
DEBUG_IGMP_EVENTS_STR)
{
- PIM_DO_DEBUG_IGMP_EVENTS;
+ PIM_DO_DEBUG_GM_EVENTS;
return CMD_SUCCESS;
}
@@ -4430,7 +4397,7 @@ DEFUN (no_debug_igmp_events,
DEBUG_IGMP_STR
DEBUG_IGMP_EVENTS_STR)
{
- PIM_DONT_DEBUG_IGMP_EVENTS;
+ PIM_DONT_DEBUG_GM_EVENTS;
return CMD_SUCCESS;
}
@@ -4442,7 +4409,7 @@ DEFUN (debug_igmp_packets,
DEBUG_IGMP_STR
DEBUG_IGMP_PACKETS_STR)
{
- PIM_DO_DEBUG_IGMP_PACKETS;
+ PIM_DO_DEBUG_GM_PACKETS;
return CMD_SUCCESS;
}
@@ -4454,7 +4421,7 @@ DEFUN (no_debug_igmp_packets,
DEBUG_IGMP_STR
DEBUG_IGMP_PACKETS_STR)
{
- PIM_DONT_DEBUG_IGMP_PACKETS;
+ PIM_DONT_DEBUG_GM_PACKETS;
return CMD_SUCCESS;
}
@@ -4466,7 +4433,7 @@ DEFUN (debug_igmp_trace,
DEBUG_IGMP_STR
DEBUG_IGMP_TRACE_STR)
{
- PIM_DO_DEBUG_IGMP_TRACE;
+ PIM_DO_DEBUG_GM_TRACE;
return CMD_SUCCESS;
}
@@ -4478,7 +4445,7 @@ DEFUN (no_debug_igmp_trace,
DEBUG_IGMP_STR
DEBUG_IGMP_TRACE_STR)
{
- PIM_DONT_DEBUG_IGMP_TRACE;
+ PIM_DONT_DEBUG_GM_TRACE;
return CMD_SUCCESS;
}
@@ -4491,7 +4458,7 @@ DEFUN (debug_igmp_trace_detail,
DEBUG_IGMP_TRACE_STR
"detailed\n")
{
- PIM_DO_DEBUG_IGMP_TRACE_DETAIL;
+ PIM_DO_DEBUG_GM_TRACE_DETAIL;
return CMD_SUCCESS;
}
@@ -4504,7 +4471,7 @@ DEFUN (no_debug_igmp_trace_detail,
DEBUG_IGMP_TRACE_STR
"detailed\n")
{
- PIM_DONT_DEBUG_IGMP_TRACE_DETAIL;
+ PIM_DONT_DEBUG_GM_TRACE_DETAIL;
return CMD_SUCCESS;
}
@@ -5559,12 +5526,13 @@ DEFUN (show_ip_msdp_mesh_group,
int idx = 2;
struct pim_msdp_mg *mg;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- struct pim_instance *pim = vrf->info;
+ struct pim_instance *pim;
struct json_object *json = NULL;
if (!vrf)
return CMD_WARNING;
+ pim = vrf->info;
/* Quick case: list is empty. */
if (SLIST_EMPTY(&pim->msdp.mglist)) {
if (uj)