From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V1 2/3][scapy vxlan] framework: update vxlan name from Vxlan to VXLAN
Date: Tue, 23 Jul 2019 08:50:52 +0800 [thread overview]
Message-ID: <1563843053-30184-2-git-send-email-lihongx.ma@intel.com> (raw)
In-Reply-To: <1563843053-30184-1-git-send-email-lihongx.ma@intel.com>
depend on dep/vxlan.py, update Vxlan to VXLAN
Signed-off-by: lihong <lihongx.ma@intel.com>
---
framework/etgen.py | 12 ++++++------
framework/packet.py | 4 ++--
framework/pktgen_ixia.py | 14 +++++++-------
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/framework/etgen.py b/framework/etgen.py
index cd6829d..212b9c2 100644
--- a/framework/etgen.py
+++ b/framework/etgen.py
@@ -238,19 +238,19 @@ class IxiaPacketGenerator(SSHConnection):
def parse_pcap(self, fpcap):
dump_str1 = "cmds = []\n"
dump_str2 = "for i in rdpcap('%s', -1):\n" % fpcap
- dump_str3 = " if 'Vxlan' in i.command():\n" + \
+ dump_str3 = " if 'VXLAN' in i.command():\n" + \
" vxlan_str = ''\n" + \
- " l = len(i[Vxlan])\n" + \
- " vxlan = str(i[Vxlan])\n" + \
+ " l = len(i[VXLAN])\n" + \
+ " vxlan = str(i[VXLAN])\n" + \
" first = True\n" + \
" for j in range(l):\n" + \
" if first:\n" + \
- " vxlan_str += \"Vxlan(hexval='%02X\" %ord(vxlan[j])\n" + \
+ " vxlan_str += \"VXLAN(hexval='%02X\" %ord(vxlan[j])\n" + \
" first = False\n" + \
" else:\n" + \
" vxlan_str += \" %02X\" %ord(vxlan[j])\n" + \
" vxlan_str += \"\')\"\n" + \
- " command = re.sub(r\"Vxlan(.*)\", vxlan_str, i.command())\n" + \
+ " command = re.sub(r\"VXLAN(.*)\", vxlan_str, i.command())\n" + \
" else:\n" + \
" command = i.command()\n" + \
" cmds.append(command)\n" + \
@@ -375,7 +375,7 @@ class IxiaPacketGenerator(SSHConnection):
match = pat.match(header)
params = eval('dict(%s)' % match.group(2))
method_name = match.group(1)
- if method_name == 'Vxlan':
+ if method_name == 'VXLAN':
method = getattr(self, method_name.lower())
method(txport, **params)
break
diff --git a/framework/packet.py b/framework/packet.py
index d39479f..502d85c 100755
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -65,7 +65,7 @@ DTS_PATH = exec_file.replace('/framework/packet.py', '')
DEP_FOLDER = DTS_PATH + '/dep'
sys.path.append(DEP_FOLDER)
-from vxlan import Vxlan
+from vxlan import VXLAN
from nvgre import NVGRE, IPPROTO_NVGRE
from lldp import LLDP, LLDPManagementAddress
from Dot1BR import Dot1BR
@@ -123,7 +123,7 @@ class scapy(object):
'icmp': ICMP(),
'gre': GRE(),
'raw': Raw(),
- 'vxlan': Vxlan(),
+ 'vxlan': VXLAN(),
'inner_mac': Ether(),
'inner_vlan': Dot1Q(),
diff --git a/framework/pktgen_ixia.py b/framework/pktgen_ixia.py
index 80481fe..2895c6b 100644
--- a/framework/pktgen_ixia.py
+++ b/framework/pktgen_ixia.py
@@ -141,19 +141,19 @@ class Ixia(SSHConnection):
dump_str1 = "cmds = []\n"
dump_str2 = "for i in rdpcap('%s', -1):\n" % pcap_path
- dump_str3 = " if 'Vxlan' in i.command():\n" + \
+ dump_str3 = " if 'VXLAN' in i.command():\n" + \
" vxlan_str = ''\n" + \
- " l = len(i[Vxlan])\n" + \
- " vxlan = str(i[Vxlan])\n" + \
+ " l = len(i[VXLAN])\n" + \
+ " vxlan = str(i[VXLAN])\n" + \
" first = True\n" + \
" for j in range(l):\n" + \
" if first:\n" + \
- " vxlan_str += \"Vxlan(hexval='%02X\" %ord(vxlan[j])\n" + \
+ " vxlan_str += \"VXLAN(hexval='%02X\" %ord(vxlan[j])\n" + \
" first = False\n" + \
" else:\n" + \
" vxlan_str += \" %02X\" %ord(vxlan[j])\n" + \
" vxlan_str += \"\')\"\n" + \
- " command = re.sub(r\"Vxlan(.*)\", vxlan_str, i.command())\n" + \
+ " command = re.sub(r\"VXLAN(.*)\", vxlan_str, i.command())\n" + \
" else:\n" + \
" command = i.command()\n" + \
" cmds.append(command)\n" + \
@@ -502,7 +502,7 @@ class Ixia(SSHConnection):
match = pat.match(header)
params = eval('dict(%s)' % match.group(2))
method_name = match.group(1)
- if method_name == 'Vxlan':
+ if method_name == 'VXLAN':
method = getattr(self, method_name.lower())
method(ixia_port, vm.get('fields_config', {}), **params)
break
@@ -1747,4 +1747,4 @@ class IxiaPacketGenerator(PacketGenerator):
''' close ixia session '''
if self._conn is not None:
self._disconnect()
- return
\ No newline at end of file
+ return
--
2.7.4
next prev parent reply other threads:[~2019-07-23 8:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-23 0:50 [dts] [PATCH V1 1/3][scapy vxlan] dep/vxlan: modify class " lihong
2019-07-23 0:50 ` lihong [this message]
2019-07-23 9:13 ` [dts] [PATCH V1 2/3][scapy vxlan] framework: update vxlan " Zhu, ShuaiX
2019-07-23 0:50 ` [dts] [PATCH V1 3/3][scapy vxlan] tests: " lihong
2019-07-23 9:14 ` Zhu, ShuaiX
2019-07-23 9:13 ` [dts] [PATCH V1 1/3][scapy vxlan] dep/vxlan: modify class " Zhu, ShuaiX
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=1563843053-30184-2-git-send-email-lihongx.ma@intel.com \
--to=lihongx.ma@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).