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

Merge pull request #349 from OlegHahm/network_debug

Network debug
This commit is contained in:
Martin Lenders 2013-11-20 12:49:36 -08:00
commit 6ad5b4fb80
4 changed files with 15 additions and 14 deletions

View File

@ -433,8 +433,6 @@ void send_DAO(ipv6_addr_t *destination, uint8_t lifetime, bool default_lifetime,
void send_DAO_ACK(ipv6_addr_t *destination)
{
char addr_str[IPV6_MAX_ADDR_STR_LEN];
printf("%s\n", ipv6_addr_to_str(addr_str, destination));
rpl_dodag_t *my_dodag;
my_dodag = rpl_get_my_dodag();
@ -462,7 +460,6 @@ void send_DAO_ACK(ipv6_addr_t *destination)
void rpl_process(void)
{
msg_t m_recv;
msg_init_queue(msg_queue, RPL_PKT_RECV_BUF_SIZE);
@ -645,9 +642,7 @@ void recv_rpl_dio(void)
}
if (rpl_dio_buf->rank != INFINITE_RANK) {
char addr_str[IPV6_MAX_ADDR_STR_LEN];
DEBUG("Will join DODAG\n");
printf("%s", ipv6_addr_to_str(addr_str, &dio_dodag.dodag_id));
rpl_join_dodag(&dio_dodag, &ipv6_buf->srcaddr, rpl_dio_buf->rank);
}
else {

View File

@ -34,6 +34,9 @@
#include "destiny/socket.h"
#include "net_help.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
#define IP_PKT_RECV_BUF_SIZE (64)
#define LLHDR_IPV6HDR_LEN (LL_HDR_LEN + IPV6_HDR_LEN)
@ -161,21 +164,21 @@ int icmpv6_demultiplex(const icmpv6_hdr_t *hdr)
{
switch (hdr->type) {
case (ICMPV6_TYPE_ECHO_REQUEST): {
puts("INFO: packet type: icmp echo request");
DEBUG("INFO: packet type: icmp echo request\n");
/* processing echo request */
recv_echo_req();
break;
}
case (ICMPV6_TYPE_ECHO_REPLY): {
puts("INFO: packet type: icmp echo reply");
DEBUG("INFO: packet type: icmp echo reply\n");
/* processing echo reply */
recv_echo_repl();
break;
}
case (ICMPV6_TYPE_ROUTER_SOL): {
puts("INFO: packet type: icmp router solicitation");
DEBUG("INFO: packet type: icmp router solicitation\n");
/* processing router solicitation */
recv_rtr_sol();
/* init solicited router advertisment*/
@ -183,7 +186,7 @@ int icmpv6_demultiplex(const icmpv6_hdr_t *hdr)
}
case (ICMPV6_TYPE_ROUTER_ADV): {
puts("INFO: packet type: icmp router advertisment");
DEBUG("INFO: packet type: icmp router advertisment\n");
/* processing router advertisment */
recv_rtr_adv();
/* init neighbor solicitation */
@ -191,19 +194,19 @@ int icmpv6_demultiplex(const icmpv6_hdr_t *hdr)
}
case (ICMPV6_TYPE_NEIGHBOR_SOL): {
puts("INFO: packet type: icmp neighbor solicitation");
DEBUG("INFO: packet type: icmp neighbor solicitation\n");
recv_nbr_sol();
break;
}
case (ICMPV6_TYPE_NEIGHBOR_ADV): {
puts("INFO: packet type: icmp neighbor advertisment");
DEBUG("INFO: packet type: icmp neighbor advertisment\n");
recv_nbr_adv();
break;
}
case (ICMPV6_TYPE_RPL_CONTROL): {
puts("INFO: packet type: RPL message");
DEBUG("INFO: packet type: RPL message\n");
if (rpl_process_pid != 0) {
msg_t m_send;
@ -211,7 +214,7 @@ int icmpv6_demultiplex(const icmpv6_hdr_t *hdr)
msg_send(&m_send, rpl_process_pid, 1);
}
else {
puts("INFO: no RPL handler registered");
DEBUG("INFO: no RPL handler registered\n");
}
break;

View File

@ -18,6 +18,7 @@
* @}
*/
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ -179,6 +180,8 @@ void sixlowpan_lowpan_sendto(const ieee_802154_long_t *dest,
}
/* check if packet needs to be fragmented */
DEBUG("sixlowpan_lowpan_sendto(%s, data, %"PRIu16"): packet_length: %"PRIu16", header_size: %"PRIu16"\n",
sixlowpan_mac_802154_long_addr_to_str(addr_str, dest), data_len, packet_length, header_size);
if (packet_length + header_size > PAYLOAD_SIZE - IEEE_802154_MAX_HDR_LEN) {
uint8_t fragbuf[packet_length + header_size];
uint8_t remaining;

View File

@ -589,10 +589,10 @@ static uint8_t send_packet(transceiver_type_t t, void *pkt)
at86rf231_packet_t at86rf231_pkt;
#endif
DEBUG("transceiver: Send packet to %" PRIu16 "\n", p.dst);
switch (t) {
case TRANSCEIVER_CC1100:
#ifdef MODULE_CC110X_NG
DEBUG("transceiver: Send packet to %" PRIu16 "\n", p.dst);
cc110x_pkt.length = p.length + CC1100_HEADER_LENGTH;
cc110x_pkt.address = p.dst;
cc110x_pkt.flags = 0;