From 03fdb53af1e69a43d023506e67c1dc48db46fd81 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Wed, 20 Feb 2013 18:25:32 -0500 Subject: [PATCH] Add some debug PRINTFs for RPL_LEAF_ONLY mode. --- core/net/rpl/rpl-icmp6.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c index 049437910..80334591b 100644 --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -158,6 +158,7 @@ dis_input(void) if(instance->used == 1) { #if RPL_LEAF_ONLY if(!uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) { + PRINTF("RPL: LEAF ONLY Multicast DIS will NOT reset DIO timer\n"); #else /* !RPL_LEAF_ONLY */ if(uip_is_addr_mcast(&UIP_IP_BUF->destipaddr)) { PRINTF("RPL: Multicast DIS => reset DIO timer\n"); @@ -415,6 +416,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) /* In leaf mode, we send DIO message only as unicasts in response to unicast DIS messages. */ if(uc_addr == NULL) { + PRINTF("RPL: LEAF ONLY have multicast addr: skip dio_output\n"); return; } #endif /* RPL_LEAF_ONLY */ @@ -427,6 +429,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) buffer[pos++] = dag->version; #if RPL_LEAF_ONLY + PRINTF("RPL: LEAF ONLY DIO rank set to INFINITE_RANK\n"); set16(buffer, pos, INFINITE_RANK); #else /* RPL_LEAF_ONLY */ set16(buffer, pos, dag->rank); @@ -522,6 +525,11 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) } #if RPL_LEAF_ONLY +#if (DEBUG) & DEBUG_PRINT + if(uc_addr == NULL) { + PRINTF("RPL: LEAF ONLY sending unicast-DIO from multicast-DIO\n"); + } +#endif /* DEBUG_PRINT */ PRINTF("RPL: Sending unicast-DIO with rank %u to ", (unsigned)dag->rank); PRINT6ADDR(uc_addr);