summaryrefslogtreecommitdiffstats
path: root/proto
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 /proto
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 'proto')
-rw-r--r--proto/rip/rip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 022d499..b3546ae 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -535,10 +535,14 @@ rip_dump(struct proto *p)
}
static void
-rip_get_route_info(rte *rte, byte *buf)
+rip_get_route_info(rte *rte, byte *buf, ea_list *attrs)
{
- buf += bsprintf(buf, " (%d/%d)", rte->pref, rte->u.rip.metric );
- bsprintf(buf, " t%04x", rte->u.rip.tag );
+ eattr *metric = ea_find(attrs, EA_RIP_METRIC);
+ eattr *tag = ea_find(attrs, EA_RIP_TAG);
+
+ buf += bsprintf(buf, " (%d/%d)", rte->pref, metric ? metric->u.data : 0);
+ if (tag && tag->u.data)
+ bsprintf(buf, " t%04x", tag->u.data);
}
static int