diff options
author | Chirag Shah <chirag@cumulusnetworks.com> | 2017-04-03 22:11:58 +0200 |
---|---|---|
committer | Chirag Shah <chirag@cumulusnetworks.com> | 2017-05-02 03:47:00 +0200 |
commit | 394381887e3a4826e256a89e35a122a6d4af338b (patch) | |
tree | 777c04fe39ccec4c9577be4ca47a27d5e1321bbc /pimd/pim_join.c | |
parent | Merge pull request #428 from qlyoung/fix-isis-mt (diff) | |
download | frr-394381887e3a4826e256a89e35a122a6d4af338b.tar.xz frr-394381887e3a4826e256a89e35a122a6d4af338b.zip |
pimd: Introduce show command for protocol counters
For all pim enabled interfaces and single pim enable interface command.
Clear command to clear protocol counters stats.
'show ip pim interface traffic {WORD} {json}'
'clear ip pim interface traffic'
Testing Done: bringup Pim configuration and form RPT and SPT and check
show ip pim interface traffic command output,
perform clear form of interface traffic command and
verified all counters reset via show form of command.
tor-21# show ip pim interface traffic swp2
Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT
Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx
---------------------------------------------------------------------------------------------------------------
swp2 22/22 0/10 0/0 0/0 0/0 0/0
leaf-22# show ip pim interface traffic swp3
Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT
Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx
---------------------------------------------------------------------------------------------------------------
swp3 23/22 10/0 0/0 0/0 0/0 0/0
spine-1#show ip pim interface traffic
Interface HELLO JOIN PRUNE REGISTER REGISTER-STOP ASSERT
Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx Rx/Tx
---------------------------------------------------------------------------------------------------------------
br1 0/1 0/0 0/0 0/0 0/0 0/0
lo 0/0 0/0 0/0 0/0 0/0 0/0
swp1 0/1 0/0 0/0 0/0 0/0 0/0
swp2 0/1 0/0 0/0 0/0 0/0 0/0
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_join.c')
-rw-r--r-- | pimd/pim_join.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 884aa35bc..c0cb1de8c 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -59,6 +59,8 @@ static void recv_join(struct interface *ifp, struct prefix_sg *sg, uint8_t source_flags) { + struct pim_interface *pim_ifp = NULL; + if (PIM_DEBUG_PIM_TRACE) { char up_str[INET_ADDRSTRLEN]; char neigh_str[INET_ADDRSTRLEN]; @@ -72,6 +74,11 @@ static void recv_join(struct interface *ifp, up_str, holdtime, neigh_str, ifp->name); } + pim_ifp = ifp->info; + zassert(pim_ifp); + + ++pim_ifp->pim_ifstat_join_recv; + /* * If the RPT and WC are set it's a (*,G) * and the source is the RP @@ -104,6 +111,8 @@ static void recv_prune(struct interface *ifp, struct prefix_sg *sg, uint8_t source_flags) { + struct pim_interface *pim_ifp = NULL; + if (PIM_DEBUG_PIM_TRACE) { char up_str[INET_ADDRSTRLEN]; char neigh_str[INET_ADDRSTRLEN]; @@ -117,6 +126,11 @@ static void recv_prune(struct interface *ifp, up_str, holdtime, neigh_str, ifp->name); } + pim_ifp = ifp->info; + zassert(pim_ifp); + + ++pim_ifp->pim_ifstat_prune_recv; + if ((source_flags & PIM_RPT_BIT_MASK) && (source_flags & PIM_WILDCARD_BIT_MASK)) { @@ -495,6 +509,9 @@ int pim_joinprune_send(struct pim_rpf *rpf, packet_size += group_size; pim_msg_build_jp_groups (grp, group, group_size); + pim_ifp->pim_ifstat_join_send += ntohs(grp->joins); + pim_ifp->pim_ifstat_prune_send += ntohs(grp->prunes); + grp = (struct pim_jp_groups *)curr_ptr; if (packet_left < sizeof (struct pim_jp_groups) || msg->num_groups == 255) { |