From patchwork Fri May 5 22:00:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 98747 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp343613qge; Fri, 5 May 2017 15:07:00 -0700 (PDT) X-Received: by 10.55.135.67 with SMTP id j64mr4263085qkd.130.1494022020869; Fri, 05 May 2017 15:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494022020; cv=none; d=google.com; s=arc-20160816; b=FEdYnty2pDDyUs/Eje+2eMEVbMDnZwxrRtXKh+BzBWPESKZfQNyMApD3jKmlqi+wHQ lbR9elSkXy+TDSw4AYRB1x5i8DnRVB2fma7lbbD2zJvjAIDXFNImUtOwJRXXLuuSkC0X 4mIVr4+4+0Io3QNncNuplxi84jwwDFPeiG1jpFYvPGQxMgm7zqgs8IOCtMNOT9DnPNLI NtrxAYyLMdSazUr5aiJ6VBlBmJFJvXmTqw4SMfHSoe9p7/8gdm8c/p0ggbTbzfYH2pFn x6cgEik25YVhf1ZZq0FMfnnl31DKPLp6aQN9yEjkRpl6gqiQHuEakSZXYT6kRPeZj2h6 EoTQ== 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=mkMsIZ++yO2IBOAOKLgj6Qfviq2/hlWlpaLlwHGlUog=; b=mUeduS6t4sOnT+yAGp9kQHmR4EiRuiCRbUCPirG7/CHopRidI13BzI60giE478btLZ enSF45uI1qmmBQNyK+GD+uKI8gCUBQZyoDYS8ReTH+XEWM9m9Et8kZnx+0bfGu75LxWr zwJGrsIl7mn0sCDUqIFdJxVZ+KETGAY/BEzk3X3/+QXU1DAYjf0xNoT5b4yD52QNfCiP LESlMdJy66iTxuV0HGixIcV8LygLj3FjkfzF2UvWobkugGIe9Ow9Fd7qms6H68DSXy+9 NaJJUGGzCY/wnbrHF0xXIOZBQT/XJnmlKHsN53xEPTDswjyBCVSUaedrmlbhP3ywKXGg jFPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v63si5706577qkd.14.2017.05.05.15.07.00; Fri, 05 May 2017 15:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 79073608AA; Fri, 5 May 2017 22:07:00 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 9EA5C608D4; Fri, 5 May 2017 22:02:12 +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 6B29260A3F; Fri, 5 May 2017 22:02:09 +0000 (UTC) Received: from forward5m.cmail.yandex.net (forward5m.cmail.yandex.net [5.255.216.23]) by lists.linaro.org (Postfix) with ESMTPS id 45230608D4 for ; Fri, 5 May 2017 22:00:43 +0000 (UTC) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [IPv6:2a02:6b8:0:2519::125]) by forward5m.cmail.yandex.net (Yandex) with ESMTP id B797821517 for ; Sat, 6 May 2017 01:00:41 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 99D6D2840DF9 for ; Sat, 6 May 2017 01:00:41 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id NVVow4V1jP-0ed88HpR; Sat, 06 May 2017 01:00:40 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Sat, 6 May 2017 01:00:22 +0300 Message-Id: <1494021622-16250-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1494021622-16250-1-git-send-email-odpbot@yandex.ru> References: <1494021622-16250-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 20 Subject: [lng-odp] [PATCH API-NEXT v2 1/1] api: ipsec: factor out IP protocol version parameter 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 Instead of using 'magic' numbers for ip version in SA params, define new enum to distinguish between IPv4 and IPv6. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 20 (lumag:ipsec-ipv) ** https://github.com/Linaro/odp/pull/20 ** Patch: https://github.com/Linaro/odp/pull/20.patch ** Base sha: 540490ddf3a1b3da4b80ed15fc874ccdfc49b60c ** Merge commit sha: 202225608c0ec69e40c461b0d0f0d7274b64c141 **/ include/odp/api/spec/ipsec.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index e83494d..8829b55 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -569,6 +569,18 @@ typedef enum odp_ipsec_pipeline_t { } odp_ipsec_pipeline_t; /** + * IPSEC header type + */ +typedef enum odp_ipsec_ip_version_t { + /** Header is IPv4 */ + ODP_IPSEC_IPV4 = 0, + + /** Header is IPv6 */ + ODP_IPSEC_IPV6 + +} odp_ipsec_ip_version_t; + +/** * IPSEC Security Association (SA) parameters */ typedef struct odp_ipsec_sa_param_t { @@ -613,11 +625,8 @@ typedef struct odp_ipsec_sa_param_t { * only in ODP_IPSEC_LOOKUP_DSTADDR_SPI lookup mode. */ struct { /** Select IP version - * - * 4: IPv4 - * 6: IPv6 */ - uint8_t ip_version; + odp_ipsec_ip_version_t ip_version; /** IP destination address (NETWORK ENDIAN) */ void *dst_addr;