diff mbox series

[v3,4/11] helper: add SCTP protocol header

Message ID 1534762808-15588-5-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v3,1/11] validation: pktio: check sctp flag in parser tests | expand

Commit Message

Github ODP bot Aug. 20, 2018, 11 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 674 (lumag:sctp-checksum)
 ** https://github.com/Linaro/odp/pull/674
 ** Patch: https://github.com/Linaro/odp/pull/674.patch
 ** Base sha: dc28824415ea510e3ef62e47f7640bf4a8420fde
 ** Merge commit sha: b482f9618a6edb2a2f2491ee5a7af757eab93b24
 **/
 helper/Makefile.am                   |  1 +
 helper/include/odp/helper/ip.h       |  2 ++
 helper/include/odp/helper/odph_api.h |  1 +
 helper/include/odp/helper/sctp.h     | 49 ++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+)
 create mode 100644 helper/include/odp/helper/sctp.h
diff mbox series

Patch

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