From patchwork Wed Jan 10 01:00:06 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: 123987 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4664984qgn; Tue, 9 Jan 2018 17:01:00 -0800 (PST) X-Google-Smtp-Source: ACJfBosvsiMvrdjufnl6wqjyvIREQ+u78tHRYtnZKs8+ZBAPaW+b5qC6i/6tYQOacuhXNe1od+XT X-Received: by 10.55.170.194 with SMTP id t185mr9398643qke.278.1515546059920; Tue, 09 Jan 2018 17:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515546059; cv=none; d=google.com; s=arc-20160816; b=vhfBVFA5rtRwgQyP4UtHqN/FDrvgOa/v5NO0TuEyXyaslU22lRhpJyPw5mj2NGrMWC 5DIgebTu8zv/y5xXmnVmoBPcF9dlRrxId4Sg4UrObvJdUqfu2qxN8+80Qf3wZOZs78V3 7ZqA8TcendfZUderI6H28MDDJxMnqRkwr5/hVL5LnC6Iq8Jsg73G3t78aOjepGq0GpPh te6nr8mVP95vtDTHWjTf9cmLR8Bm3PvfwpNiompzmwFX/rhGYCtUfPQTaYA3ucSOffmY pWwmxwwf1uc+/9YkSFeMY3TN6AlygmwMAM62VnsdOi2inN3fxEKiT4qzCsRDrBoQDZ/r k0OQ== 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=BjaNJ6FagXDS8i2rPj/U8OQGLljOPZURqZuBtIL4CpA=; b=BfLHTmhTeHKgIDF8t951i+fkshM9Ej+NHGBRYtuvPvNFuriNu3ACf9J7N2ldH07QyX 5tv/aAbeHy+wifxb/QKNNcwxC+/BKiw6zmotDuH7cwdW78UHXvVb83+7J5GUaR6JkYID Ev+vqUR0lpUbkgRv0VRKFa1Ie47VOLJBo0QV1T+TGlx3RVDqDIhoAxeW4GN6LGYVGY8E hUTTDYdKsuQ0QDL4zwuaI6KylRYvv0JrefO8WPsvjsLvPGfDVJ4nM9xc5WkYAZh3dG1L VO/tvDx517b/PDr4d5KeOaQQdUrQ3pX5Cxpjp+a0PqgCjCkOxBNpN0DSORl4AS2hn6ai j3FQ== 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 31si9425465qtt.39.2018.01.09.17.00.59; Tue, 09 Jan 2018 17:00: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 85F096172C; Wed, 10 Jan 2018 01:00: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,URIBL_BLOCKED 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 32A3661510; Wed, 10 Jan 2018 01:00:54 +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 4F9D26171B; Wed, 10 Jan 2018 01:00:49 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id DC3D361516 for ; Wed, 10 Jan 2018 01:00:16 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 8515934C37DA for ; Wed, 10 Jan 2018 04:00:15 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0PfS1xwKzE-09Xa920m; Wed, 10 Jan 2018 04:00:09 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LBg8WI4ByR-08X8xJuD; Wed, 10 Jan 2018 04:00:08 +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, 10 Jan 2018 04:00:06 +0300 Message-Id: <1515546007-13757-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515546007-13757-1-git-send-email-odpbot@yandex.ru> References: <1515546007-13757-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 386 Subject: [lng-odp] [PATCH API-NEXT v1 1/2] linux-generic: remove camelcase from icmp protocol 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: Bill Fischofer Change ODP_IPPROTO_ICMPv4 and ODP_IPPROTO_ICMPv6 to ODP_IPPROTO_ICMPV4 and ODP_IPPROTO_ICMPV6 to eliminate camelcase issues in ODP code. --- /** Email created from pull request 386 (Bill-Fischofer-Linaro:icmp-camelcase) ** https://github.com/Linaro/odp/pull/386 ** Patch: https://github.com/Linaro/odp/pull/386.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 9b488231de93541f9a2c75a6e277921c55041427 **/ platform/linux-generic/include/protocols/ip.h | 4 ++-- platform/linux-generic/odp_packet.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h index 7b6b736a6..e92a38993 100644 --- a/platform/linux-generic/include/protocols/ip.h +++ b/platform/linux-generic/include/protocols/ip.h @@ -157,7 +157,7 @@ typedef struct ODP_PACKED { * IP protocol values (IPv4:'proto' or IPv6:'next_hdr') * @{*/ #define _ODP_IPPROTO_HOPOPTS 0x00 /**< IPv6 hop-by-hop options */ -#define _ODP_IPPROTO_ICMPv4 0x01 /**< Internet Control Message Protocol (1) */ +#define _ODP_IPPROTO_ICMPV4 0x01 /**< Internet Control Message Protocol (1) */ #define _ODP_IPPROTO_IPIP 0x04 /**< IP Encapsulation within IP (4) */ #define _ODP_IPPROTO_TCP 0x06 /**< Transmission Control Protocol (6) */ #define _ODP_IPPROTO_UDP 0x11 /**< User Datagram Protocol (17) */ @@ -166,7 +166,7 @@ typedef struct ODP_PACKED { #define _ODP_IPPROTO_FRAG 0x2C /**< IPv6 Fragment (44) */ #define _ODP_IPPROTO_AH 0x33 /**< Authentication Header (51) */ #define _ODP_IPPROTO_ESP 0x32 /**< Encapsulating Security Payload (50) */ -#define _ODP_IPPROTO_ICMPv6 0x3A /**< Internet Control Message Protocol (58) */ +#define _ODP_IPPROTO_ICMPV6 0x3A /**< Internet Control Message Protocol (58) */ #define _ODP_IPPROTO_DEST 0x3C /**< IPv6 Destination header (60) */ #define _ODP_IPPROTO_SCTP 0x84 /**< Stream Control Transmission protocol (132) */ diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 83a880947..a812fec15 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2220,10 +2220,10 @@ int packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, /* Parse Layer 4 headers */ switch (ip_proto) { - case _ODP_IPPROTO_ICMPv4: + case _ODP_IPPROTO_ICMPV4: /* Fall through */ - case _ODP_IPPROTO_ICMPv6: + case _ODP_IPPROTO_ICMPV6: prs->input_flags.icmp = 1; break; From patchwork Wed Jan 10 01:00:07 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: 123988 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4665760qgn; Tue, 9 Jan 2018 17:01:47 -0800 (PST) X-Google-Smtp-Source: ACJfBovC64DYSMsYcVfN4ZfokBtr67FjYRoU40lJ4AL5ywRDwvrUbjmJISM6HBkA85KVzgl5sibO X-Received: by 10.200.58.2 with SMTP id w2mr25088589qte.156.1515546107110; Tue, 09 Jan 2018 17:01:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515546107; cv=none; d=google.com; s=arc-20160816; b=G9QUL3HR4GMqfy09rAbbF5BzizMIn7ToGW95W5hpSOmYtfg7hsQMDdFL4TYqPBLiL6 Nos5l7SFLfF+arRFguU66d0tSLPaHYRFAUsMlqn7qqqYul8ofRY7PyPTtnlAWgavKVZy b0GQED5QhqF8uyNlz1EGF8ind54yz57gRSL4lRqVaVC5Lt/XhYPHnOP8sy4n9SmxrGD+ 8RL/N8QBKEy3RhfaIwq47RJaYLBc9k+P5A3gDa6FO4xbBT2+UFj4/mLzNjXmVULNm0WG 9HQbh5LRtdMORlprtgWQHIjUXo/S3TPRoWqFNaE4PWRxm1jLjoOnN1nAN0MsvIEReCbn LLPg== 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=W+SeIbFxcXz7fkIZrHL74hS8ETUy/+UEcFHhjNM+6FQ=; b=U2QRi2t5ekgAJnYCtgVAXRGVcZAYiBSApvdNEzaD8WXQTB1qmY2mGUtp2JjupCkjtk aQEFCEJjTpryO+ITYTfD++Z85RWkvtBb7ziE3K4IXmv3/6YkMeHxqx+oV5OEycnYIad2 AuN05oiRBOakIuMIhsWE0IBdFAfo+nAy48H1Usbs2KwQuwgtYNPrgm+tXIRvByKxwSFW jw5Ig7Wjb2fQpJAu6MscoshwYESjCvvx7FNFzkmqyGnJZGL64J7sLypODTxtGkvl8P4a 6ceUbi6bjcRhrxQEWFEy3D09phUCAxJWlCag5cBvza2yZaiTZ3rqikEOn/8QpUX2ezDy tOlA== 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 t2si7169084qkb.41.2018.01.09.17.01.46; Tue, 09 Jan 2018 17:01:47 -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 CB9F261702; Wed, 10 Jan 2018 01:01:46 +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,URIBL_BLOCKED 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 AA6736171D; Wed, 10 Jan 2018 01:00:56 +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 1C46B61702; Wed, 10 Jan 2018 01:00:51 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 675FF616DE for ; Wed, 10 Jan 2018 01:00:17 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 39D30184CDE for ; Wed, 10 Jan 2018 04:00:16 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id yPvi8Jg7gw-0G4KDvRc; Wed, 10 Jan 2018 04:00:16 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LBg8WI4ByR-0FXCmd40; Wed, 10 Jan 2018 04:00:15 +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, 10 Jan 2018 04:00:07 +0300 Message-Id: <1515546007-13757-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515546007-13757-1-git-send-email-odpbot@yandex.ru> References: <1515546007-13757-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 386 Subject: [lng-odp] [PATCH API-NEXT v1 2/2] helper: provide icmp non-camelcase alternative 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: Bill Fischofer Add the ODPH_IPPROTO_ICMPV4 and ODPH_IPPROTO_ICMPV6 defines to avoid camelcase issues in ODP examples. Since the helpers are part of the public API, the camelcase variants are retained for compatibility, however ODP example code that uses helpers is updated to use the non-camelcase forms. --- /** Email created from pull request 386 (Bill-Fischofer-Linaro:icmp-camelcase) ** https://github.com/Linaro/odp/pull/386 ** Patch: https://github.com/Linaro/odp/pull/386.patch ** Base sha: 6303c7d0e98fafe0f14c8c4dd9989b3b7633ebf4 ** Merge commit sha: 9b488231de93541f9a2c75a6e277921c55041427 **/ example/generator/odp_generator.c | 4 ++-- example/ipsec/odp_ipsec_stream.c | 6 +++--- helper/include/odp/helper/ip.h | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index b1827e9c9..0fc4c9ccd 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -426,7 +426,7 @@ static odp_packet_t setup_icmp_pkt_ref(odp_pool_t pool, ip->ttl = 64; ip->tot_len = odp_cpu_to_be_16(args->appl.payload + ODPH_ICMPHDR_LEN + ODPH_IPV4HDR_LEN); - ip->proto = ODPH_IPPROTO_ICMPv4; + ip->proto = ODPH_IPPROTO_ICMPV4; ip->id = 0; ip->chksum = 0; @@ -806,7 +806,7 @@ static void print_pkts(int thr, thread_args_t *thr_args, thr_args->counters.ctr_udp_rcv++; /* icmp */ - if (ip->proto == ODPH_IPPROTO_ICMPv4) { + if (ip->proto == ODPH_IPPROTO_ICMPV4) { icmp = (odph_icmphdr_t *)(buf + offset); process_icmp_pkt(thr_args, icmp, msg); diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index c287282e8..3773ce525 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -217,7 +217,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, ip->src_addr = odp_cpu_to_be_32(entry->tun_src_ip); ip->dst_addr = odp_cpu_to_be_32(entry->tun_dst_ip); } else { - ip->proto = ODPH_IPPROTO_ICMPv4; + ip->proto = ODPH_IPPROTO_ICMPV4; ip->src_addr = odp_cpu_to_be_32(stream->src_ip); ip->dst_addr = odp_cpu_to_be_32(stream->dst_ip); } @@ -260,7 +260,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, inner_ip = (odph_ipv4hdr_t *)data; memset((char *)inner_ip, 0, sizeof(*inner_ip)); inner_ip->ver_ihl = 0x45; - inner_ip->proto = ODPH_IPPROTO_ICMPv4; + inner_ip->proto = ODPH_IPPROTO_ICMPV4; inner_ip->id = odp_cpu_to_be_16(stream->id); inner_ip->ttl = 64; inner_ip->tos = 0; @@ -518,7 +518,7 @@ odp_bool_t verify_ipv4_packet(stream_db_entry_t *stream, icmp = (odph_icmphdr_t *)(inner_ip + 1); data = (uint8_t *)icmp; } else { - if (ODPH_IPPROTO_ICMPv4 != ip->proto) + if (ODPH_IPPROTO_ICMPV4 != ip->proto) return FALSE; icmp = (odph_icmphdr_t *)data; } diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index b96aab280..a47030a39 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -252,6 +252,7 @@ typedef struct ODP_PACKED { * @{*/ #define ODPH_IPPROTO_HOPOPTS 0x00 /**< IPv6 hop-by-hop options */ #define ODPH_IPPROTO_ICMPv4 0x01 /**< Internet Control Message Protocol (1) */ +#define ODPH_IPPROTO_ICMPV4 0x01 /**< Internet Control Message Protocol (1) */ #define ODPH_IPPROTO_TCP 0x06 /**< Transmission Control Protocol (6) */ #define ODPH_IPPROTO_UDP 0x11 /**< User Datagram Protocol (17) */ #define ODPH_IPPROTO_ROUTE 0x2B /**< IPv6 Routing header (43) */ @@ -259,6 +260,7 @@ typedef struct ODP_PACKED { #define ODPH_IPPROTO_AH 0x33 /**< Authentication Header (51) */ #define ODPH_IPPROTO_ESP 0x32 /**< Encapsulating Security Payload (50) */ #define ODPH_IPPROTO_ICMPv6 0x3A /**< Internet Control Message Protocol (58) */ +#define ODPH_IPPROTO_ICMPV6 0x3A /**< Internet Control Message Protocol (58) */ #define ODPH_IPPROTO_INVALID 0xFF /**< Reserved invalid by IANA */ /**@}*/