diff mbox series

[v6,7/12] linux-gen: add SCTP protocol header

Message ID 1534870807-18456-8-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v6,1/12] validation: pktio: check sctp flag in parser tests | expand

Commit Message

Github ODP bot Aug. 21, 2018, 5 p.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: f6c423a7d29e2c7d6d890cbc098a398d0d7e1288
 ** Merge commit sha: d4f772b36da26684194cb0452a01b8da1ba7e3e1
 **/
 platform/linux-generic/Makefile.am            |  1 +
 .../linux-generic/include/protocols/sctp.h    | 49 +++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 platform/linux-generic/include/protocols/sctp.h
diff mbox series

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 13101cfdc..80f968756 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -142,6 +142,7 @@  noinst_HEADERS = \
 		  include/protocols/eth.h \
 		  include/protocols/ip.h \
 		  include/protocols/ipsec.h \
+		  include/protocols/sctp.h \
 		  include/protocols/tcp.h \
 		  include/protocols/thash.h \
 		  include/protocols/udp.h
diff --git a/platform/linux-generic/include/protocols/sctp.h b/platform/linux-generic/include/protocols/sctp.h
new file mode 100644
index 000000000..dea8a8a6e
--- /dev/null
+++ b/platform/linux-generic/include/protocols/sctp.h
@@ -0,0 +1,49 @@ 
+/* Copyright (c) 2016-2018, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP SCTP header
+ */
+
+#ifndef ODP_SCTP_H_
+#define ODP_SCTP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp_api.h>
+
+/** @addtogroup odp_header ODP HEADER
+ *  @{
+ */
+
+/** SCTP header length */
+#define _ODP_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 */
+} _odp_sctphdr_t;
+
+/** @internal Compile time assert */
+ODP_STATIC_ASSERT(sizeof(_odp_sctphdr_t) == _ODP_SCTPHDR_LEN,
+		  "_ODP_SCTPHDR_T__SIZE_ERROR");
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif