2015-04-20 10:54:03 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-07-07 09:47:26 +02:00
|
|
|
#include <inttypes.h>
|
2015-04-20 10:54:03 +02:00
|
|
|
|
2017-11-16 18:06:46 +01:00
|
|
|
#include "net/gnrc/netif.h"
|
2015-08-17 15:41:29 +02:00
|
|
|
#include "net/gnrc/netif/hdr.h"
|
2015-04-20 10:54:03 +02:00
|
|
|
|
2015-08-17 15:41:29 +02:00
|
|
|
void gnrc_netif_hdr_print(gnrc_netif_hdr_t *hdr)
|
2015-04-20 10:54:03 +02:00
|
|
|
{
|
2016-04-10 13:21:14 +02:00
|
|
|
char addr_str[GNRC_NETIF_HDR_L2ADDR_PRINT_LEN];
|
2015-04-20 10:54:03 +02:00
|
|
|
|
2016-10-12 17:30:23 +02:00
|
|
|
printf("if_pid: %u ", (unsigned) hdr->if_pid);
|
2017-08-30 20:57:04 +02:00
|
|
|
printf("rssi: %d ", (signed) hdr->rssi);
|
2016-10-12 17:30:23 +02:00
|
|
|
printf("lqi: %u\n", (unsigned) hdr->lqi);
|
2016-07-04 16:34:04 +02:00
|
|
|
printf("flags: ");
|
|
|
|
|
|
|
|
if (hdr->flags) {
|
|
|
|
if (hdr->flags & GNRC_NETIF_HDR_FLAGS_BROADCAST) {
|
|
|
|
printf("BROADCAST ");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hdr->flags & GNRC_NETIF_HDR_FLAGS_MULTICAST) {
|
|
|
|
printf("MULTICAST ");
|
|
|
|
}
|
|
|
|
puts("");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
puts("0x0");
|
|
|
|
}
|
|
|
|
|
2015-05-08 19:08:21 +02:00
|
|
|
if (hdr->src_l2addr_len > 0) {
|
|
|
|
printf("src_l2addr: %s\n",
|
2017-11-16 18:06:46 +01:00
|
|
|
gnrc_netif_addr_to_str(gnrc_netif_hdr_get_src_addr(hdr),
|
|
|
|
hdr->src_l2addr_len, addr_str));
|
2015-05-08 19:08:21 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
puts("src_l2addr: (nil)");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hdr->dst_l2addr_len > 0) {
|
|
|
|
printf("dst_l2addr: %s\n",
|
2017-11-16 18:06:46 +01:00
|
|
|
gnrc_netif_addr_to_str(gnrc_netif_hdr_get_dst_addr(hdr),
|
|
|
|
hdr->dst_l2addr_len, addr_str));
|
2015-05-08 19:08:21 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
puts("dst_l2addr: (nil)");
|
|
|
|
}
|
2015-04-20 10:54:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/** @} */
|