Export pending update and withdraw as part of struct peer_stats.
authorclaudio <claudio@openbsd.org>
Mon, 29 Aug 2022 14:57:27 +0000 (14:57 +0000)
committerclaudio <claudio@openbsd.org>
Mon, 29 Aug 2022 14:57:27 +0000 (14:57 +0000)
OK tb@

usr.sbin/bgpd/rde.c
usr.sbin/bgpd/session.h

index febdc17..10f86a8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde.c,v 1.565 2022/08/26 14:10:52 claudio Exp $ */
+/*     $OpenBSD: rde.c,v 1.566 2022/08/29 14:57:27 claudio Exp $ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -623,6 +623,8 @@ badnetdel:
                                    peer->prefix_sent_withdraw;
                                p.stats.prefix_sent_eor =
                                    peer->prefix_sent_eor;
+                               p.stats.pending_update = peer->up_nlricnt;
+                               p.stats.pending_withdraw = peer->up_wcnt;
                        }
                        imsg_compose(ibuf_se_ctl, IMSG_CTL_SHOW_NEIGHBOR, 0,
                            imsg.hdr.pid, -1, &p, sizeof(struct peer));
index 68573f2..fbc9181 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: session.h,v 1.157 2022/07/28 13:11:51 deraadt Exp $ */
+/*     $OpenBSD: session.h,v 1.158 2022/08/29 14:57:27 claudio Exp $ */
 
 /*
  * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -179,6 +179,8 @@ struct peer_stats {
        time_t                   last_write;
        uint32_t                 prefix_cnt;
        uint32_t                 prefix_out_cnt;
+       uint32_t                 pending_update;
+       uint32_t                 pending_withdraw;
        uint8_t                  last_sent_errcode;
        uint8_t                  last_sent_suberr;
        uint8_t                  last_rcvd_errcode;