title: Problems reading a .pcap file in Python using scapy
body: <p>I'm trying to create a program where I have to read a <strong>pcap</strong> file and then count the number of packets related to some IPs. I'm not used to program in Python but I have to use it because I'm using it on a Raspberry Pi and depending of the output I have to control several pins.</p>
  <p>Right now I have this, but I have an error and I don´t know how to solve it.</p>
  <pre><code>from scapy.all import *
  
  from scapy.utils import RawPcapReader
  from scapy.layers.l2 import Ether
  from scapy.layers.inet import IP, TCP
  
  def read_pcap(name_pcap):
      print(&quot;Opening&quot;, name_pcap)
      
      client_1 = '192.168.4.4:48878'
      server = '10.0.0.2:80'
      
      (client_1_ip, client_1_port) = client_1.split(':')
      (server_ip, server_port) = server.split(':')
      
      counter = 0
      
      for(pkt_data, pkt_metadata,) in RawPcapReader(name_pcap):
          counter += 1
          
          ether_pkt = Ether(pkt_data)
  
         # Below here are functions to filter the data
                  
      
  read_pcap(&quot;captura.pcap&quot;)
  </code></pre>
  <p>And the error is this one:</p>
  <p><strong>NameError: name 'Packet' is not defined</strong></p>
  <p>The error apears to be in this (<code>for(pkt_data, pkt_metadata,) in RawPcapReader(name_pcap):</code>) line.</p>
  <p>Someone knows how to solve it?</p>
  <p>Thnak you :)</p>