added debug callbacks

This commit is contained in:
Joakim Eriksson 2011-10-27 12:32:16 +02:00
parent af4ef9531c
commit 2a94b3ce82

View file

@ -72,6 +72,16 @@ static void dio_input(void);
static void dao_input(void); static void dao_input(void);
static void dao_ack_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 uint8_t dao_sequence;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static int 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); rpl_process_dio(&from, &dio);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -647,6 +661,10 @@ dao_output(rpl_parent_t *n, rpl_lifetime_t lifetime)
dag = n->dag; dag = n->dag;
} }
#ifdef RPL_DEBUG_DAO_OUTPUT
RPL_DEBUG_DAO_OUTPUT(n);
#endif
buffer = UIP_ICMP_PAYLOAD; buffer = UIP_ICMP_PAYLOAD;
++dao_sequence; ++dao_sequence;