]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Categorized TRACE() messages in rip
authorPavel Machek <pavel@ucw.cz>
Thu, 9 Mar 2000 16:38:51 +0000 (16:38 +0000)
committerPavel Machek <pavel@ucw.cz>
Thu, 9 Mar 2000 16:38:51 +0000 (16:38 +0000)
proto/rip/rip.c

index 72f92449f5563cf686a0d751822b33e40e6e595a..9680ccd09b6b98e72769602967dee208c9a6758a 100644 (file)
@@ -46,7 +46,7 @@
 #define P_CF ((struct rip_proto_config *)p->cf)
 #define E ((struct rip_entry *) e)
 
-#define TRACE(msg, args...) do { if (p->debug & 1) { log(L_TRACE "%s: " msg, p->name , ## args); } } while(0)
+#define TRACE(level, msg, args...) do { if (p->debug & level) { log(L_TRACE "%s: " msg, p->name , ## args); } } while(0)
 
 static struct rip_interface *new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_patt *patt);
 
@@ -216,7 +216,7 @@ rip_sendto( struct proto *p, ip_addr daddr, int dport, struct rip_interface *rif
   c->done = 0;
   fit_init( &c->iter, &P->rtable );
   add_head( &P->connections, NODE c );
-  TRACE( "Sending my routing table to %I:%d on %s\n", daddr, dport, rif->iface->name );
+  TRACE(D_PACKETS, "Sending my routing table to %I:%d on %s\n", daddr, dport, rif->iface->name );
 
   rip_tx(c->rif->sock);
 }
@@ -304,7 +304,7 @@ process_block( struct proto *p, struct rip_block *block, ip_addr whotoldme )
   ip_addr network = block->network;
 
   CHK_MAGIC;
-  TRACE( "block: %I tells me: %I/??? available, metric %d... ", whotoldme, network, metric );
+  TRACE(D_ROUTES, "block: %I tells me: %I/??? available, metric %d... ", whotoldme, network, metric );
   if ((!metric) || (metric > P_CF->infinity)) {
     log( L_WARN "Got metric %d from %I", metric, whotoldme );
     return;
@@ -437,12 +437,12 @@ rip_timer(timer *t)
     DBG( "Garbage: " ); rte_dump( rte );
 
     if (now - rte->u.rip.lastmodX > P_CF->timeout_time) {
-      TRACE( "RIP: entry is too old: " ); rte_dump( rte );
+      TRACE(D_EVENTS, "RIP: entry is too old: " ); rte_dump( rte );
       e->metric = P_CF->infinity;
     }
 
     if (now - rte->u.rip.lastmodX > P_CF->garbage_time) {
-      TRACE( "RIP: entry is much too old: " ); rte_dump( rte );
+      TRACE(D_EVENTS, "RIP: entry is much too old: " ); rte_dump( rte );
       rte_discard(p->table, rte);
     }
   }
@@ -604,7 +604,7 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_
        /* Don't try to transmit into this one? Well, why not? This should not happen, anyway :-) */
       }
 
-  TRACE( "RIP/%s: listening on %s, port %d, mode %s (%I)", P_NAME, rif->iface ? rif->iface->name : "(dummy)", P_CF->port, want_multicast ? "multicast" : "broadcast", rif->sock->daddr );
+  TRACE(D_EVENTS, "RIP/%s: listening on %s, port %d, mode %s (%I)", P_NAME, rif->iface ? rif->iface->name : "(dummy)", P_CF->port, want_multicast ? "multicast" : "broadcast", rif->sock->daddr );
   
   return rif;
 }