2015-06-04 16:37:59 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2018-06-01 13:19:39 +02:00
|
|
|
* @ingroup net_udp
|
2015-06-04 16:37:59 +02:00
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Generic module to dump packages received via netapi to STDOUT
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-07-06 18:06:38 +02:00
|
|
|
#include <inttypes.h>
|
2015-06-04 16:37:59 +02:00
|
|
|
|
2015-08-10 03:16:53 +02:00
|
|
|
#include "net/udp.h"
|
2015-06-04 16:37:59 +02:00
|
|
|
|
2015-08-10 03:16:53 +02:00
|
|
|
void udp_hdr_print(udp_hdr_t *hdr)
|
2015-06-04 16:37:59 +02:00
|
|
|
{
|
|
|
|
printf(" src-port: %5" PRIu16 " dst-port: %5" PRIu16 "\n",
|
|
|
|
byteorder_ntohs(hdr->src_port), byteorder_ntohs(hdr->dst_port));
|
2017-02-07 10:08:00 +01:00
|
|
|
printf(" length: %" PRIu16 " cksum: 0x%04" PRIx16 "\n",
|
2015-06-04 16:37:59 +02:00
|
|
|
byteorder_ntohs(hdr->length), byteorder_ntohs(hdr->checksum));
|
|
|
|
}
|