MCPcopy Index your code
hub / github.com/secdev/scapy / addfield

Method addfield

scapy/layers/bluetooth4LE.py:144–145  ·  view source on GitHub ↗
(self, pkt, s, val)

Source from the content-addressed store, hash-verified

142 Field.__init__(self, name, default, "<Q")
143
144 def addfield(self, pkt, s, val):
145 return s + struct.pack(self.fmt, self.i2m(pkt, val))[:5]
146
147 def getfield(self, pkt, s):
148 return s[5:], self.m2i(pkt, struct.unpack(self.fmt, s[:5] + b"\x00\x00\x00")[0]) # noqa: E501

Callers

nothing calls this directly

Calls 1

i2mMethod · 0.45

Tested by

no test coverage detected