summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client_utils
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-02 15:39:27 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-02 15:39:27 +0200
commitcce75776dbb2e05924b9628714886f11b762f1fa (patch)
tree987bfc420de3cf139db2306ea1fbbd86aff07753 /scripts/automation/trex_control_plane/client_utils
parent9b60ab42d8be1239681bcf8079e6f6f149bde253 (diff)
add valn packet ad offset
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils')
-rw-r--r--scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py b/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py
index 5ee4a044..62abe2ee 100644
--- a/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py
+++ b/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py
@@ -354,10 +354,13 @@ class CTRexScapyPktUtl(object):
"""
return layer offset by string
+ :parameters:
+
IP:0
IP:1
return offset
+
"""
l1=layer_des.split(":")
layer=""
@@ -377,13 +380,14 @@ class CTRexScapyPktUtl(object):
"""
return field_des (offset,size) layer:cnt.field
for example
-
+ 802|1Q.vlan get 802.1Q->valn replace | with .
IP.src
IP:0.src (first IP.src like IP.src)
for example IP:1.src for internal IP
return (offset, size) as tuple
+
"""
s=field_des.split(".");
@@ -391,7 +395,7 @@ class CTRexScapyPktUtl(object):
raise CTRexPacketBuildException(-11,("field desription should be layer:cnt.field e.g IP.src or IP:1.src "));
- layer_ex = s[0]
+ layer_ex = s[0].replace("|",".")
field = s[1]
l1=layer_ex.split(":")