From 6c560a4b983ad07f10c3ee26e23e463c2a5ee53a Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 29 Aug 2022 14:58:15 +0000 Subject: [PATCH] report pending update and withdraw routes in the show neighbor output. OK tb@ --- usr.sbin/bgpctl/output.c | 15 +++++++++------ usr.sbin/bgpctl/output_json.c | 7 ++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c index cce1137197d..b5fadec0668 100644 --- a/usr.sbin/bgpctl/output.c +++ b/usr.sbin/bgpctl/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.26 2022/08/10 10:21:47 claudio Exp $ */ +/* $OpenBSD: output.c,v 1.27 2022/08/29 14:58:15 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -221,13 +221,16 @@ show_neighbor_msgstats(struct peer *p) p->stats.msg_rcvd_update + p->stats.msg_rcvd_keepalive + p->stats.msg_rcvd_rrefresh); printf(" Update statistics:\n"); - printf(" %-15s %-10s %-10s\n", "", "Sent", "Received"); + printf(" %-15s %-10s %-10s %-10s\n", "", "Sent", "Received", + "Pending"); printf(" %-15s %10u %10u\n", "Prefixes", p->stats.prefix_out_cnt, p->stats.prefix_cnt); - printf(" %-15s %10llu %10llu\n", "Updates", - p->stats.prefix_sent_update, p->stats.prefix_rcvd_update); - printf(" %-15s %10llu %10llu\n", "Withdraws", - p->stats.prefix_sent_withdraw, p->stats.prefix_rcvd_withdraw); + printf(" %-15s %10llu %10llu %10u\n", "Updates", + p->stats.prefix_sent_update, p->stats.prefix_rcvd_update, + p->stats.pending_update); + printf(" %-15s %10llu %10llu %10u\n", "Withdraws", + p->stats.prefix_sent_withdraw, p->stats.prefix_rcvd_withdraw, + p->stats.pending_withdraw); printf(" %-15s %10llu %10llu\n", "End-of-Rib", p->stats.prefix_sent_eor, p->stats.prefix_rcvd_eor); printf(" Route Refresh statistics:\n"); diff --git a/usr.sbin/bgpctl/output_json.c b/usr.sbin/bgpctl/output_json.c index 1c6902fa8ca..e960da98d4c 100644 --- a/usr.sbin/bgpctl/output_json.c +++ b/usr.sbin/bgpctl/output_json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output_json.c,v 1.20 2022/07/28 10:40:25 claudio Exp $ */ +/* $OpenBSD: output_json.c,v 1.21 2022/08/29 14:58:15 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -190,6 +190,11 @@ json_neighbor_stats(struct peer *p) json_do_uint("eor", p->stats.prefix_rcvd_eor); json_do_end(); + json_do_object("pending"); + json_do_uint("updates", p->stats.pending_update); + json_do_uint("withdraws", p->stats.pending_withdraw); + json_do_end(); + json_do_end(); json_do_object("route-refresh"); -- 2.20.1