* bgp_vty.c: (bgp_show_summary) The sum of the routes received from
  each neighbour can be interesting/useful.  Add a line with this to
  end of 'show ...  bgp ...  summary'.

  Note, this is also available from 'show bgp <afi> <safi>
  statistics', along with more.
---
 bgpd/bgp_vty.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 36af648..cd5ee3a 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -7781,6 +7781,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int 
afi, int safi)
   struct peer *peer;
   struct listnode *node, *nnode;
   unsigned int count = 0;
+  unsigned int totrcount = 0;
   char timebuf[BGP_UPTIME_LEN];
   int len;
 
@@ -7862,6 +7863,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int 
afi, int safi)
          if (peer->status == Established)
            {
              vty_out (vty, " %8ld", peer->pcount[afi][safi]);
+             totrcount += peer->pcount[afi][safi];
            }
          else
            {
@@ -7878,8 +7880,12 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int 
afi, int safi)
     }
 
   if (count)
-    vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE,
-            count, VTY_NEWLINE);
+    {
+      vty_out (vty, "%sTotal number of neighbors %d%s", VTY_NEWLINE,
+              count, VTY_NEWLINE);
+      vty_out (vty, "Total number of routes received %d%s",
+               totrcount, VTY_NEWLINE);
+    }
   else
     vty_out (vty, "No %s neighbor is configured%s",
             afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
-- 
2.5.5


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to