3 from scapy.all import *
5 def somefilter(pcapfile):
7 for p in PcapReader(pcapfile):
12 if (src,dst) in flows:
17 for flow,cnt in flows.items():
19 print 'tshark -r '+pcapfile+' -w "flow_'+flow[0]+'_'+flow[1]+'.pcap" -F pcap ' \
20 + '\'ip.src == '+flow[0]+' and ip.dst == '+flow[1]+'\''
22 if __name__ == "__main__":
23 somefilter("team15_ex21.pcap")