Update the AirPcap code for Win64 and enable AirPcap for the 64-bit build.
authorGerald Combs <gerald@wireshark.org>
Thu, 12 Nov 2009 23:48:11 +0000 (23:48 -0000)
committerGerald Combs <gerald@wireshark.org>
Thu, 12 Nov 2009 23:48:11 +0000 (23:48 -0000)
svn path=/trunk/; revision=30945

Makefile.nmake
airpcap_loader.c
config.nmake
gtk/airpcap_gui_utils.c
tools/win32-setup.sh
tools/win64-setup.sh

index 6e098a1d42b547e5f83fb09d404d4a409c2ba4b4..058f93ca4258281875cd8f2053379504c3bb83ff 100644 (file)
@@ -760,7 +760,7 @@ process_libs:
 !ENDIF
 !IFDEF AIRPCAP_DIR
        @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
-               AirPcap_Devpack_1_0_0_594 AirPcap_Devpack_1_0_0_594.zip
+               AirPcap_Devpack_4_1_0_1622 AirPcap_Devpack_4_1_0_1622.zip
 !ENDIF
 !IFDEF C_ARES_DIR
        @$(SH) $(WIN_SETUP) "$(WIN_SETUP_OPT)" "$(WIRESHARK_LIBS)" \
@@ -895,6 +895,8 @@ clean_setup:
     rm -r -f $(WIRESHARK_LIBS)/user-guide
     rm -r -f $(WIRESHARK_LIBS)/WpdPack
     rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_1_0_0_594
+    rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_0_0_1480
+    rm -r -f $(WIRESHARK_LIBS)/AirPcap_Devpack_4_1_0_1622
     rm -r -f $(WIRESHARK_LIBS)/zlib123
     rm -r -f $(WIRESHARK_LIBS)/zlib123-dll
     rm -r -f $(WIRESHARK_LIBS)/upx301w
index afa226982612a1b9a0ad773739dea254c81b2a5c..90abe336b1c06d0dd6aeffed6a799cbf87c7d440 100644 (file)
@@ -120,7 +120,7 @@ airpcap_if_info_t *airpcap_if_active = NULL;
 module_t *wlan_prefs = NULL;
 
 Dot11Channel *pSupportedChannels;
-guint32 numSupportedChannels;
+guint numSupportedChannels;
 
 static AirpcapChannelInfo LegacyChannels[] =
 {
@@ -140,7 +140,7 @@ static AirpcapChannelInfo LegacyChannels[] =
        {2484, 0, {0,0,0}},
 };
 
-static guint32 num_legacy_channels = 14;
+static guint num_legacy_channels = 14;
 
 /*
  * Callback used by the load_wlan_keys() routine in order to read a WEP decryption key
@@ -325,7 +325,7 @@ write_wlan_wep_keys_to_registry(airpcap_if_info_t* info_if, GList* key_list)
     GString *new_key;
     gchar s[3];
     PAirpcapKeysCollection KeysCollection;
-    guint32 KeysCollectionSize;
+    guint KeysCollectionSize;
     guint8 KeyByte;
     guint keys_in_list = 0;
     decryption_key_t* key_item = NULL;
@@ -364,7 +364,7 @@ write_wlan_wep_keys_to_registry(airpcap_if_info_t* info_if, GList* key_list)
        key_item = (decryption_key_t*)g_list_nth_data(key_list,i);
        new_key = g_string_new(key_item->key->str);
 
-       KeysCollection->Keys[i].KeyLen = new_key->len / 2;
+       KeysCollection->Keys[i].KeyLen = (guint) new_key->len / 2;
        memset(&KeysCollection->Keys[i].KeyData, 0, sizeof(KeysCollection->Keys[i].KeyData));
 
        for(j = 0 ; j < new_key->len; j += 2)
@@ -415,7 +415,7 @@ write_wlan_driver_wep_keys_to_registry(GList* key_list)
     GString *new_key;
     gchar s[3];
     PAirpcapKeysCollection KeysCollection;
-    guint32 KeysCollectionSize;
+    guint KeysCollectionSize;
     guint8 KeyByte;
     guint keys_in_list = 0;
     decryption_key_t* key_item = NULL;
@@ -485,7 +485,7 @@ write_wlan_driver_wep_keys_to_registry(GList* key_list)
 
            new_key = g_string_new(key_item->key->str);
 
-           KeysCollection->Keys[y].KeyLen = new_key->len / 2;
+           KeysCollection->Keys[y].KeyLen = (guint) new_key->len / 2;
            memset(&KeysCollection->Keys[y].KeyData, 0, sizeof(KeysCollection->Keys[y].KeyData));
 
            for(j = 0 ; j < new_key->len; j += 2)
@@ -758,7 +758,7 @@ airpcap_if_get_device_channel(PAirpcapHandle ah, guint * ch)
  * Airpcap wrapper, used to get the supported channels of an airpcap adapter
  */
 gboolean
-airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo **cInfo, guint32 * nInfo)
+airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo **cInfo, guint * nInfo)
 {
     if (!AirpcapLoaded) return FALSE;
     if (airpcap_get_dll_state() == AIRPCAP_DLL_OLD){
@@ -776,10 +776,10 @@ airpcap_if_get_device_supported_channels(PAirpcapHandle ah, AirpcapChannelInfo *
  * Airpcap wrapper, used to get the supported channels of an airpcap adapter
  */
 Dot11Channel*
-airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint32 * pNumSupportedChannels)
+airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint * pNumSupportedChannels)
 {
     AirpcapChannelInfo *chanInfo;
-    guint32 i=0, j=0, numInfo = 0;
+    guint i=0, j=0, numInfo = 0;
 
     if (!AirpcapLoaded)
         return NULL;
@@ -797,7 +797,7 @@ airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint32 * pNum
 
     for (i = 0; i < numInfo; i++)
     {
-        guint32 supportedChannel = 0xFFFFFFFF;
+        guint supportedChannel = G_MAXUINT;
 
         /*
          * search if we have it already
@@ -811,7 +811,7 @@ airpcap_if_get_device_supported_channels_array(PAirpcapHandle ah, guint32 * pNum
             }
         }
 
-        if (supportedChannel == 0xFFFFFFFF)
+        if (supportedChannel == G_MAXUINT)
         {
             /*
              * not found, create a new item
@@ -933,7 +933,7 @@ airpcap_if_get_device_channel_ex(PAirpcapHandle ah, PAirpcapChannelInfo pChannel
 
     if (airpcap_get_dll_state() == AIRPCAP_DLL_OLD){
       guint channel = 0;
-      guint32 chan_freq = 0;
+      guint chan_freq = 0;
 
       if (!airpcap_if_get_device_channel(ah, &channel)) return FALSE;
 
@@ -1103,7 +1103,7 @@ airpcap_if_info_new(char *name, char *description)
     ad = airpcap_if_open(name, ebuf);
     if(ad)
     {
-               if_info = g_malloc(sizeof (airpcap_if_info_t));
+               if_info = g_malloc0(sizeof (airpcap_if_info_t));
                if_info->name = g_strdup(name);
                if (description == NULL){
                        if_info->description = NULL;
@@ -1369,10 +1369,12 @@ get_airpcap_interface_list(int *err, char **err_str)
 {
     GList  *il = NULL;
     airpcap_if_info_t *if_info;
-    int i, n_adapts;
+    int n_adapts;
     AirpcapDeviceDescription *devsList, *adListEntry;
     char errbuf[PCAP_ERRBUF_SIZE];
 
+    *err = 0;
+
     if (!AirpcapLoaded)
     {
                *err = AIRPCAP_NOT_LOADED;
@@ -1413,7 +1415,7 @@ get_airpcap_interface_list(int *err, char **err_str)
      * Insert the adapters in our list
      */
     adListEntry = devsList;
-    for(i = 0; i < n_adapts; i++)
+    while(adListEntry)
     {
                if_info = airpcap_if_info_new(adListEntry->Name, adListEntry->Description);
                if (if_info != NULL){
@@ -1425,7 +1427,6 @@ get_airpcap_interface_list(int *err, char **err_str)
 
     g_PAirpcapFreeDeviceList(devsList);
 
-    *err = 0;
     return il;
 }
 
@@ -1473,7 +1474,6 @@ gchar*
 airpcap_get_key_string(AirpcapKey key)
 {
     unsigned int j = 0;
-    unsigned int l = 0;
     gchar *dst,*src;
 
     dst = NULL;
@@ -1494,7 +1494,7 @@ airpcap_get_key_string(AirpcapKey key)
                /*
                 * XXX - use g_strconcat() or GStrings instead ???
                 */
-               l = g_strlcat(dst,src,WEP_KEY_MAX_CHAR_SIZE+1);
+               g_strlcat(dst, src, WEP_KEY_MAX_CHAR_SIZE+1);
            }
            g_free(src);
        }
@@ -1808,7 +1808,7 @@ get_airpcap_device_keys(airpcap_if_info_t* info_if)
            g_free(tmp_key);
 
            /* BITS */
-           new_key->bits = new_key->key->len *4; /* every char is 4 bits in WEP keys (it is an hexadecimal number) */
+           new_key->bits = (guint) new_key->key->len *4; /* every char is 4 bits in WEP keys (it is an hexadecimal number) */
 
            /* SSID not used in WEP keys */
            new_key->ssid = NULL;
@@ -1880,7 +1880,7 @@ get_airpcap_driver_keys(void)
            if(tmp_key != NULL) g_free(tmp_key);
 
            /* BITS */
-           new_key->bits = new_key->key->len *4; /* every char is 4 bits in WEP keys (it is an hexadecimal number) */
+           new_key->bits = (guint) new_key->key->len *4; /* every char is 4 bits in WEP keys (it is an hexadecimal number) */
 
            /* SSID not used in WEP keys */
            new_key->ssid = NULL;
index 62670a6ade431115c17b4c7a11c20ac93c79aaa9..06bfe923e6157fa24752d2ca4792fb9f2473d657 100644 (file)
@@ -341,7 +341,7 @@ PORTAUDIO_VERSION=19
 # If you don't have the AirPcap developer's pack, comment this line out,
 # so that AIRPCAP_DIR isn't defined.
 #
-AIRPCAP_DIR=$(WIRESHARK_LIBS)\AirPcap_Devpack_1_0_0_594\AirPcap_Devpack
+AIRPCAP_DIR=$(WIRESHARK_LIBS)\AirPcap_Devpack_4_1_0_1622\AirPcap_Devpack
 
 #
 # Optional: LIBSMI, System Management Interface
@@ -573,7 +573,7 @@ PORTAUDIO_VERSION=19
 # If you don't have the AirPcap developer's pack, comment this line out,
 # so that AIRPCAP_DIR isn't defined.
 #
-#AIRPCAP_DIR=$(WIRESHARK_LIBS)\AirPcap_Devpack_1_0_0_594\AirPcap_Devpack
+AIRPCAP_DIR=$(WIRESHARK_LIBS)\AirPcap_Devpack_4_1_0_1622\AirPcap_Devpack
 
 #
 # Optional: LIBSMI, System Management Interface
index 24465dc4553b0b23537040f732cbb739d8a03704..6f161087f92e798b7b7e07375e1cf43c4279a54d 100644 (file)
@@ -625,7 +625,7 @@ airpcap_channel_offset_changed_cb(GtkWidget *channel_offset_cb, gpointer data _U
  * Update the channel offset of the given combobox according to the given frequency.
  */
 void
-airpcap_update_channel_offset_combo(airpcap_if_info_t* if_info, guint32 chan_freq, GtkWidget *channel_offset_cb, gboolean set)
+airpcap_update_channel_offset_combo(airpcap_if_info_t* if_info, guint chan_freq, GtkWidget *channel_offset_cb, gboolean set)
 {
     gint current_offset;
     gint new_offset;
@@ -754,7 +754,7 @@ airpcap_add_keys_from_list(GtkWidget *key_ls, airpcap_if_info_t *if_info _U_)
     guint i, j;
     gchar s[3];
     PAirpcapKeysCollection KeysCollection;
-    guint32 KeysCollectionSize;
+    guint KeysCollectionSize;
     guint8 KeyByte;
 
     guint keys_in_list = 0;
@@ -808,7 +808,7 @@ airpcap_add_keys_from_list(GtkWidget *key_ls, airpcap_if_info_t *if_info _U_)
        /* Retrieve the Item corresponding to the i-th key */
        new_key = g_string_new(row_key);
 
-       KeysCollection->Keys[i].KeyLen = new_key->len / 2;
+       KeysCollection->Keys[i].KeyLen = (guint) new_key->len / 2;
        memset(&KeysCollection->Keys[i].KeyData, 0, sizeof(KeysCollection->Keys[i].KeyData));
 
        for(j = 0 ; j < new_key->len; j += 2)
@@ -848,7 +848,7 @@ airpcap_add_keys_to_driver_from_list(GtkWidget *key_ls,airpcap_if_info_t *fake_i
     guint i, j;
     gchar s[3];
     PAirpcapKeysCollection KeysCollection;
-    guint32 KeysCollectionSize;
+    guint KeysCollectionSize;
     guint8 KeyByte;
 
     guint keys_in_list = 0;
@@ -905,7 +905,7 @@ airpcap_add_keys_to_driver_from_list(GtkWidget *key_ls,airpcap_if_info_t *fake_i
        /* Retrieve the Item corresponding to the i-th key */
        new_key = g_string_new(row_key);
 
-       KeysCollection->Keys[i].KeyLen = new_key->len / 2;
+       KeysCollection->Keys[i].KeyLen = (guint) new_key->len / 2;
        memset(&KeysCollection->Keys[i].KeyData, 0, sizeof(KeysCollection->Keys[i].KeyData));
 
        /* Key must be saved in adifferent way, depending on its type... */
@@ -978,7 +978,7 @@ airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_i
            tmp_dk->key = g_string_new(tmp_key);
            tmp_dk->ssid = NULL;
            tmp_dk->type = AIRPDCAP_KEY_TYPE_WEP;
-           tmp_dk->bits = tmp_dk->key->len * 4;
+           tmp_dk->bits = (guint) tmp_dk->key->len * 4;
            key_list = g_list_append(key_list,tmp_dk);
        }
        else if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
index 1db59812980b5e868930b153a6be75f4633dce71..3e34eb15d71c2037bf3268efaa22232635508eab 100755 (executable)
@@ -4,7 +4,7 @@
 
 # 32-bit wrapper for win-setup.sh.
 
-export DOWNLOAD_TAG="2009-11-11"
+export DOWNLOAD_TAG="2009-11-12"
 export WIRESHARK_TARGET_PLATFORM="win32"
 
 WIN_SETUP=`echo $0 | sed -e s/win32/win/`
index b560ba46e22342deaa7258936422d54ab1d31f38..45db6e968f0c061d0c6bfdc03787626d2c79048b 100755 (executable)
@@ -4,7 +4,7 @@
 
 # 64-bit wrapper for win-setup.sh.
 
-export DOWNLOAD_TAG="2009-10-20"
+export DOWNLOAD_TAG="2009-11-12"
 export WIRESHARK_TARGET_PLATFORM="win64"
 
 WIN_SETUP=`echo $0 | sed -e s/win64/win/`