Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/87188/?format=api
https://patches.dpdk.org/api/patches/87188/?format=api", "web_url": "https://patches.dpdk.org/project/dts/patch/20210125084414.8503-13-yufengx.mo@intel.com/", "project": { "id": 3, "url": "https://patches.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<20210125084414.8503-13-yufengx.mo@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20210125084414.8503-13-yufengx.mo@intel.com", "date": "2021-01-25T08:43:59", "name": "[V1,12/27] framework/pktgen: enable ixNetwork", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6400c4ae90753440d42f9c5a64deb272be2dfb65", "submitter": { "id": 1342, "url": "https://patches.dpdk.org/api/people/1342/?format=api", "name": "Yufen.Mo", "email": "yufengx.mo@intel.com" }, "delegate": { "id": 23642, "url": "https://patches.dpdk.org/api/users/23642/?format=api", "username": "lijuantu", "first_name": "LIjuan", "last_name": "Tu", "email": "lijuan.tu@intel.com" }, "mbox": "https://patches.dpdk.org/project/dts/patch/20210125084414.8503-13-yufengx.mo@intel.com/mbox/", "series": [ { "id": 14926, "url": "https://patches.dpdk.org/api/series/14926/?format=api", "web_url": "https://patches.dpdk.org/project/dts/list/?series=14926", "date": "2021-01-25T08:43:47", "name": "dts: enable IxNetwork and enhance perf testing", "version": 1, "mbox": "https://patches.dpdk.org/series/14926/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/87188/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/87188/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C7DACA0A0B;\n\tMon, 25 Jan 2021 09:51:44 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C2F62140E01;\n\tMon, 25 Jan 2021 09:51:44 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 93E9D140DDD\n for <dts@dpdk.org>; Mon, 25 Jan 2021 09:51:43 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 25 Jan 2021 00:51:43 -0800", "from dpdk-moyufen06.sh.intel.com ([10.67.116.208])\n by fmsmga001.fm.intel.com with ESMTP; 25 Jan 2021 00:51:41 -0800" ], "IronPort-SDR": [ "\n USJArDnAFoBUO8+OsL2hQPmBiSQ8x1kaxw8CquTMBBEpYHueupUBWskTKnlgF3gyjx2E/fiCeW\n YAw5uDwLV+sw==", "\n xJ4/cDTdCtoDkh9CqeGOns/clEzr/XCBS6ibm65MoO65jVcraMl7xgbr+Y6ZNZvMY6XN4mpHpS\n GtQrPcqaA8fg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9874\"; a=\"241224430\"", "E=Sophos;i=\"5.79,373,1602572400\"; d=\"scan'208\";a=\"241224430\"", "E=Sophos;i=\"5.79,373,1602572400\"; d=\"scan'208\";a=\"471978459\"" ], "X-ExtLoop1": "1", "From": "yufengmx <yufengx.mo@intel.com>", "To": "dts@dpdk.org,\n\tlijuan.tu@intel.com", "Cc": "yufengmx <yufengx.mo@intel.com>", "Date": "Mon, 25 Jan 2021 16:43:59 +0800", "Message-Id": "<20210125084414.8503-13-yufengx.mo@intel.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20210125084414.8503-1-yufengx.mo@intel.com>", "References": "<20210125084414.8503-1-yufengx.mo@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dts] [PATCH V1 12/27] framework/pktgen: enable ixNetwork", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "test suite reviews and discussions <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org", "Sender": "\"dts\" <dts-bounces@dpdk.org>" }, "content": "parse pcap file/scapy Packet layers content.\n\nSigned-off-by: yufengmx <yufengx.mo@intel.com>\n---\n framework/ixia_network/packet_parser.py | 93 +++++++++++++++++++++++++\n 1 file changed, 93 insertions(+)\n create mode 100644 framework/ixia_network/packet_parser.py", "diff": "diff --git a/framework/ixia_network/packet_parser.py b/framework/ixia_network/packet_parser.py\nnew file mode 100644\nindex 00000000..6bb0e2f3\n--- /dev/null\n+++ b/framework/ixia_network/packet_parser.py\n@@ -0,0 +1,93 @@\n+# BSD LICENSE\n+#\n+# Copyright(c) 2010-2021 Intel Corporation. All rights reserved.\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+# * Redistributions of source code must retain the above copyright\n+# notice, this list of conditions and the following disclaimer.\n+# * Redistributions in binary form must reproduce the above copyright\n+# notice, this list of conditions and the following disclaimer in\n+# the documentation and/or other materials provided with the\n+# distribution.\n+# * Neither the name of Intel Corporation nor the names of its\n+# contributors may be used to endorse or promote products derived\n+# from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+import os\n+from collections import OrderedDict\n+\n+from scapy.all import conf\n+from scapy.packet import NoPayload\n+from scapy.packet import Packet as scapyPacket\n+from scapy.fields import ConditionalField\n+from scapy.utils import rdpcap\n+\n+\n+class PacketParser(object):\n+ ''' parse packet full layers information '''\n+\n+ def __init__(self):\n+ self.packetLayers = OrderedDict()\n+ self.framesize = 64\n+\n+ def _parse_packet_layer(self, pkt_object):\n+ ''' parse one packet every layers' fields and value '''\n+ if pkt_object is None:\n+ return\n+\n+ self.packetLayers[pkt_object.name] = OrderedDict()\n+ for curfield in pkt_object.fields_desc:\n+ if isinstance(curfield, ConditionalField) and \\\n+ not curfield._evalcond(pkt_object):\n+ continue\n+ field_value = pkt_object.getfieldval(curfield.name)\n+ if isinstance(field_value, scapyPacket) or (curfield.islist and\n+ curfield.holds_packets and type(field_value) is list):\n+ continue\n+ repr_value = curfield.i2repr(pkt_object, field_value)\n+ if isinstance(repr_value, str):\n+ repr_value = repr_value.replace(os.linesep,\n+ os.linesep + \" \" * (len(curfield.name) + 4))\n+ self.packetLayers[pkt_object.name][curfield.name] = repr_value\n+\n+ if isinstance(pkt_object.payload, NoPayload):\n+ return\n+ else:\n+ self._parse_packet_layer(pkt_object.payload)\n+\n+ def _parse_pcap(self, pcapFile, number=0):\n+ ''' parse one packet content '''\n+ self.packetLayers = OrderedDict()\n+ pcap_pkts = []\n+ if isinstance(pcapFile, str):\n+ if os.path.exists(pcapFile) is False:\n+ warning = \"{0} is not exist !\".format(pcapFile)\n+ raise Exception(warning)\n+ pcap_pkts = rdpcap(pcapFile)\n+ else:\n+ pcap_pkts = pcapFile\n+ # parse packets' every layers and fields\n+ if len(pcap_pkts) == 0:\n+ warning = \"{0} is empty\".format(pcapFile)\n+ raise Exception(warning)\n+ elif number >= len(pcap_pkts):\n+ warning = \"{0} is missing No.{1} packet\".format(pcapFile, number)\n+ raise Exception(warning)\n+ else:\n+ self._parse_packet_layer(pcap_pkts[number])\n+ self.framesize = len(pcap_pkts[number]) + 4\n", "prefixes": [ "V1", "12/27" ] }{ "id": 87188, "url": "