Python3: Migration of files under traffic-profiles/trex 27/24327/6
authorBalaji Venkatraman <balajiv@cisco.com>
Tue, 14 Jan 2020 14:57:10 +0000 (06:57 -0800)
committerJan Gelety <jgelety@cisco.com>
Thu, 16 Jan 2020 14:40:21 +0000 (15:40 +0100)
Change-Id: Iae16225d3d3daa4e1e9b177228fb89efe4aa5405
Signed-off-by: Balaji Venkatraman <balajiv@cisco.com>
130 files changed:
resources/traffic_profiles/trex/profile_trex_stateless_base_class.py
resources/traffic_profiles/trex/trex-sl-2n-dot1qip4asym-ip4src254.py
resources/traffic_profiles/trex/trex-sl-2n-dot1qip6asym-ip6src253.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd10000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd100000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst-rnd1000000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst10000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst100000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4dst1000000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src253.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-ip4src254.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc500kdst500k.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc50kdst50k.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4-macsrc5kdst5k.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-1000u15p.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-10u1000p-conc.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-1u1p.py
resources/traffic_profiles/trex/trex-sl-2n-ethip4udp-lb.py
resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst10000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst100000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6dst1000000.py
resources/traffic_profiles/trex/trex-sl-2n-ethip6-ip6src253.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-10c2n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c10n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c2n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c4n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c6n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-1c8n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c10n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c2n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c4n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c6n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-2c8n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c2n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c4n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-4c6n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c2n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-6c4n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c1n.py
resources/traffic_profiles/trex/trex-sl-2n3n-ethip4-ip4src254-8c2n.py
resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan100ip4src254ip4dst254.py
resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan10ip4src254ip4dst254.py
resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1ip4src254ip4dst254.py
resources/traffic_profiles/trex/trex-sl-3n-dot1qip4-vlan1kip4src254ip4dst254.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst10000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst100000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst1000000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst20000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst253_l3fwd.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst4.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst400.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst40000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst5000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-1cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-2cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-4cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000-8cnf.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4dst60000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src253.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-ip4src254.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100ip4src100.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc100kip4src100k.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc10kip4src10k.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc500kdst500k.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc50kdst50k.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4-macsrc5kdst5k.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1000u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u1000p-conc.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-100u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u1000p-conc.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u10p-conc.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-10u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-1u1p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-2000u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip4udp-4000u15p.py
resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst10000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst100000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6dst1000000.py
resources/traffic_profiles/trex/trex-sl-3n-ethip6-ip6src253.py
resources/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254-bvi.py
resources/traffic_profiles/trex/trex-sl-dot1qip4-vlan1ip4src254ip4dst254.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src10udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src1udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src2udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src4udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src6udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-dot1qip4vxlan-ip4src8udpsrcrnd.py
resources/traffic_profiles/trex/trex-sl-ethip4vxlan-ip4src1udpsrcrnd.py

index 6576cb7..a373679 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -153,13 +153,15 @@ class TrafficStreamsBaseClass:
             # Streams for latency measurement:
             # Direction 0 --> 1
             lat_stream1 = STLStream(
-                packet=pkt_lat_a, flow_stats=STLFlowLatencyStats(pg_id=0),
+                packet=pkt_lat_a,
+                flow_stats=STLFlowLatencyStats(pg_id=0),
                 mode=STLTXCont(pps=9000)
             )
             # Direction 1 --> 0
             # second traffic stream with a phase of 10ns (inter-stream gap)
             lat_stream2 = STLStream(
-                packet=pkt_lat_b, isg=10.0,
+                packet=pkt_lat_b,
+                isg=10.0,
                 flow_stats=STLFlowLatencyStats(pg_id=1),
                 mode=STLTXCont(pps=9000)
             )
@@ -185,11 +187,13 @@ class TrafficStreamsBaseClass:
 
                 # Create the streams:
                 stream1.append(STLStream(
-                    packet=pkt_a, isg=stream[u"isg"],
+                    packet=pkt_a,
+                    isg=stream[u"isg"],
                     mode=STLTXCont(pps=stream[u"pps"]))
                 )
                 stream2.append(STLStream(
-                    packet=pkt_b, isg=stream[u"isg"],
+                    packet=pkt_b,
+                    isg=stream[u"isg"],
                     mode=STLTXCont(pps=stream[u"pps"]))
                 )
             streams = list()
index 676236b..ae411e2 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -41,13 +41,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.vlan_id = 10
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -59,31 +59,65 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+          Ether() /
+          IP(
+              src=self.p1_src_start_ip,
+              dst=self.p1_dst_start_ip,
+              proto=61
+          )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      Dot1Q(vlan=self.vlan_id) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+          Ether() /
+          Dot1Q(
+              vlan=self.vlan_id
+          ) /
+          IP(
+              src=self.p2_src_start_ip,
+              dst=self.p2_dst_start_ip,
+              proto=61
+          )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index acf6bcc..f2e9e81 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -41,13 +41,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.vlan_id = 10
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '2001:1::2'
-        self.p1_src_end_ip = '2001:1::FE'
-        self.p1_dst_start_ip = '2001:2::2'
+        self.p1_src_start_ip = u"2001:1::2"
+        self.p1_src_end_ip = u"2001:1::FE"
+        self.p1_dst_start_ip = u"2001:2::2"
 
