1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net: IPv6: RPL: more debug output

This commit is contained in:
Oleg Hahm 2014-03-16 20:51:29 +01:00
parent e165a08606
commit fe788838ef
3 changed files with 9 additions and 0 deletions

View File

@ -1521,6 +1521,7 @@ int ndp_addr_is_on_link(ipv6_addr_t *dest_addr)
int if_id = -1;
if ((nce = ndp_neighbor_cache_search(dest_addr))) {
DEBUG("INFO: %s is in nbr cache\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, dest_addr));
return 1;
}

View File

@ -105,6 +105,7 @@ int ipv6_send_packet(ipv6_hdr_t *packet)
return -1;
}
DEBUG("Trying to find the next hop for %s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &packet->destaddr));
ipv6_addr_t *dest = ip_get_next_hop(&packet->destaddr);
if (dest == NULL) {
@ -402,11 +403,13 @@ void ipv6_process(void)
}
default:
DEBUG("INFO: Unknown next header\n");
break;
}
}
/* destination is foreign address */
else {
DEBUG("That's not for me, destination is %s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &ipv6_buf->destaddr));
packet_length = IPV6_HDR_LEN + NTOHS(ipv6_buf->length);
ndp_neighbor_cache_t *nce;

View File

@ -988,8 +988,13 @@ void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_
ipv6_addr_t *rpl_get_next_hop(ipv6_addr_t *addr)
{
DEBUG("%s, %d: looking up the next hop to %s\n", __FILE__, __LINE__, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, addr));
for (uint8_t i = 0; i < RPL_MAX_ROUTING_ENTRIES; i++) {
if (routing_table[i].used) {
DEBUG("%s, %d: checking %d: %s\n", __FILE__, __LINE__, i, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &routing_table[i].address));
}
if (routing_table[i].used && rpl_equal_id(&routing_table[i].address, addr)) {
DEBUG("%s, %d: found %d: %s\n", __FILE__, __LINE__, i, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN, &routing_table[i].next_hop));
return &routing_table[i].next_hop;
}
}