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

Class Dot3

scapy/layers/l2.py:312–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310
311
312class Dot3(Packet):
313 name = "802.3"
314 fields_desc = [DestMACField("dst"),
315 SourceMACField("src"),
316 LenField("len", None, "H")]
317
318 def extract_padding(self, s):
319 # type: (bytes) -> Tuple[bytes, bytes]
320 tmp_len = self.len
321 return s[:tmp_len], s[tmp_len:]
322
323 def answers(self, other):
324 # type: (Packet) -> int
325 if isinstance(other, Dot3):
326 return self.payload.answers(other.payload)
327 return 0
328
329 def mysummary(self):
330 # type: () -> str
331 return "802.3 %s > %s" % (self.src, self.dst)
332
333 @classmethod
334 def dispatch_hook(cls, _pkt=None, *args, **kargs):
335 # type: (Optional[Any], *Any, **Any) -> Type[Packet]
336 if _pkt and len(_pkt) >= 14:
337 if struct.unpack("!H", _pkt[12:14])[0] > 1500:
338 return Ether
339 return cls
340
341
342class LLC(Packet):

Callers 1

negotiate_trunkFunction · 0.90

Calls 3

LenFieldClass · 0.90
DestMACFieldClass · 0.85
SourceMACFieldClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…