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

Function rdpcap

scapy/utils.py:1304–1315  ·  view source on GitHub ↗

Read a pcap or pcapng file and return a packet list :param count: read only packets

(filename, count=-1)

Source from the content-addressed store, hash-verified

1302
1303@conf.commands.register
1304def rdpcap(filename, count=-1):
1305 # type: (Union[IO[bytes], str], int) -> PacketList
1306 """Read a pcap or pcapng file and return a packet list
1307
1308 :param count: read only <count> packets
1309 """
1310 # Rant: Our complicated use of metaclasses and especially the
1311 # __call__ function is, of course, not supported by MyPy.
1312 # One day we should simplify this mess and use a much simpler
1313 # layout that will actually be supported and properly dissected.
1314 with PcapReader(filename) as fdesc: # type: ignore
1315 return fdesc.read_all(count=count)
1316
1317
1318# NOTE: Type hinting

Callers 1

hexeditFunction · 0.85

Calls 2

PcapReaderClass · 0.85
read_allMethod · 0.45

Tested by

no test coverage detected