- vm1 = STLScVmRaw([
- STLVmFlowVar(name='nf_id', size=1, op='inc',
- min_value=0, max_value=self.nf_chains - 1),
- STLVmFlowVar(name='in_mac', size=2, op='inc',
- min_value=0, max_value=255),
- STLVmFlowVar(name='in_ip', size=1, op='inc',
- min_value=0, max_value=255),
- STLVmFlowVar(name='src_port', size=2, op='random',
- min_value=1024, max_value=65535),
- STLVmWrFlowVar(fv_name='nf_id', pkt_offset=32),
- STLVmWrFlowVar(fv_name='src_port', pkt_offset='UDP.sport'),
- STLVmWrFlowVar(fv_name='nf_id', pkt_offset=52),
- STLVmWrFlowVar(fv_name='in_mac', pkt_offset=58),
- STLVmWrFlowVar(fv_name='in_mac', pkt_offset=64),
- STLVmWrFlowVar(fv_name='in_ip', pkt_offset=82),
- STLVmWrFlowVar(fv_name='in_ip', pkt_offset=86),
- STLVmFixIpv4(offset = 'IP')
- ])
+ vm1 = STLScVmRaw(
+ [
+ STLVmFlowVar(
+ name=u"nf_id",
+ size=1,
+ op=u"inc",
+ min_value=0,
+ max_value=self.nf_chains - 1
+ ),
+ STLVmFlowVar(
+ name=u"in_mac",
+ size=2,
+ op=u"inc",
+ min_value=0,
+ max_value=255
+ ),
+ STLVmFlowVar(
+ name=u"in_ip",
+ size=1,
+ op=u"inc",
+ min_value=0,
+ max_value=255
+ ),
+ STLVmFlowVar(
+ name=u"src_port",
+ size=2,
+ op=u"random",
+ min_value=1024,
+ max_value=65535
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"nf_id",
+ pkt_offset=32
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"src_port",
+ pkt_offset=u"UDP.sport"
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"nf_id",
+ pkt_offset=52
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"in_mac",
+ pkt_offset=58
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"in_mac",
+ pkt_offset=64
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"in_ip",
+ pkt_offset=82
+ ),
+ STLVmWrFlowVar(
+ fv_name=u"in_ip",
+ pkt_offset=86
+ ),
+ STLVmFixChecksumHw(
+ l3_offset="IP:{}".format(0),
+ l4_offset="UDP:{}".format(0),
+ l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP
+ )
+ ]
+ )