@@ -0,0 +1,1877 @@
+from trex_stl_lib.api import *%0A%0Aclass STLS1(object):%0A    %22%22%22 attack 48.0.0.1 at port 80%0A    %22%22%22%0A%0A    def __init__ (self):%0A        self.max_pkt_size_l3  =9*1024;%0A%0A    def create_stream (self):%0A%0A        # TCP SYN%0A        base_pkt  = Ether()/IP(dst=%2248.0.0.1%22)/TCP(dport=80,flags=%22S%22)%0A%0A%0A        # vm%0A        vm = STLScVmRaw( %5B STLVmFlowVar(name=%22ip_src%22, %0A                                              min_value=%2216.0.0.0%22, %0A                                              max_value=%2218.0.0.254%22, %0A                                              size=4, op=%22random%22),%0A%0A                           STLVmFlowVar(name=%22src_port%22, %0A                                              min_value=1025, %0A                                              max_value=65000, %0A                                              size=2, op=%22random%22),%0A%0A                           STLVmWrFlowVar(fv_name=%22ip_src%22, pkt_offset= %22IP.src%22 ),%0A%0A%0A                           STLVmWrFlowVar(fv_name=%22src_port%22, %0A                                          pkt_offset= %22TCP.sport%22), # fix udp len  %0A%0A                           # must be last %0A                           STLVmFixChecksumHw(l3_offset = %22IP%22,%0A                                              l4_offset = %22TCP%22,%0A                                              l4_type  = CTRexVmInsFixHwCs.L4_TYPE_TCP )# hint, TRex can know that %0A%0A                          %5D%0A                       )%0A%0A        pkt = STLPktBuilder(pkt = base_pkt,%0A                            vm = vm)%0A%0A        return STLStream(packet = pkt,%0A                         random_seed = 0x1234,# can be remove. will give the same random value any run%0A                         mode = STLTXCont())%0A%0A%0A%0A    def get_streams (self, direction = 0, **kwargs):%0A        # create 1 stream %0A        return %5B self.create_stream() %5D%0A%0A%0A# dynamic load - used for trex console or simulator%0Adef register():%0A    return STLS1()%0A%0A%0A%0A

add simple example for FixHwChecksum instruction