summaryrefslogtreecommitdiffstats
path: root/scripts/stl
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-18 16:49:09 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-18 16:49:09 +0200
commit38defe118db360190121c44a9b65c1477f54afa3 (patch)
tree226c39ef54488e7a47fe80e2d450672d2a17df20 /scripts/stl
parent3931530bce5529e141f0fb10d6c72981aa0d97e6 (diff)
fix mpls example to use write_mask instruction
Diffstat (limited to 'scripts/stl')
-rw-r--r--scripts/stl/udp_1pkt_mpls_vm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/stl/udp_1pkt_mpls_vm.py b/scripts/stl/udp_1pkt_mpls_vm.py
index 262a662f..57cfb7ee 100644
--- a/scripts/stl/udp_1pkt_mpls_vm.py
+++ b/scripts/stl/udp_1pkt_mpls_vm.py
@@ -12,7 +12,7 @@ class STLS1(object):
pkt = Ether()/MPLS(label=17,cos=1,s=0,ttl=255)/MPLS(label=0,cos=1,s=1,ttl=12)/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('x'*20)
vm = CTRexScRaw( [ STLVmFlowVar(name="mlabel", min_value=1, max_value=2000, size=2, op="inc"), # 2 bytes var
- STLVmWrFlowVar(fv_name="mlabel", pkt_offset= "MPLS:1.label") # LABEL is 20 bits expected is val*8 as 3 LSB are off, 16,32,64 .. using new instruction it will be possible to write to any bits
+ STLVmWrMaskFlowVar(fv_name="mlabel", pkt_offset= "MPLS:1.label",pkt_cast_size=4, mask=0xFFFFF000,shift=12) # write to 20bit MSB
]
)