From 2e8a6255330ae7babdd0ace9889fa89796ac3687 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Wed, 3 Feb 2016 09:23:09 +0200 Subject: add fixup offset --- .../trex_control_plane/client_utils/scapy_packet_builder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/automation/trex_control_plane/client_utils') diff --git a/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py b/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py index 62abe2ee..fda77cf7 100644 --- a/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py +++ b/scripts/automation/trex_control_plane/client_utils/scapy_packet_builder.py @@ -508,10 +508,12 @@ class CTRexVmDescFixIpv4(CTRexVmDescBase): self.offset = parent._pkt_layer_offset(self.offset); class CTRexVmDescWrFlowVar(CTRexVmDescBase): - def __init__(self,fv_name,pkt_offset,add_val=0,is_big=True): + def __init__(self,fv_name,pkt_offset,offset_fixup=0,add_val=0,is_big=True): super(CTRexVmDescWrFlowVar, self).__init__() self.name =fv_name assert(type(fv_name)==str); + self.offset_fixup =offset_fixup + assert(type(offset_fixup)==int); self.pkt_offset =pkt_offset self.add_val =add_val assert(type(add_val)==int); @@ -519,7 +521,7 @@ class CTRexVmDescWrFlowVar(CTRexVmDescBase): assert(type(is_big)==bool); def get_obj (self): - return CTRexVmInsWrFlowVar(self.name,self.pkt_offset,self.add_val,self.is_big) + return CTRexVmInsWrFlowVar(self.name,self.pkt_offset+self.offset_fixup,self.add_val,self.is_big) def compile(self,parent): if type(self.pkt_offset)==str: -- cgit 1.2.3-korg