From patchwork Mon Aug 20 11:00:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 144597 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3825999ljj; Mon, 20 Aug 2018 04:02:15 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyS0TTo7+Dd2kNTekf/MHMuYVmghYKFzntojSuLYxaGwp0nDxyLITkp5bTEWRkAztCbETIo X-Received: by 2002:a0c:ca94:: with SMTP id a20-v6mr40761417qvk.37.1534762935447; Mon, 20 Aug 2018 04:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534762935; cv=none; d=google.com; s=arc-20160816; b=yClTVOT7pK0U6zRk2VdwMb4q1DBHzxNkfeuFGq4O4qUiAZiH5Y/UoFzwTmis1O5sIy OWJRgn10y9kcun/DnILAmnJ/nKmZLkllDiib4mPHpO1Kk8vHYskEq2D9cYW7HHWu2mHN kVVuyhIblQSFZEyCLyS3hUuLDBand0XUDYjA0WP8F96OYZ+6UMnC5R0FUbODe+0LCYSY MbrN69gZY1QkQZXdtUJoPmWSItHS8Znz0zgTaB5MrNcXBGV2+bQ7B2ZZKZYTIRQFlb4V uHLwP61qPMtScGHKuiYZ5EH1lvULw3rSb9BEW5DpZm9QKb2rIGlKJcsLXj+8KYorGi/Q JUZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=OU3KCD1opK62lfj0SO/UXkvneo9r15GuND9K7sElR5s=; b=O2bCdTdW1lsvjY/jurtQnnNLAli+mOOA1tR+rUBvdOK58AarB3NADHoga+J0g9I8jo OEL52WOMq5b4Ot9rRFx7jY+H4PcF97cClBPymR8B02hxghTpkIGCSIdOFsRnwkDJGQge pzYfEI5kGQ2ba0KKDLV61ZCFenfFtBXU26WJ3ZmzHEeEUw49gqd0yiJoFG0rXSNoRswO jQ9GLcTAGF3yXqRUWW8jJXIkbqEeqDen/nS6Oau5ZXcYsdAiQ62+IexwaDRqqwDoTBkq RVbAxq7sQ6jzZHQCpOBtbhXPkDCABykZbly76gbzEaAJHYUmimoZuq7alRAZcET5st5u 861w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id x48-v6si4241922qta.285.2018.08.20.04.02.15; Mon, 20 Aug 2018 04:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 25EE168649; Mon, 20 Aug 2018 11:02:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id CFF7861706; Mon, 20 Aug 2018 11:00:35 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 97082685E1; Mon, 20 Aug 2018 11:00:19 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 4EFFF60981 for ; Mon, 20 Aug 2018 11:00:14 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward100p.mail.yandex.net (Yandex) with ESMTP id ED175510581C for ; Mon, 20 Aug 2018 14:00:12 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id I3R1VIWZ7w-0CU8n9ce; Mon, 20 Aug 2018 14:00:12 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id x8w3cLDY5J-0Ct8du7u; Mon, 20 Aug 2018 14:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 20 Aug 2018 11:00:01 +0000 Message-Id: <1534762808-15588-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> References: <1534762808-15588-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v3 4/11] helper: add SCTP protocol header X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** 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 --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 #include #include +#include #include #include #include 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 + +/** @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