title: How to count packet using scapy
body: <p>I have problem with count new packet in scapy. That means I try count every packet which is sniff. I wrote it this way but in output I had new packet and there is always one below him. </p>
  
  <p>My current code is:</p>
  
  <pre><code>def print_packet(packet):
      count = 0
      ip_layer = packet.getlayer(IP)
      print("[!] New Packet: {src} -&gt; {dst}".format(src=ip_layer.src, dst=ip_layer.dst))
      count += 1
      print(count)
  
  print("[*] Start sniffing...")
  sniff(iface=interface, filter="ip", prn=print_packet)
  print("[*] Stop sniffing"
  </code></pre>