Make uip-ds6-route use neighbor table. Instead of storing a global list of routing entries that contain both the next hop and the destination, we have a separate list of reachable destination for each neighbor in the global table.

This commit is contained in:
Simon Duquennoy 2013-07-03 19:45:56 +02:00
parent ec609b49eb
commit 09d26f8060
5 changed files with 167 additions and 89 deletions

View file

@ -243,6 +243,13 @@ dio_input(void)
PRINTF(", ");
PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER));
PRINTF("\n");
} else {
PRINTF("RPL: Out of Memory, dropping DIO from ");
PRINT6ADDR(&from);
PRINTF(", ");
PRINTLLADDR((uip_lladdr_t *)packetbuf_addr(PACKETBUF_ADDR_SENDER));
PRINTF("\n");
return;
}
} else {
PRINTF("RPL: Neighbor already in neighbor cache\n");
@ -657,11 +664,11 @@ dao_input(void)
if(lifetime == RPL_ZERO_LIFETIME) {
/* No-Path DAO received; invoke the route purging routine. */
if(rep != NULL && rep->state.saved_lifetime == 0 && rep->length == prefixlen && uip_ipaddr_cmp(&rep->nexthop, &dao_sender_addr)) {
if(rep != NULL && rep->state.nopath_received == 0 && rep->length == prefixlen && uip_ipaddr_cmp(&rep->nexthop, &dao_sender_addr)) {
PRINTF("RPL: Setting expiration timer for prefix ");
PRINT6ADDR(&prefix);
PRINTF("\n");
rep->state.saved_lifetime = rep->state.lifetime;
rep->state.nopath_received = 1;
rep->state.lifetime = DAO_EXPIRATION_TIMEOUT;
}
return;