net: add compat headers without rte prefix
[dpdk.git] / lib / librte_net / rte_gre.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2016 6WIND S.A.
3  */
4
5 #ifndef _RTE_GRE_H_
6 #define _RTE_GRE_H_
7
8 #include <stdint.h>
9 #include <rte_byteorder.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #ifndef RTE_NET_NO_COMPAT
16 #include <rte_gre_compat.h>
17 #endif
18
19 /**
20  * GRE Header
21  */
22 struct rte_gre_hdr {
23 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
24         uint16_t res2:4; /**< Reserved */
25         uint16_t s:1;    /**< Sequence Number Present bit */
26         uint16_t k:1;    /**< Key Present bit */
27         uint16_t res1:1; /**< Reserved */
28         uint16_t c:1;    /**< Checksum Present bit */
29         uint16_t ver:3;  /**< Version Number */
30         uint16_t res3:5; /**< Reserved */
31 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
32         uint16_t c:1;    /**< Checksum Present bit */
33         uint16_t res1:1; /**< Reserved */
34         uint16_t k:1;    /**< Key Present bit */
35         uint16_t s:1;    /**< Sequence Number Present bit */
36         uint16_t res2:4; /**< Reserved */
37         uint16_t res3:5; /**< Reserved */
38         uint16_t ver:3;  /**< Version Number */
39 #endif
40         uint16_t proto;  /**< Protocol Type */
41 } __attribute__((__packed__));
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif /* RTE_GRE_H_ */