[Winpcap-users] Capturing wlan packets

Guy Harris guy at alum.mit.edu
Thu Dec 27 20:00:03 GMT 2007


Ziara . wrote:

> if I treat wlan packets like ethernet packets, when I am programming my 
> source code, I program like if was ethernet?

You program as if the link-layer type of the device is the value 
returned by pcap_datalink(adhandle).  That way, your application doesn't 
make any assumptions about the link-layer type.

> However, if you need access to the raw 802.11 packets and all the 
> control and management frames, this solution will not work and an 802.11 
> capture card should be considered instead.
>  
> It's mean that I have to get a wlan card (pcmcia, usb) that 
> support promiscuos mode?

Yes - for example, CACE Technologies AirPcap adapters:

	http://www.cacetech.com/products/airpcap_family.htm

Note that those aren't "WLAN cards" that you can use to connect to an 
802.11 network - they are usable *only* for capturing.

> and use...
>  
> pcap_datalink(adhandle) = DLT_IEEE802_11   ?

...and use whatever value pcap_datalink(adhandle) returns.  Don't write 
your code *assuming* what it returns - just call the routine and *use* 
what it returns.


More information about the Winpcap-users mailing list