summaryrefslogtreecommitdiffstats
path: root/scripts/stl/udp_1pkt_simple.py
blob: 3149229106b7a6efe88ab656dff5660c48659402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 
        return [ self.create_stream() ]


# dynamic load - used for trex console or simulator
def register():
    return STLS1()