From patchwork Tue Aug 21 17:00:00 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: 144755 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5518668ljj; Tue, 21 Aug 2018 10:03:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbA0uGTebuhsBibOIxabOBbPk7romogHNl7zZavXEqAZjZ2+Fbl4HG78RKEfywDq4GOias+ X-Received: by 2002:ac8:364b:: with SMTP id n11-v6mr20251357qtb.339.1534871036868; Tue, 21 Aug 2018 10:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871036; cv=none; d=google.com; s=arc-20160816; b=BG3vcmEy0G8fIzFjzOskfxXGfeTIHv7l8RbaDA9/9VRHcgLcLjie7lBYHuYaavjZ+f ejHlonfSuftt07c+rnZEEJkyep+M0aze3Vt3DbxWOrBaPliSLx1Uov5NPTLK4lA4dvss Blb+Lwb5LXWgyatQSCsq37z2YRwTsJ1G2AenTDtYIrKXPxmjD4w0qHrF5qENMsqMh8HP dg44a4Sjtqi33ZoYtuL+CFYEVwyBvVpuzESGGnZusz9UhwbnoQbnwK9ZVOa7mW+I5s/e A4ztp28YMq5BL659sYjJC0hZW/5ye0Ay4fnLhfQboW0RJbRinyNsPhmiPypjq4PM3oGH Q4fg== 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=TSV6mvrbnk++yW984tLr30WWoP5WaEn9OwfMIbkEvWA=; b=jtKfxLpxvYC7Tg5U0rSo8p8s1XJo2x5TbTK4QC3H8qUP9QwxaL6GmaK0AfzKeFO/iw P3dLZdun2T+Q5hPcGNWhGpXuKPrcagQN1IsG9z8UYZnW2cBoxrQJaVetlTrQsLE1sZGj QNtn6MzjDcta/j6IyCuk6pK9V3TLQ9XxcNZn8zOYIb3g1Ut031VwVuSVvqcVTCcsemSV 8JyaVvmcsK0nz4KaZUtBd0wpxfqaVOYagDuKgV5YptV787UZaSFtnJgYcQ2g9dVV6TxU O4jNI2muFxNiHMp565Uy2Pi5QJLLuUuzGx9luqZ6OxO45wUjQYB63jxPmu8/jKdGpSeA SRVQ== 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 k63-v6si7041573qkd.196.2018.08.21.10.03.56; Tue, 21 Aug 2018 10:03:56 -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 883E468618; Tue, 21 Aug 2018 17:03:56 +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 B49146860D; Tue, 21 Aug 2018 17:02:07 +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 A0179685F8; Tue, 21 Aug 2018 17:01:51 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id D988D607C7 for ; Tue, 21 Aug 2018 17:00:26 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 961432D83B5F for ; Tue, 21 Aug 2018 20:00:25 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nnIqOLbkO3-0JhqO51l; Tue, 21 Aug 2018 20:00:19 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PfJmBMqdLe-0IVm4l9Y; Tue, 21 Aug 2018 20:00:19 +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: Tue, 21 Aug 2018 17:00:00 +0000 Message-Id: <1534870807-18456-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> References: <1534870807-18456-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v6 5/12] 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: f6c423a7d29e2c7d6d890cbc098a398d0d7e1288 ** Merge commit sha: d4f772b36da26684194cb0452a01b8da1ba7e3e1 **/ 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