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

Method getfield

scapy/fields.py:669–676  ·  view source on GitHub ↗
(self,
                 pkt,  # type: Packet
                 s,  # type: bytes
                 )

Source from the content-addressed store, hash-verified

667 return len(pkt.original)
668
669 def getfield(self,
670 pkt, # type: Packet
671 s, # type: bytes
672 ):
673 # type: (...) -> Tuple[bytes, Any]
674 # We need to get the length that has already been dissected
675 padlen = self.padlen(self.original_length(pkt) - len(s), pkt)
676 return self.fld.getfield(pkt, s[padlen:])
677
678 def addfield(self,
679 pkt, # type: Packet

Callers

nothing calls this directly

Calls 3

original_lengthMethod · 0.95
padlenMethod · 0.45
getfieldMethod · 0.45

Tested by

no test coverage detected