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. --- proto/rip/rip.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'proto') 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 -- cgit v1.2.3