2019-06-25 11:12:58 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright 2016 6WIND S.A.
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#ifndef _RTE_GRE_H_
|
|
|
|
#define _RTE_GRE_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <rte_byteorder.h>
|
2017-04-21 10:43:26 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* GRE headers definition.
|
|
|
|
*
|
|
|
|
* Generic Routing Encapsulation (GRE) is a tunneling protocol
|
|
|
|
* that can encapsulate a wide variety of network layer protocols
|
|
|
|
* inside virtual point-to-point links or point-to-multipoint links
|
|
|
|
* over an Internet Protocol network.
|
|
|
|
*/
|
|
|
|
|
2017-04-21 10:43:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
2018-05-15 09:49:22 +00:00
|
|
|
* GRE Header
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
2019-06-25 11:12:58 +00:00
|
|
|
__extension__
|
2020-06-18 16:55:50 +00:00
|
|
|
struct rte_gre_hdr {
|
2018-05-15 09:49:22 +00:00
|
|
|
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
|
|
|
|
uint16_t res2:4; /**< Reserved */
|
|
|
|
uint16_t s:1; /**< Sequence Number Present bit */
|
|
|
|
uint16_t k:1; /**< Key Present bit */
|
|
|
|
uint16_t res1:1; /**< Reserved */
|
|
|
|
uint16_t c:1; /**< Checksum Present bit */
|
|
|
|
uint16_t ver:3; /**< Version Number */
|
|
|
|
uint16_t res3:5; /**< Reserved */
|
|
|
|
#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
|
|
|
|
uint16_t c:1; /**< Checksum Present bit */
|
|
|
|
uint16_t res1:1; /**< Reserved */
|
|
|
|
uint16_t k:1; /**< Key Present bit */
|
|
|
|
uint16_t s:1; /**< Sequence Number Present bit */
|
|
|
|
uint16_t res2:4; /**< Reserved */
|
|
|
|
uint16_t res3:5; /**< Reserved */
|
|
|
|
uint16_t ver:3; /**< Version Number */
|
|
|
|
#endif
|
|
|
|
uint16_t proto; /**< Protocol Type */
|
2021-02-05 08:48:47 +00:00
|
|
|
} __rte_packed;
|
2017-04-21 10:43:26 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#endif /* RTE_GRE_H_ */
|