-Add the compiler version to the plugin resource
[obnox/wireshark/wip.git] / airpcap_loader.h
index 70a28465dc734409aa8437de910647eb09d290e0..420eb032cd0161212f773725a5b468824b627f39 100644 (file)
 #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_CHANNEL_ANY_NAME "ANY"
 
-/*
- * WEP_KEY_MAX_SIZE is in bytes, but each byte is rapresented in strings with an ascii char
- * 4 bit are needed to store an exadecimal number, 8 bit to store a char...
- */
-#define WEP_KEY_MAX_CHAR_SIZE (WEP_KEY_MAX_SIZE*2)
-
-/*
- * WEP_KEY_MAX_SIZE is in bytes, this is in bits...
- */
-#define WEP_KEY_MAX_BIT_SIZE (WEP_KEY_MAX_SIZE*8)
-
-#define WEP_KEY_MIN_CHAR_SIZE 2
-#define WEP_KEY_MIN_BIT_SIZE  8
-
-/*
- * XXX - The next #define should probably be moved in airpcap.h,
- * near WEP_KEY_MAX_SIZE ...
- */
-#define WPA_KEY_MAX_SIZE 63 /* 63 chars followed by a '\0' */
-
-#define WPA_KEY_MAX_CHAR_SIZE (WPA_KEY_MAX_SIZE*1)
-#define WPA_KEY_MAX_BIT_SIZE  (WPA_KEY_MAX_SIZE*8)
-#define WPA_KEY_MIN_CHAR_SIZE 8
-#define WPA_KEY_MIN_BIT_SIZE  (WPA_KEY_MIN_CHAR_SIZE*8)
-
-/*
- * XXX - The next #define should probably be moved in airpcap.h,
- * near WEP_KEY_MAX_SIZE ...
- */
-#define WPA_SSID_MAX_SIZE 32
-
-#define WPA_SSID_MAX_CHAR_SIZE (WPA_SSID_MAX_SIZE*1)
-#define WPA_SSID_MAX_BIT_SIZE  (WPA_SSID_MAX_SIZE*8)
-#define WPA_SSID_MIN_CHAR_SIZE 0
-#define WPA_SSID_MIN_BIT_SIZE  (WPA_SSID_MIN_CHAR_SIZE*8)
-
-/*
- * User can enter the binary PSK, instead of the passphrase+ssid...
- */
-#define WPA_PSK_KEY_SIZE 32 /* Fixed size, 32 bytes (256bit) */
-#define WPA_PSK_KEY_CHAR_SIZE (WPA_PSK_KEY_SIZE*2)
-#define WPA_PSK_KEY_BIT_SIZE  (WPA_PSK_KEY_SIZE*8)
-
 #define AIRPCAP_WEP_KEY_STRING  "WEP"
 /*
- * XXX - WPA_PWD is the passphrase+ssid and WPA-PSK is the hexadecimal key 
+ * XXX - WPA_PWD is the passphrase+ssid and WPA-PSK is the hexadecimal key
  */
 #define AIRPCAP_WPA_PWD_KEY_STRING  "WPA-PWD"
 #define AIRPCAP_WPA_BIN_KEY_STRING  "WPA-PSK"
 
-/*
- * Key string defines
- */
-#define STRING_KEY_TYPE_WEP "wep"
-#define STRING_KEY_TYPE_WPA_PWD "wpa-pwd"
-#define STRING_KEY_TYPE_WPA_PSK "wpa-psk"
-
 #define AIRPCAP_DLL_OK                 0
 #define AIRPCAP_DLL_OLD                        1
 #define AIRPCAP_DLL_ERROR              2
@@ -151,16 +103,6 @@ typedef struct {
        gint                                    tag;                            /* int for the gtk blinking callback */
 } airpcap_if_info_t;
 
-/*
- * Struct to store infos about a specific decryption key.
- */
-typedef struct {
-    GString *key;
-    GString *ssid;
-    guint   bits;
-    guint   type;
-} decryption_key_t;
-
 /*
  * Struct used to store infos to pass to the preferences manager callbacks
  */
@@ -200,7 +142,7 @@ save_wlan_wep_keys(airpcap_if_info_t* info_if);
  * 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
@@ -362,19 +304,12 @@ airpcap_if_info_t* airpcap_driver_fake_if_info_new();
  */
 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
@@ -472,7 +407,7 @@ airpcap_if_info_free(airpcap_if_info_t *if_info);
  * 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
@@ -480,13 +415,13 @@ write_wlan_driver_wep_keys_to_regitry(GList* key_list);
 void
 airpcap_if_clear_decryption_settings(airpcap_if_info_t* info_if);
 
-/* 
+/*
  *  Function used to save to the preference file the Decryption Keys.
  */
 int
 save_wlan_driver_wep_keys();
 
-/* 
+/*
  *  Function used to save to the preference file the Decryption Keys.
  */
 int
@@ -588,17 +523,4 @@ get_compiled_airpcap_version(GString *str);
 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