summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/extras/nat_10ks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/nat/extras/nat_10ks.py')
-rw-r--r--src/plugins/nat/extras/nat_10ks.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/plugins/nat/extras/nat_10ks.py b/src/plugins/nat/extras/nat_10ks.py
index 33c7196eb9e..c210d5e81d8 100644
--- a/src/plugins/nat/extras/nat_10ks.py
+++ b/src/plugins/nat/extras/nat_10ks.py
@@ -1,35 +1,39 @@
from trex_stl_lib.api import *
-class STLS1:
- def create_stream (self):
- base_pkt = Ether()/IP(dst="2.2.0.1")/UDP(dport=12)
+class STLS1:
+ def create_stream(self):
+ base_pkt = Ether() / IP(dst="2.2.0.1") / UDP(dport=12)
pad = Padding()
if len(base_pkt) < 64:
pad_len = 64 - len(base_pkt)
- pad.load = '\x00' * pad_len
+ pad.load = "\x00" * pad_len
vm = STLVM()
- vm.tuple_var(name="tuple", ip_min="10.0.0.3", ip_max="10.0.0.102", port_min=1025, port_max=1124, limit_flows = 10000)
+ vm.tuple_var(
+ name="tuple",
+ ip_min="10.0.0.3",
+ ip_max="10.0.0.102",
+ port_min=1025,
+ port_max=1124,
+ limit_flows=10000,
+ )
vm.write(fv_name="tuple.ip", pkt_offset="IP.src")
vm.fix_chksum()
vm.write(fv_name="tuple.port", pkt_offset="UDP.sport")
- pkt = STLPktBuilder(pkt=base_pkt/pad, vm=vm)
+ pkt = STLPktBuilder(pkt=base_pkt / pad, vm=vm)
return STLStream(packet=pkt, mode=STLTXCont())
- def get_streams (self, direction = 0, **kwargs):
+ def get_streams(self, direction=0, **kwargs):
return [self.create_stream()]
# dynamic load - used for trex console or simulator
def register():
return STLS1()
-
-
-