]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Dumping of _static_ attributes implemented.
authorMartin Mares <mj@ucw.cz>
Thu, 4 Jun 1998 20:29:05 +0000 (20:29 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 4 Jun 1998 20:29:05 +0000 (20:29 +0000)
nest/rt-attr.c

index 5f386a76110b2532cbbd1c96aa56a437e42a53a0..d6a57235a8f98a72491cfbc0bd46ce66dbf5ecf5 100644 (file)
@@ -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