summaryrefslogtreecommitdiff
path: root/bgpd/bgp_advertise.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:40:36 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 17:40:36 -0700
commitcdabb8b69196648046264f4fa76b77b66ae134a6 (patch)
tree152257fd69a2d8e01ea8e17bde98bd157e14effb /bgpd/bgp_advertise.h
parent01a2af45624e3713313974b1dd9c62c2d05e928f (diff)
bgpd: bgpd-peer-outq.patch
BGP: Show more meaningful outq value in 'show ip bgp summary' output. 'outq' field in 'show ip bgp sum' displays the number of formatted packets to a peer. Since the route announcement follows an input-buffered pattern (i.e. adj-rib-out is a separate queue of routes per peer and packets are formatted from the routes at the time of TCP write), the outq field doesn't show any interesting data worth watching. The patch is to display the adj-rib-out queue depth instead. signed-off-by: pmohapat@cumulusnetworks.com reviewed-by: dwalton@cumulusnetworks.com
Diffstat (limited to 'bgpd/bgp_advertise.h')
-rw-r--r--bgpd/bgp_advertise.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/bgpd/bgp_advertise.h b/bgpd/bgp_advertise.h
index 4ebde907db..672d42d8c6 100644
--- a/bgpd/bgp_advertise.h
+++ b/bgpd/bgp_advertise.h
@@ -26,6 +26,7 @@ struct bgp_advertise_fifo
{
struct bgp_advertise *next;
struct bgp_advertise *prev;
+ u_int32_t count;
};
/* BGP advertise attribute. */
@@ -127,6 +128,24 @@ struct bgp_synchronize
#define BGP_ADJ_OUT_ADD(N,A) BGP_INFO_ADD(N,A,adj_out)
#define BGP_ADJ_OUT_DEL(N,A) BGP_INFO_DEL(N,A,adj_out)
+#define BGP_ADV_FIFO_ADD(F, N) \
+ do { \
+ FIFO_ADD((F), (N)); \
+ (F)->count++; \
+ } while (0)
+
+#define BGP_ADV_FIFO_DEL(F, N) \
+ do { \
+ FIFO_DEL((N)); \
+ (F)->count--; \
+ } while (0)
+
+#define BGP_ADV_FIFO_INIT(F) \
+ do { \
+ FIFO_INIT((F)); \
+ (F)->count = 0; \
+ } while (0)
+
/* Prototypes. */
extern void bgp_adj_out_set (struct bgp_node *, struct peer *, struct prefix *,
struct attr *, afi_t, safi_t, struct bgp_info *);