#ifndef __AIRPCAP_LOADER_H__
#define __AIRPCAP_LOADER_H__
+#include <epan/crypt/airpdcap_user.h>
+
/* Error values from "get_airpcap_interface_list()". */
#define CANT_GET_AIRPCAP_INTERFACE_LIST 0 /* error getting list */
#define NO_AIRPCAP_INTERFACES_FOUND 1 /* list is empty */
+#define AIRPCAP_NOT_LOADED 2 /* Airpcap DLL not loaded */
#define AIRPCAP_CHANNEL_ANY_NAME "ANY"
typedef BOOL (*AirpcapGetDriverDecryptionStateHandler)(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
typedef BOOL (*AirpcapStoreCurConfigAsAdapterDefaultHandler)(PAirpcapHandle AdapterHandle);
typedef VOID (*AirpcapGetVersionHandler)(PUINT VersionMajor, PUINT VersionMinor, PUINT VersionRev, PUINT VersionBuild);
+typedef BOOL (*AirpcapSetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo);
+typedef BOOL (*AirpcapGetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo);
+typedef BOOL (*AirpcapGetDeviceSupportedChannelsHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo **ppChannelInfo, PULONG pNumChannelInfo);
+
+#define FLAG_CAN_BE_LOW 0x00000001
+#define FLAG_CAN_BE_HIGH 0x00000002
+#define FLAG_IS_BG_CHANNEL 0x00000004
+#define FLAG_IS_A_CHANNEL 0x00000008
+
+typedef struct _Dot11Channel
+{
+ UINT Channel;
+ ULONG Frequency;
+ ULONG Flags;
+} Dot11Channel;
/*
* The list of interfaces returned by "get_airpcap_interface_list()" is
char *description; /* from OS, e.g. "Local Area Connection" or NULL */
GSList *ip_addr; /* containing address values of if_addr_t */
gboolean loopback; /* TRUE if loopback, FALSE otherwise */
- AirpcapLinkType linkType; /* The link layer type*/
- UINT channel; /* Channel (1-14)*/
+ AirpcapLinkType linkType; /* The link layer type */
+ AirpcapChannelInfo channelInfo; /* Channel Information */
BOOL IsFcsPresent; /* Include 802.11 CRC in frames */
AirpcapValidationType CrcValidationOn; /* Capture Frames with Wrong CRC */
- AirpcapDecryptionState DecryptionOn; /* TRUE if decryption is on, FALSE otherwise*/
+ AirpcapDecryptionState DecryptionOn; /* TRUE if decryption is on, FALSE otherwise */
PAirpcapKeysCollection keysCollection; /* WEP Key collection for the adapter */
UINT keysCollectionSize; /* Size of the key collection */
- gboolean blinking; /* TRUE if is blinkng, FALSE otherwise*/
- gboolean led; /* TRUE if on, FALSE if off*/
+ gboolean blinking; /* TRUE if is blinkng, FALSE otherwise */
+ gboolean led; /* TRUE if on, FALSE if off */
gboolean saved; /* TRUE if current configuration has been saved, FALSE otherwise */
gint tag; /* int for the gtk blinking callback */
+ Dot11Channel *pSupportedChannels;
+ ULONG numSupportedChannels;
} airpcap_if_info_t;
/*
extern airpcap_if_info_t *airpcap_if_active;
/* WLAN preferences pointer */
-//extern module_t *wlan_prefs;
+/*extern module_t *wlan_prefs; - TODO: What is this?? */
/*
* Function used to read the Decryption Keys from the preferences and store them
* This will be stored into the registry...
*/
gboolean
-write_wlan_wep_keys_to_regitry(airpcap_if_info_t* info_if, GList* key_list);
+write_wlan_wep_keys_to_registry(airpcap_if_info_t* info_if, GList* key_list);
/* Returs TRUE if the WEP key is valid, false otherwise */
gboolean
* Used to retrieve the interface given the name
* (the name is used in AirpcapOpen)
*/
-airpcap_if_info_t* get_airpcap_if_by_name(GList* if_list, const gchar* name);
+airpcap_if_info_t* get_airpcap_if_from_name(GList* if_list, const gchar* name);
/*
* Airpcap wrapper, used to store the current settings for the selected adapter
BOOL
airpcap_if_get_device_channel(PAirpcapHandle ah, PUINT ch);
+/*
+ * Airpcap wrapper, get the channels supported by the adapter
+ */
+BOOL
+airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo **cInfo, PULONG nInfo);
+
+/*
+ * Airpcap wrapper, get supported channels formatted into an array
+ */
+Dot11Channel*
+airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, PULONG pNumSupportedChannels);
+
/*
* Airpcap wrapper, used to set the channel of an airpcap adapter
*/
BOOL
airpcap_if_set_device_channel(PAirpcapHandle ah, UINT ch);
+/*
+ * Airpcap wrapper, used to get the frequency of an airpcap adapter
+ */
+BOOL
+airpcap_if_get_device_channel_ex(PAirpcapHandle ah, PAirpcapChannelInfo pChannelInfo);
+
+/*
+ * Airpcap wrapper, used to set the frequency of an airpcap adapter
+ */
+BOOL
+airpcap_if_set_device_channel_ex(PAirpcapHandle ah, AirpcapChannelInfo ChannelInfo);
+
/*
* Airpcap wrapper, used to open an airpcap adapter
*/
*/
VOID airpcap_if_close(PAirpcapHandle handle);
+/*
+ * Retrieve the state of the Airpcap DLL
+ */
+int
+airpcap_get_dll_state();
+
/*
* Airpcap wrapper, used to turn on the led of an airpcap adapter
*/
*/
int load_airpcap(void);
-/*
- * Get an error message string for a CANT_GET_INTERFACE_LIST error from
- * "get_airpcap_interface_list()".
- */
-gchar*
-cant_get_airpcap_if_list_error_message(const char *err_str);
-
/*
* This function will use the airpcap.dll to find all the airpcap devices.
* Will return null if no device is found.
*/
GList*
-get_airpcap_interface_list(int *err, char *err_str);
+get_airpcap_interface_list(int *err, char **err_str);
/*
* Returns the ASCII string of a key given the key bites
void
airpcap_save_selected_if_configuration(airpcap_if_info_t* if_info);
-/*
- * Used to retrieve the name of the interface given the description
- * (the name is used in AirpcapOpen, the description is put in the combo box)
- */
-gchar*
-get_airpcap_name_from_description(GList* if_list, gchar* description);
-
-/*
- * Used to retrieve the airpcap_if_info_t of the selected interface given the
- * description (that is the entry of the combo box).
- */
-gpointer
-get_airpcap_if_from_description(GList* if_list, const gchar* description);
-
/*
* Used to retrieve the two chars string from interface description
*/
* This will be stored into the registry...
*/
BOOL
-write_wlan_driver_wep_keys_to_regitry(GList* key_list);
+write_wlan_driver_wep_keys_to_registry(GList* key_list);
/*
* Clear keys and decryption status for the specified interface
void
get_runtime_airpcap_version(GString *str);
-/*
- * Returns the decryption_key_t struct given a string describing the key.
- * Returns NULL if the key_string cannot be parsed.
- */
-decryption_key_t*
-parse_key_string(gchar* key_string);
-
-/*
- * Returns a newly allocated string representing the given decryption_key_t struct
- */
-gchar*
-get_key_string(decryption_key_t* dk);
-
#endif