aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorKiran Kumar K <kirankumark@marvell.com>2020-10-05 08:17:27 +0530
committerPetri Savolainen <petri.savolainen@nokia.com>2020-12-21 12:42:26 +0200
commitc86a4edb62eb7695a99f9e4c0f0cf0334957d229 (patch)
tree44a115eedf15fb1881a008cdb857bb45535278e8 /helper
parent08f4f1aa63f1aa1d97f1aa44cb2d6662a1d7e8a5 (diff)
helper: add odph_gtp header description
Adds GTP header description struct odph_gtphdr_t in helper directory. This structure is used for accessing GTPU header information from the packet. Signed-off-by: Kiran Kumar K <kirankumark@marvell.com> Signed-off-by: Satheesh Paul <psatheesh@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r--helper/Makefile.am1
-rw-r--r--helper/include/odp/helper/gtp.h38
-rw-r--r--helper/include/odp/helper/odph_api.h1
3 files changed, 40 insertions, 0 deletions
diff --git a/helper/Makefile.am b/helper/Makefile.am
index aa645cc8e..858ad9b9d 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -15,6 +15,7 @@ helperinclude_HEADERS = \
include/odp/helper/chksum.h\
include/odp/helper/odph_debug.h \
include/odp/helper/eth.h\
+ include/odp/helper/gtp.h\
include/odp/helper/icmp.h\
include/odp/helper/ip.h\
include/odp/helper/ipsec.h\
diff --git a/helper/include/odp/helper/gtp.h b/helper/include/odp/helper/gtp.h
new file mode 100644
index 000000000..d542dc6b3
--- /dev/null
+++ b/helper/include/odp/helper/gtp.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2020 Marvell.
+ */
+/**
+ * @file
+ *
+ * ODP GTP header
+ */
+#ifndef _ODPH_GTP_H_
+#define _ODPH_GTP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp_api.h>
+
+/**
+ * Simplified GTP protocol header.
+ * Contains 8-bit gtp_hdr_info, 8-bit msg_type,
+ * 16-bit plen, 32-bit teid.
+ * No optional fields and next extension header.
+ */
+typedef struct ODP_PACKED {
+ uint8_t gtp_hdr_info; /**< GTP header info */
+ uint8_t msg_type; /**< GTP message type */
+ odp_u16be_t plen; /**< Total payload length */
+ odp_u32be_t teid; /**< Tunnel endpoint ID */
+} odph_gtphdr_t;
+
+/** GTP header length */
+#define ODP_GTP_HLEN sizeof(odph_gtphdr_t)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ODP_GTP_H_ */
diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h
index 921914aa2..8e0bf8eb3 100644
--- a/helper/include/odp/helper/odph_api.h
+++ b/helper/include/odp/helper/odph_api.h
@@ -22,6 +22,7 @@ extern "C" {
#include <odp/helper/chksum.h>
#include <odp/helper/odph_cuckootable.h>
#include <odp/helper/eth.h>
+#include <odp/helper/gtp.h>
#include <odp/helper/odph_hashtable.h>
#include <odp/helper/icmp.h>
#include <odp/helper/ip.h>