airpcap.h File Reference

Data Structures

struct  _AirpcapDeviceDescription
 Entry in the list returned by AirpcapGetDeviceList(). More...
struct  _AirpcapKey
 WEP key container. More...
struct  _AirpcapMacAddress
 Storage for a MAC address. More...
struct  _AirpcapKeysCollection
 This structure is used to store a collection of WEP keys. Note that the definition of the structure doesn't contain any key, so be careful to allocate a buffer with the size of the key, like in the following example:. More...
struct  _AirpcapBpfHeader
 Packet header. More...
struct  _AirpcapDeviceTimestamp
 Structure used to read the free running counter on a device. More...
struct  _AirpcapChannelInfo
 Channel information. Used by AirpcapSetDeviceChannelEx(), AirpcapGetDeviceChannelEx(), AirpcapGetDeviceSupportedChannels(). More...
struct  _AirpcapStats
 Capture statistics. Returned by AirpcapGetStats(). More...
struct  _AirpcapDeviceCapabilities
 Device capabilities. Returned by AirpcapGetDeviceCapabilities(). More...

Defines

#define AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_
#define AIRPCAP_DEVICE_NAME_PREFIX   "\\\\.\\airpcap"
 This string is the fixed prefix in the airpcap adapter name. It can be used to parse the name field in an AirpcapDeviceDescription structure.
#define AIRPCAP_DEVICE_NUMBER_EXTRACT_STRING   "\\\\.\\airpcap%u"
 This string is the scanf modifier to extract the adapter number from an adapter name. It can be used to parse the name field in an AirpcapDeviceDescription structure with scanf.
#define MAX_ENCRYPTION_KEYS   64
#define WEP_KEY_MAX_SIZE   32
 AirpcapWepKeysCollection structure.
#define AIRPCAP_KEYTYPE_WEP   0
 Key type: WEP. The key can have an arbitrary length smaller than 32 bytes.
#define AIRPCAP_KEYTYPE_TKIP   1
 Key type: TKIP (WPA). NOT SUPPORTED YET.
#define AIRPCAP_KEYTYPE_CCMP   2
 Key type: CCMP (WPA2). NOT SUPPORTED YET.
#define AIRPCAP_MEDIUM_802_11_A   1
 802.11a medium.
#define AIRPCAP_MEDIUM_802_11_B   2
 802.11b medium.
#define AIRPCAP_MEDIUM_802_11_G   4
 802.11g medium.
#define AIRPCAP_MEDIUM_802_11_N   8
 802.11n medium.
#define AIRPCAP_BAND_2GHZ   1
 2.4 GHz band.
#define AIRPCAP_BAND_5GHZ   2
 5 GHz band.
#define AIRPCAP_ALIGNMENT   sizeof(int)
 Helper macros to extract packets coming from the driver. Rounds up to the next even multiple of AIRPCAP_ALIGNMENT.
#define AIRPCAP_WORDALIGN(x)   (((x)+(AIRPCAP_ALIGNMENT-1))&~(AIRPCAP_ALIGNMENT-1))
#define AIRPCAP_ERRBUF_SIZE   512
 Size of the error buffer, in bytes.
#define AIRPCAP_CIF_TX_ENABLED   0x1
 Channel info flag: the channel is enabled for transmission, too.
#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
#define AIRPCAP_MF_MONITOR_MODE_ON   1
#define AIRPCAP_MF_ACK_FRAMES_ON   2
 802.11 network, bacause handling the ACKs in software is normally too slow.

Typedefs

typedef struct
_AirpcapDeviceDescription 
AirpcapDeviceDescription
 Entry in the list returned by AirpcapGetDeviceList().
typedef struct
_AirpcapDeviceDescription
PAirpcapDeviceDescription
typedef struct _AirpcapKey AirpcapKey
 WEP key container.
typedef struct _AirpcapKeyPAirpcapKey
typedef enum _AirpcapChannelBand AirpcapChannelBand
 frequency Band. 802.11 adapters can support different frequency bands, the most important of which are: 2.4GHz (802.11b/g/n) and 5GHz (802.11a/n).
