MCPcopy Create free account
hub / github.com/secdev/scapy / addfield

Method addfield

scapy/layers/smb2.py:596–604  ·  view source on GitHub ↗
(self, pkt, s, val)

Source from the content-addressed store, hash-verified

594
595class _NextPacketListField(PacketListField):
596 def addfield(self, pkt, s, val):
597 # we use this field to set NextEntryOffset
598 res = b""
599 for i, v in enumerate(val):
600 x = self.i2m(pkt, v)
601 if v.Next is None and i != len(val) - 1:
602 x = struct.pack("<I", len(x)) + x[4:]
603 res += x
604 return s + res
605
606
607class FileBothDirectoryInformation(Packet):

Callers 2

addfieldMethod · 0.45
post_buildMethod · 0.45

Calls 1

i2mMethod · 0.45

Tested by

no test coverage detected