From Xiao Xiangquan:
[obnox/wireshark/wip.git] / airpcap.h
index 0c21955c86d5f4a730a3312862e1ea170b8ed41e..f872565e84e89ffd04c021365495fcb78fa19179 100644 (file)
--- a/airpcap.h
+++ b/airpcap.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 CACE Technologies, Davis (California)
+ * Copyright (c) 2006-2007 CACE Technologies, Davis (California)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #if !defined(AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_)
 #define AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_
 
-/* This disables a VS warning for zero-sized arrays. All the compilers we support have that feature */
+#ifdef _MSC_VER
+// This disables a VS warning for zero-sized arrays.
 #pragma warning( disable : 4200)
+// This stops VS2005 ranting against stdio.
+#pragma warning( disable : 4996)
+#endif
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/*!
+/*
        \mainpage AirPcap interface documentation
 
        \section Introduction
@@ -39,7 +47,7 @@ extern "C" {
        link type control and WEP configuration.<br>
        This manual includes the following sections:
 
-       \note throughout this documentation, \i device refers to a physical USB AirPcap device, wile \i adapter is an open API
+       \note throughout this documentation, \e device refers to a physical USB AirPcap device, while \e adapter is an open API
        instance. Most of the AirPcap API operations are adapter-specific but some of them, like setting the channel, are
        per-device and will be reflected on all the open adapters. These functions will have "Device" in their name, e.g.
        AirpcapSetDeviceChannel().
@@ -59,18 +67,14 @@ extern "C" {
   \brief 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_NAME_PREFIX "\\\\.\\airpcap"
+#define AIRPCAP_DEVICE_NAME_PREFIX             "\\\\.\\airpcap"
 
 /*!
   \brief 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 AIRPCAP_DEVICE_NUMBER_EXTRACT_STRING "\\\\.\\airpcap%u"
+#define AIRPCAP_DEVICE_NUMBER_EXTRACT_STRING            "\\\\.\\airpcap%u"
 
-/*!
-  \brief This string is the scanf modifier to extract the adapter "Any" string from an adapter name.
-  It can be used to parse the name field in an AirpcapDeviceDescription structure with scanf.
-*/
 #define AIRPCAP_DEVICE_ANY_EXTRACT_STRING "\\\\.\\airpcap_any"
 
 /*!
@@ -78,50 +82,64 @@ extern "C" {
 */
 typedef struct _AirpcapDeviceDescription
 {
-       struct  _AirpcapDeviceDescription *next;                        /* Next element in the list */
-       PCHAR   Name;                                                                           /* Device name */
-       PCHAR   Description;                                                            /* Device description */
+       struct  _AirpcapDeviceDescription *next;                        ///< Next element in the list
+       gchar * Name;                                                                           ///< Device name
+       gchar * Description;                                                            ///< Device description
 } AirpcapDeviceDescription, *PAirpcapDeviceDescription;
 
 #define MAX_ENCRYPTION_KEYS 64
 
-#define WEP_KEY_MAX_SIZE 32            /* Maximum size of a WEP key, in bytes. This is the size of an entry in the */
-                                                               /* AirpcapWepKeysCollection structure */
+#define WEP_KEY_MAX_SIZE 32            ///< Maximum size of a WEP key, in bytes. This is the size of an entry in the
+                                                               ///< AirpcapWepKeysCollection structure
 
+#ifdef _WIN32
 #ifndef __MINGW32__
 #pragma pack(push)
 #pragma pack(1)
-#endif /* __MINGW32__ */
-
+#endif // __MINGW32__
+#endif
 
-#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_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.
 
 /*!
   \brief WEP key container
 */
 typedef struct _AirpcapKey
 {
-       UINT KeyType;                                           /* Type of key, can be on of: \ref AIRPCAP_KEYTYPE_WEP, \ref AIRPCAP_KEYTYPE_TKIP, \ref AIRPCAP_KEYTYPE_CCMP. Only AIRPCAP_KEYTYPE_WEP is supported by the driver at the moment. */
-       UINT KeyLen;                                            /* Length of the key, in bytes */
-       BYTE KeyData[WEP_KEY_MAX_SIZE];         /* Key Data */
+       guint KeyType;                                          ///< Type of key, can be on of: \ref AIRPCAP_KEYTYPE_WEP, \ref AIRPCAP_KEYTYPE_TKIP, \ref AIRPCAP_KEYTYPE_CCMP. Only AIRPCAP_KEYTYPE_WEP is supported by the driver at the moment.
+       guint KeyLen;                                           ///< Length of the key, in bytes
+       guint8 KeyData[WEP_KEY_MAX_SIZE];               ///< Key Data
 }
 #ifdef __MINGW32__
 __attribute__((__packed__))
-#endif /* __MINGW32__ */
+#endif // __MINGW32__
 AirpcapKey, *PAirpcapKey;
 
