title: Get IP addresses from PCAP file in scapy
body: <p>Is there a smart and fast way to get all IP addresses from a PCAP file?
  I need only (destination address, source address) tuples.</p>
  
  <p>Currently I'm using Scapy's <code>rdpcap</code> function like this:</p>
  
  <pre><code>from scapy.all import *
  pcap = rdpcap('file.pcap')
  
  ips = set([(p[IP].fields['src'], p[IP].fields['dst']) for p in pcap if p.haslayer(IP) == 1])
  </code></pre>
  
  <p>But it takes about two minutes on my machine to parse a 70MB PCAP file with 370 unique extracted entries...</p>