diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-03-01 13:49:56 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-03-01 13:49:56 +0200 |
commit | 0af59f17029acc700b3a8bc569e05b5603d0a114 (patch) | |
tree | 963fe5a32c886d09875c1e82acdc824473db4545 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py | |
parent | b85911614786e4b507d31fe38e1aaa9e4fe0136c (diff) |
add --pkt to stl-sim
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py | 13 |
1 files changed, 13 insertions, 0 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 e27563eb..42d648a5 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 @@ -814,6 +814,19 @@ class CScapyTRexPktBuilder(CTrexPktBuilderInterface): if not was_set : raise CTRexPacketBuildException(-14, "no buffer inside the pcap file {0}".format(f_path)) + def to_pkt_dump(self): + p = self.pkt + if p and isinstance(p, Packet): + p.show2(); + hexdump(p); + return; + p = self.pkt_raw; + if p: + scapy_pkt = Ether(p); + scapy_pkt.show2(); + hexdump(p); + + def set_packet (self, pkt): """ Scapy packet Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/IP()/"A"*10 |