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

Method addfield

scapy/fields.py:3486–3490  ·  view source on GitHub ↗
(self, pkt, s, val)

Source from the content-addressed store, hash-verified

3484 return pfxlen
3485
3486 def addfield(self, pkt, s, val):
3487 # type: (Packet, bytes, Optional[Tuple[str, int]]) -> bytes
3488 (rawpfx, pfxlen) = self.i2m(pkt, val)
3489 fmt = "!%is" % self._numbytes(pfxlen)
3490 return s + struct.pack(fmt, rawpfx)
3491
3492 def getfield(self, pkt, s):
3493 # type: (Packet, bytes) -> Tuple[bytes, Tuple[str, int]]

Callers

nothing calls this directly

Calls 2

i2mMethod · 0.95
_numbytesMethod · 0.95

Tested by

no test coverage detected