summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
diff options
context:
space:
mode:
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