udp.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef NET_UDP_H
24 #define NET_UDP_H
25 
26 #include "byteorder.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef struct __attribute__((packed)) {
40 } udp_hdr_t;
41 
47 void udp_hdr_print(udp_hdr_t *hdr);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* NET_UDP_H */
54 
udp_hdr_t::length
network_uint16_t length
payload length (including the header)
Definition: udp.h:38
byteorder.h
Functions to work with different byte orders.
be_uint16_t
A 16 bit integer in big endian aka network byte order.
Definition: byteorder.h:77
udp_hdr_t::dst_port
network_uint16_t dst_port
destination port
Definition: udp.h:37
udp_hdr_t
UDP header.
Definition: udp.h:35
udp_hdr_t::src_port
network_uint16_t src_port
source port
Definition: udp.h:36
udp_hdr_t::checksum
network_uint16_t checksum
checksum
Definition: udp.h:39
udp_hdr_print
void udp_hdr_print(udp_hdr_t *hdr)
Print the given UDP header to STDOUT.