summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-01-22 03:09:30 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-01-22 03:09:30 +0000
commite41f28818352fca378f42f262ae9b466e4a970eb (patch)
treeac0b2f6bdf8c26799e7e5cdb6a32649ce4b4c3d2
parent33cf526aaf12858b64ef09f6faa8ea0dfb656d3f (diff)
print the interface state wrt the nexthop verification in the show interface
output. makes quite some sense so that not every reader has to know the algorithm for deciding on the interface state...
-rw-r--r--usr.sbin/bgpctl/bgpctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index 5bea9cd2718..7fa5b744145 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.34 2004/01/21 23:47:35 henning Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.35 2004/01/22 03:09:29 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -494,7 +494,8 @@ show_nexthop_msg(struct imsg *imsg)
void
show_interface_head(void)
{
- printf("%-20s%-20s%-20s\n", "Interface", "Flags", "Link state");
+ printf("%-15s%-15s%-15s%s\n", "Interface", "Nexthop state", "Flags",
+ "Link state");
}
const int ifm_status_valid_list[] = IFM_STATUS_VALID_LIST;
@@ -558,8 +559,9 @@ show_interface_msg(struct imsg *imsg)
switch (imsg->hdr.type) {
case IMSG_CTL_SHOW_INTERFACE:
k = imsg->data;
- printf("%-20s", k->ifname);
- printf("%-20s", k->flags & IFF_UP ? "UP" : "");
+ printf("%-15s", k->ifname);
+ printf("%-15s", k->nh_reachable ? "ok" : "invalid");
+ printf("%-15s", k->flags & IFF_UP ? "UP" : "");
switch (k->media_type) {
case IFT_ETHER:
ifms_type = IFM_ETHER;