summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;