]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
SNMP: Improve cli output
authorVojtech Vilimek <vojtech.vilimek@nic.cz>
Thu, 15 Aug 2024 10:07:10 +0000 (12:07 +0200)
committerVojtech Vilimek <vojtech.vilimek@nic.cz>
Thu, 15 Aug 2024 10:07:10 +0000 (12:07 +0200)
proto/snmp/bgp4_mib.c

index 3f9fce29a1d606c7cc4081a6328bf5232f563015..5f4c703df35a5ef834902e4a6a8149f403dda411 100644 (file)
@@ -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, "        <no peers available>");
+  }
+
   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;
 }