+/*!
+  \brief 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 _AirpcapChannelBand
+{
+    AIRPCAP_CB_AUTO = 1,                               ///< Automatically pick the best frequency band
+    AIRPCAP_CB_2_4_GHZ = 2,                            ///< 2.4 GHz frequency band
+    AIRPCAP_CB_4_GHZ = 4,                              ///< 4 GHz frequency band
+    AIRPCAP_CB_5_GHZ = 5                               ///< 5 GHz frequency band
+}AirpcapChannelBand, *PAirpcapChannelBand;
+
 /*!
   \brief 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
 {
-    AIRPCAP_VT_ACCEPT_EVERYTHING = 1,          /* Accept all the frames the device captures */
-    AIRPCAP_VT_ACCEPT_CORRECT_FRAMES = 2,      /* Accept correct frames only, i.e. frames with correct Frame Check Sequence (FCS). */
-    AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES = 3,      /* Accept corrupt frames only, i.e. frames with worng Frame Check Sequence (FCS). */
-       AIRPCAP_VT_UNKNOWN = 4                                  /* Unknown validation type. You should see it only in case of error. */
+    AIRPCAP_VT_ACCEPT_EVERYTHING = 1,          ///< Accept all the frames the device captures
+    AIRPCAP_VT_ACCEPT_CORRECT_FRAMES = 2,      ///< Accept correct frames only, i.e. frames with correct Frame Check Sequence (FCS).
+    AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES = 3,      ///< Accept corrupt frames only, i.e. frames with wrong Frame Check Sequence (FCS).
+       AIRPCAP_VT_UNKNOWN = 4                                  ///< Unknown validation type. You should see it only in case of error.
 }AirpcapValidationType, *PAirpcapValidationType;
 
 /*!
@@ -131,8 +149,8 @@ typedef enum _AirpcapValidationType
 */
 typedef enum _AirpcapDecryptionState
 {
-    AIRPCAP_DECRYPTION_ON = 1,                         /* This adapter performs decryption */
-    AIRPCAP_DECRYPTION_OFF = 2                         /* This adapter does not perform decryption */
+    AIRPCAP_DECRYPTION_ON = 1,                         ///< This adapter performs decryption
+    AIRPCAP_DECRYPTION_OFF = 2                         ///< This adapter does not perform decryption
 }AirpcapDecryptionState, *PAirpcapDecryptionState;
 
 
@@ -141,11 +159,11 @@ typedef enum _AirpcapDecryptionState
 */
 typedef struct _AirpcapMacAddress
 {
-       BYTE Address[6];                /* MAC address bytes */
+       guint8 Address[6];              ///< MAC address bytes
 }
 #ifdef __MINGW32__
 __attribute__((__packed__))
-#endif /* __MINGW32__ */
+#endif // __MINGW32__
 AirpcapMacAddress, *PAirpcapMacAddress;
 
 /*!
@@ -155,7 +173,7 @@ AirpcapMacAddress, *PAirpcapMacAddress;
 
   \code
        PAirpcapKeysCollection KeysCollection;
-       UINT KeysCollectionSize;
+       guint KeysCollectionSize;
 
        KeysCollectionSize = sizeof(AirpcapKeysCollection) + NumKeys * sizeof(AirpcapKey);
 
@@ -168,37 +186,39 @@ AirpcapMacAddress, *PAirpcapMacAddress;
 */
 typedef struct _AirpcapKeysCollection
 {
-       UINT nKeys;                                                                                             /* Number of keys in the collection */
-       AirpcapKey Keys[0];                                                                             /* Array of nKeys keys.  */
+       guint nKeys;                                                                                            ///< Number of keys in the collection
+       AirpcapKey Keys[0];                                                                             ///< Array of nKeys keys.
 } AirpcapKeysCollection, *PAirpcapKeysCollection;
 
 /*!
   \brief Packet header.
 
-  This structure defines the BPF that preceeds every packet delivered to the application.
+  This structure defines the BPF that precedes every packet delivered to the application.
 */
 typedef struct _AirpcapBpfHeader
 {
-       UINT TsSec;                     /* Timestamp associated with the captured packet. SECONDS. */
-       UINT TsUsec;            /* Timestamp associated with the captured packet. MICROSECONDS. */
-       UINT Caplen;            /* Length of captured portion. The captured portion <b>can be different</b> from the original packet, because it is possible (with a proper filter) to instruct the driver to capture only a portion of the packets. */
-       UINT Originallen;       /* Original length of packet */
-       USHORT  Hdrlen;         /* Length of bpf header (this struct plus alignment padding). In some cases, a padding could be added between the end of this structure and the packet data for performance reasons. This field can be used to retrieve the actual data of the packet. */
+       guint TsSec;                    ///< Timestamp associated with the captured packet. SECONDS.
+       guint TsUsec;           ///< Timestamp associated with the captured packet. MICROSECONDS.
+       guint Caplen;           ///< Length of captured portion. The captured portion <b>can be different</b> from the original packet, because it is possible (with a proper filter) to instruct the driver to capture only a portion of the packets.
+       guint Originallen;      ///< Original length of packet
+       guint16 Hdrlen;         ///< Length of bpf header (this struct plus alignment padding). In some cases, a padding could be added between the end of this structure and the packet data for performance reasons. This field can be used to retrieve the actual data of the packet.
 }
 #ifdef __MINGW32__
 __attribute__((__packed__))
-#endif /* __MINGW32__ */
+#endif // __MINGW32__
 AirpcapBpfHeader, *PAirpcapBpfHeader;
 
-/* Helper macros to extract packets coming from the driver. Rounds up to the next even multiple of AIRPCAP_ALIGNMENT.  */
+/// Helper macros to extract packets coming from the driver. Rounds up to the next even multiple of AIRPCAP_ALIGNMENT.
 #define AIRPCAP_ALIGNMENT sizeof(int)
 #define AIRPCAP_WORDALIGN(x) (((x)+(AIRPCAP_ALIGNMENT-1))&~(AIRPCAP_ALIGNMENT-1))
 
+#ifdef _WIN32
 #ifndef __MINGW32__
 #pragma pack(pop)
-#endif /* __MINGW32__ */
+#endif // __MINGW32__
+#endif
 
-#define AIRPCAP_ERRBUF_SIZE 512                /* Size of the error buffer, in bytes */
+#define AIRPCAP_ERRBUF_SIZE 512                ///< Size of the error buffer, in bytes
 
 #ifndef __AIRPCAP_DRIVER__
 
@@ -206,11 +226,13 @@ AirpcapBpfHeader, *PAirpcapBpfHeader;
   \brief Link type.
    AirPcap supports two kind of 802.11 linktypes: plain 802.11 and radiotap.
 */
