From patchwork Tue Jan 23 15:00:19 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: 125530 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1808235ljf; Tue, 23 Jan 2018 07:03:19 -0800 (PST) X-Google-Smtp-Source: AH8x224xJrxhzy6UfSd6oFOPpIwv+O2IJ1JoAcLoCLCRoUtJq8g590dOhXFWozLDjV4q+bjYwhLQ X-Received: by 10.55.191.69 with SMTP id p66mr3965894qkf.315.1516719799512; Tue, 23 Jan 2018 07:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516719799; cv=none; d=google.com; s=arc-20160816; b=K4+WMAYo2Zha8sqHyv3aNEIzcovKWxlJSATxsnOqOpDb2fHVNMfNVDR/mUaAA3flfX 20vBJtvkZMsTROROfNVbO9nr5fQWuDwUMskYfdmJ03eMhUNqh99IfRSvNsBpt0W3bqkC ByNWxRFQrGBm2aCi2T4SymyjrotQNxub9a4PN9j8SWmfUMsZzQGvX+htKtTUzdFkYmZ9 JIBTBNqt/A1kIokuciqngrljXXtfHLVYxvbqSvqIj7XtByy4RsvDMq6o4UE1Tpf6BKdR hzaBuF+dpy87MP1Fc9NO+vbQFDDsRB+YZPuyT3d/+Y7joCC0pYAmqYjsJM6ie3laIb9T 00JQ== 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=tO4wAlCwru6InppUbib5YrEVLVui/sf51O95IOZORzo=; b=zaiL4YPjy0jneLJH5/EYGN1QUvThuapE8AWM/VollbSOIZntNY2NsXmt8BMlgzQhQ/ 2MgIQ3qv0W40asn8eZvDEkrqxDWdb041OJ+3yXUuFghb5BtO4FPzxafa8uCTcV3k01vs NcV6IMfqbL7uqXHih5gYdL9kBVnJICVs6u4HbmPXtNLgufwAaGb1l9VubWcMcE5zSy/M uM9AdtK8jL6hAajW0K0WvBBPb8jZL8h4UWR1jL29vTsV7DsnmknZPD8NBwD+2pl+4T2B GBXni+XH37sDI3tr0U6vSwed7uVV7Qp5JoG05v/37IxIozWmOLfS5rXvvGSbX+Cwl3p/ w1YQ== 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 b66si1949753qkd.296.2018.01.23.07.03.19; Tue, 23 Jan 2018 07:03:19 -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 1DED0617CA; Tue, 23 Jan 2018 15:03:19 +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 9264E617CF; Tue, 23 Jan 2018 15:02:07 +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 41811617AF; Tue, 23 Jan 2018 15:01:59 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 551B8617B1 for ; Tue, 23 Jan 2018 15:00:27 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 268D91244112 for ; Tue, 23 Jan 2018 18:00:26 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BqGdwuUHWH-0QWi1hK7; Tue, 23 Jan 2018 18:00:26 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IwkpSe7BuA-0PdSHDhs; Tue, 23 Jan 2018 18:00:25 +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: Tue, 23 Jan 2018 18:00:19 +0300 Message-Id: <1516719624-9914-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516719624-9914-1-git-send-email-odpbot@yandex.ru> References: <1516719624-9914-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v2 1/6] 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: 44974a09b01c79adb9637a5dff38539598a76737 ** Merge commit sha: 537da7cd2083945c4673ac0dd7b29beb6825bce7 **/ 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;