From 730f2e2c8c29b3461caa096fa514cbf71f84e51b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 1 Dec 1999 15:10:21 +0000 Subject: Added dumping of routing tables (`show route'). This includes filtering. --- nest/rt-attr.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nest/rt-attr.c') diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 2c50f4d..04dcf51 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -13,6 +13,7 @@ #include "nest/route.h" #include "nest/protocol.h" #include "nest/iface.h" +#include "nest/cli.h" #include "lib/resource.h" /* @@ -347,12 +348,11 @@ rta_dump(rta *a) "RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP", "RTS_RIP_EXT", "RTS_OSPF", "RTS_OSPF_EXT", "RTS_OSPF_IA", "RTS_OSPF_BOUNDARY", "RTS_BGP" }; - static char *sco[] = { "HOST", "LINK", "SITE", "UNIV" }; static char *rtc[] = { "", " BC", " MC", " AC" }; static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" }; debug("p=%s uc=%d %s %s%s%s", - a->proto->name, a->uc, rts[a->source], sco[a->scope], rtc[a->cast], + a->proto->name, a->uc, rts[a->source], ip_scope_text(a->scope), rtc[a->cast], rtd[a->dest]); if (a->flags & RTF_EXTERIOR) debug(" EXT"); @@ -387,6 +387,18 @@ rta_dump_all(void) debug("\n"); } +void +rta_show(struct cli *c, rta *a) +{ + static char *src_names[] = { "dummy", "static", "inherit", "device", "static-device", "redirect", + "RIP", "RIP-ext", "OSPF", "OSPF-ext", "OSPF-IA", "OSPF-boundary", + "BGP" }; + static char *cast_names[] = { "unicast", "broadcast", "multicast", "anycast" }; + + cli_printf(c, -1008, "\tType: %s %s %s", src_names[a->source], cast_names[a->cast], ip_scope_text(a->scope)); + /* FIXME: Here we probably should print the dynamic attributes... */ +} + void rta_init(void) { -- cgit v1.2.3