summaryrefslogtreecommitdiffstats
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-07 00:57:39 +0200
committerMartin Mares <mj@ucw.cz>2000-05-07 00:57:39 +0200
commitce1da96ee7efc9310f138e4234495557cdef59e2 (patch)
treeb8fb1177f83a9941c7a173093a3fa20256b6c9cc /nest/rt-attr.c
parent84f070020500de40e69e6d00df9d41ecc90a3b23 (diff)
downloadbird-ce1da96ee7efc9310f138e4234495557cdef59e2.tar
bird-ce1da96ee7efc9310f138e4234495557cdef59e2.zip
Added commands `show route protocol <p>' and `show route import <p>' 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 <filter>' 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.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c21
1 files changed, 18 insertions, 3 deletions
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; i<eal->count; i++)
{
ea_format(&eal->attrs[i], buf);