+#undef _AirpcapLinkType
 typedef enum _AirpcapLinkType
 {
-    AIRPCAP_LT_802_11 = 1,                             /* plain 802.11 linktype. Every packet in the buffer contains the raw 802.11 frame, including MAC FCS. */
-    AIRPCAP_LT_802_11_PLUS_RADIO = 2,  /* 802.11 plus radiotap linktype. Every packet in the buffer contains a radiotap header followed by the 802.11 frame. MAC FCS is included. */
-       AIRPCAP_LT_UNKNOWN = 3                          /* Unknown linktype. You should see it only in case of error. */
+    AIRPCAP_LT_802_11 = 1,                             ///< plain 802.11 linktype. Every packet in the buffer contains the raw 802.11 frame, including MAC FCS.
+    AIRPCAP_LT_802_11_PLUS_RADIO = 2,  ///< 802.11 plus radiotap linktype. Every packet in the buffer contains a radiotap header followed by the 802.11 frame. MAC FCS is included.
+       AIRPCAP_LT_UNKNOWN = 3,                         ///< Unknown linktype. You should see it only in case of error.
+       AIRPCAP_LT_802_11_PLUS_PPI = 4                  ///< 802.11 plus PPI header linktype. Every packet in the buffer contains a PPI header followed by the 802.11 frame. MAC FCS is included.
 }AirpcapLinkType, *PAirpcapLinkType;
 
 #if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)
@@ -227,17 +249,40 @@ typedef struct _AirpcapHandle AirpcapHandle, *PAirpcapHandle;
 */
 typedef struct _AirpcapStats
 {
-       UINT Recvs;                     /* Number of packets that the driver received by the adapter  */
-                                               /* from the beginning of the current capture. This value includes the packets  */
-                                               /* dropped because of buffer full. */
-       UINT Drops;                     /* number of packets that the driver dropped from the beginning of a capture.  */
-                                               /* A packet is lost when the the buffer of the driver is full.  */
-       UINT IfDrops;           /* Packets dropped by the card before going to the USB bus.  */
-                                               /* Not supported at the moment. */
-       UINT Capt;                      /* number of packets that pass the BPF filter, find place in the kernel buffer and */
-                                               /* therefore reach the application. */
+       guint Recvs;                    ///< Number of packets that the driver received by the adapter
+                                               ///< from the beginning of the current capture. This value includes the packets
+                                               ///< dropped because of buffer full.
+       guint Drops;                    ///< number of packets that the driver dropped from the beginning of a capture.
+                                               ///< A packet is lost when the the buffer of the driver is full.
+       guint IfDrops;          ///< Packets dropped by the card before going to the USB bus.
+                                               ///< Not supported at the moment.
+       guint Capt;                     ///< number of packets that pass the BPF filter, find place in the kernel buffer and
+                                               ///< therefore reach the application.
 }AirpcapStats, *PAirpcapStats;
 
+/*!
+  \brief Channel information.
+  Used by \ref AirpcapSetDeviceChannelEx(), \ref AirpcapGetDeviceChannelEx(), \ref AirpcapGetDeviceSupportedChannels()
+*/
+typedef struct _AirpcapChannelInfo
+{
+       guint Frequency;        ///< Channel frequency, in MHz.
+       /*!
+               \brief 802.11n specific. Offset of the extension channel in case of 40MHz channels.
+
+               Possible values are -1, 0 +1:
+               - -1 means that the extension channel should be below the control channel (e.g. Control = 5 and Extension = 1)
+               - 0 means that no extension channel should be used (20MHz channels or legacy mode)
+               - +1 means that the extension channel should be above the control channel (e.g. Control = 1 and Extension = 5)
+
+               In case of 802.11a/b/g channels (802.11n legacy mode), this field should be set to 0.
+       */
+       gchar ExtChannel;
+       guint8 Reserved[3];     ///< Reserved. It should be set to {0,0,0}.
+}
+       AirpcapChannelInfo, *PAirpcapChannelInfo;
+
+
 /*@}*/
 
 /** @defgroup airpcapfuncs AirPcap functions
@@ -251,14 +296,14 @@ typedef struct _AirpcapStats
   \param VersionRev Pointer to a variable that will be filled with the revision number.
   \param VersionBuild Pointer to a variable that will be filled with the build number.
 */
-void AirpcapGetVersion(PUINT VersionMajor, PUINT VersionMinor, PUINT VersionRev, PUINT VersionBuild);
+void AirpcapGetVersion(guint * VersionMajor, guint * VersionMinor, guint * VersionRev, guint * VersionBuild);
 
 /*!
   \brief Return the last error related to the specified handle
   \param AdapterHandle Handle to an open adapter.
   \return The string with the last error.
 */
-PCHAR AirpcapGetLastError(PAirpcapHandle AdapterHandle);
+gchar * AirpcapGetLastError(PAirpcapHandle AdapterHandle);
 
 /*!
   \brief Return the list of available devices
@@ -266,10 +311,10 @@ PCHAR AirpcapGetLastError(PAirpcapHandle AdapterHandle);
   \param Ebuf String that will contain error information if FALSE is returned. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes.
   \return TRUE on success. FALSE is returned on failure, in which case Ebuf is filled in with an appropriate error message.
 
-       Here's a snppet of code that shows how to use AirpcapGetDeviceList():
+       Here's a snippet of code that shows how to use AirpcapGetDeviceList():
 
        \code
-       CHAR Ebuf[AIRPCAP_ERRBUF_SIZE];
+       gchar Ebuf[AIRPCAP_ERRBUF_SIZE];
        AirpcapDeviceDescription *Desc, *tDesc;
 
        if(AirpcapGetDeviceList(&Desc, Ebuf) == -1)
@@ -285,15 +330,17 @@ PCHAR AirpcapGetLastError(PAirpcapHandle AdapterHandle);
                tDesc->Name,
                tDesc->Description);
        }
+
+       AirpcapFreeDeviceList(Desc);
        \endcode
 */
