From e41f28818352fca378f42f262ae9b466e4a970eb Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Thu, 22 Jan 2004 03:09:30 +0000 Subject: 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... --- usr.sbin/bgpctl/bgpctl.c | 10 ++++++---- 1 file 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 @@ -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; -- cgit v1.2.3