-        self.p2_src_start_ip = '2001:2::2'
-        self.p2_src_end_ip = '2001:2::FE'
-        self.p2_dst_start_ip = '2001:1::2'
+        self.p2_src_start_ip = u"2001:2::2"
+        self.p2_src_end_ip = u"2001:2::FE"
+        self.p2_dst_start_ip = u"2001:1::2"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -58,37 +58,67 @@ class TrafficStreams(TrafficStreamsBaseClass):
         :rtype: tuple
         """
 
-        base_p1, count_p1 = self._get_start_end_ipv6(self.p1_src_start_ip,
-                                                     self.p1_src_end_ip)
-        base_p2, count_p2 = self._get_start_end_ipv6(self.p2_src_start_ip,
-                                                     self.p2_src_end_ip)
+        base_p1, count_p1 = self._get_start_end_ipv6(
+            self.p1_src_start_ip,
+            self.p1_src_end_ip
+        )
+        base_p2, count_p2 = self._get_start_end_ipv6(
+            self.p2_src_start_ip,
+            self.p2_src_end_ip
+        )
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IPv6(src=self.p1_src_start_ip,
-                           dst=self.p1_dst_start_ip))
+        base_pkt_a = (
+            Ether() /
+            IPv6(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      Dot1Q(vlan=self.vlan_id) /
-                      IPv6(src=self.p2_src_start_ip,
-                           dst=self.p2_dst_start_ip))
+        base_pkt_b = (
+            Ether() /
+            Dot1Q(
+                vlan=self.vlan_id
+            ) /
+            IPv6(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="ipv6_src",
-                                       min_value=base_p1,
-                                       max_value=base_p1 + count_p1,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_src",
-                                         pkt_offset="IPv6.src",
-                                         offset_fixup=8)])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_src",
+                    min_value=base_p1,
+                    max_value=base_p1 + count_p1,
+                    size=8, op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_src",
+                    pkt_offset=u"IPv6.src",
+                    offset_fixup=8
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_src",
-                                       min_value=base_p2,
-                                       max_value=base_p2 + count_p2,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_src",
-                                         pkt_offset="IPv6.src",
-                                         offset_fixup=8)])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_src",
+                    min_value=base_p2,
+                    max_value=base_p2 + count_p2,
+                    size=8, op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_src",
+                    pkt_offset=u"IPv6.src",
+                    offset_fixup=8
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 4ad4de5..321b12c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -55,34 +55,65 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+                Ether() /
+                IP(
+                    src=self.p1_src_start_ip,
+                    dst=self.p1_dst_start_ip,
+                    proto=61
+                )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+                Ether() /
+                IP(
+                    src=self.p2_src_start_ip,
+                    dst=self.p2_dst_start_ip,
+                    proto=61
+                )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVarRepeatableRandom (\
-                              name=u"dst",
-                              min_value=self.p1_dst_start_ip,
-                              max_value=self.p1_dst_end_ip,
-                              size=4,
-                              limit=10000, seed=0x0000),
-                          STLVmWrFlowVar(\
-                              fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    limit=10000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
+
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVarRepeatableRandom (name=u"dst",
-                              min_value=self.p2_dst_start_ip,
-                              max_value=self.p2_dst_end_ip,
-                              size=4,
-                              limit=10000, seed=0x0000),
-                          STLVmWrFlowVar(fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    limit=10000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 423af64..1e181c9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -55,34 +55,64 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+                Ether() /
+                IP(
+                    src=self.p1_src_start_ip,
+                    dst=self.p1_dst_start_ip,
+                    proto=61
+                )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+                Ether() /
+                IP(
+                    src=self.p2_src_start_ip,
+                    dst=self.p2_dst_start_ip,
+                    proto=61
+                )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVarRepeatableRandom (\
-                             name=u"dst",
-                             min_value=self.p1_dst_start_ip,
-                             max_value=self.p1_dst_end_ip,
-                             size=4,
-                             limit=100000, seed=0x0000),
-                          STLVmWrFlowVar(fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    limit=100000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVarRepeatableRandom (\
-                             name=u"dst",
-                             min_value=self.p2_dst_start_ip,
-                             max_value=self.p2_dst_end_ip,
-                             size=4,
-                             limit=100000, seed=0x0000),
-                          STLVmWrFlowVar(fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    limit=100000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index d32d90c..d7e74ab 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -55,34 +55,64 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+                Ether() /
+                IP(
+                    src=self.p1_src_start_ip,
+                    dst=self.p1_dst_start_ip,
+                    proto=61
+                )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+                Ether() /
+                IP(
+                    src=self.p2_src_start_ip,
+                    dst=self.p2_dst_start_ip,
+                    proto=61
+                )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVarRepeatableRandom (\
-                              name=u"dst",
-                              min_value=self.p1_dst_start_ip,
-                              max_value=self.p1_dst_end_ip,
-                              size=4,
-                              limit=1000000, seed=0x0000),
-                          STLVmWrFlowVar(fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    limit=1000000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVarRepeatableRandom (\
-                              name=u"dst",
-                              min_value=self.p2_dst_start_ip,
-                              max_value=self.p2_dst_end_ip,
-                              size=4,
-                              limit=1000000, seed=0x0000),
-                          STLVmWrFlowVar(fv_name=u"dst", pkt_offset=u"IP.dst"),
-                          STLVmFixIpv4(offset=u"IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVarRepeatableRandom(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    limit=1000000,
+                    seed=0x0000
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index e324aa7..e9d5fb1 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.1'
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.0.39.15'
+        self.p1_src_start_ip = u"10.0.0.1"
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.0.39.15"
 
-        self.p2_src_start_ip = '20.0.0.1'
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.0.39.15'
+        self.p2_src_start_ip = u"20.0.0.1"
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.0.39.15"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -55,30 +55,61 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+          Ether() /
+          IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+          Ether() /
+          IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4, op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 65b85b4..5977d36 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.1'
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.1.134.159'
+        self.p1_src_start_ip = u"10.0.0.1"
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.1.134.159"
 
-        self.p2_src_start_ip = '20.0.0.1'
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.1.134.159'
+        self.p2_src_start_ip = u"20.0.0.1"
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.1.134.159"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -55,30 +55,62 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+          Ether() /
+          IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+          Ether() /
+          IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 84df261..8b63b82 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.1'
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.15.66.63'
+        self.p1_src_start_ip = u"10.0.0.1"
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.15.66.63"
 
-        self.p2_src_start_ip = '20.0.0.1'
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.15.66.63'
+        self.p2_src_start_ip = u"20.0.0.1"
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.15.66.63"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -55,30 +55,62 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+          Ether() /
+          IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+          Ether() /
+          IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name="dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op="inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name="dst",
+                    pkt_offset="IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset="IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name="dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op="inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name="dst",
+                    pkt_offset="IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset="IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 685365a..883883a 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.2'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.2'
+        self.p1_src_start_ip = u"10.10.10.2"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.2"
 
-        self.p2_src_start_ip = '20.20.20.2'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.2'
+        self.p2_src_start_ip = u"20.20.20.2"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.2"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -55,28 +55,62 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IP(src=self.p1_src_start_ip,
-                                  dst=self.p1_dst_start_ip,
-                                  proto=61)
+        base_pkt_a = (
+            Ether() /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IP(src=self.p2_src_start_ip,
-                                  dst=self.p2_dst_start_ip,
-                                  proto=61)
+        base_pkt_b = (
+            Ether() /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 1a0b047..fc6167d 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -55,28 +55,62 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IP(src=self.p1_src_start_ip,
-                                  dst=self.p1_dst_start_ip,
-                                  proto=61)
+        base_pkt_a = (
+            Ether() /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IP(src=self.p2_src_start_ip,
-                                  dst=self.p2_dst_start_ip,
-                                  proto=61)
+        base_pkt_b = (
+            Ether() /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 6dda8fe..9c55482 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,24 +43,24 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.clients = 500000
 
         # MACs used in packet headers.
-        self.p1_src_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p1_dst_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
-        self.p2_src_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p2_dst_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.0'
-        self.p1_src_end_ip = '10.7.161.31'
+        self.p1_src_start_ip = u"10.0.0.0"
+        self.p1_src_end_ip = u"10.7.161.31"
 
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.7.161.31'
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.7.161.31"
 
-        self.p2_src_start_ip = '20.0.0.0'
-        self.p2_src_end_ip = '20.7.161.31'
+        self.p2_src_start_ip = u"20.0.0.0"
+        self.p2_src_end_ip = u"20.7.161.31"
 
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.7.161.31'
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.7.161.31"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -72,62 +72,134 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(src=self.p1_src_start_mac,
-                            dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                src=self.p1_src_start_mac,
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(src=self.p2_src_start_mac,
-                            dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+          Ether(
+              src=self.p2_src_start_mac,
+              dst=self.p2_dst_start_mac
+          ) /
+          IP(
+              src=self.p2_src_start_ip,
+              dst=self.p2_dst_start_ip,
+              proto=61
+          )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                      fv_name=u"ip_dst",
+                      pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                      offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 0355911..42e3db6 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,24 +43,24 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.clients = 50000
 
         # MACs used in packet headers.
-        self.p1_src_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p1_dst_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
-        self.p2_src_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p2_dst_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.0'
-        self.p1_src_end_ip = '10.0.195.79'
+        self.p1_src_start_ip = u"10.0.0.0"
+        self.p1_src_end_ip = u"10.0.195.79"
 
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.0.195.79'
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.0.195.79"
 
-        self.p2_src_start_ip = '20.0.0.0'
-        self.p2_src_end_ip = '20.0.195.79'
+        self.p2_src_start_ip = u"20.0.0.0"
+        self.p2_src_end_ip = u"20.0.195.79"
 
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.0.195.79'
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.0.195.79"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -72,62 +72,133 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(src=self.p1_src_start_mac,
-                            dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                src=self.p1_src_start_mac,
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(src=self.p2_src_start_mac,
-                            dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                src=self.p2_src_start_mac,
+                dst=self.p2_dst_start_mac) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 0ce4ca9..29df337 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,24 +43,24 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.clients = 5000
 
         # MACs used in packet headers.
-        self.p1_src_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p1_dst_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p1_src_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p1_dst_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
-        self.p2_src_start_mac = 'fa:ce:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
-        self.p2_dst_start_mac = 'ca:fe:00:00:00:00' # mask: 00:00:FF:FF:FF:FF
+        self.p2_src_start_mac = u"fa:ce:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
+        self.p2_dst_start_mac = u"ca:fe:00:00:00:00" # mask: 00:00:FF:FF:FF:FF
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.0.0.0'
-        self.p1_src_end_ip = '10.0.19.135'
+        self.p1_src_start_ip = u"10.0.0.0"
+        self.p1_src_end_ip = u"10.0.19.135"
 
-        self.p1_dst_start_ip = '20.0.0.0'
-        self.p1_dst_end_ip = '20.0.19.135'
+        self.p1_dst_start_ip = u"20.0.0.0"
+        self.p1_dst_end_ip = u"20.0.19.135"
 
-        self.p2_src_start_ip = '20.0.0.0'
-        self.p2_src_end_ip = '20.0.19.135'
+        self.p2_src_start_ip = u"20.0.0.0"
+        self.p2_src_end_ip = u"20.0.19.135"
 
-        self.p2_dst_start_ip = '10.0.0.0'
-        self.p2_dst_end_ip = '10.0.19.135'
+        self.p2_dst_start_ip = u"10.0.0.0"
+        self.p2_dst_end_ip = u"10.0.19.135"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -72,62 +72,134 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(src=self.p1_src_start_mac,
-                            dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                src=self.p1_src_start_mac,
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(src=self.p2_src_start_mac,
-                            dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                src=self.p2_src_start_mac,
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p1_dst_start_ip,
-                                       max_value=self.p1_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p1_dst_start_ip,
+                    max_value=self.p1_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_src",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmFlowVar(name="mac_dst",
-                                       min_value=0,
-                                       max_value=self.clients-1,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 8),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset= 2),
-                          STLVmFlowVar(name="ip_src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="ip_dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="ip_dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_src",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=0,
+                    max_value=self.clients-1,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_src",
+                    pkt_offset= 8
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset= 2
+                ),
+                STLVmFlowVar(
+                    name=u"ip_src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"ip_dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ip_dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 74a07c3..4c306aa 100755 (executable)
@@ -69,29 +69,29 @@ class TrafficStreams(TrafficStreamsBaseClass):
 
         # Direction 0 --> 1
         base_pkt_a = (
-                Ether() /
-                IP(
-                    src=self.p1_src_start_ip,
-                    dst=self.p1_dst_start_ip,
-                    proto=17
-                ) /
-                UDP(
-                    sport=self.p1_src_start_udp_port,
-                    dport=self.p1_dst_start_udp_port
-                )
+            Ether() /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=17
+            ) /
+            UDP(
+                sport=self.p1_src_start_udp_port,
+                dport=self.p1_dst_start_udp_port
+            )
         )
         # Direction 1 --> 0
         base_pkt_b = (
-                Ether() /
-                IP(
-                    src=self.p2_src_start_ip,
-                    dst=self.p2_dst_start_ip,
-                    proto=17
-                ) /
-                UDP(
-                    sport=self.p2_src_start_udp_port,
-                    dport=self.p2_dst_start_udp_port
-                )
+            Ether() /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=17
+            ) /
+            UDP(
+                sport=self.p2_src_start_udp_port,
+                dport=self.p2_dst_start_udp_port
+            )
         )
 
         # Direction 0 --> 1
index 384037d..77f05f8 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -41,15 +41,15 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.2'
-        self.p1_src_end_ip = '10.10.10.11'
-        self.p1_dst_start_ip = '20.20.20.2'
-        self.p1_dst_end_ip = '20.20.20.11'
+        self.p1_src_start_ip = u"10.10.10.2"
+        self.p1_src_end_ip = u"10.10.10.11"
+        self.p1_dst_start_ip = u"20.20.20.2"
+        self.p1_dst_end_ip = u"20.20.20.11"
 
-        self.p2_src_start_ip = '20.20.20.2'
-        self.p2_src_end_ip = '20.20.20.11'
-        self.p2_dst_start_ip = '10.10.10.2'
-        self.p2_dst_end_ip = '10.10.10.11'
+        self.p2_src_start_ip = u"20.20.20.2"
+        self.p2_src_end_ip = u"20.20.20.11"
+        self.p2_dst_start_ip = u"10.10.10.2"
+        self.p2_dst_end_ip = u"10.10.10.11"
 
         # UDP ports used in packet headers.
         self.p1_src_start_udp_port = 1001
@@ -72,56 +72,108 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=17) /
-                      UDP(sport=self.p1_src_start_udp_port,
-                          dport=self.p1_dst_start_udp_port))
+        base_pkt_a = (
+            Ether() /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=17
+            ) /
+            UDP(
+                sport=self.p1_src_start_udp_port,
+                dport=self.p1_dst_start_udp_port
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=17) /
-                      UDP(sport=self.p2_src_start_udp_port,
-                          dport=self.p2_dst_start_udp_port))
+        base_pkt_b = (
+            Ether() /
+            IP(
+                  src=self.p2_src_start_ip,
+                  dst=self.p2_dst_start_ip,
+                  proto=17
+            ) /
+            UDP(
+                sport=self.p2_src_start_udp_port,
+                dport=self.p2_dst_start_udp_port
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([
-            STLVmTupleGen(ip_min=self.p1_src_start_ip,
-                          ip_max=self.p1_src_end_ip,
-                          port_min=self.p1_src_start_udp_port,
-                          port_max=self.p1_src_end_udp_port,
-                          name="tuple1_src"),
-            STLVmTupleGen(ip_min=self.p1_dst_start_ip,
-                          ip_max=self.p1_dst_end_ip,
-                          port_min=self.p1_dst_start_udp_port,
-                          port_max=self.p1_dst_end_udp_port,
-                          name="tuple1_dst"),
-            STLVmWrFlowVar(fv_name="tuple1_src.ip", pkt_offset="IP.src"),
-            STLVmWrFlowVar(fv_name="tuple1_dst.ip", pkt_offset="IP.dst"),
-            STLVmFixIpv4(offset="IP"),
-            STLVmWrFlowVar(fv_name="tuple1_src.port", pkt_offset="UDP.sport"),
-            STLVmWrFlowVar(fv_name="tuple1_dst.port", pkt_offset="UDP.dport")
-        ])
+        vm1 = STLScVmRaw(
+            [
+                STLVmTupleGen(
+                    ip_min=self.p1_src_start_ip,
+                    ip_max=self.p1_src_end_ip,
+                    port_min=self.p1_src_start_udp_port,
+                    port_max=self.p1_src_end_udp_port,
+                    name=u"tuple1_src"
+                ),
+                STLVmTupleGen(
+                    ip_min=self.p1_dst_start_ip,
+                    ip_max=self.p1_dst_end_ip,
+                    port_min=self.p1_dst_start_udp_port,
+                    port_max=self.p1_dst_end_udp_port,
+                    name=u"tuple1_dst"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple1_src.ip",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple1_dst.ip",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple1_src.port",
+                    pkt_offset=u"UDP.sport"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple1_dst.port",
+                    pkt_offset=u"UDP.dport"
+                )
+            ]
+        )
         # Direction 0 --> 1
-        vm2 = STLScVmRaw([
-            STLVmTupleGen(ip_min=self.p2_src_start_ip,
-                          ip_max=self.p2_src_end_ip,
-                          port_min=self.p2_src_start_udp_port,
-                          port_max=self.p2_src_end_udp_port,
-                          name="tuple2_src"),
-            STLVmTupleGen(ip_min=self.p2_dst_start_ip,
-                          ip_max=self.p2_dst_end_ip,
-                          port_min=self.p2_dst_start_udp_port,
-                          port_max=self.p2_dst_end_udp_port,
-                          name="tuple2_dst"),
-            STLVmWrFlowVar(fv_name="tuple2_src.ip", pkt_offset="IP.src"),
-            STLVmWrFlowVar(fv_name="tuple2_dst.ip", pkt_offset="IP.dst"),
-            STLVmFixIpv4(offset="IP"),
-            STLVmWrFlowVar(fv_name="tuple2_src.port", pkt_offset="UDP.sport"),
-            STLVmWrFlowVar(fv_name="tuple2_dst.port", pkt_offset="UDP.dport")
-        ])
+        vm2 = STLScVmRaw(
+            [
+                STLVmTupleGen(
+                    ip_min=self.p2_src_start_ip,
+                    ip_max=self.p2_src_end_ip,
+                    port_min=self.p2_src_start_udp_port,
+                    port_max=self.p2_src_end_udp_port,
+                    name=u"tuple2_src"
+                ),
+                STLVmTupleGen(
+                    ip_min=self.p2_dst_start_ip,
+                    ip_max=self.p2_dst_end_ip,
+                    port_min=self.p2_dst_start_udp_port,
+                    port_max=self.p2_dst_end_udp_port,
+                    name=u"tuple2_dst"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple2_src.ip",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple2_dst.ip",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple2_src.port",
+                    pkt_offset=u"UDP.sport"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"tuple2_dst.port",
+                    pkt_offset=u"UDP.dport"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index a4d0842..a892ec8 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -41,11 +41,11 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_ip = '20.0.0.0'
-        self.p1_dst_ip = '12.0.0.2'
+        self.p1_src_ip = u"20.0.0.0"
+        self.p1_dst_ip = u"12.0.0.2"
 
-        self.p2_src_ip = '12.0.0.2'
-        self.p2_dst_ip = '200.0.0.0'
+        self.p2_src_ip = u"12.0.0.2"
+        self.p2_dst_ip = u"200.0.0.0"
 
         # UDP ports used in packet headers.
         self.p1_src_udp_port = 1024
@@ -64,15 +64,31 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether() /
-                      IP(src=self.p1_src_ip, dst=self.p1_dst_ip, proto=17) /
-                      UDP(sport=self.p1_src_udp_port,
-                          dport=self.p1_dst_udp_port))
+        base_pkt_a = (
+            Ether() /
+            IP(
+                src=self.p1_src_ip,
+                dst=self.p1_dst_ip,
+                proto=17
+            ) /
+            UDP(
+                sport=self.p1_src_udp_port,
+                dport=self.p1_dst_udp_port
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether() /
-                      IP(src=self.p2_src_ip, dst=self.p2_dst_ip, proto=17) /
-                      UDP(sport=self.p2_src_udp_port,
-                          dport=self.p2_dst_udp_port))
+        base_pkt_b = (
+            Ether() /
+            IP(
+                src=self.p2_src_ip,
+                dst=self.p2_dst_ip,
+                proto=17
+            ) /
+            UDP(
+                sport=self.p2_src_udp_port,
+                dport=self.p2_dst_udp_port
+            )
+        )
 
         return base_pkt_a, base_pkt_b, None, None
 
index bcd5328..df05cbf 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Intel and/or its affiliates.
+# Copyright (c) 2020 Intel and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -36,14 +36,14 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '192.168.50.74'
-        self.p1_src_end_ip = '192.168.50.79'
-        self.p1_dst_start_ip = '90.1.2.1'
+        self.p1_src_start_ip = u"192.168.50.74"
+        self.p1_src_end_ip = u"192.168.50.79"
+        self.p1_dst_start_ip = u"90.1.2.1"
 
-        self.p2_src_start_ip = '192.168.60.74'
-        self.p2_src_end_ip = '192.168.60.79'
-        self.p2_dst_start_ip = '192.168.50.74'
-        self.p2_dst_end_ip = '192.168.50.79'
+        self.p2_src_start_ip = u"192.168.60.74"
+        self.p2_src_end_ip = u"192.168.60.79"
+        self.p2_dst_start_ip = u"192.168.50.74"
+        self.p2_dst_end_ip = u"192.168.50.79"
 
         # UDP ports used in packet headers.
         self.p1_src_udp_port = 63
@@ -62,36 +62,80 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IP(src=self.p1_src_start_ip,
-                                  dst=self.p1_dst_start_ip,
-                                  proto=17) / UDP(sport=self.p1_src_udp_port,
-                                                  dport=self.p1_dst_udp_port)
+        base_pkt_a = (
+            Ether() /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=17) /
+            UDP(
+                sport=self.p1_src_udp_port,
+                dport=self.p1_dst_udp_port
+             )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IP(src=self.p2_src_start_ip,
-                                  dst=self.p2_dst_start_ip,
-                                  proto=17) / UDP(sport=self.p2_src_udp_port,
-                                                  dport=self.p2_dst_udp_port)
+        base_pkt_b = (
+            Ether() /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=17
+             ) /
+            UDP(
+                sport=self.p2_src_udp_port,
+                dport=self.p2_dst_udp_port
+             )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFlowVar(name="dst",
-                                       min_value=self.p2_dst_start_ip,
-                                       max_value=self.p2_dst_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="dst", pkt_offset="IP.dst"),
-                          STLVmFixIpv4(offset="IP")])
-
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFlowVar(
+                    name=u"dst",
+                    min_value=self.p2_dst_start_ip,
+                    max_value=self.p2_dst_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"dst",
+                    pkt_offset=u"IP.dst"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         return base_pkt_a, base_pkt_b, vm1, vm2
 
 
index 085787a..f1b9035 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '2001:1::1'
-        self.p1_dst_start_ip = '2001:2::0'
-        self.p1_dst_end_ip = '2001:2::270F'
+        self.p1_src_start_ip = u"2001:1::1"
+        self.p1_dst_start_ip = u"2001:2::0"
+        self.p1_dst_end_ip = u"2001:2::270F"
 
-        self.p2_src_start_ip = '2001:2::1'
-        self.p2_dst_start_ip = '2001:1::0'
-        self.p2_dst_end_ip = '2001:1::270F'
+        self.p2_src_start_ip = u"2001:2::1"
+        self.p2_dst_start_ip = u"2001:1::0"
+        self.p2_dst_end_ip = u"2001:1::270F"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -54,34 +54,66 @@ class TrafficStreams(TrafficStreamsBaseClass):
         :rtype: tuple
         """
 
