AirPcap Sample Programs Library
How to Compile the Sample
Programs
How to Run the Sample Programs
Sample Programs list
The AirPcap developer's pack contains a complete set of sample programs. They are ideal to use as starting points for application development or simply to familiarize yourself with the AirPcap API.
Each sample program has its own folder, containing:
Microsoft Visual Studio 6/2002/2003
Microsoft Visual Studio 2005/2008
GCC/cygwin
Microsoft Visual Studio
GCC/cygwin
The following is the list of the standard sample programs provided in the AirPcap developer's pack:
airpcap_and_libpcap
This example shows how to use AirPcap and libpcap at the same time to
set the wireless adapter parameters and then receive and print the wireless
packets.
The program needs files from both the AirPcap and WinPcap developer's pack,
and ASSUMES THAT THE TWO DEVELOPER'S PACKS ARE UNPACKED IN THE SAME FOLDER.
SetChannel
This program sets the channel the specified AirPcap adapter is listening
on, and saves it as the default channel for that adapter. In this way,
successive accesses to the adapter will use this channel.
GetMacAddress
This program open an adapter, retrieves its mac address, and prints it
on the screen.
Capture_no_radio
This program is a reference of how to use the AirPcap API to receive
802.11 packets with no radio information.
Note that the suggested method to receive packets is using WinPcap, as shown
in the "airpcap_and_libpcap" sample program.
After opening the adapter specified by the user, this program sets it to
receive bare 802.11 packets (no radiotap header), and then loops capturing
packets, interpreting them, and printing them to the console.
Capture_radio
This program is a reference of how to use the AirPcap API to receive
802.11 packets radiotap-encoded radio information.
Note that the suggested method to receive packets is using WinPcap, as shown
in the "airpcap_and_libpcap" sample program.
After opening the adapter specified by the user, this program sets it to
receive 802.11 packets with radio information (radiotap header), and then
loops capturing packets, interpreting them, and printing them to the
console.
Capture_PPI
This program is a reference of how to use the AirPcap API to receive 802.11
packets with PPI-encoded information.
Note that the suggested method to receive packets is using WinPcap, as shown
in the "airpcap_and_libpcap" sample program.
After opening the adapter specified by the user, this program sets it to
receive 802.11 packets with PPI information (PPI header), and then loops
capturing packets, interpreting them, and printing them to the console.
Dot11NTransmitterTest
This program shows how to transmit raw 802.11N frames with an
802.11n-capable adapter (e.g. AirPcap Nx) using the PPI encapsulation to
select the 802.11n modulation (MCS, gap info, 20 or 40MHz channel).
HwTimestamp
This sample shows how to retrieve the current value of the adapter free
running counter used to timestamp packets.
Transmit802_11PPI
This program shows how to transmit raw 802.11 frames, with or without rate
information.
MonitorMode
This example shows how use the AirpcapSetMonitorMode() function to turn
monitor mode on or off.
The program asks for the interface number, the channel, and if the adapter
will be set in monitor mode or not. At that point, it starts capturing
packets and displaying them on the screen.
NOTE: with AirPcap adapters, monitor mode is on by default, so you
need to use AirpcapSetMonitorMode() only when you want to turn OFF monitor
mode. The main reason to turn monitor mode off is that, when not in monitor
mode, the adapter will acknowledge the data frames sent to its address. This
is useful when the adapter needs to interact with other devices on the
802.11 network, bacause handling the ACKs in software is too slow.
AirPcap_AP
This program allows the user to test the transmission functionality of the
AirPcap adapters by simulating a fake AP. This fake AP should be visible
from any computer in the area.
CACE Technologies AirPcap documentation. Copyright (c) 2007-2008 CACE Technologies, Inc. All rights reserved.