summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfctl/ospfctl.c
diff options
context:
space:
mode:
authorEsben Norby <norby@cvs.openbsd.org>2006-02-24 21:06:48 +0000
committerEsben Norby <norby@cvs.openbsd.org>2006-02-24 21:06:48 +0000
commitcbb1a89d3a75b8775d6341047df5cd124e5b84fd (patch)
tree32e6a4abdc182edd522381ed9b423e4e42f0caf6 /usr.sbin/ospfctl/ospfctl.c
parent0463f85022ae32bb12975684527e4ec1943ff6f9 (diff)
Keep track of the uptime of the entries in the RIB.
It is now possible to see the uptime of the individual entries in the RIB. The uptime can be displayed with "ospfctl show rib" ok claudio@
Diffstat (limited to 'usr.sbin/ospfctl/ospfctl.c')
-rw-r--r--usr.sbin/ospfctl/ospfctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c
index e7fbc7b827c..5a6f1553a0e 100644
--- a/usr.sbin/ospfctl/ospfctl.c
+++ b/usr.sbin/ospfctl/ospfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfctl.c,v 1.24 2006/02/19 21:48:56 norby Exp $ */
+/* $OpenBSD: ospfctl.c,v 1.25 2006/02/24 21:06:46 norby Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -166,8 +166,8 @@ main(int argc, char *argv[])
imsg_compose(ibuf, IMSG_CTL_SHOW_DB_ASBR, 0, 0, NULL, 0);
break;
case SHOW_RIB:
- printf("%-20s %-17s %-12s %-9s %-7s\n", "Destination",
- "Nexthop", "Path Type", "Type", "Cost");
+ printf("%-20s %-17s %-12s %-9s %-7s %-8s\n", "Destination",
+ "Nexthop", "Path Type", "Type", "Cost", "Uptime");
case SHOW_RIB_DTAIL:
imsg_compose(ibuf, IMSG_CTL_SHOW_RIB, 0, 0, NULL, 0);
break;
@@ -932,9 +932,10 @@ show_rib_msg(struct imsg *imsg)
errx(1, "Invalid route type");
}
- printf("%-20s %-17s %-12s %-9s %-7d\n", dstnet,
+ printf("%-20s %-17s %-12s %-9s %-7d %s\n", dstnet,
inet_ntoa(rt->nexthop), path_type_names[rt->p_type],
- dst_type_names[rt->d_type], rt->cost);
+ dst_type_names[rt->d_type], rt->cost,
+ rt->uptime == 0 ? "-" : fmt_timeframe_core(rt->uptime));
free(dstnet);
break;
case IMSG_CTL_END: