summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-03-15 07:56:00 -0400
committerGitHub <noreply@github.com>2022-03-15 07:56:00 -0400
commitcde5655bf4636c6bdf97460579898a53f69e83ff (patch)
tree1554566eb365424f83ec3e045028ca0ad03f0946
parent6ec6186af9987b3e2b698943b6e77f2e07e31067 (diff)
parentca3e7807f6640c0b08042088e069e206b148e1e7 (diff)
Merge pull request #10793 from opensourcerouting/feature/igmp_stats_total_received_messages
pimd: Show total received messages IGMP stats
-rw-r--r--pimd/pim_cmd.c38
-rw-r--r--pimd/pim_igmp_stats.c3
-rw-r--r--pimd/pim_igmp_stats.h1
3 files changed, 25 insertions, 17 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 3c2f59bf2f..78dbbf9326 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -1348,6 +1348,8 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
igmp_stats.mtrace_req);
json_object_int_add(json_row, "unsupported",
igmp_stats.unsupported);
+ json_object_int_add(json_row, "totalReceivedMessages",
+ igmp_stats.total_recv_messages);
json_object_int_add(json_row, "totalGroups",
igmp_stats.total_groups);
json_object_int_add(json_row, "totalSourceGroups",
@@ -1365,39 +1367,41 @@ static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
vty_json(vty, json);
} else {
vty_out(vty, "IGMP statistics\n");
- vty_out(vty, "Interface : %s\n",
+ vty_out(vty, "Interface : %s\n",
ifname ? ifname : "global");
- vty_out(vty, "V1 query : %u\n",
+ vty_out(vty, "V1 query : %u\n",
igmp_stats.query_v1);
- vty_out(vty, "V2 query : %u\n",
+ vty_out(vty, "V2 query : %u\n",
igmp_stats.query_v2);
- vty_out(vty, "V3 query : %u\n",
+ vty_out(vty, "V3 query : %u\n",
igmp_stats.query_v3);
- vty_out(vty, "V2 leave : %u\n",
+ vty_out(vty, "V2 leave : %u\n",
igmp_stats.leave_v2);
- vty_out(vty, "V1 report : %u\n",
+ vty_out(vty, "V1 report : %u\n",
igmp_stats.report_v1);
- vty_out(vty, "V2 report : %u\n",
+ vty_out(vty, "V2 report : %u\n",
igmp_stats.report_v2);
- vty_out(vty, "V3 report : %u\n",
+ vty_out(vty, "V3 report : %u\n",
igmp_stats.report_v3);
- vty_out(vty, "mtrace response : %u\n",
+ vty_out(vty, "mtrace response : %u\n",
igmp_stats.mtrace_rsp);
- vty_out(vty, "mtrace request : %u\n",
+ vty_out(vty, "mtrace request : %u\n",
igmp_stats.mtrace_req);
- vty_out(vty, "unsupported : %u\n",
+ vty_out(vty, "unsupported : %u\n",
igmp_stats.unsupported);
- vty_out(vty, "joins failed : %u\n",
+ vty_out(vty, "total received messages : %u\n",
+ igmp_stats.total_recv_messages);
+ vty_out(vty, "joins failed : %u\n",
igmp_stats.joins_failed);
- vty_out(vty, "joins sent : %u\n",
+ vty_out(vty, "joins sent : %u\n",
igmp_stats.joins_sent);
- vty_out(vty, "general queries sent : %u\n",
+ vty_out(vty, "general queries sent : %u\n",
igmp_stats.general_queries_sent);
- vty_out(vty, "group queries sent : %u\n",
+ vty_out(vty, "group queries sent : %u\n",
igmp_stats.group_queries_sent);
- vty_out(vty, "total groups : %u\n",
+ vty_out(vty, "total groups : %u\n",
igmp_stats.total_groups);
- vty_out(vty, "total source groups : %u\n",
+ vty_out(vty, "total source groups : %u\n",
igmp_stats.total_source_groups);
}
}
diff --git a/pimd/pim_igmp_stats.c b/pimd/pim_igmp_stats.c
index b2f1d6b3cc..6a5ce4dc8d 100644
--- a/pimd/pim_igmp_stats.c
+++ b/pimd/pim_igmp_stats.c
@@ -49,4 +49,7 @@ void igmp_stats_add(struct igmp_stats *a, struct igmp_stats *b)
a->joins_failed += b->joins_failed;
a->general_queries_sent += b->general_queries_sent;
a->group_queries_sent += b->group_queries_sent;
+ a->total_recv_messages += b->query_v1 + b->query_v2 + b->query_v3 +
+ b->report_v1 + b->report_v2 + b->report_v3 +
+ b->leave_v2 + b->mtrace_rsp + b->mtrace_req;
}
diff --git a/pimd/pim_igmp_stats.h b/pimd/pim_igmp_stats.h
index c22922a316..560132a19a 100644
--- a/pimd/pim_igmp_stats.h
+++ b/pimd/pim_igmp_stats.h
@@ -39,6 +39,7 @@ struct igmp_stats {
uint32_t joins_failed;
uint32_t general_queries_sent;
uint32_t group_queries_sent;
+ uint32_t total_recv_messages;
};
#if PIM_IPV == 4