Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
 def setUp(self): 
     self.hpcap = pcap.pcap_open_offline('./test.pcap')
Пример #4
0
 def setUp(self):
     self.hpcap = pcap.pcap_open_offline('./test.pcap')