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

Method Resolve

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

Source from the content-addressed store, hash-verified

354 return big, size
355
356 def Resolve(self):
357 big = {"bigVal": 0, "bigMsk": 0}
358 offset = 0
359
360 for phf in self.fields:
361 if phf.Size == 0:
362 continue
363
364 big, bits = self.append(big, phf)
365
366 offset += bits
367
368 byteList1 = []
369 byteList2 = []
370
371 bigVal = big["bigVal"]
372 bigMsk = big["bigMsk"]
373
374 while offset > 0:
375 byteList1.append(bigVal & 0xFF)
376 byteList2.append(bigMsk & 0xFF)
377 bigVal = bigVal >> 8
378 bigMsk = bigMsk >> 8
379 offset -= 8
380
381 byteList1.reverse()
382 byteList2.reverse()
383 buffer = copy.deepcopy(byteList1)
384 mask = copy.deepcopy(byteList2)
385
386 self.Buffer = buffer
387 self.Mask = mask

Callers 1

ForgeMethod · 0.80

Calls 1

appendMethod · 0.95

Tested by

no test coverage detected