def read(): hpcap = pcap.pcap_open_offline('./test.pcap') while True: (pkthdr, packet) = pcap.pcap_next(hpcap) if pkthdr is None: break print(pkthdr.caplen, pkthdr.len, packet) pcap.pcap_close(hpcap)
def setUp(self): self.hpcap = pcap.pcap_open_offline('./test.pcap')