summaryrefslogtreecommitdiffstats
path: root/scripts/stl/udp_1pkt_dns.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/stl/udp_1pkt_dns.py')
-rw-r--r--scripts/stl/udp_1pkt_dns.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/stl/udp_1pkt_dns.py b/scripts/stl/udp_1pkt_dns.py
new file mode 100644
index 00000000..b9fac9b2
--- /dev/null
+++ b/scripts/stl/udp_1pkt_dns.py
@@ -0,0 +1,27 @@
+from trex_stl_lib.api import *
+from scapy.layers.dns import * # import from layers. in default only ipv4/ipv6 are imported for speedup
+
+
+class STLS1(object):
+
+ def __init__ (self):
+ pass;
+
+ def create_stream (self):
+ # DNS
+ pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(sport=1025)/DNS();
+
+ # burst of 17 packets
+ return STLStream(packet = STLPktBuilder(pkt = pkt ,vm = []),
+ mode = STLTXSingleBurst( pps = 1, total_pkts = 17) )
+
+
+ def get_streams (self, direction = 0, **kwargs):
+ # create 1 stream
+ return [ self.create_stream() ]
+
+def register():
+ return STLS1()
+
+
+