ROHC compression/decompression library
src
common
protocols
udp.h
Go to the documentation of this file.
1
/*
2
* Copyright 2012 Didier Barvaux
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
/**
20
* @file udp.h
21
* @brief Defines the UDP header
22
* @author Didier Barvaux <didier@barvaux.org>
23
*
24
* This file mimics the udphdr struct defined by netinet/udp.h from the GNU C
25
* library. It is defined here to be portable on all platforms, even the
26
* platforms that miss the declarations or got different declarations, such as
27
* Microsoft Windows or FreeBSD. The udphdr struct being trivial, the original
28
* copyrights and licenses are not kept to simplify the library license.
29
*/
30
31
#ifndef ROHC_PROTOCOLS_UDP_H
32
#define ROHC_PROTOCOLS_UDP_H
33
34
#include <stdint.h>
35
36
37
/** The UDP header */
38
struct
udphdr
39
{
40
uint16_t
source
;
/**< The source port of the UDP header */
41
uint16_t
dest
;
/**< The destination port of the UDP header */
42
uint16_t
len
;
/**< The length (in bytes) of the UDP packet (header + payload) */
43
uint16_t
check
;
/**< The checksum over of the UDP header + pseudo IP header */
44
} __attribute__((packed));
45
46
#endif
47
udphdr::len
uint16_t len
Definition:
udp.h:42
udphdr::check
uint16_t check
Definition:
udp.h:43
udphdr
Definition:
udp.h:38
udphdr::dest
uint16_t dest
Definition:
udp.h:41
udphdr::source
uint16_t source
Definition:
udp.h:40
Generated by
1.8.13