title: Parsing PCAP in Python 2.6
body: <p>I am trying to simply parse through data in a packet capture.  I've taken examples just to see if I could compile and I end up with an error.  Below is the code.  </p>
  
  <pre><code>import dpkt
  import sys
  
  f = open('test.pcap')
  pcap = dpkt.pcap.Reader(f)
  
  for ts, buf in pcap:
      eth = dpkt.ethernet.Ethernet(buf)
      ip = eth.data
      tcp = ip.data
  
  
  f.close()
  </code></pre>
  
  <p>The error I get is the following:File "inspection.py", line 15, in  tcp = ip.data</p>
  
  <p>AttributeError: 'str' object has no attribute 'data'</p>
  
  <p>Any help would be appreciated.  </p>