title: how to capture wireless data frame using scapy in python
body: <p>I am using the following code to capture only data packets from a wireless network but following code is not working for the data packets it worked only for management frame. So what changes should be made to capture the data frames? </p>
  
  <pre><code>def PacketHandler(pkt) :                                          
     if pkt.haslayer(Dot11) :                      
             if pkt.type == 2 and pkt.subtype == 0 :                
                  TCP IP data
  
  
  
  sniff(iface="mon0", prn = PacketHandler)
  </code></pre>
  
  <p>code taken from:  <a href="http://hackoftheday.securitytube.net/2013/03/wi-fi-sniffer-in-10-lines-of-python.html" rel="nofollow">http://hackoftheday.securitytube.net/2013/03/wi-fi-sniffer-in-10-lines-of-python.html</a></p>