From patchwork Wed Jan 31 14:00:29 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: 126343 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp771208ljc; Wed, 31 Jan 2018 06:16:43 -0800 (PST) X-Google-Smtp-Source: AH8x224y6nRl7npYatJahiMFVt8LPNH4A9xr5rrtrCcThIOUCD4AnLFOI03PgFs6rmuagZR4CWF6 X-Received: by 10.200.15.83 with SMTP id l19mr53800136qtk.45.1517408203737; Wed, 31 Jan 2018 06:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408203; cv=none; d=google.com; s=arc-20160816; b=GTLmtu4CbmQlp5JQQtY2hRsrTGAsbD2yydeSKANdJKDQV9WYrIjsGbhniZy73L9fJN PyQEp//Ncp7m3rACJ92lBQVePj+bxnCHOgBdlHgfqEauRbgmB91IT55EoPjH0qYDRnSA sEhsr0Badxz3ar3cP1Z1lty6iI0G+EBdAX9Cd1tJovCdP2eOeoA4qUogzzhXxEHNKPyY Fc1ohv4at1lQN5zjMxx1GRCdApx3TI9ejeLKn9mR4Dpepvmkq+duHLMT7kcCOoOJLTyE LvNz/JTTM6INuYhz240Vr7TaWrHPCi7vBO5eaDu94RxcZdOFTghqnC8fmGopTXINC86O ANng== 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=B440pTQC8IXVYnXWBYQo/mzD1CWL0yoTT8qEow628u8=; b=bV0nP5xbbZTdvEJJcBKD8bGXDlzzKMLsQt5wdM6JjAKsBXzflk2U8WNxImCh6MNn6n TTaqaZpRmqGg1MPCQeaTf2/wQZqIXja2NaNAFAtdZuT1UoaRt9fx8H6kCROEdXZ6Ix8K qgrYBQJSHoLK0y5Y+QrcrgFf7J0TwvJHKsB7MzyrB8f2RtTro0SQhsEmCqmlCBkgeUF9 dIQVMsNqeWhHrbe0Z4oins7dmkijy7lWXW86KUJPOXT/LBZjM7QlnFh8HEUptSWG+naI huG20k1rnnkuPf3bUwQMrIWqlCQGS1GcYL9/GnLPlP2KLa5rDzb+tJ0r1W/4Mx/r9tHU 9Kcw== 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 x78si4539999qkx.129.2018.01.31.06.16.43; Wed, 31 Jan 2018 06:16:43 -0800 (PST) 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 57A93617B2; Wed, 31 Jan 2018 14:16:43 +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, RCVD_IN_MSPIKE_H2 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 5BB6D617E4; Wed, 31 Jan 2018 14:03:27 +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 E120F61787; Wed, 31 Jan 2018 14:03:15 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 58FF561787 for ; Wed, 31 Jan 2018 14:00:38 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward102p.mail.yandex.net (Yandex) with ESMTP id CBAB743029E6 for ; Wed, 31 Jan 2018 17:00:36 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id yRtn1Jjgyz-0abqEu2X; Wed, 31 Jan 2018 17:00:36 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Tps9JIjLUO-0aq8EGoU; Wed, 31 Jan 2018 17:00:36 +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: Wed, 31 Jan 2018 17:00:29 +0300 Message-Id: <1517407234-19273-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> References: <1517407234-19273-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v4 2/7] api: ipsec: IP header parameter types 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: Petri Savolainen Create IP header parameter types, so that those can be used also outside of SA parameter struct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 403 (psavol:next-ipsec-tfc) ** https://github.com/Linaro/odp/pull/403 ** Patch: https://github.com/Linaro/odp/pull/403.patch ** Base sha: 5718327018debbb02aacb464493504c95fbe57a3 ** Merge commit sha: 5fe995377a907528cc4b1ce80386e5238f99e8de **/ include/odp/api/spec/ipsec.h | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 47e3045f3..c78afbe3f 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -382,6 +382,44 @@ typedef struct odp_ipsec_crypto_param_t { } odp_ipsec_crypto_param_t; +/** IPv4 header parameters */ +typedef struct odp_ipsec_ipv4_param_t { + /** IPv4 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv4 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv4 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv4 Don't Fragment bit */ + uint8_t df; + + /** IPv4 Time To Live */ + uint8_t ttl; + +} odp_ipsec_ipv4_param_t; + +/** IPv6 header parameters */ +typedef struct odp_ipsec_ipv6_param_t { + /** IPv6 source address (NETWORK ENDIAN) */ + void *src_addr; + + /** IPv6 destination address (NETWORK ENDIAN) */ + void *dst_addr; + + /** IPv6 flow label */ + uint32_t flabel; + + /** IPv6 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv6 hop limit */ + uint8_t hlimit; + +} odp_ipsec_ipv6_param_t; + /** * IPSEC tunnel parameters * @@ -397,40 +435,10 @@ typedef struct odp_ipsec_tunnel_param_t { /** Variant mappings for tunnel parameters */ union { /** IPv4 header parameters */ - struct { - /** IPv4 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv4 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv4 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv4 Don't Fragment bit */ - uint8_t df; - - /** IPv4 Time To Live */ - uint8_t ttl; - } ipv4; + odp_ipsec_ipv4_param_t ipv4; /** IPv6 header parameters */ - struct { - /** IPv6 source address (NETWORK ENDIAN) */ - void *src_addr; - - /** IPv6 destination address (NETWORK ENDIAN) */ - void *dst_addr; - - /** IPv6 Differentiated Services Code Point */ - uint8_t dscp; - - /** IPv6 flow label */ - uint32_t flabel; - - /** IPv6 hop limit */ - uint8_t hlimit; - } ipv6; + odp_ipsec_ipv6_param_t ipv6; }; } odp_ipsec_tunnel_param_t;