summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-06-04 20:29:05 +0000
committerMartin Mares <mj@ucw.cz>1998-06-04 20:29:05 +0000
commit66e53309acceb0fd7e56faf54e1cc733a5477c67 (patch)
tree5a90063d3dae224946b296be2ffc6fb402167a1f
parentb1e4f81485c15bacfff6040a1295bee31479a875 (diff)
Dumping of _static_ attributes implemented.
-rw-r--r--nest/rt-attr.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 5f386a76..d6a57235 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -11,6 +11,7 @@
#include "nest/bird.h"
#include "nest/route.h"
#include "nest/protocol.h"
+#include "nest/iface.h"
#include "lib/resource.h"
/*
@@ -121,18 +122,48 @@ rta_lookup(rta *o)
}
void
-_rta_free(rta *r)
+_rta_free(rta *a)
{
}
void
-rta_dump(rta *r)
+rta_dump(rta *a)
{
+ static char *rts[] = { "?", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE",
+ "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 TOS=%d",
+ a->proto->name, a->uc, rts[a->source], sco[a->scope], rtc[a->cast],
+ rtd[a->dest], a->tos);
+ if (a->flags & RTF_EXTERIOR)
+ debug(" EXT");
+ if (a->flags & RTF_TAGGED)
+ debug(" TAG");
+ debug(" <-%08x", _I(a->from));
+ if (a->dest == RTD_ROUTER)
+ debug(" ->%08x", _I(a->gw));
+ if (a->dest == RTD_DEVICE || a->dest == RTD_ROUTER)
+ debug(" [%s]", a->iface->name);
}
void
rta_dump_all(void)
{
+ rta *a;
+
+ debug("Route attribute cache:\n");
+ for(a=first_rta; a; a=a->next)
+ {
+ debug("%p ", a);
+ rta_dump(a);
+ debug("\n");
+ }
+ debug("\n");
}
void