summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl/bgpctl.c
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2016-10-14 09:40:55 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2016-10-14 09:40:55 +0000
commit9e30bda60e0efac04ee0df7198b1bdaf729bf2df (patch)
tree561ee156522b8e3d348cf8c8d01e10d038d05d4b /usr.sbin/bgpctl/bgpctl.c
parentf526f7d8beb77d5de18cc7b5d22afcb07f202d15 (diff)
when looking at the details of a prefix, show any unknown attributes and
what we know about it. OK claudio@
Diffstat (limited to 'usr.sbin/bgpctl/bgpctl.c')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 7f3f42e0a77..b3361c4943b 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.188 2016/06/03 17:36:37 benno Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.189 2016/10/14 09:40:54 phessler Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -1393,6 +1393,7 @@ show_attr(void *b, u_int16_t len)
u_int32_t as;
u_int16_t alen, ioff;
u_int8_t flags, type;
+ int i;
if (len < 3)
errx(1, "show_attr: too short bgp attr");
@@ -1448,8 +1449,29 @@ show_attr(void *b, u_int16_t len)
show_ext_community(data, alen);
printf("\n");
break;
+ case ATTR_ATOMIC_AGGREGATE:
+ /* ignore */
+ break;
default:
/* ignore unknown attributes */
+ printf(" Unknown Attribute #%u", type);
+ if (flags) {
+ printf(" flags [");
+ if (flags & ATTR_OPTIONAL)
+ printf("O");
+ if (flags & ATTR_TRANSITIVE)
+ printf("T");
+ if (flags & ATTR_PARTIAL)
+ printf("P");
+ printf("]");
+ }
+ printf(" len %u", alen);
+ if (alen) {
+ printf(":");
+ for (i=0; i < alen; i++)
+ printf(" %02x", *(data+i) & 0xFF);
+ }
+ printf("\n");
break;
}
}