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

Method getfield

scapy/fields.py:249–260  ·  view source on GitHub ↗

Extract an internal value from a string Extract from the raw packet `s` the field value belonging to layer `pkt`. Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal

(self, pkt, s)

Source from the content-addressed store, hash-verified

247 )
248
249 def getfield(self, pkt, s):
250 # type: (Packet, bytes) -> Tuple[bytes, I]
251 """Extract an internal value from a string
252
253 Extract from the raw packet `s` the field value belonging to layer
254 `pkt`.
255
256 Returns a two-element list,
257 first the raw packet string after having removed the extracted field,
258 second the extracted field itself in internal representation.
259 """
260 return s[self.sz:], self.m2i(pkt, self.struct.unpack(s[:self.sz])[0])
261
262 def do_copy(self, x):
263 # type: (I) -> I

Callers 8

getfieldMethod · 0.45
getfieldMethod · 0.45
getfieldMethod · 0.45
getfieldMethod · 0.45
getfieldMethod · 0.45
getfieldMethod · 0.45
getfieldMethod · 0.45
do_dissectMethod · 0.45

Calls 1

m2iMethod · 0.95

Tested by

no test coverage detected