summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-13 22:55:02 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-13 22:55:02 +0000
commited0f247a7e10713298528237221fe0bce195c5fb (patch)
treede474df07ab69365cb4802759fc52c53b0f52dd5
parentdc0d3d1fb6747911830f06804c440b25e0a8f1fb (diff)
print the MP capabilities as the neighbor announced in the show neighbor
display, claudio ok
-rw-r--r--usr.sbin/bgpctl/bgpctl.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 522eb6b338e..15646110cae 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.48 2004/03/11 18:56:34 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.49 2004/04/13 22:55:01 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -45,6 +45,7 @@ int main(int, char *[]);
void show_summary_head(void);
int show_summary_msg(struct imsg *);
int show_neighbor_msg(struct imsg *, enum neighbor_views);
+void print_neighbor_capa_mp_safi(u_int8_t);
void print_neighbor_msgstats(struct peer *);
void print_neighbor_timers(struct peer *);
void print_timer(const char *, time_t, u_int);
@@ -303,6 +304,17 @@ show_neighbor_msg(struct imsg *imsg, enum neighbor_views nv)
printf(" Last read %s, holdtime %us, keepalive interval %us\n",
fmt_timeframe(p->stats.last_read),
p->holdtime, p->holdtime/3);
+ if (p->capa.mp_v4 || p->capa.mp_v6) {
+ printf(" Neighbor capabilities:\n");
+ if (p->capa.mp_v4) {
+ printf(" Multiprotocol extensions: IPv4:");
+ print_neighbor_capa_mp_safi(p->capa.mp_v4);
+ }
+ if (p->capa.mp_v6) {
+ printf(" Multiprotocol extensions: IPv6:");
+ print_neighbor_capa_mp_safi(p->capa.mp_v6);
+ }
+ }
printf("\n");
switch (nv) {
case NV_DEFAULT:
@@ -338,6 +350,26 @@ show_neighbor_msg(struct imsg *imsg, enum neighbor_views nv)
}
void
+print_neighbor_capa_mp_safi(u_int8_t safi)
+{
+ switch (safi) {
+ case SAFI_UNICAST:
+ printf(" Unicast");
+ break;
+ case SAFI_MULTICAST:
+ printf(" Multicast");
+ break;
+ case SAFI_BOTH:
+ printf(" Unicast Multicast");
+ break;
+ default:
+ printf(" unknown (%u)", safi);
+ break;
+ }
+ printf("\n");
+}
+
+void
print_neighbor_msgstats(struct peer *p)
{
printf(" Message statistics:\n");