Continued merge with sf master

This commit is contained in:
Nicolas Tsiftes 2011-11-21 15:09:19 +01:00
parent 0e32956a63
commit 2b1549bfe8
5 changed files with 18 additions and 6 deletions

View file

@ -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

3
core/net/rpl/rpl-dag.c Normal file → Executable file
View file

@ -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;
}
}

12
core/net/rpl/rpl-icmp6.c Normal file → Executable file
View file

@ -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;

View file

@ -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);

View file

@ -4,6 +4,7 @@ CONTIKI=../../..
WITH_UIP6=1
UIP_CONF_IPV6=1
CFLAGS+= -DUIP_CONF_IPV6_RPL
ifdef WITH_COMPOWER