-BOOL AirpcapGetDeviceList(PAirpcapDeviceDescription *PPAllDevs, PCHAR Ebuf);
+gboolean AirpcapGetDeviceList(PAirpcapDeviceDescription *PPAllDevs, gchar * Ebuf);
 
 /*!
   \brief Free a list of devices returned by AirpcapGetDeviceList()
   \param PAllDevs Head of the list of devices returned by \ref AirpcapGetDeviceList().
 */
-VOID AirpcapFreeDeviceList(PAirpcapDeviceDescription PAllDevs);
+void AirpcapFreeDeviceList(PAirpcapDeviceDescription PAllDevs);
 
 /*!
   \brief Open an adapter
@@ -301,13 +348,57 @@ VOID AirpcapFreeDeviceList(PAirpcapDeviceDescription PAllDevs);
   \param Ebuf String that will contain error information in case of failure. The size of the string must be AIRPCAP_ERRBUF_SIZE bytes.
   \return A PAirpcapHandle handle on success. NULL is returned on failure, in which case Ebuf is filled in with an appropriate error message.
 */
-PAirpcapHandle AirpcapOpen(PCHAR DeviceName, PCHAR Ebuf);
+PAirpcapHandle AirpcapOpen(gchar * DeviceName, gchar * Ebuf);
 
 /*!
   \brief Close an adapter
   \param AdapterHandle Handle to the adapter to close.
 */
-VOID AirpcapClose(PAirpcapHandle AdapterHandle);
+void AirpcapClose(PAirpcapHandle AdapterHandle);
+
+/*!
+  \brief Sets the monitor mode for the specified adapter
+  \param AdapterHandle Handle to the adapter.
+  \param MonitorModeEnabled If TRUE, the adapter will be put in monitor mode. If FALSE, the adapter will be configured
+         for normal operation.
+  \return TRUE on success.
+
+  When monitor mode is on, the adapter captures all the packets transmitted on the channel. This includes:
+
+   - unicast packets
+   - multicast packets
+   - broadcast packets
+   - control and management packets
+
+  When monitor mode is off, the adapter has a filter on unicast packets to capture only the packets whose MAC
+  destination address equals to the adapter's address. This means the following frames will be received:
+
+   - unicast packets with the address of the adapter
+   - multicast packets
+   - broadcast packets
+   - beacons and probe requests
+
+  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, because handling the ACKs in software is too slow.
+
+  \note When an adapter is plugged into the system, it's always configured with monitor mode ON. The monitor mode
+        configuration is not stored persistently, so if you want to turn monitor mode off, you will need to do it
+               every time you open the adapter.
+*/
+gboolean AirpcapSetMonitorMode(PAirpcapHandle AdapterHandle, gboolean MonitorModeEnabled);
+
+/*!
+  \brief Returns TRUE if the specified adapter is in monitor mode.
+  \param AdapterHandle Handle to the adapter.
+  \param PMonitorModeEnabled User-provided variable that will be set to true if the adapter is in monitor mode.
+  \return TRUE if the operation is successful. FALSE otherwise.
+
+  \note When an adapter is plugged into the system, it's always configured with monitor mode ON. The monitor mode
+        configuration is not stored persistently, so if you want to turn monitor mode off, you will need to do it
+               every time you open the adapter.
+*/
+gboolean AirpcapGetMonitorMode(PAirpcapHandle AdapterHandle, gboolean * PMonitorModeEnabled);
 
 /*!
   \brief Set the link type of an adapter
@@ -317,15 +408,18 @@ VOID AirpcapClose(PAirpcapHandle AdapterHandle);
 
   the "link type" determines how the driver will encode the packets captured from the network.
   Aircap supports two link types:
-  - AIRPCAP_LT_802_11, to capture 802.11 frames (including control frames) without any
+  - \ref AIRPCAP_LT_802_11, to capture 802.11 frames (including control frames) without any
    power information. Look at the Capture_no_radio example application in the developer's pack
    for a reference on how to decode 802.11 frames with this link type.
-  - AIRPCAP_LT_802_11_PLUS_RADIO, to capture 802.11 frames (including control frames) with a radiotap header
-  that contains power and channel information. More information about the radiotap header can be found int the
+  - \ref AIRPCAP_LT_802_11_PLUS_RADIO, to capture 802.11 frames (including control frames) with a radiotap header
+  that contains power and channel information. More information about the radiotap header can be found in the
   \ref radiotap section. Moreover, the "Capture_radio" example application in
   the developer's pack can be used as a reference on how to decode 802.11 frames with radiotap headers.
+  - \ref AIRPCAP_LT_802_11_PLUS_PPI, to capture 802.11 frames (including control frames) with a Per Packet Information (PPI)
+       header that contains per-packet meta information like channel and power information. More details on the PPI header can
+       be found in the PPI online documentation (TODO).
 */
-BOOL AirpcapSetLinkType(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType);
+gboolean AirpcapSetLinkType(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType);
 
 /*!
   \brief Get the link type of the specified adapter
@@ -343,7 +437,7 @@ BOOL AirpcapSetLinkType(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkTyp
   \ref radiotap section. Moreover, the "Capture_radio" example application in
   the developer's pack can be used as a reference on how to decode 802.11 frames with radiotap headers.
 */
-BOOL AirpcapGetLinkType(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType);
+gboolean AirpcapGetLinkType(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType);
 
 /*!
   \brief Configures the adapter on whether to include the MAC Frame Check Sequence in the captured packets.
@@ -358,7 +452,7 @@ BOOL AirpcapGetLinkType(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType
   that precedes each frame has two additional fields at the end: Padding and FCS. These two fields are not present
   when FCS inclusion is off.
 */
