X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fextras%2Fnat_out2in_100ks.py;h=911f2cefda47a9bfebcf26217874142ccb1d5fe3;hb=d9b0c6fbf7aa5bd9af84264105b39c82028a4a29;hp=55ab5d42ee1af8f38f24d99368fcf194a482e411;hpb=f90348bcb4afd0af2611cefc43b17ef3042b511c;p=vpp.git diff --git a/src/plugins/nat/extras/nat_out2in_100ks.py b/src/plugins/nat/extras/nat_out2in_100ks.py index 55ab5d42ee1..911f2cefda4 100644 --- a/src/plugins/nat/extras/nat_out2in_100ks.py +++ b/src/plugins/nat/extras/nat_out2in_100ks.py @@ -1,35 +1,39 @@ from trex_stl_lib.api import * -class STLS1: - def create_stream (self): - base_pkt = Ether()/IP(src="2.2.0.1")/UDP(sport=12) +class STLS1: + def create_stream(self): + base_pkt = Ether() / IP(src="2.2.0.1") / UDP(sport=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="173.16.1.3", ip_max="173.16.4.234", port_min=1025, port_max=1124, limit_flows = 100000) + vm.tuple_var( + name="tuple", + ip_min="173.16.1.3", + ip_max="173.16.4.234", + port_min=1025, + port_max=1124, + limit_flows=100000, + ) vm.write(fv_name="tuple.ip", pkt_offset="IP.dst") vm.fix_chksum() vm.write(fv_name="tuple.port", pkt_offset="UDP.dport") - 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() - - -