diff options
author | Martin Mares <mj@ucw.cz> | 1999-12-01 16:10:21 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-12-01 16:10:21 +0100 |
commit | 730f2e2c8c29b3461caa096fa514cbf71f84e51b (patch) | |
tree | 0a01f3aeb128be3746f67ee9c9adc1c8c62013d7 /nest/rt-attr.c | |
parent | 04a60c689aeb10fafa9919bcff5f8391e0f3a158 (diff) | |
download | bird-730f2e2c8c29b3461caa096fa514cbf71f84e51b.tar bird-730f2e2c8c29b3461caa096fa514cbf71f84e51b.zip |
Added dumping of routing tables (`show route'). This includes filtering.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r-- | nest/rt-attr.c | 16 |
1 files changed, 14 insertions, 2 deletions
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"); @@ -388,6 +388,18 @@ rta_dump_all(void) } 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) { rta_pool = rp_new(&root_pool, "Attributes"); |