test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhou Jun <junx.w.zhou@intel.com>
To: dts@dpdk.org
Cc: Zhou Jun <junx.w.zhou@intel.com>
Subject: [dts] [dts 1/3] framework/packet.py:add interface for write raw pkt
Date: Wed,  9 Dec 2020 09:59:42 +0800	[thread overview]
Message-ID: <20201209015944.12586-2-junx.w.zhou@intel.com> (raw)
In-Reply-To: <20201209015944.12586-1-junx.w.zhou@intel.com>

Signed-off-by: Zhou Jun <junx.w.zhou@intel.com>
---
 framework/packet.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/framework/packet.py b/framework/packet.py
index 7d974db0..e13e74f2 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -119,6 +119,12 @@ PKTGEN_PIDS = {}
 # default filter for LLDP packet
 LLDP_FILTER = {'layer': 'ether', 'config': {'type': 'not lldp'}}
 
+def write_raw_pkt(pkt_str, file_name):
+    tmp = eval(pkt_str)
+    tmp = bytearray(bytes(tmp))
+    with open(file_name, 'wb') as w:
+        w.write(tmp)
+        w.close()
 
 class scapy(object):
     SCAPY_LAYERS = {
-- 
2.17.1


  reply	other threads:[~2020-12-09  1:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  1:59 [dts] [PATCH V2 0/3] add new interface for write raw pkt and Zhou Jun
2020-12-09  1:59 ` Zhou Jun [this message]
2020-12-09  1:59 ` [dts] [dts 2/3] tests/TestSuite_ddp_gtp_qregion:change send pkt mode and use framework interface to write raw pkt Zhou Jun
2020-12-09  1:59 ` [dts] [dts 3/3] tests/TestSuite_dynamic_flowtype:change send pkt mode Zhou Jun
2020-12-09  2:00 ` [dts] [PATCH V2 0/3] add new interface for write raw pkt and Zhou, JunX W

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201209015944.12586-2-junx.w.zhou@intel.com \
    --to=junx.w.zhou@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).