aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>2018-08-16 11:40:40 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-08-22 17:59:19 +0300
commit3e8d0eeb61b49034d0c13c2e675b8cd8eb77a4b4 (patch)
tree4e7bb0e6e808755041d5f8c74151bff1201fa3a2 /helper
parent663dcce721a2f4502644adc7140dc945c7e7f333 (diff)
helper: add SCTP protocol header
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r--helper/Makefile.am1
-rw-r--r--helper/include/odp/helper/ip.h2
-rw-r--r--helper/include/odp/helper/odph_api.h1
-rw-r--r--helper/include/odp/helper/sctp.h49
4 files changed, 53 insertions, 0 deletions
diff --git a/helper/Makefile.am b/helper/Makefile.am
index d1b0359cc..518a6a944 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -22,6 +22,7 @@ helperinclude_HEADERS = \
include/odp/helper/odph_hashtable.h\
include/odp/helper/odph_iplookuptable.h\
include/odp/helper/odph_lineartable.h\
+ include/odp/helper/sctp.h \
include/odp/helper/strong_types.h\
include/odp/helper/tcp.h\
include/odp/helper/table.h\
diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h
index cdc430627..b5bfed78c 100644
--- a/helper/include/odp/helper/ip.h
+++ b/helper/include/odp/helper/ip.h
@@ -259,6 +259,8 @@ typedef struct ODP_PACKED {
#define ODPH_IPPROTO_AH 0x33 /**< Authentication Header (51) */
#define ODPH_IPPROTO_ESP 0x32 /**< Encapsulating Security Payload (50) */
#define ODPH_IPPROTO_ICMPV6 0x3A /**< Internet Control Message Protocol (58) */
+#define ODPH_IPPROTO_SCTP 0x84 /**< Stream Control Transmission protocol
+ (132) */
#define ODPH_IPPROTO_INVALID 0xFF /**< Reserved invalid by IANA */
/**@}*/
diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h
index 8ad8a27fe..d46ab2ad2 100644
--- a/helper/include/odp/helper/odph_api.h
+++ b/helper/include/odp/helper/odph_api.h
@@ -27,6 +27,7 @@ extern "C" {
#include <odp/helper/ipsec.h>
#include <odp/helper/odph_lineartable.h>
#include <odp/helper/odph_iplookuptable.h>
+#include <odp/helper/sctp.h>
#include <odp/helper/strong_types.h>
#include <odp/helper/tcp.h>
#include <odp/helper/table.h>
diff --git a/helper/include/odp/helper/sctp.h b/helper/include/odp/helper/sctp.h
new file mode 100644
index 000000000..c81bd6313
--- /dev/null
+++ b/helper/include/odp/helper/sctp.h
@@ -0,0 +1,49 @@
+/* Copyright (c) 2014-2018, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP SCTP header
+ */
+
+#ifndef ODPH_SCTP_H_
+#define ODPH_SCTP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp_api.h>
+
+/** @addtogroup odph_header ODPH HEADER
+ * @{
+ */
+
+/** SCTP header length */
+#define ODPH_SCTPHDR_LEN 12
+
+/** SCTP header */
+typedef struct ODP_PACKED {
+ odp_u16be_t src_port; /**< Source port */
+ odp_u16be_t dst_port; /**< Destination port */
+ odp_u32be_t tag; /**< Verification tag */
+ odp_u32be_t chksum; /**< SCTP header and data checksum */
+} odph_sctphdr_t;
+
+/** @internal Compile time assert */
+ODP_STATIC_ASSERT(sizeof(odph_sctphdr_t) == ODPH_SCTPHDR_LEN,
+ "ODPH_SCTPHDR_T__SIZE_ERROR");
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif