From patchwork Wed May 3 14:00:08 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: 98491 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp70079qgd; Wed, 3 May 2017 07:00:36 -0700 (PDT) X-Received: by 10.237.38.135 with SMTP id q7mr31483258qtd.115.1493820036136; Wed, 03 May 2017 07:00:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w207si1956322qka.315.2017.05.03.07.00.35; Wed, 03 May 2017 07:00:36 -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 9A4486066C; Wed, 3 May 2017 14:00:35 +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 46D51608BE; Wed, 3 May 2017 14:00:30 +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 D509D60A35; Wed, 3 May 2017 14:00:27 +0000 (UTC) Received: from forward20p.cmail.yandex.net (forward20p.cmail.yandex.net [77.88.31.15]) by lists.linaro.org (Postfix) with ESMTPS id D8AA06085A for ; Wed, 3 May 2017 14:00:22 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::26]) by forward20p.cmail.yandex.net (Yandex) with ESMTP id 74F6E2227A for ; Wed, 3 May 2017 17:00:20 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 1AE315081187 for ; Wed, 3 May 2017 17:00:16 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LKVpRhIgJo-0FKKlKRJ; Wed, 03 May 2017 17: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: Wed, 3 May 2017 17:00:08 +0300 Message-Id: <1493820008-31161-1-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 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: 0b1dbf37b4030c6da4c6f13645c63fd4ac8ff923 ** Merge commit sha: 3525f2823e4a228a1fd0f9d8b661de0fc248457a **/ 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;