-BOOL AirpcapSetFcsPresence(PAirpcapHandle AdapterHandle, BOOL IsFcsPresent);
+gboolean AirpcapSetFcsPresence(PAirpcapHandle AdapterHandle, gboolean IsFcsPresent);
 
 /*!
   \brief Returns TRUE if the specified adapter includes the MAC Frame Check Sequence in the captured packets
@@ -366,14 +460,14 @@ BOOL AirpcapSetFcsPresence(PAirpcapHandle AdapterHandle, BOOL IsFcsPresent);
   \param PIsFcsPresent User-provided variable that will be set to true if the adapter is including the FCS.
   \return TRUE if the operation is successful. FALSE otherwise.
 
-  In the default configuration, the adatper has FCS inclusion turned on. The MAC Frame Check Sequence is 4 bytes
+  In the default configuration, the adapter has FCS inclusion turned on. The MAC Frame Check Sequence is 4 bytes
   and is located at the end of the 802.11 packet, with both AIRPCAP_LT_802_11 and AIRPCAP_LT_802_11_PLUS_RADIO
   link types.
   When the FCS inclusion is turned on, and if the link type is AIRPCAP_LT_802_11_PLUS_RADIO, the radiotap header
   that precedes each frame has two additional fields at the end: Padding and FCS. These two fields are not present
   when FCS inclusion is off.
 */
-BOOL AirpcapGetFcsPresence(PAirpcapHandle AdapterHandle, PBOOL PIsFcsPresent);
+gboolean AirpcapGetFcsPresence(PAirpcapHandle AdapterHandle, gboolean * PIsFcsPresent);
 
 /*!
   \brief Configures the adapter to accept or drop frames with an incorrect Frame Check sequence (FCS).
@@ -383,17 +477,17 @@ BOOL AirpcapGetFcsPresence(PAirpcapHandle AdapterHandle, PBOOL PIsFcsPresent);
 
   \note By default, the driver is configured in \ref AIRPCAP_VT_ACCEPT_EVERYTHING mode.
 */
-BOOL AirpcapSetFcsValidation(PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType);
+gboolean AirpcapSetFcsValidation(PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType);
 
 /*!
   \brief Checks if the specified adapter is configured to capture frames with incorrect an incorrect Frame Check Sequence (FCS).
   \param AdapterHandle Handle to the adapter.
   \param ValidationType Pointer to a user supplied variable that will contain the type of validation the driver will perform. See the documentation of \ref AirpcapValidationType for details.
-  \return TRUE if the operation is succesful. FALSE otherwise.
+  \return TRUE if the operation is successful. FALSE otherwise.
 
   \note By default, the driver is configured in \ref AIRPCAP_VT_ACCEPT_EVERYTHING mode.
 */
-BOOL AirpcapGetFcsValidation(PAirpcapHandle AdapterHandle, PAirpcapValidationType ValidationType);
+gboolean AirpcapGetFcsValidation(PAirpcapHandle AdapterHandle, PAirpcapValidationType ValidationType);
 
 /*!
   \brief Set the list of decryption keys that the driver is going to use with the specified device.
@@ -404,19 +498,19 @@ BOOL AirpcapGetFcsValidation(PAirpcapHandle AdapterHandle, PAirpcapValidationTyp
   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.
-  The driver supports, for every device, multiple keys at the same time.
 
-  At this time, the only supported decryption method is WEP.
+  This function allows to set the <b>adapter-specific</b> set of keys. These keys will be used by the specified adapter only,
+  and will not be used by other airpcap devices besides the specified one.
 
-  The configured decryption keys are device-specific: they 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.
 
-  \note: this is a Device-related function: when you change the channel from an open capture instance, the change will be
+  \note: when you change the set of keys from an open capture instance, the change will be
          immediately reflected on all the other capture instances.
 */
-BOOL AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
+gboolean AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
 
 /*!
   \brief Returns the list of decryption keys in the driver that are currently associated with the specified device
@@ -424,12 +518,14 @@ BOOL AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection K
   \param KeysCollection User-allocated PAirpcapKeysCollection structure that will be filled with the keys.
   \param PKeysCollectionSize \b IN: pointer to a user-allocated variable that contains the length of the KeysCollection structure, in bytes.
                                                \b OUT: amount of data moved by the driver in the buffer pointed by KeysBuffer, in bytes.
-  \return TRUE if the operation is succesful. If an error occurs, the return value is FALSE and KeysCollectionSize is zero.
+  \return TRUE if the operation is successful. If an error occurs, the return value is FALSE and KeysCollectionSize is zero.
   If the provided buffer is too small to contain the keys, the return value is FALSE and KeysCollectionSize contains the
   needed KeysCollection length, in bytes. If the device doesn't have any decryption key configured, the return value is TRUE, and
   KeysCollectionSize will be zero.
 
-  This function returns the list of decryption keys in the driver that are associated with the specified device.
+  This function returns the <b>adapter-specific</b> set of keys. These keys are used by the specified adapter only,
+  and not by other airpcap devices besides the specified one.
+
   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.
@@ -439,33 +535,97 @@ BOOL AirpcapSetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection K
   when called on different devices.
 
   At this time, the only supported decryption method is WEP.
+*/
+gboolean AirpcapGetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
 
-  \note: this is a Device-related function: when you change the channel from an open capture instance, the change will be
+/*!
+  \brief Set the global list of decryption keys that the driver is going to use with all the devices.
+  \param AdapterHandle Handle an open adapter instance.
+  \param KeysCollection Pointer to a \ref PAirpcapKeysCollection structure that contains the keys to be set in the driver.
+  \return TRUE if the operation is successful. FALSE otherwise.
+
+  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.
+
+  This function allows to set the <b>global driver</b> set of keys. These keys will be used by all the adapters 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.
+
+  \note: when you change the set of keys from an open capture instance, the change will be
          immediately reflected on all the other capture instances.
 */
