From ce1da96ee7efc9310f138e4234495557cdef59e2 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 6 May 2000 22:57:39 +0000 Subject: Added commands `show route protocol

' and `show route import

' which show the routing table as exported to the protocol given resp. as returned from its import control hook. To get handling of filtered extended attributes right (even in the old `show route where ' command), the get_route_info hook gets an attribute list and all protocol specific rte attributes are contained there as temporary ones. Updated RIP to do that. Added ea_append() which joins two ea_list's. --- nest/rt-attr.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'nest/rt-attr.c') diff --git a/nest/rt-attr.c b/nest/rt-attr.c index fd0da97..38decb5 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -380,6 +380,20 @@ ea_hash(ea_list *e) return h; } +ea_list * +ea_append(ea_list *to, ea_list *what) +{ + ea_list *res; + + if (!to) + return what; + res = to; + while (to->next) + to = to->next; + to->next = what; + return res; +} + /* * rta's */ @@ -551,18 +565,19 @@ rta_dump_all(void) } void -rta_show(struct cli *c, rta *a) +rta_show(struct cli *c, rta *a, ea_list *eal) { 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" }; - ea_list *eal; int i; byte buf[EA_FORMAT_BUF_SIZE]; cli_printf(c, -1008, "\tType: %s %s %s", src_names[a->source], cast_names[a->cast], ip_scope_text(a->scope)); - for(eal=a->eattrs; eal; eal=eal->next) + if (!eal) + eal = a->eattrs; + for(; eal; eal=eal->next) for(i=0; icount; i++) { ea_format(&eal->attrs[i], buf); -- cgit v1.2.3