From 6b427a25f2216d0492183da189b093febaf884c0 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 29 Aug 2022 14:58:16 +0000 Subject: 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"); -- cgit v1.2.3