8 #if !defined(AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_) 9 #define AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_ 13 #pragma warning( disable : 4996) 54 #define AIRPCAP_DEVICE_NAME_PREFIX "\\\\.\\airpcap" 60 #define AIRPCAP_DEVICE_NUMBER_EXTRACT_STRING "\\\\.\\airpcap%u" 62 #define AIRPCAP_DEVICE_ANY_EXTRACT_STRING "\\\\.\\airpcap_any" 74 #define MAX_ENCRYPTION_KEYS 64 76 #define WEP_KEY_MAX_SIZE 32 86 #define AIRPCAP_KEYTYPE_WEP 0 87 #define AIRPCAP_KEYTYPE_TKIP 1 88 #define AIRPCAP_KEYTYPE_CCMP 2 100 __attribute__((__packed__))
112 AIRPCAP_CB_2_4_GHZ = 2,
113 AIRPCAP_CB_4_GHZ = 4,
123 AIRPCAP_VT_ACCEPT_EVERYTHING = 1,
124 AIRPCAP_VT_ACCEPT_CORRECT_FRAMES = 2,
125 AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES = 3,
126 AIRPCAP_VT_UNKNOWN = 4
136 AIRPCAP_DECRYPTION_ON = 1,
137 AIRPCAP_DECRYPTION_OFF = 2
149 __attribute__((__packed__))
179 #define AirpcapKeysCollectionSize(nKeys) \ 180 ((sizeof(AirpcapKeysCollection) - sizeof(AirpcapKey)) + ((nKeys) * sizeof(AirpcapKey))) 181 #define AirpcapKeysCollectionSizeToKeyCount(size) \ 182 (guint)(((size) - AirpcapKeysCollectionSize(0))/sizeof(AirpcapKey)) 198 __attribute__((__packed__))
203 #define AIRPCAP_ALIGNMENT sizeof(int) 204 #define AIRPCAP_WORDALIGN(x) (((x)+(AIRPCAP_ALIGNMENT-1))&~(AIRPCAP_ALIGNMENT-1)) 212 #define AIRPCAP_ERRBUF_SIZE 512 214 #ifndef __AIRPCAP_DRIVER__ 220 #undef _AirpcapLinkType 223 AIRPCAP_LT_802_11 = 1,
224 AIRPCAP_LT_802_11_PLUS_RADIO = 2,
225 AIRPCAP_LT_UNKNOWN = 3,
226 AIRPCAP_LT_802_11_PLUS_PPI = 4
229 #if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_) 230 #define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_ 290 void AirpcapGetVersion(guint * VersionMajor, guint * VersionMinor, guint * VersionRev, guint * VersionBuild);
342 PAirpcapHandle
AirpcapOpen(gchar * DeviceName, gchar * Ebuf);
431 gboolean
AirpcapGetLinkType(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType);
504 gboolean
AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
530 gboolean
AirpcapGetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
553 gboolean
AirpcapSetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
575 gboolean
AirpcapGetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
731 gboolean
AirpcapSetFilter(PAirpcapHandle AdapterHandle,
void * Instructions, guint Len);
786 gboolean
AirpcapRead(PAirpcapHandle AdapterHandle, guint8 *
Buffer, guint BufSize, guint * PReceievedBytes);
805 gboolean
AirpcapWrite(PAirpcapHandle AdapterHandle, gchar * TxPacket, guint32 PacketLen);
813 gboolean
AirpcapGetStats(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
gboolean AirpcapGetDeviceChannel(PAirpcapHandle AdapterHandle, guint *PChannel)
Get the radio channel of a device.
gboolean AirpcapTurnLedOn(PAirpcapHandle AdapterHandle, guint LedNumber)
Turn on one of the adapter's LEDs.
gboolean AirpcapGetFcsPresence(PAirpcapHandle AdapterHandle, gboolean *PIsFcsPresent)
Returns TRUE if the specified adapter includes the MAC Frame Check Sequence in the captured packets...
gboolean AirpcapSetDriverDecryptionState(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable)
Turns on or off the decryption of the incoming frames with the global driver set of keys...
PAirpcapHandle AirpcapOpen(gchar *DeviceName, gchar *Ebuf)
Open an adapter.
struct _AirpcapStats AirpcapStats
Capture statistics. Returned by AirpcapGetStats();.
gboolean AirpcapConvertChannelToFrequency(guint Channel, guint *PFrequency)
Converts a given channel to the corresponding frequency.
gboolean AirpcapSetFcsValidation(PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType)
Configures the adapter to accept or drop frames with an incorrect Frame Check sequence (FCS)...
gboolean AirpcapSetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection)
Set the global list of decryption keys that the driver is going to use with all the devices...
gboolean AirpcapSetDecryptionState(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable)
Turns on or off the decryption of the incoming frames with the adapter-specific keys.
gboolean AirpcapStoreCurConfigAsAdapterDefault(PAirpcapHandle AdapterHandle)
Saves the configuration of the specified adapter in the registry, so that it becomes the default for ...
Entry in the list returned by AirpcapGetDeviceList();.
Definition: airpcap.h:67
gboolean AirpcapSetLinkType(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType)
Set the link type of an adapter.
struct _AirpcapDeviceDescription AirpcapDeviceDescription
Entry in the list returned by AirpcapGetDeviceList();.
Capture statistics. Returned by AirpcapGetStats();.
Definition: airpcap.h:241
gboolean AirpcapGetDriverDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable)
Tells if this open instance is configured to perform the decryption of the incoming frames with the g...
gboolean AirpcapTurnLedOff(PAirpcapHandle AdapterHandle, guint LedNumber)
Turn off one of the adapter's LEDs.
enum _AirpcapDecryptionState AirpcapDecryptionState
Type of decryption the adapter performs. An adapter can be instructed to turn decryption (based on th...
Storage for a MAC address.
Definition: airpcap.h:144
gboolean AirpcapGetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint *PKeysCollectionSize)
Returns the global list of decryption keys in the driver that are associated with all the devices...
gboolean AirpcapSetMonitorMode(PAirpcapHandle AdapterHandle, gboolean MonitorModeEnabled)
Sets the monitor mode for the specified adapter.
gboolean AirpcapGetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint *PKeysCollectionSize)
Returns the list of decryption keys in the driver that are currently associated with the specified de...
gboolean AirpcapGetKernelBufferSize(PAirpcapHandle AdapterHandle, guint *PSizeBytes)
Get the size of the kernel packet buffer for this adapter.
Channel information. Used by AirpcapSetDeviceChannelEx(), AirpcapGetDeviceChannelEx(), AirpcapGetDeviceSupportedChannels()
Definition: airpcap.h:258
struct _AirpcapKeysCollection AirpcapKeysCollection
This structure is used to store a collection of WEP keys. Note that the definition of the structure h...
gboolean AirpcapSetDeviceChannelEx(PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo)
Set the channel of a device through its radio frequency. In case of 802.11n enabled devices...
gboolean AirpcapGetReadEvent(PAirpcapHandle AdapterHandle, void ***PReadEvent)
Gets an event that is signaled when that is signalled when packets are available in the kernel buffer...
gboolean AirpcapGetStats(PAirpcapHandle AdapterHandle, PAirpcapStats PStats)
Get per-adapter WinPcap-compatible capture statistics.
struct _AirpcapKey AirpcapKey
WEP key container.
gboolean AirpcapRead(PAirpcapHandle AdapterHandle, guint8 *Buffer, guint BufSize, guint *PReceievedBytes)
Fills a user-provided buffer with zero or more packets that have been captured on the referenced adap...
gboolean AirpcapGetMacAddress(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress)
Return the MAC address of an adapter.
gint8 ExtChannel
802.11n specific. Offset of the extension channel in case of 40MHz channels.
Definition: airpcap.h:271
gchar * AirpcapGetLastError(PAirpcapHandle AdapterHandle)
Return the last error related to the specified handle.
This structure is used to store a collection of WEP keys. Note that the definition of the structure h...
Definition: airpcap.h:173
void AirpcapFreeDeviceList(PAirpcapDeviceDescription PAllDevs)
Free a list of devices returned by AirpcapGetDeviceList()
gboolean AirpcapSetDeviceChannel(PAirpcapHandle AdapterHandle, guint Channel)
Set the radio channel of a device.
enum _AirpcapValidationType AirpcapValidationType
Type of frame validation the adapter performs. An adapter can be instructed to accept different kind ...
_AirpcapDecryptionState
Type of decryption the adapter performs. An adapter can be instructed to turn decryption (based on th...
Definition: airpcap.h:134
_AirpcapValidationType
Type of frame validation the adapter performs. An adapter can be instructed to accept different kind ...
Definition: airpcap.h:121
gboolean AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection)
Set the list of decryption keys that the driver is going to use with the specified device...
void AirpcapClose(PAirpcapHandle AdapterHandle)
Close an adapter.
struct _AirpcapBpfHeader AirpcapBpfHeader
Packet header.
gboolean AirpcapGetDeviceList(PAirpcapDeviceDescription *PPAllDevs, gchar *Ebuf)
Return the list of available devices.
gboolean AirpcapSetMinToCopy(PAirpcapHandle AdapterHandle, guint MinToCopy)
Set the mintocopy parameter for an open adapter.
struct _AirpcapMacAddress AirpcapMacAddress
Storage for a MAC address.
gboolean AirpcapGetLinkType(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType)
Get the link type of the specified adapter.
gboolean AirpcapGetDeviceChannelEx(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo)
Get the channel of a device through its radiofrequency. In case of 802.11n enabled devices...
gboolean AirpcapSetFcsPresence(PAirpcapHandle AdapterHandle, gboolean IsFcsPresent)
Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets...
enum _AirpcapChannelBand AirpcapChannelBand
frequency Band. 802.11 adapters can support different frequency bands, the most important of which ar...
void AirpcapGetVersion(guint *VersionMajor, guint *VersionMinor, guint *VersionRev, guint *VersionBuild)
Return a string with the API version.
struct _AirpcapChannelInfo AirpcapChannelInfo
Channel information. Used by AirpcapSetDeviceChannelEx(), AirpcapGetDeviceChannelEx(), AirpcapGetDeviceSupportedChannels()
enum _AirpcapLinkType AirpcapLinkType
Link type. AirPcap supports two kind of 802.11 linktypes: plain 802.11 and radiotap.
gboolean AirpcapConvertFrequencyToChannel(guint Frequency, guint *PChannel, PAirpcapChannelBand PBand)
Converts a given frequency to the corresponding channel.
gboolean AirpcapGetLedsNumber(PAirpcapHandle AdapterHandle, guint *NumberOfLeds)
Get the number of LEDs the referenced adapter has available.
_AirpcapLinkType
Link type. AirPcap supports two kind of 802.11 linktypes: plain 802.11 and radiotap.
Definition: airpcap.h:221
_AirpcapChannelBand
frequency Band. 802.11 adapters can support different frequency bands, the most important of which ar...
Definition: airpcap.h:109
gboolean AirpcapSetKernelBuffer(PAirpcapHandle AdapterHandle, guint BufferSize)
Set the size of the kernel packet buffer for this adapter.
gboolean AirpcapWrite(PAirpcapHandle AdapterHandle, gchar *TxPacket, guint32 PacketLen)
Transmits a packet.
gboolean AirpcapGetDeviceSupportedChannels(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo *ppChannelInfo, guint *pNumChannelInfo)
Get the list of supported channels for a given device. In case of a 802.11n capable device...
WEP key container.
Definition: airpcap.h:93
gboolean AirpcapGetFcsValidation(PAirpcapHandle AdapterHandle, PAirpcapValidationType ValidationType)
Checks if the specified adapter is configured to capture frames with incorrect an incorrect Frame Che...
gboolean AirpcapSetFilter(PAirpcapHandle AdapterHandle, void *Instructions, guint Len)
Set the BPF kernel filter for an adapter.
struct _AirpcapHandle AirpcapHandle
Adapter handle.
Definition: airpcap.h:234
gboolean AirpcapGetDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable)
Tells if this open instance is configured to perform the decryption of the incoming frames with the a...
#define WEP_KEY_MAX_SIZE
Definition: wep-wpadefs.h:33
gboolean AirpcapGetMonitorMode(PAirpcapHandle AdapterHandle, gboolean *PMonitorModeEnabled)
Returns TRUE if the specified adapter is in monitor mode.