-BOOL AirpcapGetDeviceKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, PUINT PKeysCollectionSize);
+gboolean AirpcapSetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
 
 /*!
-  \brief Turns on or off the decryption of the incoming frames
+  \brief Returns the global list of decryption keys in the driver that are associated with all the devices.
+  \param AdapterHandle Handle to an open adapter instance.
+  \param KeysCollection User-allocated PAirpcapKeysCollection structure that will be filled with the keys.
+  \param PKeysCollectionSize \b IN: pointer to a user-allocated variable that contains the length of the KeysCollection structure, in bytes.
+                                               \b OUT: amount of data moved by the driver in the buffer pointed by KeysBuffer, in bytes.
+  \return TRUE if the operation is successful. If an error occurs, the return value is FALSE and KeysCollectionSize is zero.
+  If the provided buffer is too small to contain the keys, the return value is FALSE and KeysCollectionSize contains the
+  needed KeysCollection length, in bytes. If the device doesn't have any decryption key configured, the return value is TRUE, and
+  KeysCollectionSize will be zero.
+
+  This function returns the <b>global driver</b> set of keys. These keys will be used by all the adapters plugged in
+  the machine.
+
+  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.
+*/
+gboolean AirpcapGetDriverKeys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
+
+/*!
+  \brief Turns on or off the decryption of the incoming frames with the <b>adapter-specific</b> keys.
   \param AdapterHandle Handle to the adapter.
-  \param ValidationType Either \ref AIRPCAP_DECRYPTION_ON or \ref AIRPCAP_DECRYPTION_OFF
+  \param Enable Either \ref AIRPCAP_DECRYPTION_ON or \ref AIRPCAP_DECRYPTION_OFF
   \return TRUE on success.
 
-  The decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function.
+  The adapter-specific decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function.
   \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON.
 */
