RPL: clearer naming and documentation of DAO delay constants

This commit is contained in:
Simon Duquennoy 2015-11-18 14:06:18 +01:00
parent 9bb3a3a235
commit 33f8db0dd3
3 changed files with 15 additions and 11 deletions

View file

@ -729,7 +729,7 @@ dao_input(void)
PRINT6ADDR(&prefix); PRINT6ADDR(&prefix);
PRINTF("\n"); PRINTF("\n");
rep->state.nopath_received = 1; rep->state.nopath_received = 1;
rep->state.lifetime = DAO_EXPIRATION_TIMEOUT; rep->state.lifetime = RPL_NOPATH_REMOVAL_DELAY;
/* We forward the incoming no-path DAO to our parent, if we have /* We forward the incoming no-path DAO to our parent, if we have
one. */ one. */

View file

@ -103,12 +103,19 @@
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Default values for RPL constants and variables. */ /* Default values for RPL constants and variables. */
/* The default value for the DAO timer. */ /* DAO transmissions are always delayed by RPL_DAO_DELAY +/- RPL_DAO_DELAY/2 */
#ifdef RPL_CONF_DAO_LATENCY #ifdef RPL_CONF_DAO_DELAY
#define RPL_DAO_LATENCY RPL_CONF_DAO_LATENCY #define RPL_DAO_DELAY RPL_CONF_DAO_DELAY
#else /* RPL_CONF_DAO_LATENCY */ #else /* RPL_CONF_DAO_DELAY */
#define RPL_DAO_LATENCY (CLOCK_SECOND * 4) #define RPL_DAO_DELAY (CLOCK_SECOND * 4)
#endif /* RPL_DAO_LATENCY */ #endif /* RPL_CONF_DAO_DELAY */
/* Delay between reception of a no-path DAO and actual route removal */
#ifdef RPL_CONF_NOPATH_REMOVAL_DELAY
#define RPL_NOPATH_REMOVAL_DELAY RPL_CONF_NOPATH_REMOVAL_DELAY
#else /* RPL_CONF_NOPATH_REMOVAL_DELAY */
#define RPL_NOPATH_REMOVAL_DELAY 60
#endif /* RPL_CONF_NOPATH_REMOVAL_DELAY */
/* Special value indicating immediate removal. */ /* Special value indicating immediate removal. */
#define RPL_ZERO_LIFETIME 0 #define RPL_ZERO_LIFETIME 0
@ -134,9 +141,6 @@
#define INFINITE_RANK 0xffff #define INFINITE_RANK 0xffff
/* Expire DAOs from neighbors that do not respond in this time. (seconds) */
#define DAO_EXPIRATION_TIMEOUT 60
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define RPL_INSTANCE_LOCAL_FLAG 0x80 #define RPL_INSTANCE_LOCAL_FLAG 0x80
#define RPL_INSTANCE_D_FLAG 0x40 #define RPL_INSTANCE_D_FLAG 0x40

View file

@ -312,7 +312,7 @@ schedule_dao(rpl_instance_t *instance, clock_time_t latency)
void void
rpl_schedule_dao(rpl_instance_t *instance) rpl_schedule_dao(rpl_instance_t *instance)
{ {
schedule_dao(instance, RPL_DAO_LATENCY); schedule_dao(instance, RPL_DAO_DELAY);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void