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. |
void AirpcapGetVersion | ( | PUINT | VersionMajor, | |
PUINT | VersionMinor, | |||
PUINT | VersionRev, | |||
PUINT | VersionBuild | |||
) |
Returns a string with the API version.
VersionMajor | Pointer to a variable that will be filled with the major version number. | |
VersionMinor | Pointer to a variable that will be filled with the minor version number. | |
VersionRev | Pointer to a variable that will be filled with the revision number. | |
VersionBuild | Pointer to a variable that will be filled with the build number. |
PCHAR AirpcapGetLastError | ( | PAirpcapHandle | AdapterHandle | ) |
Returns the last error related to the specified handle.
AdapterHandle | Handle to an open adapter. |
BOOL AirpcapGetDeviceList | ( | PAirpcapDeviceDescription * | PPAllDevs, | |
PCHAR | Ebuf | |||
) |
Returns the list of available devices.
PPAllDevs | Address to a caller allocated pointer. On success this pointer will receive the head of a list of available devices. | |
Ebuf | String that will contain error information if FALSE is returned. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes. |
CHAR Ebuf[AIRPCAP_ERRBUF_SIZE]; AirpcapDeviceDescription *Desc, *tDesc; if(AirpcapGetDeviceList(&Desc, Ebuf) == -1) { printf("Unable to get the list of devices: %s\n", Ebuf); return -1; } for(tDesc = Desc; tDesc; tDesc = tDesc->next) { printf("%u) %s (%s)\n", ++i, tDesc->Name, tDesc->Description); } AirpcapFreeDeviceList(Desc);
VOID AirpcapFreeDeviceList | ( | PAirpcapDeviceDescription | PAllDevs | ) |
Frees a list of devices returned by AirpcapGetDeviceList().
PAllDevs | Head of the list of devices returned by AirpcapGetDeviceList(). |
PAirpcapHandle AirpcapOpen | ( | PCHAR | DeviceName, | |
PCHAR | Ebuf | |||
) |
Opens an adapter.
DeviceName | Name of the device to open. Use AirpcapGetDeviceList() to get the list of devices. | |
Ebuf | String that will contain error information in case of failure. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes. |
VOID AirpcapClose | ( | PAirpcapHandle | AdapterHandle | ) |
Closes an adapter.
AdapterHandle | Handle to the adapter to close. |
BOOL AirpcapGetDeviceCapabilities | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapDeviceCapabilities * | PCapabilities | |||
) |
Get the capabilties of a device.
AdapterHandle | Handle to the adapter. | |
PCapabilities | Pointer to a library-allocated AirpcapDeviceCapabilities structure that contains the capabilities of the adapter. |
BOOL AirpcapSetDeviceMacFlags | ( | PAirpcapHandle | AdapterHandle, | |
UINT | AirpcapMacFlags | |||
) |
Sets the device's monitor mode and acknowledgment settings.
AdapterHandle | Handle to the adapter. | |
AirpcapMacFlags | Flags word, that contains a bitwise-OR combination of the following flags: AIRPCAP_MF_MONITOR_MODE_ON and AIRPCAP_MF_ACK_FRAMES_ON . |
BOOL AirpcapGetDeviceMacFlags | ( | PAirpcapHandle | AdapterHandle, | |
PUINT | PAirpcapMacFlags | |||
) |
Gets the device's monitor mode and acknowledgement settings.
AdapterHandle | Handle to the adapter. | |
PAirpcapMacFlags | User-provided flags word, that will be filled by the function with an OR combination of the following flags: AIRPCAP_MF_MONITOR_MODE_ON and AIRPCAP_MF_ACK_FRAMES_ON. |
BOOL AirpcapSetLinkType | ( | PAirpcapHandle | AdapterHandle, | |
AirpcapLinkType | NewLinkType | |||
) |
Sets the link type of an adapter.
AdapterHandle | Handle to the adapter. | |
NewLinkType | the "link type", i.e. the format of the frames that will be received from the adapter. |
BOOL AirpcapGetLinkType | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapLinkType | PLinkType | |||
) |
Gets the link type of the specified adapter.
AdapterHandle | Handle to the adapter. | |
PLinkType | Pointer to a caller allocated AirpcapLinkType variable that will contain the link type of the adapter. |
BOOL AirpcapSetFcsPresence | ( | PAirpcapHandle | AdapterHandle, | |
BOOL | IsFcsPresent | |||
) |
Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets.
AdapterHandle | Handle to the adapter. | |
IsFcsPresent | TRUE if the packets should include the FCS. FALSE otherwise |
BOOL AirpcapGetFcsPresence | ( | PAirpcapHandle | AdapterHandle, | |
PBOOL | PIsFcsPresent | |||
) |
Returns TRUE if the specified adapter includes the MAC Frame Check Sequence in the captured packets.
AdapterHandle | Handle to the adapter. | |
PIsFcsPresent | User-provided variable that will be set to true if the adapter is including the FCS. |
BOOL AirpcapSetFcsValidation | ( | PAirpcapHandle | AdapterHandle, | |
AirpcapValidationType | ValidationType | |||
) |
Configures the adapter to accept or drop frames with an incorrect Frame Check sequence (FCS).
AdapterHandle | Handle to the adapter. | |
ValidationType | The type of validation the driver will perform. See the documentation of AirpcapValidationType for details. |
BOOL AirpcapGetFcsValidation | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapValidationType | ValidationType | |||
) |
Checks if the specified adapter is configured to capture frames with incorrect an incorrect Frame Check Sequence (FCS).
AdapterHandle | Handle to the adapter. | |
ValidationType | Pointer to a user supplied variable that will contain the type of validation the driver will perform. See the documentation of AirpcapValidationType for details. |
BOOL AirpcapSetDeviceKeys | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapKeysCollection | KeysCollection | |||
) |
Sets the list of decryption keys that AirPcap is going to use with the specified device.
AdapterHandle | Handle an open adapter instance. | |
KeysCollection | Pointer to a PAirpcapKeysCollection structure that contains the keys to be set in the device. |
This function allows to set the device-specific set of keys. These keys will be used by the specified device only, and will not be used by other airpcap devices besides the specified one.
At this time, the only supported decryption method is WEP.
The keys are applied to the packets in the same order they appear in the KeysCollection structure until the packet is correctly decrypted, therefore putting frequently used keys at the beginning of the structure improves performance.
BOOL AirpcapGetDeviceKeys | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapKeysCollection | KeysCollection, | |||
PUINT | PKeysCollectionSize | |||
) |
Returns the list of decryption keys that are currently associated with the specified device.
AdapterHandle | Handle to an open adapter instance. | |
KeysCollection | User-allocated PAirpcapKeysCollection structure that will be filled with the keys. | |
PKeysCollectionSize |
|
AirPcap is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames to the application. AirPcap supports, for every device, multiple keys at the same time.
The configured decryption keys are device-specific, therefore AirpcapGetDeviceKeys() will return a different set of keys when called on different devices.
At this time, the only supported decryption method is WEP.
BOOL AirpcapSetDriverKeys | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapKeysCollection | KeysCollection | |||
) |
Set the global list of decryption keys that AirPcap is going to use with all the devices.
AdapterHandle | Handle an open adapter instance. | |
KeysCollection | Pointer to a PAirpcapKeysCollection structure that contains the keys to be set globally. |
This function allows to set the global set of keys. These keys will be used by all the devices plugged in the machine.
At this time, the only supported decryption method is WEP.
The keys are applied to the packets in the same order they appear in the KeysCollection structure until the packet is correctly decrypted, therefore putting frequently used keys at the beginning of the structure improves performance.
BOOL AirpcapGetDriverKeys | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapKeysCollection | KeysCollection, | |||
PUINT | PKeysCollectionSize | |||
) |
Returns the global list of decryption keys that AirPcap is using with all the devices.
AdapterHandle | Handle to an open adapter instance. | |
KeysCollection | User-allocated PAirpcapKeysCollection structure that will be filled with the keys. | |
PKeysCollectionSize |
|
The AirPcap driver is able to use a set of decryption keys to decrypt the traffic transmitted on a specific SSID. If one of the keys corresponds to the one the frame has been encrypted with, the driver will perform decryption and return the cleartext frames to the application.
At this time, the only supported decryption method is WEP.
BOOL AirpcapSetDecryptionState | ( | PAirpcapHandle | AdapterHandle, | |
AirpcapDecryptionState | Enable | |||
) |
Turns on or off the decryption of the incoming frames with the device-specific keys.
AdapterHandle | Handle to the adapter. | |
Enable | Either AIRPCAP_DECRYPTION_ON or AIRPCAP_DECRYPTION_OFF |
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.
AdapterHandle | Handle to the adapter. | |
PEnable | Pointer to a user supplied variable that will contain the decryption configuration. See PAirpcapDecryptionState for details. |
BOOL AirpcapSetDriverDecryptionState | ( | PAirpcapHandle | AdapterHandle, | |
AirpcapDecryptionState | Enable | |||
) |
Turns on or off the decryption of the incoming frames with the global set of keys.
AdapterHandle | Handle to the adapter. | |
Enable | Either AIRPCAP_DECRYPTION_ON or AIRPCAP_DECRYPTION_OFF |
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.
AdapterHandle | Handle to the adapter. | |
PEnable | Pointer to a user supplied variable that will contain the decryption configuration. See PAirpcapDecryptionState for details. |
BOOL AirpcapSetDeviceChannel | ( | PAirpcapHandle | AdapterHandle, | |
UINT | Channel | |||
) |
Sets the radio channel of a device.
AdapterHandle | Handle to the adapter. | |
Channel | the new channel to set. |
BOOL AirpcapGetDeviceChannel | ( | PAirpcapHandle | AdapterHandle, | |
PUINT | PChannel | |||
) |
Gets the radio channel of a device.
AdapterHandle | Handle to the adapter. | |
PChannel | Pointer to a user-supplied variable into which the function will copy the currently configured radio channel. |
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.
AdapterHandle | Handle to the adapter. | |
ChannelInfo | The new channel information to set. |
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.
AdapterHandle | Handle to the adapter. | |
PChannelInfo | Pointer to a user-supplied variable into which the function will copy the currently configured channel information. |
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.
Every control channel is listed multiple times, one for each different supported extension channel. For example channel 6 (2437MHz) is usually listed three times:
AdapterHandle | Handle to the adapter. | |
ppChannelInfo | Pointer to a user-supplied variable that will point to an array of supported channel. Such list must not be freed by the caller | |
pNumChannelInfo | Number of channels returned in the array. |
BOOL AirpcapConvertFrequencyToChannel | ( | UINT | Frequency, | |
PUINT | PChannel, | |||
PAirpcapChannelBand | PBand | |||
) |
Converts a given frequency to the corresponding channel.
Frequency | Frequency of the channel, in MHz. | |
PChannel | Pointer to a user-supplied variable that will contain the channel number on success. | |
PBand | Pointer to a user-supplied variable that will contain the band (a or b/g) of the given channel. |
BOOL AirpcapConvertChannelToFrequency | ( | UINT | Channel, | |
PUINT | PFrequency | |||
) |
Converts a given channel to the corresponding frequency.
Channel | Channel number to be converted. | |
PFrequency | Pointer to a user-supplied variable that will contain the channel frequency in MHz on success. |
BOOL AirpcapSetKernelBuffer | ( | PAirpcapHandle | AdapterHandle, | |
UINT | BufferSize | |||
) |
Sets the size of the kernel packet buffer for this adapter.
AdapterHandle | Handle to the adapter. | |
BufferSize | New size, in bytes. |
BOOL AirpcapGetKernelBufferSize | ( | PAirpcapHandle | AdapterHandle, | |
PUINT | PSizeBytes | |||
) |
Gets the size of the kernel packet buffer for this adapter.
AdapterHandle | Handle to the adapter. | |
PSizeBytes | User-allocated variable that will be filled with the size of the kernel buffer. |
BOOL AirpcapSetTxPower | ( | PAirpcapHandle | AdapterHandle, | |
UINT | Power | |||
) |
Sets the power of the frames are transmitted by adapter.
AdapterHandle | Handle to the adapter. | |
Power | The transmit power. Setting a zero power makes the adapter select the highest possible power for the current channel. |
BOOL AirpcapGetTxPower | ( | PAirpcapHandle | AdapterHandle, | |
PUINT | PPower | |||
) |
Returns the current transmit power level of the adapter.
AdapterHandle | Handle to the adapter. | |
PPower | User-allocated variable that will be filled with the size of the transmit power. |
BOOL AirpcapStoreCurConfigAsAdapterDefault | ( | PAirpcapHandle | AdapterHandle | ) |
Saves the configuration of the specified adapter in the registry, so that it becomes the default for this adapter.
AdapterHandle | Handle to the adapter. |
Exceptions to this rule are the AirpcapSetDeviceChannel() and AirpcapSetDeviceKeys() functions: a channel change is reflected on all the open instances, and remembered until the next call to AirpcapSetDeviceChannel(), until the adapter is unplugged, or until the machine is powered off. Same thing for the configuration of the WEP keys.
AirpcapStoreCurConfigAsAdapterDefault() stores the configuration of the give open instance as the default for the adapter: all the instances opened in the future will have the same configuration that this adapter currently has. The configuration is stored in the registry, therefore it is remembered even when the adapter is unplugged or the machine is turned off. However, an adapter doesn't bring its configuration with it from machine to machine.
the configuration information saved in the registry includes the following parameters:
The configuration is device-specific. This means that changing the configuration of a device doesn't modify the one of the other devices that are currently used or that will be used in the future.
BOOL AirpcapSetFilter | ( | PAirpcapHandle | AdapterHandle, | |
PVOID | Instructions, | |||
UINT | Len | |||
) |
Sets the BPF kernel filter for an adapter.
AdapterHandle | Handle to the adapter. | |
Instructions | pointer to the first BPF instruction in the array. Corresponds to the bf_insns in a bpf_program structure (see the WinPcap documentation at http://www.winpcap.org/devel.htm). | |
Len | Number of instructions in the array pointed by the previous field. Corresponds to the bf_len in a a bpf_program structure (see the WinPcap documentation at http://www.winpcap.org/devel.htm). |
A filter can be automatically created by using the pcap_compile() function of the WinPcap API. This function converts a human readable text expression with the tcpdump/libpcap syntax into a BPF program. If your program doesn't link wpcap, but you need to generate the code for a particular filter, you can run WinDump with the -d or -dd or -ddd flags to obtain the pseudocode.
BOOL AirpcapGetMacAddress | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapMacAddress | PMacAddress | |||
) |
Returns the MAC address of a device.
AdapterHandle | Handle to the adapter. | |
PMacAddress | Pointer to a user allocated AirpcapMacAddress structure that will receive the MAC address on success. |
BOOL AirpcapSetMacAddress | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapMacAddress | PMacAddress | |||
) |
Sets the MAC address of a device.
AdapterHandle | Handle to the adapter. | |
PMacAddress | Pointer to a user-initialized structure containing the MAC address. |
BOOL AirpcapSetMinToCopy | ( | PAirpcapHandle | AdapterHandle, | |
UINT | MinToCopy | |||
) |
Sets the mintocopy parameter for an open adapter.
AdapterHandle | Handle to the adapter. | |
MinToCopy | is the mintocopy size in bytes. |
BOOL AirpcapGetReadEvent | ( | PAirpcapHandle | AdapterHandle, | |
HANDLE * | PReadEvent | |||
) |
Gets an event that is signalled when packets are available in the kernel buffer (see AirpcapSetMinToCopy()).
AdapterHandle | Handle to the adapter. | |
PReadEvent | Pointer to a user-supplied handle in which the read event will be copied. |
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.
AdapterHandle | Handle to the adapter. | |
Buffer | pointer to the buffer that will be filled with captured packets. | |
BufSize | size of the input buffer that will contain the packets, in bytes. | |
PReceievedBytes | Pointer to a user supplied variable that will receive the number of bytes copied by AirpcapRead. Can be smaller than BufSize. |
BOOL AirpcapWrite | ( | PAirpcapHandle | AdapterHandle, | |
PCHAR | TxPacket, | |||
ULONG | PacketLen | |||
) |
Transmits a packet.
AdapterHandle | Handle to the adapter. | |
TxPacket | Pointer to a buffer that contains the packet to be transmitted. | |
PacketLen | Length of the buffer pointed by the TxPacket argument, in bytes. |
If the link type of the adapter is AIRPCAP_LT_802_11, the buffer pointed by TxPacket should contain just the 802.11 packet, without additional information. The packet will be transmitted at 1Mbps.
If the link type of the adapter is AIRPCAP_LT_802_11_PLUS_RADIO, the buffer pointed by TxPacket should contain a radiotap header followed by the 802.11 packet. AirpcapWrite will use the rate information in the radiotap header when transmitting the packet.
If the link type of the adapter is AIRPCAP_LT_802_11_PLUS_PPI, the buffer pointed by TxPacket should contain a PPI header followed by the 802.11 packet. AirpcapWrite will use the rate information in the PPI header when transmitting the packet. If the packet should be transmitted at a 802.11n rate, the packet must include a PPI 802.11n MAC+PHY Extension header, containing the rate expressed in terms of MCS, short/long guard interval (SGI/LGI) and 20MHz or 40MHz channel. When the MAC+PHY Extension header is present, the rate field in the PPI 802.11-Common header is ignored. By default on 802.11n-capable AirPcap adapters, packets are transmitted with no A-MPDU aggregation. A-MPDU aggregation is controlled by the adapter, but it's possible to give a hint to the hardware to aggregate some packets by setting the "Aggregate" and "More aggregates" flags in the PPI 802.11n MAC+PHY extension header.
BOOL AirpcapGetStats | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapStats | PStats | |||
) |
Gets per-adapter WinPcap-compatible capture statistics.
AdapterHandle | Handle to the adapter. | |
PStats | pointer to a user-allocated AirpcapStats structure that will be filled with statistical information. |
BOOL AirpcapGetLedsNumber | ( | PAirpcapHandle | AdapterHandle, | |
PUINT | NumberOfLeds | |||
) |
Gets the number of LEDs the referenced adapter has available.
AdapterHandle | Handle to the adapter. | |
NumberOfLeds | Number of LEDs available on this adapter. |
BOOL AirpcapTurnLedOn | ( | PAirpcapHandle | AdapterHandle, | |
UINT | LedNumber | |||
) |
Turns on one of the adapter's LEDs.
AdapterHandle | Handle to the adapter. | |
LedNumber | zero-based identifier of the LED to turn on. |
BOOL AirpcapTurnLedOff | ( | PAirpcapHandle | AdapterHandle, | |
UINT | LedNumber | |||
) |
Turns off one of the adapter's LEDs.
AdapterHandle | Handle to the adapter. | |
LedNumber | zero-based identifier of the LED to turn off. |
BOOL AirpcapGetDeviceTimestamp | ( | PAirpcapHandle | AdapterHandle, | |
PAirpcapDeviceTimestamp | PTimestamp | |||
) |
Gets the current value of the device counter used to timestamp packets.
AdapterHandle | Handle to the adapter. | |
PTimestamp | Pointer to a caller allocated 64bit integer that will receive the device timestamp, in microseconds. |
AirPcap documentation. Copyright (c) 2006-2008
CACE Technologies, Inc. All rights reserved.