title: Filtering scapy packet information Python
body: <p>I am writing a program that involves scapy and I am trying to sniff all the packets and search a specific keyword in each packet (like "TCP") </p>
  
  <p>Here is the code that sniffs all the packets:</p>
  
  <pre><code>def pkt_callback(pkt):
      pkt.show()
  
  sniff(iface = 'eth0', prn = lambda x : x.show())
  </code></pre>
  
  <p>And here's the code trying to present only tcp packets</p>
  
  <pre><code>from scapy.all import *
  global my_raw
  my_raw = "tcp"
  
  def pkt_callback(pkt):
      global my_raw
      if my_raw in pkt:
          pkt.show() 
  
  sniff(iface='eth0', filter="", prn=lambda x: x.show())
  print sniff
  </code></pre>