From patchwork Tue Jan 23 15:00:22 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: 125533 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1810010ljf; Tue, 23 Jan 2018 07:05:59 -0800 (PST) X-Google-Smtp-Source: AH8x226aaHnsF4U5PniJSg0/SsuTrpeAhOMqw58KbsjqCKZhMTR26RWfG7EnD2exXN7FuP+m9/Jp X-Received: by 10.200.13.74 with SMTP id r10mr4114168qti.133.1516719959509; Tue, 23 Jan 2018 07:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516719959; cv=none; d=google.com; s=arc-20160816; b=sIyTTRupjUyE8XetfLURMjd31YyI2g1Fzey8Ajo4nMteaOqI63/wVvQxkxebkt+YZd z5VO5o0pqaNJa3c5nViSLQhBAKIbiVlQw5AUNY15qLCtWygukDSflSft2mHv7Q9Sm2k2 PbS4yghRKxyWdZYj9eD7BXsBEl3PkBWfS2RVPb2GSYO4Z9XQOJIkoGWx+2/dUJsyu2g9 24hCW3fmE0mZeiG1vKESPkPcuU5/W3Ku0UP2YpbcMp9wbNB/xkVk2jbYaZwmIl6BaSlQ LaMwuAd/PG8k6UWEAajn+WRvHo3UYlSn42OSsD9fWNGkC5b2hzHhEDGxrmQl13FYWwe9 O8ZQ== 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=6ItK5h8PFzBveJRzI8nynNqwZUzVXqAAl4RnVQo8JEc=; b=wLftoS+tiRNO60Z4Z0XJhh8ux0eeHxLt14eBsiYf3zNQ/fiRhuofyhoSqhCMAe68e0 kipiL1e/ehsRo/2kLilSLOTt32w0S5n3oGez2qjIxm+3kN+s/3Hpcwk0fjBAW1dvTyPG 1KJPAeQ6aVg+1XdJgbIfksABWiiBfkcYRbAJiaGSIjo+BqBwNEZXGF5MbF0PTw3BRX9m kRBK5UEOvrBxQWLdpIibviWSvW9VjmU8jDTQ6HdcY0MgM2GYKoOgtHnxuvtuhK1yN8PM Lb/kIUxSqCnjkB5Rm8NxVARYAyG7TUSaJDnpUyskdwFeZUU6CU/PT52R/NkrERHANmc3 vYmg== 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 j3si3025250qkj.304.2018.01.23.07.05.59; Tue, 23 Jan 2018 07:05:59 -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 12966617AD; Tue, 23 Jan 2018 15:05:59 +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_H3, RCVD_IN_MSPIKE_WL 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 5A9D1617C9; Tue, 23 Jan 2018 15:02:29 +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 EB36D617A5; Tue, 23 Jan 2018 15:02:14 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 84BCE617BE for ; Tue, 23 Jan 2018 15:00:28 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 8CE765602D04 for ; Tue, 23 Jan 2018 18:00:27 +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 AJks6DT7Sk-0RWuxD6m; Tue, 23 Jan 2018 18:00:27 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id IwkpSe7BuA-0RdaOZUJ; Tue, 23 Jan 2018 18:00:27 +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:22 +0300 Message-Id: <1516719624-9914-5-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 4/6] api: ipsec: inbound TFC padding and dummy packets 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 Specify how application can recognize TFC padding and dummy packets at input. Packet metadata flags for IPv4 and IPv6 indicate if the original packet was an IP or a TFC dummy packet. When packet length is larger than protocol fields indicate, some TFC padding remain in the packet. 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 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 08533d80d..27ff16691 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1224,16 +1224,22 @@ typedef struct odp_ipsec_status_t { * * The operation does packet transformation according to IPSEC standards (see * e.g. RFC 4302 and 4303). Resulting packets are well formed, reconstructed - * original IP packets, with IPSEC headers removed and valid header field values - * restored. The amount and content of packet data before the IP header is - * undefined. + * original IP (or TFC dummy) packets, with IPSEC headers removed and valid + * header field values restored. The amount and content of packet data before + * the IP header is undefined. TFC padding may follow the IP packet payload, + * in which case packet length is larger than protocol headers indicate. + * TFC dummy packets in tunnel mode have both IPv4 and IPv6 flags cleared and + * may contain some (dummy) data. * * Each successfully transformed packet has a valid value for these metadata * regardless of the inner packet parse configuration * (odp_ipsec_inbound_config_t): - * - L3 offset: Offset to the first byte of the (outmost) IP header - * - pktio: For inline IPSEC processed packets, original packet input - * interface + * - l3_offset: Offset to the first byte of the original IP packet. The value + * is implementation specific for tunnel mode TFC dummy packets. + * - has_ipv4/6: Specifies if the original packet is IPv4 or IPv6. For tunnel + * mode TFC dummy packets neither flag is set. + * - pktio: For inline IPSEC processed packets, original packet input + * interface * * Other metadata for parse results and error checks depend on configuration * (selected parse and error check levels).