]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Add counting to nexthop register/unregister events
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 5 Oct 2018 13:28:41 +0000 (09:28 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 31 Oct 2018 10:25:51 +0000 (06:25 -0400)
Add a bit of code to note how many register/unregister nht
events we have had.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zapi_msg.c
zebra/zserv.c
zebra/zserv.h

index 7ea0a4d47dc7b3ebe952571a68e0db3229f29335..42b0a815104e09802d3a992066432f9acce08efd 100644 (file)
@@ -1056,6 +1056,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                STREAM_GETC(s, p.prefixlen);
                l += 4;
                if (p.family == AF_INET) {
+                       client->v4_nh_watch_add_cnt++;
                        if (p.prefixlen > IPV4_MAX_BITLEN) {
                                zlog_debug(
                                        "%s: Specified prefix hdr->length %d is too large for a v4 address",
@@ -1065,6 +1066,7 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                        STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
                        l += IPV4_MAX_BYTELEN;
                } else if (p.family == AF_INET6) {
+                       client->v6_nh_watch_add_cnt++;
                        if (p.prefixlen > IPV6_MAX_BITLEN) {
                                zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v6 address",
@@ -1139,6 +1141,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                STREAM_GETC(s, p.prefixlen);
                l += 4;
                if (p.family == AF_INET) {
+                       client->v4_nh_watch_rem_cnt++;
                        if (p.prefixlen > IPV4_MAX_BITLEN) {
                                zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v4 address",
@@ -1148,6 +1151,7 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                        STREAM_GET(&p.u.prefix4.s_addr, s, IPV4_MAX_BYTELEN);
                        l += IPV4_MAX_BYTELEN;
                } else if (p.family == AF_INET6) {
+                       client->v6_nh_watch_rem_cnt++;
                        if (p.prefixlen > IPV6_MAX_BITLEN) {
                                zlog_debug(
                                        "%s: Specified prefix hdr->length %d is to large for a v6 address",
index 8cc462577a2a5a317ab46b49105d0e91480d2f83..3c3bf4077b745bb8a41f2f51a61406625fd7ca9f 100644 (file)
@@ -940,6 +940,10 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client)
                client->ifdel_cnt);
        vty_out(vty, "BFD peer    %-12d%-12d%-12d\n", client->bfd_peer_add_cnt,
                client->bfd_peer_upd8_cnt, client->bfd_peer_del_cnt);
+       vty_out(vty, "NHT v4      %-12d%-12d%-12d\n",
+               client->v4_nh_watch_add_cnt, 0, client->v4_nh_watch_rem_cnt);
+       vty_out(vty, "NHT v6      %-12d%-12d%-12d\n",
+               client->v6_nh_watch_add_cnt, 0, client->v6_nh_watch_rem_cnt);
        vty_out(vty, "Interface Up Notifications: %d\n", client->ifup_cnt);
        vty_out(vty, "Interface Down Notifications: %d\n", client->ifdown_cnt);
        vty_out(vty, "VNI add notifications: %d\n", client->vniadd_cnt);
index 987c67635dadb6c7923734ef64c9ffc7728b245d..f21ea17fe884d1fe3d63b5afd4f54b489d7bc611 100644 (file)
@@ -133,6 +133,10 @@ struct zserv {
        uint32_t macipdel_cnt;
        uint32_t prefixadd_cnt;
        uint32_t prefixdel_cnt;
+       uint32_t v4_nh_watch_add_cnt;
+       uint32_t v4_nh_watch_rem_cnt;
+       uint32_t v6_nh_watch_add_cnt;
+       uint32_t v6_nh_watch_rem_cnt;
 
        time_t nh_reg_time;
        time_t nh_dereg_time;