summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-03 18:10:29 +0200
committerimarom <imarom@cisco.com>2016-03-03 18:11:08 +0200
commitf749b4358cfedd1ef7e0b58f69f63ee4d00554ea (patch)
treed9d87a4480eacfb290cef25ede72a37880198cb5 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
parent13cfb2c4ea55b7e0dab40155d8d51e7955ae4681 (diff)
RX stats example "stl_rx_stream.py"
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.py7
1 files changed, 7 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 b2843ac3..dc787263 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
@@ -870,6 +870,13 @@ class CScapyTRexPktBuilder(CTrexPktBuilderInterface):
if isinstance(sc, CTRexScRaw):
self._compile_raw(sc)
+ def get_pkt_len (self):
+ if self.pkt:
+ return len(self.pkt)
+ elif self.pkt_raw:
+ return len(self.pkt_raw)
+ else:
+ raise CTRexPacketBuildException(-14, "Packet is empty")
####################################################
# private