-        base_p1, count_p1 = self._get_start_end_ipv6(self.p1_dst_start_ip,
-                                                     self.p1_dst_end_ip)
-        base_p2, count_p2 = self._get_start_end_ipv6(self.p2_dst_start_ip,
-                                                     self.p2_dst_end_ip)
+        base_p1, count_p1 = self._get_start_end_ipv6(
+            self.p1_dst_start_ip,
+            self.p1_dst_end_ip
+        )
+        base_p2, count_p2 = self._get_start_end_ipv6(
+            self.p2_dst_start_ip,
+            self.p2_dst_end_ip
+        )
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IPv6(src=self.p1_src_start_ip,
-                                    dst=self.p1_dst_start_ip)
+        base_pkt_a = (
+            Ether() /
+            IPv6(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IPv6(src=self.p2_src_start_ip,
-                                    dst=self.p2_dst_start_ip)
+        base_pkt_b = (
+            Ether() /
+            IPv6(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p1,
-                                       max_value=base_p1 + count_p1,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p1,
+                    max_value=base_p1 + count_p1,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p2,
-                                       max_value=base_p2 + count_p2,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p2,
+                    max_value=base_p2 + count_p2,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index b329430..87e7672 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '2001:1::1'
-        self.p1_dst_start_ip = '2001:2::0'
-        self.p1_dst_end_ip = '2001:2::1:869F'
+        self.p1_src_start_ip = u"2001:1::1"
+        self.p1_dst_start_ip = u"2001:2::0"
+        self.p1_dst_end_ip = u"2001:2::1:869F"
 
-        self.p2_src_start_ip = '2001:2::1'
-        self.p2_dst_start_ip = '2001:1::0'
-        self.p2_dst_end_ip = '2001:1::1:869F'
+        self.p2_src_start_ip = u"2001:2::1"
+        self.p2_dst_start_ip = u"2001:1::0"
+        self.p2_dst_end_ip = u"2001:1::1:869F"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -54,34 +54,66 @@ class TrafficStreams(TrafficStreamsBaseClass):
         :rtype: tuple
         """
 
-        base_p1, count_p1 = self._get_start_end_ipv6(self.p1_dst_start_ip,
-                                                     self.p1_dst_end_ip)
-        base_p2, count_p2 = self._get_start_end_ipv6(self.p2_dst_start_ip,
-                                                     self.p2_dst_end_ip)
+        base_p1, count_p1 = self._get_start_end_ipv6(
+            self.p1_dst_start_ip,
+            self.p1_dst_end_ip
+        )
+        base_p2, count_p2 = self._get_start_end_ipv6(
+            self.p2_dst_start_ip,
+            self.p2_dst_end_ip
+        )
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IPv6(src=self.p1_src_start_ip,
-                                    dst=self.p1_dst_start_ip)
+        base_pkt_a = (
+            Ether() /
+            IPv6(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IPv6(src=self.p2_src_start_ip,
-                                    dst=self.p2_dst_start_ip)
+        base_pkt_b = (
+            Ether() /
+            IPv6(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p1,
-                                       max_value=base_p1 + count_p1,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p1,
+                    max_value=base_p1 + count_p1,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p2,
-                                       max_value=base_p2 + count_p2,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p2,
+                    max_value=base_p2 + count_p2,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index e45d37f..9214b62 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '2001:1::1'
-        self.p1_dst_start_ip = '2001:2::0'
-        self.p1_dst_end_ip = '2001:2::F:423F'
+        self.p1_src_start_ip = u"2001:1::1"
+        self.p1_dst_start_ip = u"2001:2::0"
+        self.p1_dst_end_ip = u"2001:2::F:423F"
 
-        self.p2_src_start_ip = '2001:2::1'
-        self.p2_dst_start_ip = '2001:1::0'
-        self.p2_dst_end_ip = '2001:1::F:423F'
+        self.p2_src_start_ip = u"2001:2::1"
+        self.p2_dst_start_ip = u"2001:1::0"
+        self.p2_dst_end_ip = u"2001:1::F:423F"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -54,34 +54,66 @@ class TrafficStreams(TrafficStreamsBaseClass):
         :rtype: tuple
         """
 
-        base_p1, count_p1 = self._get_start_end_ipv6(self.p1_dst_start_ip,
-                                                     self.p1_dst_end_ip)
-        base_p2, count_p2 = self._get_start_end_ipv6(self.p2_dst_start_ip,
-                                                     self.p2_dst_end_ip)
+        base_p1, count_p1 = self._get_start_end_ipv6(
+            self.p1_dst_start_ip,
+            self.p1_dst_end_ip
+        )
+        base_p2, count_p2 = self._get_start_end_ipv6(
+            self.p2_dst_start_ip,
+            self.p2_dst_end_ip
+        )
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IPv6(src=self.p1_src_start_ip,
-                                    dst=self.p1_dst_start_ip)
+        base_pkt_a = (
+            Ether() /
+            IPv6(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = Ether() / IPv6(src=self.p2_src_start_ip,
-                                    dst=self.p2_dst_start_ip)
+        base_pkt_b = (
+            Ether() /
+            IPv6(
+                  src=self.p2_src_start_ip,
+                  dst=self.p2_dst_start_ip
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p1,
-                                       max_value=base_p1 + count_p1,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p1,
+                    max_value=base_p1 + count_p1,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_dst",
-                                       min_value=base_p2,
-                                       max_value=base_p2 + count_p2,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_dst",
-                                         pkt_offset="IPv6.dst",
-                                         offset_fixup=8)])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_dst",
+                    min_value=base_p2,
+                    max_value=base_p2 + count_p2,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_dst",
+                    pkt_offset=u"IPv6.dst",
+                    offset_fixup=8
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 8bce54f..7ac5f75 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -37,13 +37,13 @@ class TrafficStreams(TrafficStreamsBaseClass):
         super(TrafficStreamsBaseClass, self).__init__()
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '2001:1::2'
-        self.p1_src_end_ip = '2001:1::FE'
-        self.p1_dst_start_ip = '2001:2::2'
+        self.p1_src_start_ip = u"2001:1::2"
+        self.p1_src_end_ip = u"2001:1::FE"
+        self.p1_dst_start_ip = u"2001:2::2"
 
-        self.p2_src_start_ip = '2001:2::2'
-        self.p2_src_end_ip = '2001:2::FE'
-        self.p2_dst_start_ip = '2001:1::2'
+        self.p2_src_start_ip = u"2001:2::2"
+        self.p2_src_end_ip = u"2001:2::FE"
+        self.p2_dst_start_ip = u"2001:1::2"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -54,34 +54,66 @@ class TrafficStreams(TrafficStreamsBaseClass):
         :rtype: tuple
         """
 
-        base_p1, count_p1 = self._get_start_end_ipv6(self.p1_src_start_ip,
-                                                     self.p1_src_end_ip)
-        base_p2, count_p2 = self._get_start_end_ipv6(self.p2_src_start_ip,
-                                                     self.p2_src_end_ip)
+        base_p1, count_p1 = self._get_start_end_ipv6(
+            self.p1_src_start_ip,
+            self.p1_src_end_ip
+        )
+        base_p2, count_p2 = self._get_start_end_ipv6(
+            self.p2_src_start_ip,
+            self.p2_src_end_ip
+        )
 
         # Direction 0 --> 1
-        base_pkt_a = Ether() / IPv6(src=self.p1_src_start_ip,
-                                    dst=self.p1_dst_start_ip)
-        # Direction 1 --> 0
-        base_pkt_b = Ether() / IPv6(src=self.p2_src_start_ip,
-                                    dst=self.p2_dst_start_ip)
+        base_pkt_a = (
+            Ether() /
+            IPv6(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip
+            )
+        )
+          # Direction 1 --> 0
+        base_pkt_b = (
+            Ether() /
+            IPv6(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="ipv6_src",
-                                       min_value=base_p1,
-                                       max_value=base_p1 + count_p1,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_src",
-                                         pkt_offset="IPv6.src",
-                                         offset_fixup=8)])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_src",
+                    min_value=base_p1,
+                    max_value=base_p1 + count_p1,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_src",
+                    pkt_offset=u"IPv6.src",
+                    offset_fixup=8
+              )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="ipv6_src",
-                                       min_value=base_p2,
-                                       max_value=base_p2 + count_p2,
-                                       size=8, op="inc"),
-                          STLVmWrFlowVar(fv_name="ipv6_src",
-                                         pkt_offset="IPv6.src",
-                                         offset_fixup=8)])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"ipv6_src",
+                    min_value=base_p2,
+                    max_value=base_p2 + count_p2,
+                    size=8,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"ipv6_src",
+                    pkt_offset=u"IPv6.src",
+                    offset_fixup=8
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 4495d32..7a70177 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 1
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,89 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4, op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index fe5d986..abae4f4 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 2
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u'52:54:00:00:00:01'
+        self.p2_dst_start_mac = u'52:54:00:00:00:02'
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u'10.10.10.1'
+        self.p1_src_end_ip = u'10.10.10.254'
+        self.p1_dst_start_ip = u'20.20.20.1'
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u'20.20.20.1'
+        self.p2_src_end_ip = u'20.20.20.254'
+        self.p2_dst_start_ip = u'10.10.10.1'
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 83c2f04..cb48235 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 10
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 2b1aa52..86b6a95 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -45,17 +45,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 1
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -67,40 +67,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 9fffaf2..277c17f 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 2
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index a256107..d5f1332 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 4
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 68647d4..d284756 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 6
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 59b571d..ac95e1b 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 8
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+          )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 429758e..33905d3 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 10
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 667c970..5940921 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 1
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+              dst=self.p1_dst_start_mac
+            ) /
+            IP(
+              src=self.p1_src_start_ip,
+              dst=self.p1_dst_start_ip,
+              proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+              dst=self.p2_dst_start_mac
+            ) /
+            IP(
+              src=self.p2_src_start_ip,
+              dst=self.p2_dst_start_ip,
+              proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 647cbc8..cc9f8fc 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 2
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                      offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index a3059be..9edc6cb 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 4
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 5225ff3..a9acd36 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 6
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                  ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 6b105b8..1d78147 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 8
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                  STLVmFlowVar(
+                    name=u"mac_dst",
+                      min_value=self.nf_nodes,
+                      max_value=self.nf_chains*self.nf_nodes,
+                      size=1,
+                      step=self.nf_nodes,
+                      op=u"inc"
+                  ),
+                  STLVmWrFlowVar(
+                      fv_name=u"mac_dst",
+                      pkt_offset=4
+                  ),
+                  STLVmFlowVar(
+                      name=u"src",
+                      min_value=self.p2_src_start_ip,
+                      max_value=self.p2_src_end_ip,
+                      size=4,
+                      op=u"inc"
+                  ),
+                  STLVmWrFlowVar(
+                      fv_name=u"src",
+                      pkt_offset=u"IP.src"
+                  ),
+                  STLVmFixIpv4(
+                      offset=u"IP"
+                  )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 38a9a7d..4d1f640 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 1
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 5fb88e3..e7da41d 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 2
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,88 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1, step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 8608f37..2d874d4 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 4
 
         # MACs used in packet headers.
-        self.p1_dst_start_mac = '52:54:00:00:00:01'
-        self.p2_dst_start_mac = '52:54:00:00:00:02'
+        self.p1_dst_start_mac = u"52:54:00:00:00:01"
+        self.p2_dst_start_mac = u"52:54:00:00:00:02"
 
         # IPs used in packet headers.
-        self.p1_src_start_ip = '10.10.10.1'
-        self.p1_src_end_ip = '10.10.10.254'
-        self.p1_dst_start_ip = '20.20.20.1'
+        self.p1_src_start_ip = u"10.10.10.1"
+        self.p1_src_end_ip = u"10.10.10.254"
+        self.p1_dst_start_ip = u"20.20.20.1"
 
-        self.p2_src_start_ip = '20.20.20.1'
-        self.p2_src_end_ip = '20.20.20.254'
-        self.p2_dst_start_ip = '10.10.10.1'
+        self.p2_src_start_ip = u"20.20.20.1"
+        self.p2_src_end_ip = u"20.20.20.254"
+        self.p2_dst_start_ip = u"10.10.10.1"
 
     def define_packets(self):
         """Defines the packets to be sent from the traffic generator.
@@ -65,40 +65,90 @@ class TrafficStreams(TrafficStreamsBaseClass):
         """
 
         # Direction 0 --> 1
-        base_pkt_a = (Ether(dst=self.p1_dst_start_mac) /
-                      IP(src=self.p1_src_start_ip,
-                         dst=self.p1_dst_start_ip,
-                         proto=61))
+        base_pkt_a = (
+            Ether(
+                dst=self.p1_dst_start_mac
+            ) /
+            IP(
+                src=self.p1_src_start_ip,
+                dst=self.p1_dst_start_ip,
+                proto=61
+            )
+        )
         # Direction 1 --> 0
-        base_pkt_b = (Ether(dst=self.p2_dst_start_mac) /
-                      IP(src=self.p2_src_start_ip,
-                         dst=self.p2_dst_start_ip,
-                         proto=61))
+        base_pkt_b = (
+            Ether(
+                dst=self.p2_dst_start_mac
+            ) /
+            IP(
+                src=self.p2_src_start_ip,
+                dst=self.p2_dst_start_ip,
+                proto=61
+            )
+        )
 
         # Direction 0 --> 1
-        vm1 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=1,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p1_src_start_ip,
-                                       max_value=self.p1_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm1 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=1,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p1_src_start_ip,
+                    max_value=self.p1_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
         # Direction 1 --> 0
-        vm2 = STLScVmRaw([STLVmFlowVar(name="mac_dst",
-                                       min_value=self.nf_nodes,
-                                       max_value=self.nf_chains*self.nf_nodes,
-                                       size=1, step=self.nf_nodes, op="inc"),
-                          STLVmWrFlowVar(fv_name="mac_dst", pkt_offset=4),
-                          STLVmFlowVar(name="src",
-                                       min_value=self.p2_src_start_ip,
-                                       max_value=self.p2_src_end_ip,
-                                       size=4, op="inc"),
-                          STLVmWrFlowVar(fv_name="src", pkt_offset="IP.src"),
-                          STLVmFixIpv4(offset="IP")])
+        vm2 = STLScVmRaw(
+            [
+                STLVmFlowVar(
+                    name=u"mac_dst",
+                    min_value=self.nf_nodes,
+                    max_value=self.nf_chains*self.nf_nodes,
+                    size=1,
+                    step=self.nf_nodes,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"mac_dst",
+                    pkt_offset=4
+                ),
+                STLVmFlowVar(
+                    name=u"src",
+                    min_value=self.p2_src_start_ip,
+                    max_value=self.p2_src_end_ip,
+                    size=4,
+                    op=u"inc"
+                ),
+                STLVmWrFlowVar(
+                    fv_name=u"src",
+                    pkt_offset=u"IP.src"
+                ),
+                STLVmFixIpv4(
+                    offset=u"IP"
+                )
+            ]
+        )
 
         return base_pkt_a, base_pkt_b, vm1, vm2
 
index 088cde7..a28475f 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -43,17 +43,17 @@ class TrafficStreams(TrafficStreamsBaseClass):
         self.nf_nodes = 6