From 2a94b3ce820eda73c0f9c6ea611355d8c70d4d62 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Thu, 27 Oct 2011 12:32:16 +0200 Subject: [PATCH] added debug callbacks --- core/net/rpl/rpl-icmp6.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c index 72393bff4..3c3a660ca 100644 --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -72,6 +72,16 @@ static void dio_input(void); static void dao_input(void); static void dao_ack_input(void); +/* some debug callbacks useful when debugging RPL networks */ +#ifdef RPL_DEBUG_DIO_INPUT +void RPL_DEBUG_DIO_INPUT(uip_ipaddr_t *, rpl_dio_t *); +#endif + +#ifdef RPL_DEBUG_DAO_OUTPUT +void RPL_DEBUG_DAO_OUTPUT(rpl_parent_t *); +#endif + + static uint8_t dao_sequence; /*---------------------------------------------------------------------------*/ static int @@ -357,6 +367,10 @@ dio_input(void) } } +#ifdef RPL_DEBUG_DIO_INPUT + RPL_DEBUG_DIO_INPUT(&from, &dio); +#endif + rpl_process_dio(&from, &dio); } /*---------------------------------------------------------------------------*/ @@ -647,6 +661,10 @@ dao_output(rpl_parent_t *n, rpl_lifetime_t lifetime) dag = n->dag; } +#ifdef RPL_DEBUG_DAO_OUTPUT + RPL_DEBUG_DAO_OUTPUT(n); +#endif + buffer = UIP_ICMP_PAYLOAD; ++dao_sequence;