aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/protocols/udp.h
blob: 0eccbd44d7eed01ecf3c91533679baf68e64e11a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2016-2018 Linaro Limited
 */

/**
 * @file
 *
 * ODP UDP header
 */

#ifndef ODP_UDP_H_
#define ODP_UDP_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <odp/api/align.h>
#include <odp/api/byteorder.h>
#include <odp/api/debug.h>

/** @addtogroup odp_header ODP HEADER
 *  @{
 */

/** UDP header length */
#define _ODP_UDPHDR_LEN 8

/** UDP header */
typedef struct ODP_PACKED {
	odp_u16be_t src_port; /**< Source port */
	odp_u16be_t dst_port; /**< Destination port */
	odp_u16be_t length;   /**< UDP datagram length in bytes (header+data) */
	odp_u16be_t chksum;   /**< UDP header and data checksum (0 if not used)*/
} _odp_udphdr_t;

/** @internal Compile time assert */
ODP_STATIC_ASSERT(sizeof(_odp_udphdr_t) == _ODP_UDPHDR_LEN,
		  "_ODP_UDPHDR_T__SIZE_ERROR");

#define _ODP_UDP_IPSEC_PORT 4500

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif