From patchwork Tue May 23 06:00:10 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: 100352 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp167393qge; Mon, 22 May 2017 23:00:56 -0700 (PDT) X-Received: by 10.237.58.33 with SMTP id n30mr12975310qte.101.1495519256738; Mon, 22 May 2017 23:00:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495519256; cv=none; d=google.com; s=arc-20160816; b=wdncsT9l2iKZsQpwVyJgr7b6RgGnhr1so+ifRNxeoOsqf5N1kN/Y8T6nkVIYk6yEwN 5ck22NK4+mD5QlbkdW5F10h6mzeC1X5xXpRhjcJFI7uqLS/Aw4Ai3wrRWRG9gO/XiWzc VDNs63UbUKVd7VASkniYRyq3xgBJ4SwChrB8WCkJluIMI1LVslPXUk4rwexYewb5Ed3x Vilob6pa6lOnhLHvlw5Sndp6mwZVMZ97MuHjql6SJw16QTDRk9CMKys/yFlsrG2MbxZz u7iQsfHhmXo4Gv+eq8j19Ogsomn6rloLV+R8RWxRTWMT9F9SzDStjQ/26tMo4bwz08RW 4lAw== 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=Vbg5VeKJ88cs2rpFRG1T1ZGjUN39HF1WV1DNFYgtvj0=; b=trgr3OQdWLUk1V9SP3q/hVZWdo0JNJcrTMunlN7WnlHSUvwzWhEwH9UdBboZUnwrIi D9ncoIEsPi6FZPW3treiUO4qptjZRp1e1ZqDICW1pyYd2Zs56PTBHuMntBMfMzJPIUUc y6iq6buhkfxvNeRSgV+0mgY8NhVMdOW0dzJ6UVz8VStIhUPrFVZ8OHyIPDeY2yKVDDjO 8XhhJo43d1zzU+i8ucOIr/58ohFUkbos9NkNzTuKuEUnyGftOeICbD4A+i+W7NeqapWu VMjul0RV6+WSb+FvZ5fxLGNVUT/4zI3I8XoGeNjadPTfLrh83ZcgVNPcsPCk7MkXFINN 6mTA== 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 n7si20784179qtf.97.2017.05.22.23.00.56; Mon, 22 May 2017 23:00:56 -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 9279B60745; Tue, 23 May 2017 06:00:55 +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,URIBL_BLOCKED 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 AE62360A12; Tue, 23 May 2017 06:00:51 +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 3540C60BDF; Tue, 23 May 2017 06:00:49 +0000 (UTC) Received: from forward5m.cmail.yandex.net (forward5m.cmail.yandex.net [5.255.216.23]) by lists.linaro.org (Postfix) with ESMTPS id E25C160BFB for ; Tue, 23 May 2017 06:00:24 +0000 (UTC) Received: from smtp1m.mail.yandex.net (smtp1m.mail.yandex.net [77.88.61.132]) by forward5m.cmail.yandex.net (Yandex) with ESMTP id 5B10120F9E for ; Tue, 23 May 2017 09:00:23 +0300 (MSK) Received: from smtp1m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1m.mail.yandex.net (Yandex) with ESMTP id 218A063C0F2A for ; Tue, 23 May 2017 09:00:15 +0300 (MSK) Received: by smtp1m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8NpxKB3gOc-0FtG1Yp5; Tue, 23 May 2017 09:00:15 +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: Tue, 23 May 2017 09:00:10 +0300 Message-Id: <1495519210-740-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495519210-740-1-git-send-email-odpbot@yandex.ru> References: <1495519210-740-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 20 Subject: [lng-odp] [PATCH API-NEXT v3 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: 826ee894aa0ebd09d42a17e1de077c46bc5b366a ** Merge commit sha: 113bbff64c0bc3040833985e4de3f5b887f2b0c0 **/ include/odp/api/spec/ipsec.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) Reviewed-by: Petri Savolainen diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index e83494d3..674bcb96 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 = 4, + + /** Header is IPv6 */ + ODP_IPSEC_IPV6 = 6 + +} 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;