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

Method getfield

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

Source from the content-addressed store, hash-verified

725 # brave enough to refactor it, it'll be easier.
726
727 def getfield(self, pkt, s):
728 # type: (Packet, bytes) -> Tuple[bytes, int]
729 previous_post_dissect = pkt.post_dissect
730
731 def _post_dissect(self, s):
732 # type: (Packet, bytes) -> bytes
733 # Reset packet to allow post_build
734 self.raw_packet_cache = None
735 self.post_dissect = previous_post_dissect # type: ignore
736 return previous_post_dissect(s)
737 pkt.post_dissect = MethodType(_post_dissect, pkt) # type: ignore
738 s = TrailerBytes(s)
739 s, val = self.fld.getfield(pkt, s)
740 return bytes(s), val
741
742 def addfield(self, pkt, s, val):
743 # type: (Packet, bytes, Optional[int]) -> bytes

Callers

nothing calls this directly

Calls 2

TrailerBytesClass · 0.85
getfieldMethod · 0.45

Tested by

no test coverage detected