typedef enum _AirpcapChannelBandPAirpcapChannelBand
typedef enum _AirpcapValidationType AirpcapValidationType
 Type of frame validation the adapter performs. An adapter can be instructed to accept different kind of frames: correct frames only, frames with wrong Frame Check Sequence (FCS) only, all frames.
typedef enum
_AirpcapValidationType
PAirpcapValidationType
typedef enum
_AirpcapDecryptionState 
AirpcapDecryptionState
 Type of decryption the adapter performs. An adapter can be instructed to turn decryption (based on the device-configured keys configured with AirpcapSetDeviceKeys()) on or off.
typedef enum
_AirpcapDecryptionState
PAirpcapDecryptionState
typedef enum _AirpcapAdapterBus AirpcapAdapterBus
typedef enum _AirpcapAdapterId AirpcapAdapterId
typedef struct _AirpcapMacAddress AirpcapMacAddress
 Storage for a MAC address.
typedef struct _AirpcapMacAddressPAirpcapMacAddress
typedef struct
_AirpcapKeysCollection 
AirpcapKeysCollection
 This structure is used to store a collection of WEP keys. Note that the definition of the structure doesn't contain any key, so be careful to allocate a buffer with the size of the key, like in the following example:.
typedef struct
_AirpcapKeysCollection
PAirpcapKeysCollection
typedef struct _AirpcapBpfHeader AirpcapBpfHeader
 Packet header.
typedef struct _AirpcapBpfHeaderPAirpcapBpfHeader
typedef struct
_AirpcapDeviceTimestamp 
AirpcapDeviceTimestamp
 Structure used to read the free running counter on a device.
typedef struct
_AirpcapDeviceTimestamp
PAirpcapDeviceTimestamp
typedef struct _AirpcapChannelInfo AirpcapChannelInfo
 Channel information. Used by AirpcapSetDeviceChannelEx(), AirpcapGetDeviceChannelEx(), AirpcapGetDeviceSupportedChannels().
typedef struct
_AirpcapChannelInfo
PAirpcapChannelInfo
typedef enum _AirpcapLinkType AirpcapLinkType
 Link type.
typedef enum _AirpcapLinkTypePAirpcapLinkType
typedef struct _AirpcapHandle AirpcapHandle
 Adapter handle.
typedef struct _AirpcapHandle * PAirpcapHandle
typedef struct _AirpcapStats AirpcapStats
 Capture statistics. Returned by AirpcapGetStats().
typedef struct _AirpcapStatsPAirpcapStats
typedef struct
_AirpcapDeviceCapabilities 
AirpcapDeviceCapabilities
 Device capabilities. Returned by AirpcapGetDeviceCapabilities().
typedef struct
_AirpcapDeviceCapabilities
PAirpcapDeviceCapabilities

Enumerations

enum  _AirpcapChannelBand { AIRPCAP_CB_AUTO = 1, AIRPCAP_CB_2_4_GHZ = 2, AIRPCAP_CB_4_GHZ = 4, AIRPCAP_CB_5_GHZ = 5 }
 

frequency Band. 802.11 adapters can support different frequency bands, the most important of which are: 2.4GHz (802.11b/g/n) and 5GHz (802.11a/n).

More...
enum  _AirpcapValidationType { AIRPCAP_VT_ACCEPT_EVERYTHING = 1, AIRPCAP_VT_ACCEPT_CORRECT_FRAMES = 2, AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES = 3, AIRPCAP_VT_UNKNOWN = 4 }
 

Type of frame validation the adapter performs. An adapter can be instructed to accept different kind of frames: correct frames only, frames with wrong Frame Check Sequence (FCS) only, all frames.

More...
enum  _AirpcapDecryptionState { AIRPCAP_DECRYPTION_ON = 1, AIRPCAP_DECRYPTION_OFF = 2 }
 

Type of decryption the adapter performs. An adapter can be instructed to turn decryption (based on the device-configured keys configured with AirpcapSetDeviceKeys()) on or off.

