Issue reading packets from a pcap file. dpkt
- by Chris
I am running the following test script to try to read packets from a sample .pcap file I have downloaded.
import socket
import dpkt
import sys
pcapReader = dpkt.pcap.Reader(file("test1.pcap", "rb"))
for ts, data in pcapReader:
ether = dpkt.ethernet.Ethernet(data)
if ether.type != dpkt.ethernet.ETH_TYPE_IP: raise
ip = ether.data
…