-BOOL AirpcapSetDecryptionState(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
+gboolean AirpcapSetDecryptionState(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
 
 /*!
-  \brief Tells if this open instance is configured to perform the decryption of the incoming frames
+  \brief Tells if this open instance is configured to perform the decryption of the incoming frames with the <b>adapter-specific</b> keys.
   \param AdapterHandle Handle to the adapter.
-  \param ValidationType Pointer to a user supplied variable that will contain the decryption configuration. See \ref PAirpcapDecryptionState for details.
+  \param PEnable Pointer to a user supplied variable that will contain the decryption configuration. See \ref PAirpcapDecryptionState for details.
+  \return TRUE if the operation is successful. FALSE otherwise.
+
+  The adapter-specific decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function.
+  \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON.
+*/
+gboolean AirpcapGetDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
+
+/*!
+  \brief Turns on or off the decryption of the incoming frames with the <b>global driver</b> set of keys.
+  \param AdapterHandle Handle to the adapter.
+  \param Enable Either \ref AIRPCAP_DECRYPTION_ON or \ref AIRPCAP_DECRYPTION_OFF
+  \return TRUE on success.
+
+  The global decryption keys can be configured with the \ref AirpcapSetDriverKeys() function.
+  \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON.
+*/
+gboolean AirpcapSetDriverDecryptionState(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
+
+/*!
+  \brief Tells if this open instance is configured to perform the decryption of the incoming frames with the <b>global driver</b> set of keys.
+  \param AdapterHandle Handle to the adapter.
+  \param PEnable Pointer to a user supplied variable that will contain the decryption configuration. See \ref PAirpcapDecryptionState for details.
   \return TRUE if the operation is succesful. FALSE otherwise.
 
-  The decryption keys can be configured with the \ref AirpcapSetDeviceKeys() function.
+  The global decryption keys can be configured with the \ref AirpcapSetDriverKeys() function.
   \note By default, the driver is configured with \ref AIRPCAP_DECRYPTION_ON.
 */
-BOOL AirpcapGetDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
+gboolean AirpcapGetDriverDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
 
 /*!
   \brief Set the radio channel of a device
@@ -473,12 +633,12 @@ BOOL AirpcapGetDecryptionState(PAirpcapHandle AdapterHandle, PAirpcapDecryptionS
   \param Channel the new channel to set.
   \return TRUE on success.
 
-  Valid channels are in the range 1-14. The default channel setting is 6.
+  The list of available channels can be retrieved with \ref AirpcapGetDeviceSupportedChannels(). The default channel setting is 6.
 
-  \note: this is a Device-related function: when you change the channel from an open capture instance, the change will be
+  \note this is a device-related function: when you change the channel from an open capture instance, the change will be
          immediately reflected on all the other capture instances.
 */
-BOOL AirpcapSetDeviceChannel(PAirpcapHandle AdapterHandle, UINT Channel);
+gboolean AirpcapSetDeviceChannel(PAirpcapHandle AdapterHandle, guint Channel);
 
 /*!
   \brief Get the radio channel of a device
@@ -486,12 +646,12 @@ BOOL AirpcapSetDeviceChannel(PAirpcapHandle AdapterHandle, UINT Channel);
   \param PChannel Pointer to a user-supplied variable into which the function will copy the currently configured radio channel.
   \return TRUE on success.
 
-  Valid channels are in the range 1-14. The default channel setting is 6.
+  The list of available channels can be retrieved with \ref AirpcapGetDeviceSupportedChannels(). The default channel setting is 6.
 
-  \note: this is a Device-related function: when you change the channel from an open capture instance, the change will be
+  \note this is a device-related function: when you change the channel from an open capture instance, the change will be
          immediately reflected on all the other capture instances.
 */
-BOOL AirpcapGetDeviceChannel(PAirpcapHandle AdapterHandle, PUINT PChannel);
+gboolean AirpcapGetDeviceChannel(PAirpcapHandle AdapterHandle, guint * PChannel);
 
 /*!
   \brief Set the size of the kernel packet buffer for this adapter
@@ -504,10 +664,10 @@ BOOL AirpcapGetDeviceChannel(PAirpcapHandle AdapterHandle, PUINT PChannel);
   A bigger kernel buffer size decreases the risk of dropping packets during network bursts or when the
   application is busy, at the cost of higher kernel memory usage.
 
-  \note: don't use this function unless you know what you are doing. Due to chaching issues and bigger non-paged
-  memory consumption, Bigger buffer sizes can decrease the capture performace instead of improving it.
+  \note don't use this function unless you know what you are doing. Due to caching issues and bigger non-paged
+  memory consumption, bigger buffer sizes can decrease the capture performance instead of improving it.
 */
-BOOL AirpcapSetKernelBuffer(PAirpcapHandle AdapterHandle, UINT BufferSize);
+gboolean AirpcapSetKernelBuffer(PAirpcapHandle AdapterHandle, guint BufferSize);
 
 /*!
   \brief Get the size of the kernel packet buffer for this adapter
@@ -518,7 +678,7 @@ BOOL AirpcapSetKernelBuffer(PAirpcapHandle AdapterHandle, UINT BufferSize);
   Every AirPcap open instance has an associated kernel buffer, whose default size is 1 Mbyte.
   This function can be used to get the size of this buffer.
 */
-BOOL AirpcapGetKernelBufferSize(PAirpcapHandle AdapterHandle, PUINT PSizeBytes);
+gboolean AirpcapGetKernelBufferSize(PAirpcapHandle AdapterHandle, guint * PSizeBytes);
 
 /*!
   \brief Saves the configuration of the specified adapter in the registry, so that it becomes the default for this adapter.
@@ -557,7 +717,7 @@ BOOL AirpcapGetKernelBufferSize(PAirpcapHandle AdapterHandle, PUINT PSizeBytes);
    AirpcapStoreCurConfigAsAdapterDefault() needs administrator privileges. It will fail if the calling user
    is not a local machine administrator.
 */
-BOOL AirpcapStoreCurConfigAsAdapterDefault(PAirpcapHandle AdapterHandle);
+gboolean AirpcapStoreCurConfigAsAdapterDefault(PAirpcapHandle AdapterHandle);
 
 /*!
   \brief Set the BPF kernel filter for an adapter
@@ -569,7 +729,7 @@ BOOL AirpcapStoreCurConfigAsAdapterDefault(PAirpcapHandle AdapterHandle);
   \return TRUE on success.
 
   The AirPcap driver is able to perform kernel-level filtering using the standard BPF pseudo-machine format. You can read
-  the WinPcap documentation at http://www.winpcap.org/devel.htm for more details on the BPF filtering mechaism.
+  the WinPcap documentation at http://www.winpcap.org/devel.htm for more details on the BPF filtering mechanism.
 
   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.
@@ -577,7 +737,7 @@ BOOL AirpcapStoreCurConfigAsAdapterDefault(PAirpcapHandle AdapterHandle);
   with the -d or -dd or -ddd flags to obtain the pseudocode.
 
 */
-BOOL AirpcapSetFilter(PAirpcapHandle AdapterHandle, PVOID Instructions, UINT Len);
+gboolean AirpcapSetFilter(PAirpcapHandle AdapterHandle, void * Instructions, guint Len);
 
 /*!
   \brief Return the MAC address of an adapter.
@@ -586,7 +746,7 @@ BOOL AirpcapSetFilter(PAirpcapHandle AdapterHandle, PVOID Instructions, UINT Len
    The size of this buffer needs to be at least 6 bytes.
   \return TRUE on success.
 */
-BOOL AirpcapGetMacAddress(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress);
+gboolean AirpcapGetMacAddress(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress);
 
 /*!
   \brief Set the mintocopy parameter for an open adapter
@@ -601,7 +761,7 @@ BOOL AirpcapGetMacAddress(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacA
   A low MinToCopy results in good responsiveness since the driver will signal the application close to the arrival time of
   the packet. This has higher CPU loading over the first approach.
 */
-BOOL AirpcapSetMinToCopy(PAirpcapHandle AdapterHandle, UINT MinToCopy);
+gboolean AirpcapSetMinToCopy(PAirpcapHandle AdapterHandle, guint MinToCopy);
 
 /*!
   \brief Gets an event that is signaled when that is signalled when packets are available in the kernel buffer (see \ref AirpcapSetMinToCopy()).
@@ -613,7 +773,7 @@ BOOL AirpcapSetMinToCopy(PAirpcapHandle AdapterHandle, UINT MinToCopy);
   This event can be used by WaitForSingleObject() and WaitForMultipleObjects() to create blocking behavior when reading
   packets from one or more adapters (see \ref AirpcapRead()).
 */
-BOOL AirpcapGetReadEvent(PAirpcapHandle AdapterHandle, HANDLE* PReadEvent);
+gboolean AirpcapGetReadEvent(PAirpcapHandle AdapterHandle, void *** PReadEvent);
 
 /*!
   \brief Fills a user-provided buffer with zero or more packets that have been captured on the referenced adapter.
@@ -632,7 +792,26 @@ BOOL AirpcapGetReadEvent(PAirpcapHandle AdapterHandle, HANDLE* PReadEvent);
   \note this function is NOT blocking. Blocking behavior can be obtained using the event returned
    by \ref AirpcapGetReadEvent(). See also \ref AirpcapSetMinToCopy().
 */
-BOOL AirpcapRead(PAirpcapHandle AdapterHandle, PBYTE Buffer, UINT BufSize, PUINT PReceievedBytes);
+gboolean AirpcapRead(PAirpcapHandle AdapterHandle, guint8 * Buffer, guint BufSize, guint * PReceievedBytes);
+
+/*!
+  \brief Transmits a packet.
+  \param AdapterHandle Handle to the adapter.
+  \param TxPacket Pointer to a buffer that contains the packet to be transmitted.
+  \param PacketLen Length of the buffer pointed by the TxPacket argument, in bytes.
+  \return TRUE on success.
+
+  The packet will be transmitted on the channel the device is currently set. To change the device adapter, use the
+  \ref AirpcapSetDeviceChannel() function.
+
+  If the linktype 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 linktype 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.
+*/
+gboolean AirpcapWrite(PAirpcapHandle AdapterHandle, gchar * TxPacket, guint32 PacketLen);
 
 /*!
   \brief Get per-adapter WinPcap-compatible capture statistics.
@@ -640,7 +819,7 @@ BOOL AirpcapRead(PAirpcapHandle AdapterHandle, PBYTE Buffer, UINT BufSize, PUINT
   \param PStats pointer to a user-allocated AirpcapStats structure that will be filled with statistical information.
   \return TRUE on success.
 */
-BOOL AirpcapGetStats(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
+gboolean AirpcapGetStats(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
 
 /*!
   \brief Get the number of LEDs the referenced adapter has available.
@@ -648,7 +827,7 @@ BOOL AirpcapGetStats(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
   \param NumberOfLeds Number of LEDs available on this adapter.
   \return TRUE on success.
 */
-BOOL AirpcapGetLedsNumber(PAirpcapHandle AdapterHandle, PUINT NumberOfLeds);
+gboolean AirpcapGetLedsNumber(PAirpcapHandle AdapterHandle, guint * NumberOfLeds);
 
 /*!
   \brief Turn on one of the adapter's LEDs.
@@ -656,7 +835,7 @@ BOOL AirpcapGetLedsNumber(PAirpcapHandle AdapterHandle, PUINT NumberOfLeds);
   \param LedNumber zero-based identifier of the LED to turn on.
   \return TRUE on success.
 */
-BOOL AirpcapTurnLedOn(PAirpcapHandle AdapterHandle, UINT LedNumber);
+gboolean AirpcapTurnLedOn(PAirpcapHandle AdapterHandle, guint LedNumber);
 
 /*!
   \brief Turn off one of the adapter's LEDs.
@@ -664,14 +843,72 @@ BOOL AirpcapTurnLedOn(PAirpcapHandle AdapterHandle, UINT LedNumber);
   \param LedNumber zero-based identifier of the LED to turn off.
   \return TRUE on success.
 */
-BOOL AirpcapTurnLedOff(PAirpcapHandle AdapterHandle, UINT LedNumber);
+gboolean AirpcapTurnLedOff(PAirpcapHandle AdapterHandle, guint LedNumber);
+
+/*!
+  \brief Set the channel of a device through its radio frequency. In case of 802.11n enabled devices, it sets the extension channel, if used.
+  \param AdapterHandle Handle to the adapter.
+  \param ChannelInfo The new channel information to set.
+  \return TRUE on success.
+
+  \note this is a device-related function: when you change the channel from an open capture instance, the change will be
+         immediately reflected on all the other capture instances.
+*/
+gboolean AirpcapSetDeviceChannelEx(PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo);
+
+/*!
+  \brief Get the channel of a device through its radiofrequency. In case of 802.11n enabled devices, it gets the extension channel, if in use.
+  \param AdapterHandle Handle to the adapter.
+  \param PChannelInfo Pointer to a user-supplied variable into which the function will copy the currently configured channel information.
+  \return TRUE on success.
+
+  \note this is a device-related function: when you change the channel from an open capture instance, the change will be
+         immediately reflected on all the other capture instances.
+*/
+gboolean AirpcapGetDeviceChannelEx(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo);
+
+/*!
+  \brief Get 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:
+       - <b>Frequency 2437 Extension +1</b>. Control channel is 6, extension channel is 10.
+       - <b>Frequency 2437 Extension 0</b>. Control channel is 6, no extension channel is used (20MHz channel and legacy mode).
+       - <b>Frequency 2437 Extension -1</b>. Control channel is 6, extension channel is 2.
+  \param AdapterHandle Handle to the adapter.
+  \param 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
+  \param pNumChannelInfo Number of channels returned in the array.
+  \return TRUE on success.
+
+  \note The supported channels are not listed in any specific order.
+*/
+gboolean AirpcapGetDeviceSupportedChannels(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo *ppChannelInfo, guint * pNumChannelInfo);
+
+/*!
+  \brief Converts a given frequency to the corresponding channel.
+
+  \param Frequency Frequency of the channel, in MHz.
+  \param PChannel Pointer to a user-supplied variable that will contain the channel number on success.
+  \param PBand Pointer to a user-supplied variable that will contain the band (a or b/g) of the given channel.
+  \return TRUE on success, i.e. the frequency corresponds to a valid a or b/g channel.
+*/
+gboolean AirpcapConvertFrequencyToChannel(guint Frequency, guint * PChannel, PAirpcapChannelBand PBand);
+
+/*!
+  \brief Converts a given channel to the corresponding frequency.
+
+  \param Channel Channel number to be converted.
+  \param PFrequency Pointer to a user-supplied variable that will contain the channel frequency in MHz on success.
+  \return TRUE on success, i.e. the given channel number exists.
+*/
+gboolean AirpcapConvertChannelToFrequency(guint Channel, guint * PFrequency);
+
 
 /*@}*/
 
-#endif /* __AIRPCAP_DRIVER__ */
+#endif // __AIRPCAP_DRIVER__
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* !defined(AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_) */
+#endif // !defined(AIRPCAP_H__EAE405F5_0171_9592_B3C2_C19EC426AD34__INCLUDED_)