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

Method getfield

scapy/fields.py:3492–3497  ·  view source on GitHub ↗
(self, pkt, s)

Source from the content-addressed store, hash-verified

3490 return s + struct.pack(fmt, rawpfx)
3491
3492 def getfield(self, pkt, s):
3493 # type: (Packet, bytes) -> Tuple[bytes, Tuple[str, int]]
3494 pfxlen = self.length_from(pkt)
3495 numbytes = self._numbytes(pfxlen)
3496 fmt = "!%is" % numbytes
3497 return s[numbytes:], self.m2i(pkt, (struct.unpack(fmt, s[:numbytes])[0], pfxlen)) # noqa: E501
3498
3499
3500class IPPrefixField(_IPPrefixFieldBase):

Callers

nothing calls this directly

Calls 3

_numbytesMethod · 0.95
m2iMethod · 0.95
length_fromMethod · 0.45

Tested by

no test coverage detected