More...
enum  _AirpcapAdapterBus {
  AIRPCAP_BUS_USB, AIRPCAP_BUS_PCI, AIRPCAP_BUS_PCI_EXPRESS, AIRPCAP_BUS_MINI_PCI,
  AIRPCAP_BUS_MINI_PCI_EXPRESS, AIRPCAP_BUS_CARDBUS, AIRPCAP_BUS_EXPRESSCARD
}
enum  _AirpcapAdapterId {
  AIRPCAP_ID_CLASSIC, AIRPCAP_ID_CLASSIC_REL2, AIRPCAP_ID_TX, AIRPCAP_ID_EX,
  AIRPCAP_ID_N, AIRPCAP_ID_NX
}
enum  _AirpcapLinkType { AIRPCAP_LT_802_11 = 1, AIRPCAP_LT_802_11_PLUS_RADIO = 2, AIRPCAP_LT_UNKNOWN = 3, AIRPCAP_LT_802_11_PLUS_PPI = 4 }
 

Link type.

More...

Functions

void AirpcapGetVersion (PUINT VersionMajor, PUINT VersionMinor, PUINT VersionRev, PUINT VersionBuild)
 Returns a string with the API version.
PCHAR AirpcapGetLastError (PAirpcapHandle AdapterHandle)
 Returns the last error related to the specified handle.
BOOL AirpcapGetDeviceList (PAirpcapDeviceDescription *PPAllDevs, PCHAR Ebuf)
 Returns the list of available devices.
VOID AirpcapFreeDeviceList (PAirpcapDeviceDescription PAllDevs)
 Frees a list of devices returned by AirpcapGetDeviceList().
PAirpcapHandle AirpcapOpen (PCHAR DeviceName, PCHAR Ebuf)
 Opens an adapter.
VOID AirpcapClose (PAirpcapHandle AdapterHandle)
 Closes an adapter.
BOOL AirpcapGetDeviceCapabilities (PAirpcapHandle AdapterHandle, PAirpcapDeviceCapabilities *PCapabilities)
 Get the capabilties of a device.
BOOL AirpcapSetDeviceMacFlags (PAirpcapHandle AdapterHandle, UINT AirpcapMacFlags)
 Sets the device's monitor mode and acknowledgment settings.
BOOL AirpcapGetDeviceMacFlags (PAirpcapHandle AdapterHandle, PUINT PAirpcapMacFlags)
 Gets the device's monitor mode and acknowledgement settings.
BOOL AirpcapSetLinkType (PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType)
 Sets the link type of an adapter.
BOOL AirpcapGetLinkType (PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType)
 Gets the link type of the specified adapter.
BOOL AirpcapSetFcsPresence (PAirpcapHandle AdapterHandle, BOOL IsFcsPresent)
 Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets.
BOOL AirpcapGetFcsPresence (PAirpcapHandle AdapterHandle, PBOOL PIsFcsPresent)
 Returns TRUE if the specified adapter includes the MAC Frame Check Sequence in the captured packets.
BOOL AirpcapSetFcsValidation (PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType)
 Configures the adapter to accept or drop frames with an incorrect Frame Check sequence (FCS).
BOOL AirpcapGetFcsValidation (PAirpcapHandle AdapterHandle, PAirpcapValidationType ValidationType)
 Checks if the specified adapter is configured to capture frames with incorrect an incorrect Frame Check Sequence (FCS).
BOOL AirpcapSetDeviceKeys (PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection)
 Sets the list of decryption keys that AirPcap is going to use with the specified device.
BOOL AirpcapGetDeviceKeys (PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, PUINT PKeysCollectionSize)
 Returns the list of decryption keys that are currently associated with the specified device.
BOOL AirpcapSetDriverKeys (PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection)
 Set the global list of decryption keys that AirPcap is going to use with all the devices.
BOOL AirpcapGetDriverKeys (PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, PUINT PKeysCollectionSize)
 Returns the global list of decryption keys that AirPcap is using with all the devices.
BOOL AirpcapSetDecryptionState (PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable)
 Turns on or off the decryption of the incoming frames with the device-specific keys.
BOOL AirpcapGetDecryptionState (PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable)
 Tells if this open instance is configured to perform the decryption of the incoming frames with the device-specific keys.
BOOL AirpcapSetDriverDecryptionState (PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable)
 Turns on or off the decryption of the incoming frames with the global set of keys.
BOOL AirpcapGetDriverDecryptionState (PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable)
 Tells if this open instance is configured to perform the decryption of the incoming frames with the global set of keys.
BOOL AirpcapSetDeviceChannel (PAirpcapHandle AdapterHandle, UINT Channel)
 Sets the radio channel of a device.
