From cce75776dbb2e05924b9628714886f11b762f1fa Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 2 Feb 2016 15:39:27 +0200 Subject: add valn packet ad offset --- .../trex_control_plane/client_utils/scapy_packet_builder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/automation/trex_control_plane/client_utils') 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(":") -- cgit 1.2.3-korg