aboutsummaryrefslogtreecommitdiffstats
path: root/capture/airpcap_loader.h
diff options
context:
space:
mode:
Diffstat (limited to 'capture/airpcap_loader.h')
-rw-r--r--capture/airpcap_loader.h172
1 files changed, 87 insertions, 85 deletions
diff --git a/capture/airpcap_loader.h b/capture/airpcap_loader.h
index c1d612bd9f..9ca9fa45c9 100644
--- a/capture/airpcap_loader.h
+++ b/capture/airpcap_loader.h
@@ -1,4 +1,5 @@
-/* airpcap_loader.h
+/** @file
+ *
* Declarations of routines for the "About" dialog
*
* Giorgio Tino <giorgio.tino@cacetech.com>
@@ -15,6 +16,7 @@
#define __AIRPCAP_LOADER_H__
#include <epan/crypt/dot11decrypt_system.h>
+#include <wsutil/feature_list.h>
#ifdef __cplusplus
extern "C" {
@@ -41,41 +43,41 @@ extern "C" {
/* #define AIRPCAP_DEBUG 1 */
-typedef gchar * (*AirpcapGetLastErrorHandler)(PAirpcapHandle AdapterHandle);
-typedef gboolean (*AirpcapGetDeviceListHandler)(PAirpcapDeviceDescription *PPAllDevs, gchar * Ebuf);
+typedef char * (*AirpcapGetLastErrorHandler)(PAirpcapHandle AdapterHandle);
+typedef bool (*AirpcapGetDeviceListHandler)(PAirpcapDeviceDescription *PPAllDevs, char * Ebuf);
typedef void (*AirpcapFreeDeviceListHandler)(PAirpcapDeviceDescription PAllDevs);
-typedef PAirpcapHandle (*AirpcapOpenHandler)(gchar * DeviceName, gchar * Ebuf);
+typedef PAirpcapHandle (*AirpcapOpenHandler)(char * DeviceName, char * Ebuf);
typedef void (*AirpcapCloseHandler)(PAirpcapHandle AdapterHandle);
-typedef gboolean (*AirpcapGetLinkTypeHandler)(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType);
-typedef gboolean (*AirpcapSetLinkTypeHandler)(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType);
-typedef gboolean (*AirpcapSetKernelBufferHandler)(PAirpcapHandle AdapterHandle, guint BufferSize);
-typedef gboolean (*AirpcapSetFilterHandler)(PAirpcapHandle AdapterHandle, void * Instructions, guint Len);
-typedef gboolean (*AirpcapGetMacAddressHandler)(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress);
-typedef gboolean (*AirpcapSetMinToCopyHandler)(PAirpcapHandle AdapterHandle, guint MinToCopy);
-typedef gboolean (*AirpcapGetReadEventHandler)(PAirpcapHandle AdapterHandle, void *** PReadEvent);
-typedef gboolean (*AirpcapReadHandler)(PAirpcapHandle AdapterHandle, guint8 * Buffer, guint BufSize, guint * PReceievedBytes);
-typedef gboolean (*AirpcapGetStatsHandler)(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
-typedef gboolean (*AirpcapTurnLedOnHandler)(PAirpcapHandle AdapterHandle, guint LedNumber);
-typedef gboolean (*AirpcapTurnLedOffHandler)(PAirpcapHandle AdapterHandle, guint LedNumber);
-typedef gboolean (*AirpcapSetDeviceChannelHandler)(PAirpcapHandle AdapterHandle, guint Channel);
-typedef gboolean (*AirpcapGetDeviceChannelHandler)(PAirpcapHandle AdapterHandle, guint * PChannel);
-typedef gboolean (*AirpcapSetFcsPresenceHandler)(PAirpcapHandle AdapterHandle, gboolean IsFcsPresent);
-typedef gboolean (*AirpcapGetFcsPresenceHandler)(PAirpcapHandle AdapterHandle, gboolean * PIsFcsPresent);
-typedef gboolean (*AirpcapSetFcsValidationHandler)(PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType);
-typedef gboolean (*AirpcapGetFcsValidationHandler)(PAirpcapHandle AdapterHandle, PAirpcapValidationType PValidationType);
-typedef gboolean (*AirpcapSetDeviceKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
-typedef gboolean (*AirpcapGetDeviceKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
-typedef gboolean (*AirpcapSetDriverKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
-typedef gboolean (*AirpcapGetDriverKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
-typedef gboolean (*AirpcapSetDecryptionStateHandler)(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
-typedef gboolean (*AirpcapGetDecryptionStateHandler)(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
-typedef gboolean (*AirpcapSetDriverDecryptionStateHandler)(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
-typedef gboolean (*AirpcapGetDriverDecryptionStateHandler)(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
-typedef gboolean (*AirpcapStoreCurConfigAsAdapterDefaultHandler)(PAirpcapHandle AdapterHandle);
-typedef void (*AirpcapGetVersionHandler)(guint * VersionMajor, guint * VersionMinor, guint * VersionRev, guint * VersionBuild);
-typedef gboolean (*AirpcapSetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo);
-typedef gboolean (*AirpcapGetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo);
-typedef gboolean (*AirpcapGetDeviceSupportedChannelsHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo **ppChannelInfo, guint32 * pNumChannelInfo);
+typedef bool (*AirpcapGetLinkTypeHandler)(PAirpcapHandle AdapterHandle, PAirpcapLinkType PLinkType);
+typedef bool (*AirpcapSetLinkTypeHandler)(PAirpcapHandle AdapterHandle, AirpcapLinkType NewLinkType);
+typedef bool (*AirpcapSetKernelBufferHandler)(PAirpcapHandle AdapterHandle, unsigned BufferSize);
+typedef bool (*AirpcapSetFilterHandler)(PAirpcapHandle AdapterHandle, void * Instructions, unsigned Len);
+typedef bool (*AirpcapGetMacAddressHandler)(PAirpcapHandle AdapterHandle, PAirpcapMacAddress PMacAddress);
+typedef bool (*AirpcapSetMinToCopyHandler)(PAirpcapHandle AdapterHandle, unsigned MinToCopy);
+typedef bool (*AirpcapGetReadEventHandler)(PAirpcapHandle AdapterHandle, void *** PReadEvent);
+typedef bool (*AirpcapReadHandler)(PAirpcapHandle AdapterHandle, uint8_t * Buffer, unsigned BufSize, unsigned * PReceievedBytes);
+typedef bool (*AirpcapGetStatsHandler)(PAirpcapHandle AdapterHandle, PAirpcapStats PStats);
+typedef bool (*AirpcapTurnLedOnHandler)(PAirpcapHandle AdapterHandle, unsigned LedNumber);
+typedef bool (*AirpcapTurnLedOffHandler)(PAirpcapHandle AdapterHandle, unsigned LedNumber);
+typedef bool (*AirpcapSetDeviceChannelHandler)(PAirpcapHandle AdapterHandle, unsigned Channel);
+typedef bool (*AirpcapGetDeviceChannelHandler)(PAirpcapHandle AdapterHandle, unsigned * PChannel);
+typedef bool (*AirpcapSetFcsPresenceHandler)(PAirpcapHandle AdapterHandle, bool IsFcsPresent);
+typedef bool (*AirpcapGetFcsPresenceHandler)(PAirpcapHandle AdapterHandle, bool * PIsFcsPresent);
+typedef bool (*AirpcapSetFcsValidationHandler)(PAirpcapHandle AdapterHandle, AirpcapValidationType ValidationType);
+typedef bool (*AirpcapGetFcsValidationHandler)(PAirpcapHandle AdapterHandle, PAirpcapValidationType PValidationType);
+typedef bool (*AirpcapSetDeviceKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
+typedef bool (*AirpcapGetDeviceKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, unsigned * PKeysCollectionSize);
+typedef bool (*AirpcapSetDriverKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
+typedef bool (*AirpcapGetDriverKeysHandler)(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, unsigned * PKeysCollectionSize);
+typedef bool (*AirpcapSetDecryptionStateHandler)(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
+typedef bool (*AirpcapGetDecryptionStateHandler)(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
+typedef bool (*AirpcapSetDriverDecryptionStateHandler)(PAirpcapHandle AdapterHandle, AirpcapDecryptionState Enable);
+typedef bool (*AirpcapGetDriverDecryptionStateHandler)(PAirpcapHandle AdapterHandle, PAirpcapDecryptionState PEnable);
+typedef bool (*AirpcapStoreCurConfigAsAdapterDefaultHandler)(PAirpcapHandle AdapterHandle);
+typedef void (*AirpcapGetVersionHandler)(unsigned * VersionMajor, unsigned * VersionMinor, unsigned * VersionRev, unsigned * VersionBuild);
+typedef bool (*AirpcapSetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo ChannelInfo);
+typedef bool (*AirpcapGetDeviceChannelExHandler)(PAirpcapHandle AdapterHandle, PAirpcapChannelInfo PChannelInfo);
+typedef bool (*AirpcapGetDeviceSupportedChannelsHandler)(PAirpcapHandle AdapterHandle, AirpcapChannelInfo **ppChannelInfo, uint32_t * pNumChannelInfo);
#define FLAG_CAN_BE_LOW 0x00000001
#define FLAG_CAN_BE_HIGH 0x00000002
@@ -84,9 +86,9 @@ typedef gboolean (*AirpcapGetDeviceSupportedChannelsHandler)(PAirpcapHandle Adap
typedef struct _Dot11Channel
{
- guint Channel;
- guint32 Frequency;
- guint32 Flags;
+ unsigned Channel;
+ uint32_t Frequency;
+ uint32_t Flags;
} Dot11Channel;
/*
@@ -97,20 +99,20 @@ typedef struct {
char *name; /* e.g. "eth0" */
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 */
+ bool loopback; /* true if loopback, false otherwise */
AirpcapLinkType linkType; /* The link layer type */
AirpcapChannelInfo channelInfo; /* Channel Information */
- gboolean IsFcsPresent; /* Include 802.11 CRC in frames */
+ 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 */
- guint keysCollectionSize; /* Size of the key collection */
- 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 */
+ unsigned keysCollectionSize; /* Size of the key collection */
+ bool blinking; /* true if is blinkng, false otherwise */
+ bool led; /* true if on, false if off */
+ bool saved; /* true if current configuration has been saved, false otherwise */
+ int tag; /* int for the gtk blinking callback */
Dot11Channel *pSupportedChannels;
- guint32 numSupportedChannels;
+ uint32_t numSupportedChannels;
} airpcap_if_info_t;
/*
@@ -142,8 +144,8 @@ airpcap_if_info_print(airpcap_if_info_t* if_info);
/*
* Used to retrieve the two chars string from interface
*/
-gchar*
-airpcap_get_if_string_number_from_description(gchar* description);
+char*
+airpcap_get_if_string_number_from_description(char* description);
/*
* Function used to free the airpcap interface list
@@ -155,24 +157,24 @@ free_airpcap_interface_list(GList *if_list);
* Used to retrieve the interface given the name
* (the name is used in AirpcapOpen).
*/
-airpcap_if_info_t* get_airpcap_if_from_name(GList* if_list, const gchar* name);
+airpcap_if_info_t* get_airpcap_if_from_name(GList* if_list, const char* name);
/*
* Airpcap wrapper, used to store the current settings for the selected adapter
*/
-gboolean
+bool
airpcap_if_store_cur_config_as_adapter_default(PAirpcapHandle ah);
/*
* Function used to load the WEP keys for a selected interface
*/
-gboolean
+bool
airpcap_if_load_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info);
/*
* Function used to load the WEP keys from the global driver list
*/
-gboolean
+bool
airpcap_if_load_driver_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info);
/*
@@ -190,92 +192,92 @@ airpcap_if_save_driver_keys(PAirpcapHandle ad, airpcap_if_info_t *if_info);
/*
* Airpcap wrapper, used to get the fcs validation of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_get_fcs_validation(PAirpcapHandle ah, PAirpcapValidationType val);
/*
* Airpcap wrapper, used to set the fcs validation of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_set_fcs_validation(PAirpcapHandle ah, AirpcapValidationType val);
/* Many of these are GTK+ only. */
/*
* Airpcap wrapper, used to get the decryption enabling of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_get_decryption_state(PAirpcapHandle ah, PAirpcapDecryptionState val);
/*
* Airpcap wrapper, used to set the decryption enabling of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_set_decryption_state(PAirpcapHandle ah, AirpcapDecryptionState val);
/*
* Airpcap wrapper, used to get the fcs presence of an airpcap adapter
*/
-gboolean
-airpcap_if_get_fcs_presence(PAirpcapHandle ah, gboolean * ch);
+bool
+airpcap_if_get_fcs_presence(PAirpcapHandle ah, bool * ch);
/*
* Airpcap wrapper, used to set the fcs presence of an airpcap adapter
*/
-gboolean
-airpcap_if_set_fcs_presence(PAirpcapHandle ah, gboolean ch);
+bool
+airpcap_if_set_fcs_presence(PAirpcapHandle ah, bool ch);
/*
* Airpcap wrapper, used to get the link type of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_get_link_type(PAirpcapHandle ah, PAirpcapLinkType lt);
/*
* Airpcap wrapper, used to set the link type of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_set_link_type(PAirpcapHandle ah, AirpcapLinkType lt);
/*
* Airpcap wrapper, used to get the channel of an airpcap adapter
*/
-gboolean
-airpcap_if_get_device_channel(PAirpcapHandle ah, guint * ch);
+bool
+airpcap_if_get_device_channel(PAirpcapHandle ah, unsigned * ch);
/*
* Airpcap wrapper, get the channels supported by the adapter
*/
-gboolean
-airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo **cInfo, guint32 * nInfo);
+bool
+airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo **cInfo, uint32_t * nInfo);
/*
* Airpcap wrapper, get supported channels formatted into an array
*/
Dot11Channel*
-airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint32 * pNumSupportedChannels);
+airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, uint32_t * pNumSupportedChannels);
/*
* Airpcap wrapper, used to set the channel of an airpcap adapter
*/
-gboolean
-airpcap_if_set_device_channel(PAirpcapHandle ah, guint ch);
+bool
+airpcap_if_set_device_channel(PAirpcapHandle ah, unsigned ch);
/*
* Airpcap wrapper, used to get the frequency of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_get_device_channel_ex(PAirpcapHandle ah, PAirpcapChannelInfo pChannelInfo);
/*
* Airpcap wrapper, used to set the frequency of an airpcap adapter
*/
-gboolean
+bool
airpcap_if_set_device_channel_ex(PAirpcapHandle ah, AirpcapChannelInfo ChannelInfo);
/*
* Airpcap wrapper, used to open an airpcap adapter
*/
-PAirpcapHandle airpcap_if_open(gchar * name, gchar * err);
+PAirpcapHandle airpcap_if_open(char * name, char * err);
/*
* Airpcap wrapper, used to close an airpcap adapter
@@ -291,12 +293,12 @@ airpcap_get_dll_state(void);
/*
* Airpcap wrapper, used to turn on the led of an airpcap adapter
*/
-gboolean airpcap_if_turn_led_on(PAirpcapHandle AdapterHandle, guint LedNumber);
+bool airpcap_if_turn_led_on(PAirpcapHandle AdapterHandle, unsigned LedNumber);
/*
* Airpcap wrapper, used to turn off the led of an airpcap adapter
*/
-gboolean airpcap_if_turn_led_off(PAirpcapHandle AdapterHandle, guint LedNumber);
+bool airpcap_if_turn_led_off(PAirpcapHandle AdapterHandle, unsigned LedNumber);
/*
* This function will create a new airpcap_if_info_t using a name and a description
@@ -335,42 +337,42 @@ airpcap_save_selected_if_configuration(airpcap_if_info_t* if_info);
/*
* Used to retrieve the two chars string from interface description
*/
-gchar*
+char*
airpcap_get_if_string_number(airpcap_if_info_t* if_info);
/*
* Airpcap wrapper, used to save the settings for the selected_if
*/
-gboolean
+bool
airpcap_if_set_device_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
/*
* Airpcap wrapper, used to save the settings for the selected_if
*/
-gboolean
-airpcap_if_get_device_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
+bool
+airpcap_if_get_device_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, unsigned * PKeysCollectionSize);
/*
* Airpcap wrapper, used to save the settings for the selected_if
*/
-gboolean
+bool
airpcap_if_set_driver_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection);
/*
* Airpcap wrapper, used to save the settings for the selected_if
*/
-gboolean
-airpcap_if_get_driver_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, guint * PKeysCollectionSize);
+bool
+airpcap_if_get_driver_keys(PAirpcapHandle AdapterHandle, PAirpcapKeysCollection KeysCollection, unsigned * PKeysCollectionSize);
/*
* Airpcap wrapper, used to get the decryption enabling of an airpcap driver
*/
-gboolean
+bool
airpcap_if_get_driver_decryption_state(PAirpcapHandle ah, PAirpcapDecryptionState PEnable);
/*
* Airpcap wrapper, used to set the decryption enabling of an airpcap driver
*/
-gboolean
+bool
airpcap_if_set_driver_decryption_state(PAirpcapHandle ah, AirpcapDecryptionState Enable);
/*
@@ -395,10 +397,10 @@ airpcap_if_clear_decryption_settings(airpcap_if_info_t* info_if);
* Adds compiled version string to str
*/
void
-get_compiled_airpcap_version(GString *str);
+gather_airpcap_compile_info(feature_list l);
void
-get_runtime_airpcap_version(GString *str);
+gather_airpcap_runtime_info(feature_list l);
#ifdef __cplusplus
}