From 53169abe298996dd87c0a62cfe41af0598c766d8 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Mon, 29 Feb 2016 17:03:09 +0200 Subject: hltapi: fix decrement exceeding maximal add_value range, add several useful functions, add mac profile --- scripts/stl/hlt/hlt_mac_ranges.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 scripts/stl/hlt/hlt_mac_ranges.py (limited to 'scripts/stl/hlt/hlt_mac_ranges.py') 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() + + + -- cgit 1.2.3-korg