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_streams.py | |
parent | b85911614786e4b507d31fe38e1aaa9e4fe0136c (diff) |
add --pkt to stl-sim
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py | 15 |
1 files changed, 15 insertions, 0 deletions
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 7964992b..24acd28b 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 @@ -224,6 +224,7 @@ class STLStream(object): if not packet: packet = CScapyTRexPktBuilder(pkt = Ether()/IP()) + self.scapy_pkt_builder = packet # packet builder packet.compile() @@ -299,6 +300,14 @@ class STLStream(object): def get_rate (self): return self.get_rate_from_field(self.fields['mode']['rate']) + def to_pkt_dump (self): + scapy_b = self.scapy_pkt_builder; + if scapy_b and isinstance(scapy_b,CScapyTRexPktBuilder): + scapy_b.to_pkt_dump() + else: + print "Nothing to dump" + + def to_yaml (self): y = {} @@ -598,6 +607,12 @@ class STLProfile(object): return profile + def dump_as_pkt (self): + cnt=0; + for stream in self.streams: + print "Stream %d" % cnt + cnt = cnt +1 + stream.to_pkt_dump() def dump_to_yaml (self, yaml_file = None): yaml_list = [stream.to_yaml() for stream in self.streams] |