summaryrefslogtreecommitdiffstats
path: root/scripts/stl
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-02-29 17:03:09 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-02-29 17:03:09 +0200
commit53169abe298996dd87c0a62cfe41af0598c766d8 (patch)
treebab4d9ff60f3d8084bf0cc8f93817bf337ffdd1f /scripts/stl
parentb85911614786e4b507d31fe38e1aaa9e4fe0136c (diff)
hltapi: fix decrement exceeding maximal add_value range, add several useful functions, add mac profile
Diffstat (limited to 'scripts/stl')
-rwxr-xr-xscripts/stl/hlt/hlt_mac_ranges.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/stl/hlt/hlt_mac_ranges.py b/scripts/stl/hlt/hlt_mac_ranges.py
new file mode 100755
index 00000000..e265ba5f
--- /dev/null
+++ b/scripts/stl/hlt/hlt_mac_ranges.py
@@ -0,0 +1,29 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Eth/IP/UDP stream with VM, to change the MAC addr (only 32 lsb)
+ '''
+
+ def create_streams (self, direction = 0):
+ return STLHltStream(l3_protocol = 'ipv4', l4_protocol = 'udp',
+ mac_src = '10:00:00:00:00:01', mac_dst = '10:00:00:00:01:00',
+ mac_src2 = '11:11:00:00:00:01', mac_dst2 = '11:11:00:00:01:00',
+ mac_src_step = 2, mac_src_mode = 'decrement', mac_src_count = 19,
+ mac_dst_step = 2, mac_dst_mode = 'increment', mac_dst_count = 19,
+ mac_src2_step = 2, mac_src2_mode = 'decrement', mac_src2_count = 19,
+ mac_dst2_step = 2, mac_dst2_mode = 'increment', mac_dst2_count = 19,
+ direction = direction,
+ save_to_yaml = '/tmp/foo.yaml',
+ )
+
+ def get_streams (self, direction = 0):
+ return self.create_streams(direction)
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+