doc: add missing network layers in API reference
[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 /**
12  * @file
13  *
14  * GRE headers definition.
15  *
16  * Generic Routing Encapsulation (GRE) is a tunneling protocol that can
17  * encapsulate a wide variety of network layer protocols inside virtual
18  * point-to-point links or point-to-multipoint links over an Internet Protocol
19  * network.
20  */
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * GRE Header
28  */
29 __extension__
30 struct rte_gre_hdr {
31 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
32         uint16_t res2:4; /**< Reserved */
33         uint16_t s:1;    /**< Sequence Number Present bit */
34         uint16_t k:1;    /**< Key Present bit */
35         uint16_t res1:1; /**< Reserved */
36         uint16_t c:1;    /**< Checksum Present bit */
37         uint16_t ver:3;  /**< Version Number */
38         uint16_t res3:5; /**< Reserved */
39 #elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
40         uint16_t c:1;    /**< Checksum Present bit */
41         uint16_t res1:1; /**< Reserved */
42         uint16_t k:1;    /**< Key Present bit */
43         uint16_t s:1;    /**< Sequence Number Present bit */
44         uint16_t res2:4; /**< Reserved */
45         uint16_t res3:5; /**< Reserved */
46         uint16_t ver:3;  /**< Version Number */
47 #endif
48         uint16_t proto;  /**< Protocol Type */
49 } __rte_packed;
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif /* RTE_GRE_H_ */