From patchwork Wed May 3 16:00:07 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: 98497 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp125029qgd; Wed, 3 May 2017 09:00:25 -0700 (PDT) X-Received: by 10.200.49.229 with SMTP id i34mr32146102qte.259.1493827225438; Wed, 03 May 2017 09:00:25 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d72si2121122qkc.80.2017.05.03.09.00.25; Wed, 03 May 2017 09:00:25 -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 DCFA060A32; Wed, 3 May 2017 16:00:24 +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 1871F608C4; Wed, 3 May 2017 16:00:23 +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 2B8B0609C0; Wed, 3 May 2017 16:00:20 +0000 (UTC) Received: from forward2o.cmail.yandex.net (forward2o.cmail.yandex.net [37.9.109.243]) by lists.linaro.org (Postfix) with ESMTPS id B0F79608C3 for ; Wed, 3 May 2017 16:00:18 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [IPv6:2a02:6b8:0:801::ac]) by forward2o.cmail.yandex.net (Yandex) with ESMTP id 44134211BA for ; Wed, 3 May 2017 19:00:17 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id F11A83EC1097 for ; Wed, 3 May 2017 19:00:16 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id UUSdK2dvUh-0GR4Fm3r; Wed, 03 May 2017 19:00:16 +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: Wed, 3 May 2017 19:00:07 +0300 Message-Id: <1493827207-19809-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493827207-19809-1-git-send-email-odpbot@yandex.ru> References: <1493827207-19809-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 20 Subject: [lng-odp] [PATCH] 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 Both tunnel and lookup parameters refer IP protocol version. Factor that out as an IPsec enum used in both places. 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: 467285f59991e0f28d22a50c99e56f07a4380b8d ** Merge commit sha: cd17da2593db2313648bb4b462e751dae1b19659 **/ include/odp/api/spec/ipsec.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index e83494d..7b3b1fe 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -339,16 +339,16 @@ typedef enum odp_ipsec_protocol_t { } odp_ipsec_protocol_t; /** - * IPSEC tunnel type + * IPSEC header type */ -typedef enum odp_ipsec_tunnel_type_t { - /** Outer header is IPv4 */ - ODP_IPSEC_TUNNEL_IPV4 = 0, +typedef enum odp_ipsec_header_type_t { + /** Header is IPv4 */ + ODP_IPSEC_IPV4 = 0, - /** Outer header is IPv6 */ - ODP_IPSEC_TUNNEL_IPV6 + /** Header is IPv6 */ + ODP_IPSEC_IPV6 -} odp_ipsec_tunnel_type_t; +} odp_ipsec_header_type_t; /** * IPSEC crypto parameters @@ -378,7 +378,7 @@ typedef struct odp_ipsec_crypto_param_t { */ typedef struct odp_ipsec_tunnel_param_t { /** Tunnel type: IPv4 or IPv6 */ - odp_ipsec_tunnel_type_t type; + odp_ipsec_header_type_t type; /** Variant mappings for tunnel parameters */ union { @@ -613,11 +613,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_header_type_t ip_version; /** IP destination address (NETWORK ENDIAN) */ void *dst_addr;