1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 1982, 1986, 1990, 1993 3 * The Regents of the University of California. 4 * Copyright(c) 2010-2014 Intel Corporation. 5 * All rights reserved. 6 */ 7 8 #ifndef _RTE_GTP_H_ 9 #define _RTE_GTP_H_ 10 11 /** 12 * @file 13 * 14 * GTP-related defines 15 */ 16 17 #include <stdint.h> 18 #include <rte_byteorder.h> 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /** 25 * Simplified GTP protocol header. 26 * Contains 8-bit header info, 8-bit message type, 27 * 16-bit payload length after mandatory header, 32-bit TEID. 28 * No optional fields and next extension header. 29 */ 30 struct rte_gtp_hdr { 31 uint8_t gtp_hdr_info; /**< GTP header info */ 32 uint8_t msg_type; /**< GTP message type */ 33 uint16_t plen; /**< Total payload length */ 34 uint32_t teid; /**< Tunnel endpoint ID */ 35 } __rte_packed; 36 37 /** GTP header length */ 38 #define RTE_ETHER_GTP_HLEN \ 39 (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr)) 40 /* GTP next protocal type */ 41 #define RTE_GTP_TYPE_IPV4 0x40 /**< GTP next protocal type IPv4 */ 42 #define RTE_GTP_TYPE_IPV6 0x60 /**< GTP next protocal type IPv6 */ 43 /* GTP destination port number */ 44 #define RTE_GTPC_UDP_PORT 2123 /**< GTP-C UDP destination port */ 45 #define RTE_GTPU_UDP_PORT 2152 /**< GTP-U UDP destination port */ 46 47 #ifdef __cplusplus 48 } 49 #endif 50 51 #endif /* RTE_GTP_H_ */ 52