From 49bc31236eabaa9db4011737e74c8ac2fbd041a7 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 24 Feb 2008 21:02:09 +0000 Subject: [PATCH] Improved debug output --- core/net/uip-over-mesh.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/net/uip-over-mesh.c b/core/net/uip-over-mesh.c index bd1497cfa..e8e3d9175 100644 --- a/core/net/uip-over-mesh.c +++ b/core/net/uip-over-mesh.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uip-over-mesh.c,v 1.6 2008/02/03 20:56:07 adamdunkels Exp $ + * $Id: uip-over-mesh.c,v 1.7 2008/02/24 21:02:09 adamdunkels Exp $ */ /** @@ -52,7 +52,7 @@ static rimeaddr_t queued_receiver; static struct route_discovery_conn route_discovery; static struct uc_conn dataconn; -#define DEBUG 1 +#define DEBUG 0 #if DEBUG #include #define PRINTF(...) printf(__VA_ARGS__) @@ -157,15 +157,19 @@ uip_over_mesh_send(void) receiver.u8[1] = BUF->destipaddr.u8[3]; } else { if(rimeaddr_cmp(&gateway, &rimeaddr_node_addr)) { - PRINTF("I am gateway, should forward over a local interface\n"); + PRINTF("uip_over_mesh_send: I am gateway, packet to %d.%d.%d.%d to local interface\n", + uip_ipaddr_to_quad(&BUF->destipaddr)); if(gw_netif != NULL) { return gw_netif->output(); } return UIP_FW_DROPPED; } else if(rimeaddr_cmp(&gateway, &rimeaddr_null)) { - PRINTF("No gateway setup, dropping packet\n"); + PRINTF("uip_over_mesh_send: No gateway setup, dropping packet\n"); return UIP_FW_OK; } else { + PRINTF("uip_over_mesh_send: forwarding packet to %d.%d.%d.%d towards gateway %d.%d\n", + uip_ipaddr_to_quad(&BUF->destipaddr), + gateway.u8[0], gateway.u8[1]); rimeaddr_copy(&receiver, &gateway); } }