title: Read 802.11 packets from pcap file using python
body: <p>I found similar questions but they do not solve my problem</p>
  
  <p>I have a pcap file (screenshot of it opened in Wireshark below) which contains some 802.11 frame data
  <a href="https://i.stack.imgur.com/NpZqX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NpZqX.jpg" alt="enter image description here"></a></p>
  
  <p>I tried to read it using the following code I found from <a href="https://stackoverflow.com/questions/47228102/how-to-decode-data-from-scapy-dot11-packet">this</a> question. But all it printed was the following:</p>
  
  <p>Code:</p>
  
  <pre><code>from scapy.all import Dot11
  from scapy.all import sniff
  
  def parse(frame):
      if frame.haslayer(Dot11):
          print("ToDS:", frame.FCfield &amp; 0b1 != 0)
          print("MF:", frame.FCfield &amp; 0b10 != 0)
          print("WEP:", frame.FCfield &amp; 0b01000000 != 0)
          print("src MAC:", frame.addr2)
          print("dest MAC:", frame.addr1)
          print("BSSID:", frame.addr3)
          print("Duration ID:", frame.ID)
          print("Sequence Control:", frame.SC)
          print(feature(frame))
          print("\n")
  
      else:
          print("Not dot11")
  
  
  sniff(offline="./testData/test.pcap", prn=parse)
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>D:\Apps\Python3\python.exe F:/tes/pcapReader/main.py
  Not dot11
  Not dot11
  Not dot11
  Not dot11
  ...
  </code></pre>
  
  <p>From this, what I understand is that there are no dot11 packets in my trace, which is confusing because the protocol for most packets is 802.11 according to the Wireshark output.</p>
  
  <p>I also tried to use the <a href="https://dpkt.readthedocs.io/en/latest/api/api_auto.html#module-dpkt.ieee80211" rel="nofollow noreferrer">dpkt 802.11 package</a>, but didn't get any result</p>
  
  <p>What am I missing here?</p>
  
  <p>(I'm using Python3, if that's any help) </p>