BOOL AirpcapGetDeviceChannel (PAirpcapHandle AdapterHandle, PUINT PChannel)
 Gets the radio channel of a device.
BOOL AirpcapSetDeviceChannelEx (PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo)
 Sets the channel of a device through its radio frequency. In case of 802.11n enabled devices, it sets the extension channel, if used.
BOOL AirpcapGetDeviceChannelEx (PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo)
 Gets the channel of a device through its radio frequency. In case of 802.11n enabled devices, it gets the extension channel, if in use.
BOOL AirpcapGetDeviceSupportedChannels (PAirpcapHandle AdapterHandle, PAirpcapChannelInfo *ppChannelInfo, PUINT pNumChannelInfo)
 Gets the list of supported channels for a given device. In case of a 802.11n capable device, information related to supported extension channels is also reported.
BOOL AirpcapConvertFrequencyToChannel (UINT Frequency, PUINT PChannel, PAirpcapChannelBand PBand)
 Converts a given frequency to the corresponding channel.
BOOL AirpcapConvertChannelToFrequency (UINT Channel, PUINT PFrequency)
 Converts a given channel to the corresponding frequency.
BOOL AirpcapSetKernelBuffer (PAirpcapHandle AdapterHandle, UINT BufferSize)
 Sets the size of the kernel packet buffer for this adapter.
BOOL AirpcapGetKernelBufferSize (PAirpcapHandle AdapterHandle, PUINT PSizeBytes)
 Gets the size of the kernel packet buffer for this adapter.
BOOL AirpcapSetTxPower (PAirpcapHandle AdapterHandle, UINT Power)
 Sets the power of the frames are transmitted by adapter.
BOOL AirpcapGetTxPower (PAirpcapHandle AdapterHandle, PUINT PPower)
 Returns the current transmit power level of the adapter.
BOOL AirpcapStoreCurConfigAsAdapterDefault (PAirpcapHandle AdapterHandle)
 Saves the configuration of the specified adapter in the registry, so that it becomes the default for this adapter.
BOOL AirpcapSetFilter (PAirpcapHandle AdapterHandle, PVOID Instructions, UINT Len)
 Sets the BPF kernel filter for an adapter.
BOOL AirpcapGetMacAddress (PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress)
 Returns the MAC address of a device.
BOOL AirpcapSetMacAddress (PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress)
 Sets the MAC address of a device.
BOOL AirpcapSetMinToCopy (PAirpcapHandle AdapterHandle, UINT MinToCopy)
 Sets the mintocopy parameter for an open adapter.
BOOL AirpcapGetReadEvent (PAirpcapHandle AdapterHandle, HANDLE *PReadEvent)
 Gets an event that is signalled when packets are available in the kernel buffer (see AirpcapSetMinToCopy()).
BOOL AirpcapRead (PAirpcapHandle AdapterHandle, PBYTE Buffer, UINT BufSize, PUINT PReceievedBytes)
 Fills a user-provided buffer with zero or more packets that have been captured on the referenced adapter.
BOOL AirpcapWrite (PAirpcapHandle AdapterHandle, PCHAR TxPacket, ULONG PacketLen)
 Transmits a packet.
BOOL AirpcapGetStats (PAirpcapHandle AdapterHandle, PAirpcapStats PStats)
 Gets per-adapter WinPcap-compatible capture statistics.
BOOL AirpcapGetLedsNumber (PAirpcapHandle AdapterHandle, PUINT NumberOfLeds)
 Gets the number of LEDs the referenced adapter has available.
BOOL AirpcapTurnLedOn (PAirpcapHandle AdapterHandle, UINT LedNumber)
 Turns on one of the adapter's LEDs.
BOOL AirpcapTurnLedOff (PAirpcapHandle AdapterHandle, UINT LedNumber)
 Turns off one of the adapter's LEDs.
BOOL AirpcapGetDeviceTimestamp (PAirpcapHandle AdapterHandle, PAirpcapDeviceTimestamp PTimestamp)
 Gets the current value of the device counter used to timestamp packets.

Define Documentation

#define AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_

AirPcap documentation. Copyright (c) 2006-2008 CACE Technologies, Inc. All rights reserved.