From: Vojtech Vilimek Date: Thu, 15 Aug 2024 10:07:10 +0000 (+0200) Subject: SNMP: Improve cli output X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35954b667f9aa0090ed681dcf3d7e8c265f3d6aa;p=thirdparty%2Fbird.git SNMP: Improve cli output --- diff --git a/proto/snmp/bgp4_mib.c b/proto/snmp/bgp4_mib.c index 3f9fce29a..5f4c703df 100644 --- a/proto/snmp/bgp4_mib.c +++ b/proto/snmp/bgp4_mib.c @@ -814,14 +814,20 @@ snmp_bgp4_show_info(struct snmp_proto *p) cli_msg(-1006, " Local router id %R", p->bgp_local_id); cli_msg(-1006, " BGP peers"); + if (p->bgp_hash.count == 0) + { + cli_msg(-1006, " "); + } + if (!snmp_is_active(p)) return; HASH_WALK(p->bgp_hash, next, peer) { - cli_msg(-1006, " protocol name: %s", peer->bgp_proto->p.name); - cli_msg(-1006, " Remote IPv4 address: %I4", peer->peer_ip); - cli_msg(-1006, " Remote router id %R", peer->bgp_proto->remote_id); + cli_msg(-1006, " Protocol name: %s", peer->bgp_proto->p.name); + cli_msg(-1006, " Remote IPv4 address: %I4", peer->peer_ip); + cli_msg(-1006, " Remote router id %R", peer->bgp_proto->remote_id); + // TODO: add local ip addr } HASH_WALK_END; }