summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-03-13 14:43:11 +0200
committerHanoh Haim <hhaim@cisco.com>2016-03-13 14:43:11 +0200
commit1c53541847206c2fb33ef713014fd43d7a6c1357 (patch)
treebe630f4e938581606d2f3a98e5ba1f9341e74047
parentb2732e9df76d1024673d1ce14b510dc63df3f14b (diff)
bdir simple
-rw-r--r--scripts/stl/udp_1pkt_simple_bdir.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/stl/udp_1pkt_simple_bdir.py b/scripts/stl/udp_1pkt_simple_bdir.py
new file mode 100644
index 00000000..c3371974
--- /dev/null
+++ b/scripts/stl/udp_1pkt_simple_bdir.py
@@ -0,0 +1,35 @@
+from trex_stl_lib.api import *
+
+class STLS1(object):
+
+ def create_stream (self):
+ return STLStream(
+ packet =
+ STLPktBuilder(
+ pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/
+ UDP(dport=12,sport=1025)/(10*'x')
+ ),
+ mode = STLTXCont())
+
+ def get_streams (self, direction = 0):
+ # create 1 stream
+ if direction==0:
+ src_ip="16.0.0.1"
+ dst_ip="48.0.0.1"
+ else:
+ src_ip="48.0.0.1"
+ dst_ip="16.0.0.1"
+
+ pkt = STLPktBuilder(
+ pkt = Ether()/IP(src=src_ip,dst=dst_ip)/
+ UDP(dport=12,sport=1025)/(10*'x') )
+
+ return [ STLStream( packet = pkt,mode = STLTXCont()) ]
+
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+