From patchwork Thu Jan 18 14:00:09 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: 124961 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp138305lja; Thu, 18 Jan 2018 06:02:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotpV3Hcvc7q5ESkXmcRZgpn/R39w8Pe8h/W4Js9Q3MAYu1eZBJg9RRvYixUf9OgYOFakbqX X-Received: by 10.46.4.15 with SMTP id 15mr3371659lje.64.1516284157537; Thu, 18 Jan 2018 06:02:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516284157; cv=none; d=google.com; s=arc-20160816; b=i8lxp2fHSLXakAdOzmgZCispkzyNmqHqRSPSGQkHLufkSealn9xldhlpMrcDSA0yvC DBJf+FI5vadATDD8XvGcj7IaRYggrFVUi46EOxeVOcRu4cUvu3Y7+dGEFXichEXCQ/Rx uYJrPhkNuqEwGOFXc8HDc4d567mpdjJCGOIwnvPnxvQ4BUzY8ekNDzPRG80N8m8EVBeO v7Q4ODDR6OWHIKs1WiBgxWYY4CMjHdGcD9eVgCAuCZQMyCqr3MJTbGAokzdJlTObhOm0 paz0VA7gA5s6v+5YWKnzY8Uu5TDO0Y4+0aqFAuRSE3sh+PBbmylAoYdylMSUA9iexras RsuQ== 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=Ww+u4dzIbUppu/NBpDTlqWX6HE8XiaAiUlpltklPVdc=; b=Et4J9tuQiwjn2lHH9ACUOPFlnMpVwHfC5IQMo4+GOlhwqVceuen8XIiHNH0S5ElgEw sn1LxLJ/J6OKCurg0rc0VJu+q8+HPkxSgBDFb3yp8GnfOpRa5/VDHw8kphlcx3sIrHT8 u1wVuQnPi54rv76qZsAKlB0CRYXPYIRX2NFYNaqfp7T6hGNL4sWLUV6bss3AyS3gbdFd Qg7ZbUTr8EajBATPRM68STB3N+WLyr27IhaO/b2/KU/fHDw3PzMy1xwo/6FSc+bErB6Z IzW3U4HTT0ol3OeiVgAV9aUZHz3UDs6l4SRGpQ4UQ2IMT8zTpjD0NB+lUCau0pm70Kpb Jb8A== 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 p41si5691440qta.81.2018.01.18.06.02.37; Thu, 18 Jan 2018 06:02:37 -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 E1FCE61802; Thu, 18 Jan 2018 14:02:36 +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 219B6627DF; Thu, 18 Jan 2018 14:01:41 +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 CAD44627FD; Thu, 18 Jan 2018 14:01:37 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 620AF60B0E for ; Thu, 18 Jan 2018 14:00:31 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [5.45.198.18]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 76CCF5D83397 for ; Thu, 18 Jan 2018 17:00:29 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 71kFwIR8B2-0QWa2k2k; Thu, 18 Jan 2018 17:00:26 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id dH7Jf5U1Ot-0JqmEahA; Thu, 18 Jan 2018 17:00:20 +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: Thu, 18 Jan 2018 17:00:09 +0300 Message-Id: <1516284012-2640-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> References: <1516284012-2640-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 403 Subject: [lng-odp] [PATCH API-NEXT v1 1/4] 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: 0c7741d067d9b96e14e420b53a256a1b93096e16 ** Merge commit sha: 14f0b7020e142ed747602a2856214c93e06ff84e **/ 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 4c3c498cd..f97e071a6 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 Differentiated Services Code Point */ + uint8_t dscp; + + /** IPv6 flow label */ + uint32_t flabel; + + /** 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;