summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-07-20 15:04:51 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-07-20 15:04:51 +0000
commitf786e0e3662574da3990229c780653e6b2efc23a (patch)
treeef8046133bc0b6f286921aa29e66dea861ca96af /usr.sbin
parent7b4a6451f38153833bb1bf7ea19900410574cc1e (diff)
Try to show a more usable nexthop output. It may still change but at least
it is better than what we had till now and syncs up with the last bgpd change.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index b11a072ff4a..5ea6b7a3678 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.142 2009/06/06 06:33:15 eric Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.143 2009/07/20 15:04:50 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -848,7 +848,8 @@ show_fib_msg(struct imsg *imsg)
void
show_nexthop_head(void)
{
- printf("%-20s %-10s\n", "Nexthop", "State");
+ printf("%-20s %-20s %-10s %-10s %s\n", "Nexthop", "Gateway", "State",
+ "Interface", "Link State");
}
int
@@ -860,23 +861,21 @@ show_nexthop_msg(struct imsg *imsg)
switch (imsg->hdr.type) {
case IMSG_CTL_SHOW_NEXTHOP:
p = imsg->data;
- printf("%-20s %-10s", log_addr(&p->addr),
+ printf("%-20s ", log_addr(&p->addr));
+ printf("%-20s %-10s ",
+ p->connected ? "connected" : log_addr(&p->gateway),
p->valid ? "valid" : "invalid");
if (p->kif.ifname[0]) {
- printf("%-8s", p->kif.ifname);
+ printf("%-10s ", p->kif.ifname);
if (p->kif.flags & IFF_UP) {
- printf("UP");
ifms_type = ift2ifm(p->kif.media_type);
- if (ifms_type != 0)
- printf(", %s, %s",
- get_media_descr(ifms_type),
- get_linkstate(ifms_type,
+ if (ifms_type)
+ printf("%s", get_linkstate(ifms_type,
p->kif.link_state));
- if (p->kif.baudrate) {
- printf(", ");
- print_baudrate(p->kif.baudrate);
- }
- }
+ else
+ printf("up, unknown");
+ } else
+ printf("admin down");
}
printf("\n");
break;