diff --git a/core/net/rpl/Makefile.rpl b/core/net/rpl/Makefile.rpl index 68f67f2bc..88d5c4775 100644 --- a/core/net/rpl/Makefile.rpl +++ b/core/net/rpl/Makefile.rpl @@ -1,2 +1,2 @@ CONTIKI_SOURCEFILES += rpl.c rpl-dag.c rpl-icmp6.c rpl-timers.c \ - rpl-of-etx.c + rpl-of-etx.c rpl-ext-header.c diff --git a/core/net/rpl/rpl-dag.c b/core/net/rpl/rpl-dag.c old mode 100644 new mode 100755 index 7a96887cc..0310c1727 --- a/core/net/rpl/rpl-dag.c +++ b/core/net/rpl/rpl-dag.c @@ -567,7 +567,6 @@ rpl_select_dodag(rpl_instance_t * instance, rpl_parent_t *p) return NULL; } -<<<<<<< HEAD if(instance->current_dag != best_dag) { /* Remove routes installed by DAOs. */ rpl_remove_routes(instance->current_dag); @@ -758,7 +757,7 @@ rpl_get_dodag(uint8_t instance_id, uip_ipaddr_t *dag_id) for(i = 0; i < RPL_MAX_DODAG_PER_INSTANCE; ++i) { dag = &instance->dag_table[i]; - if(dag->used && !uip_ipaddr_cmp(dag->dag_id, dag_id)) { + if(dag->used && !uip_ipaddr_cmp(&dag->dag_id, dag_id)) { return dag; } } diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c old mode 100644 new mode 100755 index fe496c928..2dcc33f8b --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -82,6 +82,16 @@ void RPL_DEBUG_DAO_OUTPUT(rpl_parent_t *); #endif static uint8_t dao_sequence = RPL_LOLLIPOP_INIT; + +/* 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 int get_global_addr(uip_ipaddr_t *addr) @@ -407,6 +417,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) buffer = UIP_ICMP_PAYLOAD; buffer[pos++] = instance->instance_id; buffer[pos++] = dag->version; + #if RPL_LEAF_ONLY set16(buffer, pos, INFINITE_RANK); #else /* RPL_LEAF_ONLY */ @@ -460,6 +471,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) return; } } +#endif /* !RPL_LEAF_ONLY */ /* Always add a DAG configuration option. */ buffer[pos++] = RPL_OPTION_DAG_CONF; diff --git a/core/net/rpl/rpl.h b/core/net/rpl/rpl.h index 4132d429c..9dcfba586 100644 --- a/core/net/rpl/rpl.h +++ b/core/net/rpl/rpl.h @@ -335,13 +335,13 @@ struct rpl_instance { /* Public RPL functions. */ void rpl_init(void); rpl_dag_t *rpl_set_root(uint8_t instance_id, uip_ipaddr_t * dag_id); -int rpl_set_prefix(rpl_dag_t *dag, uip_ipaddr_t *prefix, int len); +int rpl_set_prefix(rpl_dag_t *dag, uip_ipaddr_t *prefix, unsigned len); int rpl_repair_root(uint8_t instance_id); int rpl_set_default_route(rpl_instance_t *instance, uip_ipaddr_t *from); rpl_dag_t *rpl_get_any_dag(void); -rpl_dag_t *rpl_get_dodag(uint8_t instance_id,uip_ipaddr_t * dag_id); +rpl_dag_t *rpl_get_dodag(uint8_t instance_id, uip_ipaddr_t *dag_id); rpl_instance_t *rpl_get_instance(uint8_t instance_id); -int rpl_add_header(rpl_instance_t *instance,int down); +int rpl_add_header(rpl_instance_t *instance, int down); int rpl_add_header_root(void); void rpl_remove_header(void); u8_t rpl_invert_header(void); diff --git a/examples/ipv6/rpl-udp/Makefile b/examples/ipv6/rpl-udp/Makefile index 6c7e2cb7a..e4ea78e28 100644 --- a/examples/ipv6/rpl-udp/Makefile +++ b/examples/ipv6/rpl-udp/Makefile @@ -4,6 +4,7 @@ CONTIKI=../../.. WITH_UIP6=1 UIP_CONF_IPV6=1 + CFLAGS+= -DUIP_CONF_IPV6_RPL ifdef WITH_COMPOWER