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

Method recv_raw

scapy/layers/tuntap.py:247–263  ·  view source on GitHub ↗
(self, x=None)

Source from the content-addressed store, hash-verified

245 return self
246
247 def recv_raw(self, x=None):
248 if x is None:
249 x = self.default_read_size
250
251 x += self.mtu_overhead
252
253 dat = self.ins.read(x)
254 r = self.kernel_packet_class, dat, time.time()
255 if self.mtu_overhead > 0 and self.strip_packet_info:
256 # Get the packed class of the payload, without triggering a full
257 # decode of the payload data.
258 cls = r[0](r[1][:self.mtu_overhead]).guess_payload_class(b'')
259
260 # Return the payload data only
261 return cls, r[1][self.mtu_overhead:], r[2]
262 else:
263 return r
264
265 def send(self, x):
266 # type: (Packet) -> int

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
guess_payload_classMethod · 0.45

Tested by

no test coverage detected