summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-03-04 17:10:33 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-03-04 17:10:33 +0200
commit2a3171f73e838fccbc82d2d8553e36c7c3820e28 (patch)
treeb9a77061079deeb96de9ce69958582fe27c4bce3
parent5650f2add4b03ef8d51d670af5db9fccade80f3f (diff)
add manual padding to 60 bytes with zeros
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py14
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py2
-rw-r--r--scripts/exp/pcap.pcapbin476 -> 476 bytes
-rw-r--r--scripts/exp/pcap_with_vm.pcapbin2284 -> 2284 bytes
-rw-r--r--scripts/exp/syn_attack.pcapbin3824 -> 3824 bytes
-rw-r--r--scripts/exp/udp_1pkt_range_clients_split_garp.pcapbin3824 -> 3824 bytes
6 files changed, 6 insertions, 10 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
index a3430c79..6a2e268f 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
@@ -950,20 +950,18 @@ class CScapyTRexPktBuilder(CTrexPktBuilderInterface):
# for buffer, promote to a scapy packet
if self.pkt_raw:
self.pkt = Ether(self.pkt_raw)
- if self.remove_fcs and self.pkt.lastlayer().name == 'Padding':
- self.pkt.lastlayer().underlayer.remove_payload()
- self.pkt.build()
self.pkt_raw = None
# regular scapy packet
- elif self.pkt:
- self.pkt.build()
-
- else:
+ elif not self.pkt:
# should not reach here
raise CTRexPacketBuildException(-11, 'empty packet')
-
+ if self.remove_fcs and self.pkt.lastlayer().name == 'Padding':
+ self.pkt.lastlayer().underlayer.remove_payload()
+ if len(self.pkt) < 60: # simulator can write padding with non-zeros, set it explicit
+ self.pkt /= Padding('\x00' * (60 - len(self.pkt)))
+ self.pkt.build()
self.is_pkt_built = True
def _pkt_layer_offset (self,layer_name):
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
index c41fa0c2..5aa544ab 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
@@ -344,8 +344,6 @@ class STLStream(object):
imports_arr = []
if 'MPLS(' in packet_command:
imports_arr.append('from scapy.contrib.mpls import MPLS')
- if 'VXLAN(' in packet_command:
- imports_arr.append('from scapy.contrib.mpls import MPLS')
imports = '\n'.join(imports_arr)
if payload:
diff --git a/scripts/exp/pcap.pcap b/scripts/exp/pcap.pcap
index 34a2e9b6..b13275ee 100644
--- a/scripts/exp/pcap.pcap
+++ b/scripts/exp/pcap.pcap
Binary files differ
diff --git a/scripts/exp/pcap_with_vm.pcap b/scripts/exp/pcap_with_vm.pcap
index a278dd8e..a7a2d2ba 100644
--- a/scripts/exp/pcap_with_vm.pcap
+++ b/scripts/exp/pcap_with_vm.pcap
Binary files differ
diff --git a/scripts/exp/syn_attack.pcap b/scripts/exp/syn_attack.pcap
index aa420d2c..84da36a7 100644
--- a/scripts/exp/syn_attack.pcap
+++ b/scripts/exp/syn_attack.pcap
Binary files differ
diff --git a/scripts/exp/udp_1pkt_range_clients_split_garp.pcap b/scripts/exp/udp_1pkt_range_clients_split_garp.pcap
index dde0c6dd..627bcd54 100644
--- a/scripts/exp/udp_1pkt_range_clients_split_garp.pcap
+++ b/scripts/exp/udp_1pkt_range_clients_split_garp.pcap
Binary files differ