it's a Reader object
you can iterate over it and print each packet as shown in the tutorial
or you can use
Not tested but
you can iterate over it and print each packet as shown in the tutorial
or you can use
Reader.readpkts()
method to get a list and print it. If you just want the number of packets I guess you can print just the lenNot tested but
import dpkt with open('test1.pcap', 'rb') as f: pcap = dpkt.pcap.Reader(f) packets = pcap.readpkts() print(len(packets)) print(packets)note that you will need to process packets further in order to extract info - see how they use Ethernet class in the tutorial
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs