summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
committerGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
commit9c89cdaaa3eccfe74d4e17705f38508c640b5047 (patch)
tree593646c7e1eb44302243659672c5fc691f0d4272 /gtk
parenta189f34b84345d6851a489c484c01c1bf21f56d1 (diff)
downloadwireshark-9c89cdaaa3eccfe74d4e17705f38508c640b5047.tar.gz
strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
Diffstat (limited to 'gtk')
-rw-r--r--gtk/airpcap_dlg.c62
-rw-r--r--gtk/airpcap_gui_utils.c38
-rw-r--r--gtk/capture_if_dlg.c6
-rw-r--r--gtk/decode_as_dlg.c4
-rw-r--r--gtk/expert_comp_table.c4
-rw-r--r--gtk/gui_utils.c6
-rw-r--r--gtk/main.c8
-rw-r--r--gtk/menu.c8
-rw-r--r--gtk/mgcp_stat.c22
-rw-r--r--gtk/prefs_dlg.c12
-rw-r--r--gtk/recent.c28
-rw-r--r--gtk/rtp_analysis.c6
-rw-r--r--gtk/voip_calls.c6
13 files changed, 129 insertions, 81 deletions
diff --git a/gtk/airpcap_dlg.c b/gtk/airpcap_dlg.c
index 1616efc55c..6a0997dae6 100644
--- a/gtk/airpcap_dlg.c
+++ b/gtk/airpcap_dlg.c
@@ -62,6 +62,10 @@
#include "keys.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
/* temporary block signals to widgets */
BOOL block_advanced_signals;
@@ -231,7 +235,7 @@ on_edit_type_en_changed(GtkWidget *w, gpointer data)
* If it is a WEP key, no SSID is required! Gray out rhe entry text so
* it doesn't create confusion ...
*/
- if (g_strcasecmp(type_text,AIRPCAP_WEP_KEY_STRING) == 0)
+ if (g_ascii_strcasecmp(type_text,AIRPCAP_WEP_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(edit_ssid_te,FALSE);
/*
@@ -242,7 +246,7 @@ on_edit_type_en_changed(GtkWidget *w, gpointer data)
gtk_label_set_text(GTK_LABEL(key_lb),"Key");
gtk_label_set_text(GTK_LABEL(ssid_lb),"");
}
- else if (g_strcasecmp(type_text,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
+ else if (g_ascii_strcasecmp(type_text,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(edit_ssid_te,FALSE);
/*
@@ -253,7 +257,7 @@ on_edit_type_en_changed(GtkWidget *w, gpointer data)
gtk_label_set_text(GTK_LABEL(key_lb),"Key");
gtk_label_set_text(GTK_LABEL(ssid_lb),"");
}
- else if (g_strcasecmp(type_text,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
+ else if (g_ascii_strcasecmp(type_text,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(edit_ssid_te,TRUE);
/*
@@ -299,7 +303,7 @@ on_add_type_en_changed(GtkWidget *w, gpointer data)
* If it is a WEP key, no SSID is required! Gray out rhe entry text so
* it doesn't create confusion ...
*/
- if (g_strcasecmp(type_text,AIRPCAP_WEP_KEY_STRING) == 0)
+ if (g_ascii_strcasecmp(type_text,AIRPCAP_WEP_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(add_ssid_te,FALSE);
/*
@@ -310,7 +314,7 @@ on_add_type_en_changed(GtkWidget *w, gpointer data)
gtk_label_set_text(GTK_LABEL(key_lb),"Key");
gtk_label_set_text(GTK_LABEL(ssid_lb),"");
}
- else if (g_strcasecmp(type_text,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
+ else if (g_ascii_strcasecmp(type_text,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(add_ssid_te,FALSE);
/*
@@ -321,7 +325,7 @@ on_add_type_en_changed(GtkWidget *w, gpointer data)
gtk_label_set_text(GTK_LABEL(key_lb),"Key");
gtk_label_set_text(GTK_LABEL(ssid_lb),"");
}
- else if (g_strcasecmp(type_text,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
+ else if (g_ascii_strcasecmp(type_text,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(add_ssid_te,TRUE);
/*
@@ -345,7 +349,7 @@ on_add_type_en_changed(GtkWidget *w, gpointer data)
gboolean
string_is_not_empty(gchar *s)
{
- if (g_strcasecmp(s,"") != 0)
+ if (g_ascii_strcasecmp(s,"") != 0)
return TRUE;
else
return FALSE;
@@ -363,7 +367,7 @@ on_fcs_filter_en_changed(GtkWidget *w, gpointer data)
if ( !block_advanced_signals && (data != NULL) && (w != NULL) )
{
- if ((g_strcasecmp("",s)))
+ if ((g_ascii_strcasecmp("",s)))
{
airpcap_if_selected->CrcValidationOn = airpcap_get_validation_type(s);
airpcap_if_selected->saved = FALSE;
@@ -383,7 +387,7 @@ on_channel_en_changed(GtkWidget *w _U_, gpointer data)
if ( !block_advanced_signals && (data != NULL) && (w != NULL) )
{
s = gtk_entry_get_text(GTK_ENTRY(w));
- if ((g_strcasecmp("",s)))
+ if ((g_ascii_strcasecmp("",s)))
{
if (airpcap_if_selected != NULL)
{
@@ -408,7 +412,7 @@ on_channel_offset_cb_changed(GtkWidget *w _U_, gpointer data)
if ( !block_advanced_signals && (data != NULL) && (w != NULL) )
{
s = gtk_entry_get_text(GTK_ENTRY(w));
- if ((g_strcasecmp("",s)))
+ if ((g_ascii_strcasecmp("",s)))
{
if (airpcap_if_selected != NULL)
{
@@ -432,7 +436,7 @@ on_capture_type_en_changed(GtkWidget *w _U_, gpointer data)
if ( !block_advanced_signals && (data != NULL) && (w != NULL) )
{
- if ((g_strcasecmp("",s)))
+ if ((g_ascii_strcasecmp("",s)))
{
airpcap_if_selected->linkType = airpcap_get_link_type(s);
airpcap_if_selected->saved = FALSE;
@@ -638,17 +642,17 @@ on_key_management_apply_bt_clicked(GtkWidget *button _U_, gpointer data)
"- Close all the airpcap-based applications.\n"\
"- Have administrative privileges."
/* Set the Decryption Mode */
- if (g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0)
+ if (g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0)
{
set_wireshark_decryption(TRUE);
if (!set_airpcap_decryption(FALSE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
}
- else if (g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
+ else if (g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
{
set_wireshark_decryption(FALSE);
if (!set_airpcap_decryption(TRUE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
}
- else if (g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0)
+ else if (g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0)
{
set_wireshark_decryption(FALSE);
if (!set_airpcap_decryption(FALSE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
@@ -694,7 +698,7 @@ on_advanced_apply_bt_clicked(GtkWidget *button, gpointer data _U_)
airpcap_save_selected_if_configuration(airpcap_if_selected);
/* Update toolbar (only if airpcap_if_selected is airpcap_if_active)*/
- if ( g_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
+ if ( g_ascii_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
{
gtk_label_set_text(GTK_LABEL(toolbar_if_lb), g_strdup_printf("%s %s\t","Current Wireless Interface: #",airpcap_get_if_string_number(airpcap_if_selected)));
airpcap_update_channel_combo(GTK_WIDGET(toolbar_channel_cm),airpcap_if_selected);
@@ -741,7 +745,7 @@ airpcap_advanced_ok_cb(GtkWidget *w, gpointer data _U_)
gtk_timeout_remove(airpcap_if_selected->tag);
/* Update toolbar (only if airpcap_if_selected is airpcap_if_active)*/
- if ( g_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
+ if ( g_ascii_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
{
gtk_label_set_text(GTK_LABEL(toolbar_if_lb), g_strdup_printf("%s %s\t","Current Wireless Interface: #",airpcap_get_if_string_number(airpcap_if_selected)));
airpcap_update_channel_combo(GTK_WIDGET(toolbar_channel_cm),airpcap_if_selected);
@@ -821,7 +825,7 @@ on_add_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
g_strchomp(new_ssid_string->str);
/* Check which type of key the user has entered */
- if (g_strcasecmp(new_type_string->str,AIRPCAP_WEP_KEY_STRING) == 0) /* WEP key */
+ if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WEP_KEY_STRING) == 0) /* WEP key */
{
if ( ((new_key_string->len) > WEP_KEY_MAX_CHAR_SIZE) || ((new_key_string->len) < WEP_KEY_MIN_CHAR_SIZE))
@@ -874,7 +878,7 @@ on_add_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
if (airpcap_if_selected != NULL) airpcap_if_selected->saved = FALSE;
}
- else if (g_strcasecmp(new_type_string->str,AIRPCAP_WPA_PWD_KEY_STRING) == 0) /* WPA Key */
+ else if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WPA_PWD_KEY_STRING) == 0) /* WPA Key */
{
/* XXX - Perform some WPA related input fields check */
/* If everything is ok, modify the entry int he list */
@@ -915,7 +919,7 @@ on_add_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
if (airpcap_if_selected != NULL) airpcap_if_selected->saved = FALSE;
}
- else if (g_strcasecmp(new_type_string->str,AIRPCAP_WPA_BIN_KEY_STRING) == 0) /* WPA_BIN Key */
+ else if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WPA_BIN_KEY_STRING) == 0) /* WPA_BIN Key */
{
/* XXX - Perform some WPA_BIN related input fields check */
/* If everything is ok, modify the entry int he list */
@@ -1029,7 +1033,7 @@ on_edit_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
g_strchomp(new_ssid_string->str);
/* Check which type of key the user has entered */
- if (g_strcasecmp(new_type_string->str,AIRPCAP_WEP_KEY_STRING) == 0) /* WEP key */
+ if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WEP_KEY_STRING) == 0) /* WEP key */
{
if ( ((new_key_string->len) > WEP_KEY_MAX_CHAR_SIZE) || ((new_key_string->len) < WEP_KEY_MIN_CHAR_SIZE))
@@ -1082,7 +1086,7 @@ on_edit_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
if (airpcap_if_selected != NULL) airpcap_if_selected->saved = FALSE;
}
- else if (g_strcasecmp(new_type_string->str,AIRPCAP_WPA_PWD_KEY_STRING) == 0) /* WPA Key */
+ else if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WPA_PWD_KEY_STRING) == 0) /* WPA Key */
{
/* XXX - Perform some WPA related input fields check */
/* If everything is ok, modify the entry int he list */
@@ -1123,7 +1127,7 @@ on_edit_key_ok_bt_clicked(GtkWidget *widget, gpointer data _U_)
if (airpcap_if_selected != NULL) airpcap_if_selected->saved = FALSE;
}
- else if (g_strcasecmp(new_type_string->str,AIRPCAP_WPA_BIN_KEY_STRING) == 0) /* WPA_BIN Key */
+ else if (g_ascii_strcasecmp(new_type_string->str,AIRPCAP_WPA_BIN_KEY_STRING) == 0) /* WPA_BIN Key */
{
/* XXX - Perform some WPA_BIN related input fields check */
/* If everything is ok, modify the entry int he list */
@@ -1631,7 +1635,7 @@ on_edit_key_bt_clicked(GtkWidget *button, gpointer data _U_)
gtk_widget_set_name (edit_ssid_te, "edit_ssid_te");
/* Set current ssid (if key type is not WEP!)*/
- if (g_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
+ if (g_ascii_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
{
gtk_widget_set_sensitive(edit_ssid_te,FALSE);
}
@@ -1850,20 +1854,20 @@ on_enable_decryption_en_changed(GtkWidget *w, gpointer data)
* and then when the 'new text' is added ("new text"). We don't really
* care about the first time, and we just return.
*/
- if (g_strcasecmp(gtk_entry_get_text(decryption_en),"") == 0)
+ if (g_ascii_strcasecmp(gtk_entry_get_text(decryption_en),"") == 0)
return;
- if (g_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0)
+ if (g_ascii_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0)
{
set_wireshark_decryption(TRUE);
if (!set_airpcap_decryption(FALSE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
}
- else if (g_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
+ else if (g_ascii_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
{
set_wireshark_decryption(FALSE);
if (!set_airpcap_decryption(TRUE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
}
- else if (g_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0)
+ else if (g_ascii_strcasecmp(gtk_entry_get_text(decryption_en),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0)
{
set_wireshark_decryption(FALSE);
if (!set_airpcap_decryption(FALSE)) simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, CANT_SAVE_ERR_STR);
@@ -1938,7 +1942,7 @@ update_decryption_mode_list(GtkWidget *w)
else
{
/* The last decryption mode was 'Driver', but no more AirPcap adapter are found */
- if (g_strcasecmp(current_text,AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
+ if (g_ascii_strcasecmp(current_text,AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0)
{
if (current_text != NULL) g_free(current_text);
@@ -2485,7 +2489,7 @@ on_advanced_ok_bt_clicked(GtkWidget *button, gpointer data _U_)
gtk_timeout_remove(airpcap_if_selected->tag);
/* Update toolbar (only if airpcap_if_selected is airpcap_if_active)*/
- if ( g_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
+ if ( g_ascii_strcasecmp(airpcap_if_selected->description,airpcap_if_active->description) == 0)
{
gtk_label_set_text(GTK_LABEL(toolbar_if_lb), g_strdup_printf("%s %s\t","Current Wireless Interface: #",airpcap_get_if_string_number(airpcap_if_selected)));
airpcap_update_channel_combo(GTK_WIDGET(toolbar_channel_cm),airpcap_if_selected);
diff --git a/gtk/airpcap_gui_utils.c b/gtk/airpcap_gui_utils.c
index 92316761e3..cd65a1f230 100644
--- a/gtk/airpcap_gui_utils.c
+++ b/gtk/airpcap_gui_utils.c
@@ -55,6 +55,10 @@
#include "keys.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
/* Controls the releay of settings back to the adapter. */
gboolean change_airpcap_settings = FALSE;
@@ -82,7 +86,7 @@ airpcap_get_all_channels_list(airpcap_if_info_t* if_info)
{
current_item = g_list_nth(airpcap_if_list,i);
current_adapter = (airpcap_if_info_t*)current_item->data;
- if(current_adapter != if_info && g_strncasecmp("AirPcap USB wireless capture adapter nr.", current_adapter->description, 40) == 0)
+ if(current_adapter != if_info && g_ascii_strncasecmp("AirPcap USB wireless capture adapter nr.", current_adapter->description, 40) == 0)
{
g_string_sprintfa(freq_str, "%s%s", sep,
ieee80211_mhz_to_str(current_adapter->channelInfo.Frequency));
@@ -433,15 +437,15 @@ airpcap_fill_key_list(GtkWidget *keylist)
AirpcapValidationType
airpcap_get_validation_type(const gchar* name)
{
- if(!(g_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_ALL,name)))
+ if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_ALL,name)))
{
return AIRPCAP_VT_ACCEPT_EVERYTHING;
}
- else if(!(g_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRECT,name)))
+ else if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRECT,name)))
{
return AIRPCAP_VT_ACCEPT_CORRECT_FRAMES;
}
- else if(!(g_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRUPT,name)))
+ else if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRUPT,name)))
{
return AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES;
}
@@ -483,11 +487,11 @@ airpcap_get_validation_name(AirpcapValidationType vt)
AirpcapLinkType
airpcap_get_link_type(const gchar* name)
{
- if(!(g_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_ONLY,name))){
+ if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_ONLY,name))){
return AIRPCAP_LT_802_11;
- }else if(!(g_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_RADIO,name))){
+ }else if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_RADIO,name))){
return AIRPCAP_LT_802_11_PLUS_RADIO;
- }else if(!(g_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_PPI,name))){
+ }else if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_PPI,name))){
return AIRPCAP_LT_802_11_PLUS_PPI;
}else{
return AIRPCAP_LT_UNKNOWN;
@@ -678,7 +682,7 @@ airpcap_update_channel_offset_cb(airpcap_if_info_t* if_info, ULONG ch_freq, GtkW
int
airpcap_if_is_any(airpcap_if_info_t* if_info)
{
- if(g_strcasecmp(if_info->name,AIRPCAP_DEVICE_ANY_EXTRACT_STRING)==0)
+ if(g_ascii_strcasecmp(if_info->name,AIRPCAP_DEVICE_ANY_EXTRACT_STRING)==0)
return 1;
else
return 0;
@@ -814,11 +818,11 @@ airpcap_add_keys_from_list(GtkWidget *key_ls, airpcap_if_info_t *if_info)
gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&row_key);
gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&row_ssid);
- if(g_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
+ if(g_ascii_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WEP;
- else if(g_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPCAP_KEYTYPE_TKIP;
- else if(g_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPCAP_KEYTYPE_CCMP;
/* Retrieve the Item corresponding to the i-th key */
@@ -913,11 +917,11 @@ airpcap_add_keys_to_driver_from_list(GtkWidget *key_ls,airpcap_if_info_t *fake_i
gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&row_key);
gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&row_ssid);
- if(g_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
+ if(g_ascii_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WEP;
- else if(g_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
- else if(g_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WPA_PMK;
/* Retrieve the Item corresponding to the i-th key */
@@ -990,7 +994,7 @@ airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_i
gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&tmp_key);
gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&tmp_ssid);
- if(g_strcasecmp(tmp_type,AIRPCAP_WEP_KEY_STRING) == 0)
+ if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WEP_KEY_STRING) == 0)
{
tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
tmp_dk->key = g_string_new(tmp_key);
@@ -999,7 +1003,7 @@ airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_i
tmp_dk->bits = tmp_dk->key->len * 4;
key_list = g_list_append(key_list,tmp_dk);
}
- else if(g_strcasecmp(tmp_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
{
tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
tmp_dk->key = g_string_new(tmp_key);
@@ -1009,7 +1013,7 @@ airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_i
tmp_dk->bits = 256;
key_list = g_list_append(key_list,tmp_dk);
}
- else if(g_strcasecmp(tmp_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
+ else if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
{
tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
tmp_dk->key = g_string_new(tmp_key);
diff --git a/gtk/capture_if_dlg.c b/gtk/capture_if_dlg.c
index dcbfc7685e..0664651183 100644
--- a/gtk/capture_if_dlg.c
+++ b/gtk/capture_if_dlg.c
@@ -81,6 +81,10 @@
#include "airpcap_dlg.h"
#endif
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
/*
* Keep a static pointer to the current "Capture Interfaces" window, if
* any, so that if somebody tries to do "Capture:Start" while there's
@@ -346,7 +350,7 @@ gint if_list_comparator_alph (const void *first_arg, const void *second_arg){
if (first != NULL && first->description != NULL &&
second != NULL && second->description != NULL) {
- return g_strcasecmp(first->description, second->description);
+ return g_ascii_strcasecmp(first->description, second->description);
} else {
return 0;
}
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 1beacd4994..1f46cced77 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -42,6 +42,10 @@
#include "decode_as_ber.h"
#include "help_dlg.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
#undef DEBUG
/**************************************************/
diff --git a/gtk/expert_comp_table.c b/gtk/expert_comp_table.c
index 16625f1571..520095b0f6 100644
--- a/gtk/expert_comp_table.c
+++ b/gtk/expert_comp_table.c
@@ -55,6 +55,10 @@
#include <epan/expert.h>
#include <epan/emem.h>
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
#define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
#define SORT_ALPHABETICAL 0
diff --git a/gtk/gui_utils.c b/gtk/gui_utils.c
index e7b7cbc647..375c301dc5 100644
--- a/gtk/gui_utils.c
+++ b/gtk/gui_utils.c
@@ -51,6 +51,10 @@
/* XXX - remove this later again, when dlg_xx function cleanup done */
#include "dlg_utils.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
#define WINDOW_GEOM_KEY "window_geom"
@@ -488,7 +492,7 @@ window_geom_recent_read_pair(const char *name, const char *key, const char *valu
geom.height = strtol(value, NULL, 10);
geom.set_size = TRUE;
} else if (strcmp(key, "maximized") == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
geom.maximized = TRUE;
}
else {
diff --git a/gtk/main.c b/gtk/main.c
index 72677903b4..0228bfa052 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -188,6 +188,10 @@
/* Davide Schiera (2006-11-22) ---------------------------------------------- */
#endif
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
/*
* Files under personal and global preferences directories in which
* GTK settings for Wireshark are stored.
@@ -4169,7 +4173,7 @@ airpcap_toolbar_channel_changed_cb(GtkWidget *w _U_, gpointer data)
if ((data != NULL) && (w != NULL) && change_airpcap_settings) {
s = gtk_entry_get_text(GTK_ENTRY(w));
- if ((g_strcasecmp("",s))) {
+ if ((g_ascii_strcasecmp("",s))) {
ch_freq = airpcap_get_frequency_from_str(s);
if (airpcap_if_active != NULL) {
airpcap_if_active->channelInfo.Frequency = ch_freq;
@@ -4191,7 +4195,7 @@ on_channel_offset_cb_changed(GtkWidget *w _U_, gpointer data)
if ((data != NULL) && (w != NULL) && change_airpcap_settings)
{
s = gtk_entry_get_text(GTK_ENTRY(w));
- if ((g_strcasecmp("",s)))
+ if ((g_ascii_strcasecmp("",s)))
{
if (airpcap_if_active != NULL)
{
diff --git a/gtk/menu.c b/gtk/menu.c
index 48bb9da317..f9f7c673d4 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -90,6 +90,10 @@
#include "export_object.h"
#endif
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
GtkWidget *popup_menu_object;
static void
@@ -1762,11 +1766,7 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) {
if (!widget_cf_name ||
#ifdef _WIN32
/* do a case insensitive compare on win32 */
-#if GLIB_MAJOR_VERSION < 2
- g_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
-#else
g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
-#endif
#else /* _WIN32 */
/* do a case sensitive compare on unix */
strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c
index 62af803642..5daa8d3895 100644
--- a/gtk/mgcp_stat.c
+++ b/gtk/mgcp_stat.c
@@ -53,6 +53,10 @@
#include "../tap_dfilter_dlg.h"
#include "gui_utils.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
#define NUM_TIMESTATS 10
@@ -145,31 +149,31 @@ mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
/* calculate time delta between request and response */
nstime_delta(&delta, &pinfo->fd->abs_ts, &mi->req_time);
- if (strncasecmp(mi->code, "EPCF", 4) == 0 ) {
+ if (g_ascii_strncasecmp(mi->code, "EPCF", 4) == 0 ) {
time_stat_update(&(ms->rtd[0]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "CRCX", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "CRCX", 4) == 0 ) {
time_stat_update(&(ms->rtd[1]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "MDCX", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "MDCX", 4) == 0 ) {
time_stat_update(&(ms->rtd[2]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "DLCX", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "DLCX", 4) == 0 ) {
time_stat_update(&(ms->rtd[3]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "RQNT", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "RQNT", 4) == 0 ) {
time_stat_update(&(ms->rtd[4]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "NTFY", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "NTFY", 4) == 0 ) {
time_stat_update(&(ms->rtd[5]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "AUEP", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "AUEP", 4) == 0 ) {
time_stat_update(&(ms->rtd[6]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "AUCX", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "AUCX", 4) == 0 ) {
time_stat_update(&(ms->rtd[7]),&delta, pinfo);
}
- else if (strncasecmp(mi->code, "RSIP", 4) == 0 ) {
+ else if (g_ascii_strncasecmp(mi->code, "RSIP", 4) == 0 ) {
time_stat_update(&(ms->rtd[8]),&delta, pinfo);
}
else {
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index 9447f60207..e6da8c72ac 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -66,6 +66,10 @@
#endif
#endif
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
static void prefs_main_ok_cb(GtkWidget *, gpointer);
static void prefs_main_apply_cb(GtkWidget *, gpointer);
static void prefs_main_save_cb(GtkWidget *, gpointer);
@@ -828,7 +832,7 @@ label_to_enum_val(GtkWidget *label, const enum_val_t *enumvals)
gtk_label_get(GTK_LABEL(label), &label_string);
for (i = 0; enumvals[i].name != NULL; i++) {
- if (strcasecmp(label_string, enumvals[i].description) == 0) {
+ if (g_ascii_strcasecmp(label_string, enumvals[i].description) == 0) {
return enumvals[i].value;
}
}
@@ -1202,17 +1206,17 @@ gboolean wireshark_decryption_is_now_enabled;
decryption_cm = GTK_WIDGET(OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_DECRYPTION_KEY));
decryption_en = GTK_WIDGET(GTK_ENTRY(GTK_COMBO(decryption_cm)->entry));
-if( g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0 )
+if( g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK) == 0 )
{
wireshark_decryption_was_enabled = TRUE;
airpcap_decryption_was_enabled = FALSE;
}
-else if( g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0 )
+else if( g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP) == 0 )
{
wireshark_decryption_was_enabled = FALSE;
airpcap_decryption_was_enabled = TRUE;
}
-else if( g_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0 )
+else if( g_ascii_strcasecmp(gtk_entry_get_text(GTK_ENTRY(decryption_en)),AIRPCAP_DECRYPTION_TYPE_STRING_NONE) == 0 )
{
wireshark_decryption_was_enabled = FALSE;
airpcap_decryption_was_enabled = FALSE;
diff --git a/gtk/recent.c b/gtk/recent.c
index 361cd2807a..5dfa13f26e 100644
--- a/gtk/recent.c
+++ b/gtk/recent.c
@@ -49,6 +49,10 @@
#include "file_util.h"
#include "u3.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
#define RECENT_KEY_MAIN_TOOLBAR_SHOW "gui.toolbar_main_show"
#define RECENT_KEY_FILTER_TOOLBAR_SHOW "gui.filter_toolbar_show"
#define RECENT_KEY_AIRPCAP_TOOLBAR_SHOW "gui.airpcap_toolbar_show"
@@ -321,63 +325,63 @@ read_set_recent_pair_static(gchar *key, gchar *value, void *private_data _U_)
char *p;
if (strcmp(key, RECENT_KEY_MAIN_TOOLBAR_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.main_toolbar_show = TRUE;
}
else {
recent.main_toolbar_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_FILTER_TOOLBAR_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.filter_toolbar_show = TRUE;
}
else {
recent.filter_toolbar_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_AIRPCAP_TOOLBAR_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.airpcap_toolbar_show = TRUE;
}
else {
recent.airpcap_toolbar_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_DRIVER_CHECK_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.airpcap_driver_check_show = TRUE;
}
else {
recent.airpcap_driver_check_show = FALSE;
}
}else if (strcmp(key, RECENT_KEY_PACKET_LIST_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.packet_list_show = TRUE;
}
else {
recent.packet_list_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_TREE_VIEW_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.tree_view_show = TRUE;
}
else {
recent.tree_view_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_BYTE_VIEW_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.byte_view_show = TRUE;
}
else {
recent.byte_view_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_STATUSBAR_SHOW) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.statusbar_show = TRUE;
}
else {
recent.statusbar_show = FALSE;
}
} else if (strcmp(key, RECENT_KEY_PACKET_LIST_COLORIZE) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.packet_list_colorize = TRUE;
}
else {
@@ -395,7 +399,7 @@ read_set_recent_pair_static(gchar *key, gchar *value, void *private_data _U_)
return PREFS_SET_SYNTAX_ERR; /* number was bad */
recent.gui_zoom_level = num;
} else if (strcmp(key, RECENT_GUI_GEOMETRY_MAIN_MAXIMIZED) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.gui_geometry_main_maximized = TRUE;
}
else {
@@ -465,14 +469,14 @@ read_set_recent_pair_static(gchar *key, gchar *value, void *private_data _U_)
window_geom_recent_read_pair(win, sub_key, value);
}
} else if (strcmp(key, RECENT_KEY_PRIVS_WARN_IF_ELEVATED) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.privs_warn_if_elevated = TRUE;
}
else {
recent.privs_warn_if_elevated = FALSE;
}
} else if (strcmp(key, RECENT_KEY_PRIVS_WARN_IF_NO_NPF) == 0) {
- if (strcasecmp(value, "true") == 0) {
+ if (g_ascii_strcasecmp(value, "true") == 0) {
recent.privs_warn_if_no_npf = TRUE;
}
else {
diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c
index 9ffb9e3afb..ace4ca206d 100644
--- a/gtk/rtp_analysis.c
+++ b/gtk/rtp_analysis.c
@@ -94,6 +94,10 @@
#include "rtp_stream.h"
#include "rtp_stream_dlg.h"
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
/****************************************************************************/
@@ -285,7 +289,7 @@ get_dyn_pt_clock_rate(gchar *payload_type_str)
size_t i;
for (i = 0; i < NUM_DYN_CLOCK_VALUES; i++) {
- if (strncasecmp(mimetype_and_clock_map[i].pt_mime_name_str,payload_type_str,(strlen(mimetype_and_clock_map[i].pt_mime_name_str))) == 0)
+ if (g_ascii_strncasecmp(mimetype_and_clock_map[i].pt_mime_name_str,payload_type_str,(strlen(mimetype_and_clock_map[i].pt_mime_name_str))) == 0)
return mimetype_and_clock_map[i].value;
}
diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c
index 01390be224..6a47ef5b30 100644
--- a/gtk/voip_calls.c
+++ b/gtk/voip_calls.c
@@ -77,6 +77,10 @@
#endif /* GTK_MAJOR_VERSION >= 2 */
#endif /* HAVE_LIBPORTAUDIO */
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
const char *voip_call_state_name[8]={
"",
"CALL SETUP",
@@ -2368,7 +2372,7 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
if ((tmp_listinfo->protocol == VOIP_MGCP) && (tmp_listinfo->call_active_state == VOIP_ACTIVE)){
tmp_mgcpinfo = tmp_listinfo->prot_info;
if (pi->endpointId != NULL){
- if (g_strcasecmp(tmp_mgcpinfo->endpointId,pi->endpointId) == 0){
+ if (g_ascii_strcasecmp(tmp_mgcpinfo->endpointId,pi->endpointId) == 0){
/*
check first if it is an ended call. We can still match packets to this Endpoint 2 seconds
after the call has been released