MCPcopy Create free account
hub / github.com/FDio/vpp / Adjust

Method Adjust

extras/packetforge/ProtocolHeader.py:157–173  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 return 0
156
157 def Adjust(self):
158 autoIncreases = []
159 increaseHeaders = []
160
161 self.resolveAllSize()
162
163 for phf in self.fields:
164 if phf.Field.IsAutoIncrease:
165 autoIncreases.append(phf)
166 if phf.Field.IsIncreaseLength and self.resolveOptional(phf.Field.Optional):
167 increaseHeaders.append(phf)
168
169 for f1 in autoIncreases:
170 for f2 in increaseHeaders:
171 f1.UpdateValue(
172 ExpressionConverter.IncreaseValue(f1.Value, f2.Size >> 3), True
173 )
174
175 def resolveAllSize(self):
176 for phf in self.fields:

Callers 1

ForgeMethod · 0.80

Calls 4

resolveAllSizeMethod · 0.95
resolveOptionalMethod · 0.95
appendMethod · 0.80
UpdateValueMethod · 0.45

Tested by

no test coverage detected