kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.09k stars 270 forks source link

how to analysis more pcap together #494

Closed lixiang957 closed 3 years ago

lixiang957 commented 3 years ago
abc = dpkt.pcap.Reader(open(a, 'rb'))
bcd = dpkt.pcap.Reader(open(b, 'rb'))
e = dpkt.pcap.Reader(open(b, 'rb'))

for ts, data in (abc, bcd, e):

obormot commented 3 years ago

pcap.Reader gives an iterator, so this is really a basic Python question, not a dpkt issue. something like this would work:

for aa, bb, cc in zip(abc, bcd, e):
    ts1, data1 = aa
    ts2, data2 = bb
    ts3, data3 = cc