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

Method __init__

scapy/utils.py:1547–1559  ·  view source on GitHub ↗
(self, filename, fdesc=None, magic=None)

Source from the content-addressed store, hash-verified

1545
1546class PcapReader(RawPcapReader):
1547 def __init__(self, filename, fdesc=None, magic=None): # type: ignore
1548 # type: (str, IO[bytes], bytes) -> None
1549 RawPcapReader.__init__(self, filename, fdesc, magic)
1550 try:
1551 self.LLcls = conf.l2types.num2layer[
1552 self.linktype
1553 ] # type: Type[Packet]
1554 except KeyError:
1555 warning("PcapReader: unknown LL type [%i]/[%#x]. Using Raw packets" % (self.linktype, self.linktype)) # noqa: E501
1556 if conf.raw_layer is None:
1557 # conf.raw_layer is set on import
1558 import scapy.packet # noqa: F401
1559 self.LLcls = conf.raw_layer
1560
1561 def __enter__(self):
1562 # type: () -> PcapReader

Callers

nothing calls this directly

Calls 2

warningFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected