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

Method getfield

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

Source from the content-addressed store, hash-verified

1569 return super(_PacketFieldSingle, self).any2i(pkt, x)
1570
1571 def getfield(self,
1572 pkt, # type: Packet
1573 s, # type: bytes
1574 ):
1575 # type: (...) -> Tuple[bytes, K]
1576 i = self.m2i(pkt, s)
1577 remain = b""
1578 if conf.padding_layer in i:
1579 r = i[conf.padding_layer]
1580 del r.underlayer.payload
1581 remain = r.load
1582 return remain, i # type: ignore
1583
1584
1585class PacketField(_PacketFieldSingle[BasePacket]):

Callers

nothing calls this directly

Calls 1

m2iMethod · 0.45

Tested by

no test coverage detected