strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 27 Nov 2007 18:52:51 +0000 (18:52 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 27 Nov 2007 18:52:51 +0000 (18:52 +0000)
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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23623 f5534014-38df-0310-8fa8-9805f1628bb7

57 files changed:
airpcap_loader.c
capture-wpcap.c
capture_loop.c
configure.in
epan/Makefile.am
epan/crypt/airpdcap.c
epan/dfilter/semcheck.c
epan/dissectors/packet-3com-njack.c
epan/dissectors/packet-afp.c
epan/dissectors/packet-cigi.c
epan/dissectors/packet-diameter.c
epan/dissectors/packet-edonkey.c
epan/dissectors/packet-giop.c
epan/dissectors/packet-http.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-ipsec.c
epan/dissectors/packet-megaco.c
epan/dissectors/packet-mgcp.c
epan/dissectors/packet-multipart.c
epan/dissectors/packet-pvfs2.c
epan/dissectors/packet-rtcp.c
epan/dissectors/packet-rtsp.c
epan/dissectors/packet-sccp.c
epan/dissectors/packet-sip.c
epan/dissectors/packet-smtp.c
epan/dissectors/packet-sqloracle.c
epan/dissectors/packet-tftp.c
epan/dissectors/packet-tivoconnect.c
epan/dissectors/packet-vnc.c
epan/dissectors/packet-wbxml.c
epan/dissectors/packet-wsp.c
epan/dissectors/packet-xml.c
epan/dtd_parse.l
epan/g_ascii_strcasecmp.c [new file with mode: 0644]
epan/g_ascii_strcasecmp.h [new file with mode: 0644]
epan/prefs.c
epan/proto.c
epan/req_resp_hdrs.c
epan/strutil.c
epan/tvbuff.c
epan/tvbuff.h
gtk/airpcap_dlg.c
gtk/airpcap_gui_utils.c
gtk/capture_if_dlg.c
gtk/decode_as_dlg.c
gtk/expert_comp_table.c
gtk/gui_utils.c
gtk/main.c
gtk/menu.c
gtk/mgcp_stat.c
gtk/prefs_dlg.c
gtk/recent.c
gtk/rtp_analysis.c
gtk/voip_calls.c
plugins/mgcp/packet-mgcp.c
tap-mgcpstat.c
util.c

index cad8500c73e96cd1b9e4d2657ff98dd6085efdc1..411df70c8eee782dd057980972719c2eb7b8fde5 100644 (file)
 #include <airpcap.h>
 #include "airpcap_loader.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /*
  * We load dynamically the dag library in order link it only when
  * it's present on the system
@@ -153,7 +157,7 @@ get_wep_key(pref_t *pref, gpointer ud _U_)
     /* Retrieve user data info */
     user_data = (keys_cb_data_t*)ud;
 
-    if (g_strncasecmp(pref->name, "wep_key", 7) == 0 && pref->type == PREF_STRING)
+    if (g_ascii_strncasecmp(pref->name, "wep_key", 7) == 0 && pref->type == PREF_STRING)
     {
        my_string = g_strdup(*pref->varp.string);
 
@@ -219,7 +223,7 @@ set_wep_key(pref_t *pref, gpointer ud _U_)
     /* Retrieve user data info */
     user_data = (keys_cb_data_t*)ud;
 
-    if (g_strncasecmp(pref->name, "wep_key", 7) == 0 && pref->type == PREF_STRING)
+    if (g_ascii_strncasecmp(pref->name, "wep_key", 7) == 0 && pref->type == PREF_STRING)
     {
        /* Ok, the pref we're gonna set is a wep_key ... but what number? */
        sscanf(pref->name,"wep_key%d",&wep_key_number);
@@ -1550,7 +1554,7 @@ airpcap_get_if_string_number(airpcap_if_info_t* if_info)
      */
     if(a == 0)
     {
-       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)
            number = g_strdup_printf("??");
        else
            number = g_strdup_printf(AIRPCAP_CHANNEL_ANY_NAME);
@@ -2238,7 +2242,7 @@ test_if_on(pref_t *pref, gpointer ud _U_)
     is_on = (gboolean*)ud;
 
 
-    if (g_strncasecmp(pref->name, "enable_decryption", 17) == 0 && pref->type == PREF_BOOL)
+    if (g_ascii_strncasecmp(pref->name, "enable_decryption", 17) == 0 && pref->type == PREF_BOOL)
     {
        number = *pref->varp.boolp;
 
@@ -2335,7 +2339,7 @@ set_on_off(pref_t *pref, gpointer ud _U_)
     /* Retrieve user data info */
     is_on = (gboolean*)ud;
 
-    if (g_strncasecmp(pref->name, "enable_decryption", 17) == 0 && pref->type == PREF_BOOL)
+    if (g_ascii_strncasecmp(pref->name, "enable_decryption", 17) == 0 && pref->type == PREF_BOOL)
     {
        number = *pref->varp.boolp;
 
index 7b1ecb3429c1fbfd3ac269d1f8fa1fad7870efb9..f7667f2574ee5c4abeea2488899f24206ec436d0 100644 (file)
 /* XXX - yes, I know, I should move cppmagic.h to a generic location. */
 #include "tools/lemon/cppmagic.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 
 #define MAX_WIN_IF_NAME_LEN 511
 
@@ -406,7 +410,7 @@ pcap_datalink_name_to_val(const char *name)
                 * We don't have it in WinPcap; do it ourselves.
                 */
                for (i = 0; dlt_choices[i].name != NULL; i++) {
-                       if (strcasecmp(dlt_choices[i].name + sizeof("DLT_") - 1,
+                       if (g_ascii_strcasecmp(dlt_choices[i].name + sizeof("DLT_") - 1,
                            name) == 0)
                                return dlt_choices[i].dlt;
                }
index c147ee430fe8116b3d9506f9d3132fa97103a9e7..4040d0e92b1100dc2caac15231e94bd99a614949 100644 (file)
 
 #include "capture_loop.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* E: capture_loop.c only (Wireshark/dumpcap) T: tshark only */
 typedef struct _loop_data {
   /* common */
@@ -341,7 +345,7 @@ cap_pipe_open_live(char *pipename, struct pcap_hdr *hdr, loop_data *ld,
     pncopy = g_strdup(pipename);
     if ( (pos=strstr(pncopy, "\\\\")) == pncopy) {
       pos = strchr(pncopy + 3, '\\');
-      if (pos && g_strncasecmp(pos, PIPE_STR, strlen(PIPE_STR)) != 0)
+      if (pos && g_ascii_strncasecmp(pos, PIPE_STR, strlen(PIPE_STR)) != 0)
         pos = NULL;
     }
 
index 47974dd33e1ea5dd50983f46f813f9dc85171c9e..350cbb0ff45f16454331fddd5d30bba257e81a25 100644 (file)
@@ -1312,6 +1312,28 @@ fi
 AC_SUBST(MKSTEMP_C)
 AC_SUBST(MKSTEMP_O)
 
+ac_save_LIBS="$LIBS"
+LIBS="$GLIB_LIBS $LIBS"
+G_ASCII_STRCASECMP_C=""
+G_ASCII_STRCASECMP_O=""
+G_ASCII_STRCASECMP_LO=""
+AC_CHECK_FUNC(g_ascii_strcasecmp,
+  [G_ASCII_STRCASECMP_O=""
+   G_ASCII_STRCASECMP_LO=""],
+  [G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
+   G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
+   AC_DEFINE(NEED_G_ASCII_STRCASECMP_H, 1, [Define if g_ascii_strcasecmp.h needs to be included])
+])
+LIBS="$ac_save_LIBS"
+if test "$ac_cv_func_g_ascii_strcasecmp" = no ; then
+  G_ASCII_STRCASECMP_C="g_ascii_strcasecmp.c"
+  G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
+  G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
+fi
+AC_SUBST(G_ASCII_STRCASECMP_C)
+AC_SUBST(G_ASCII_STRCASECMP_O)
+AC_SUBST(G_ASCII_STRCASECMP_LO)
+
 ac_save_LIBS="$LIBS"
 LIBS="$GLIB_LIBS $LIBS"
 G_ASCII_STRTOULL_C=""
index 0ac1941da454b95f666284ae85657f5954ecc0f9..902c76b40f12712eeffec06c5352f2bb26d9d1c7 100644 (file)
@@ -69,6 +69,8 @@ libwireshark_generated_la_SOURCES = \
        $(LIBWIRESHARK_GENERATED_INCLUDES)
 
 EXTRA_libwireshark_la_SOURCES =        \
+       g_ascii_strcasecmp.c    \
+       g_ascii_strcasecmp.h    \
        g_ascii_strtoull.c      \
        g_ascii_strtoull.h      \
        inet_aton.c             \
@@ -113,8 +115,8 @@ MAINTAINERCLEANFILES = \
 #
 # Add the object files for missing routines, if any.
 #
-libwireshark_la_LIBADD = @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la crypt/libairpdcap.la ftypes/libftypes.la dfilter/libdfilter.la dissectors/libcleandissectors.la dissectors/libdissectors.la dissectors/libasndissectors.la dissectors/libpidldissectors.la $(wslua_lib) @ADNS_LIBS@ @LIBGNUTLS_LIBS@ @LIBICONV@ @KRB5_LIBS@ @SSL_LIBS@ -lm
-libwireshark_la_DEPENDENCIES = @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la crypt/libairpdcap.la ftypes/libftypes.la dfilter/libdfilter.la dissectors/libcleandissectors.la dissectors/libdissectors.la dissectors/libasndissectors.la dissectors/libpidldissectors.la $(wslua_lib)
+libwireshark_la_LIBADD = @G_ASCII_STRCASECMP_LO@ @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la crypt/libairpdcap.la ftypes/libftypes.la dfilter/libdfilter.la dissectors/libcleandissectors.la dissectors/libdissectors.la dissectors/libasndissectors.la dissectors/libpidldissectors.la $(wslua_lib) @ADNS_LIBS@ @LIBGNUTLS_LIBS@ @LIBICONV@ @KRB5_LIBS@ @SSL_LIBS@ -lm
+libwireshark_la_DEPENDENCIES = @G_ASCII_STRCASECMP_LO@ @G_ASCII_STRTOULL_LO@ @INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la crypt/libairpdcap.la ftypes/libftypes.la dfilter/libdfilter.la dissectors/libcleandissectors.la dissectors/libdissectors.la dissectors/libasndissectors.la dissectors/libpidldissectors.la $(wslua_lib)
 
 #EXTRA_PROGRAMS = reassemble_test
 #reassemble_test_LDADD = $(GLIB_LIBS)
index 87297056e3ac27704b31592c2e1c93f0c64a97f8..04f1a9ff357f5a21ae9002c845ae80cbb84c2816 100644 (file)
 
 #include "wep-wpadefs.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /****************************************************************************/
 
 /****************************************************************************/
@@ -1353,7 +1357,7 @@ parse_key_string(gchar* input_string)
 
     /* First, check for a WEP string */
     /* XXX - This duplicates code in packet-ieee80211.c */
-    if (g_strncasecmp(input_string, STRING_KEY_TYPE_WEP ":", 4) == 0) {
+    if (g_ascii_strncasecmp(input_string, STRING_KEY_TYPE_WEP ":", 4) == 0) {
         first_nibble += 4;
     }
 
@@ -1407,7 +1411,7 @@ parse_key_string(gchar* input_string)
         ssid = g_strdup(tokens[2]);
     }
 
-    if (g_strcasecmp(type,STRING_KEY_TYPE_WPA_PSK) == 0) /* WPA key */
+    if (g_ascii_strcasecmp(type,STRING_KEY_TYPE_WPA_PSK) == 0) /* WPA key */
     {
         /* Create a new string */
         key_string = g_string_new(key);
@@ -1446,7 +1450,7 @@ parse_key_string(gchar* input_string)
         g_strfreev(tokens);
         return dk;
     }
-    else if(g_strcasecmp(type,STRING_KEY_TYPE_WPA_PWD) == 0) /* WPA key *//* If the number of tokens is more than three, we accept the string... if the first three tokens are correct... */
+    else if(g_ascii_strcasecmp(type,STRING_KEY_TYPE_WPA_PWD) == 0) /* WPA key *//* If the number of tokens is more than three, we accept the string... if the first three tokens are correct... */
     {
         /* Create a new string */
         key_string = g_string_new(key);
index 3acb7c560fcca3a40da4fdd9e0c9d3790fad2dcf..2e48be2adb0eeb60a7a106ec724a53ffb3443793 100644 (file)
 #include <epan/exceptions.h>
 #include <epan/packet.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Enable debug logging by defining AM_CFLAGS
  * so that it contains "-DDEBUG_dfilter".
  * Usage: DebugLog(("Error: string=%s\n", str)); */
@@ -202,10 +206,10 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s)
                        tf = hfinfo->strings;
                }
 
-               if (strcasecmp(s, tf->true_string) == 0) {
+               if (g_ascii_strcasecmp(s, tf->true_string) == 0) {
                        return mk_uint32_fvalue(TRUE);
                }
-               else if (strcasecmp(s, tf->false_string) == 0) {
+               else if (g_ascii_strcasecmp(s, tf->false_string) == 0) {
                        return mk_uint32_fvalue(FALSE);
                }
                else {
@@ -224,7 +228,7 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s)
 
        vals = hfinfo->strings;
        while (vals->strptr != NULL) {
-               if (strcasecmp(s, vals->strptr) == 0) {
+               if (g_ascii_strcasecmp(s, vals->strptr) == 0) {
                        return mk_uint32_fvalue(vals->value);
                }
                vals++;
index cc0334880a4b25a205b07decaf6626d230ee8d27..724b47852c587baeebd5614b815e7ce08a60fd8d 100644 (file)
@@ -59,6 +59,10 @@ Specs:
 #include <epan/packet.h>
 #include <epan/emem.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* protocol handles */
 static int proto_njack = -1;
 
@@ -650,7 +654,7 @@ test_njack(tvbuff_t *tvb)
 {
        /* We need at least 'NJ200' + 1 Byte packet type */
        if ( tvb_length(tvb) < 6 ||
-                   g_strncasecmp((const char *)tvb_get_ptr(tvb, 0, 5), "NJ200", 5) ) {
+                   g_ascii_strncasecmp((const char *)tvb_get_ptr(tvb, 0, 5), "NJ200", 5) ) {
                return FALSE;
        }
        return TRUE;
index 149ce22a42ad10a150fd65a074d8b8c8264e06d9..4b0ad2740522ff358c031527a5c57c4fe15e221a 100644 (file)
 
 #include "packet-afp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* The information in this module (AFP) comes from:
 
   AFP 2.1 & 2.2.pdf contained in AppleShare_IP_6.3_SDK
@@ -2364,7 +2368,7 @@ decode_uam_parameters(const char *uam, int len_uam, tvbuff_t *tvb, proto_tree *t
 {
        int len;
 
-       if (!strncasecmp(uam, "Cleartxt passwrd", len_uam)) {
+       if (!g_ascii_strncasecmp(uam, "Cleartxt passwrd", len_uam)) {
                if ((offset & 1))
                        PAD(1);
 
@@ -2372,7 +2376,7 @@ decode_uam_parameters(const char *uam, int len_uam, tvbuff_t *tvb, proto_tree *t
                proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, len,FALSE);
                offset += len;
        }
-       else if (!strncasecmp(uam, "DHCAST128", len_uam)) {
+       else if (!g_ascii_strncasecmp(uam, "DHCAST128", len_uam)) {
                if ((offset & 1))
                        PAD(1);
 
@@ -2380,7 +2384,7 @@ decode_uam_parameters(const char *uam, int len_uam, tvbuff_t *tvb, proto_tree *t
                proto_tree_add_item(tree, hf_afp_random, tvb, offset, len,FALSE);
                offset += len;
         }
-       else if (!strncasecmp(uam, "2-Way Randnum exchange", len_uam)) {
+       else if (!g_ascii_strncasecmp(uam, "2-Way Randnum exchange", len_uam)) {
                /* nothing */
                return offset;
        }
@@ -2403,7 +2407,7 @@ dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
        proto_tree_add_item(tree, hf_afp_UAM, tvb, offset, 1,FALSE);
        offset += len_uam +1;
 
-       if (!strncasecmp(uam, "No User Authent", len_uam)) {
+       if (!g_ascii_strncasecmp(uam, "No User Authent", len_uam)) {
                return offset;
        }
 
index d0db7ef365fb61fc62d5aebd1a14b5d64f215276..dc062c827a5af772a1f4db07b4d33efc2edf1094 100644 (file)
 #include <epan/prefs.h>
 #include <epan/emem.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Forward declaration */
 void proto_reg_handoff_cigi(void);
 static gboolean packet_is_cigi(tvbuff_t*);
@@ -2073,16 +2077,16 @@ dissect_cigi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /* Format the Info String */
     src_str = ip_to_str(pinfo->src.data);
-    if ( !g_strcasecmp(global_host_ip, src_str) ) {
+    if ( !g_ascii_strcasecmp(global_host_ip, src_str) ) {
         src_str = "Host";
-    } else if ( !g_strcasecmp(global_ig_ip, src_str) ) {
+    } else if ( !g_ascii_strcasecmp(global_ig_ip, src_str) ) {
         src_str = "IG";
     }
 
     dest_str = ip_to_str(pinfo->dst.data);
-    if ( !g_strcasecmp(global_host_ip, dest_str) ) {
+    if ( !g_ascii_strcasecmp(global_host_ip, dest_str) ) {
         dest_str = "Host";
-    } else if ( !g_strcasecmp(global_ig_ip, dest_str) ) {
+    } else if ( !g_ascii_strcasecmp(global_ig_ip, dest_str) ) {
         dest_str = "IG";
     }
 
index 129c887327ff1c83d479b58dafdd79c05faadf96..d235b9d99d28cdd86d86308f8dcc7bd953943c31 100644 (file)
@@ -955,18 +955,43 @@ static const avp_type_t basic_types[] = {
 
 
 
+/*
+ * This is like g_str_hash() (as of GLib 2.4.8), but it maps all
+ * upper-case ASCII characters to their ASCII lower-case equivalents.
+ * We can't use g_strdown(), as that doesn't do an ASCII mapping;
+ * in Turkish locales, for example, there are two lower-case "i"s
+ * and two upper-case "I"s, with and without dots - the ones with
+ * dots map between each other, as do the ones without dots, so "I"
+ * doesn't map to "i".
+ */
 static guint strcase_hash(gconstpointer key) {
-       char* k = ep_strdup(key);
-       g_strdown(k);
-       return g_str_hash(k);
+       const char *p = key;
+       guint h = *p;
+       char c;
+
+       if (h) {
+               if (h >= 'A' && h <= 'Z')
+                       h = h - 'A' + 'a';
+               for (p += 1; *p != '\0'; p++) {
+                       c = *p;
+                       if (c >= 'A' && c <= 'Z')
+                               c = c - 'A' + 'a';
+                       h = (h << 5) - h + c;
+               }
+       }
+
+       return h;
 }
 
+/*
+ * Again, use g_ascii_strcasecmp(), not strcasecmp(), so that only ASCII
+ * letters are mapped, and they're mapped to the lower-case ASCII
+ * equivalents.
+ */
 static gboolean strcase_equal(gconstpointer ka, gconstpointer kb) {
-       char* a = ep_strdup(ka);
-       char* b = ep_strdup(kb);
-       g_strdown(a);
-       g_strdown(b);
-       return g_str_equal(a,b);
+       const char* a = ka;
+       const char* b = kb;
+       return g_ascii_strcasecmp(a,b) == 0;
 }
 
 extern int dictionary_load(void);
index e7b13be61d9ea3e5bc98bef550493254a8b5a81d..0826364d898d6548555c785701b1528f5ffae2aa 100644 (file)
 #include "packet-edonkey.h"
 #include "packet-tcp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static int proto_edonkey = -1;
 
 static int hf_edonkey_message  = -1;
@@ -529,7 +533,7 @@ static gint lookup_str_index(gchar* str, gint length, const value_string *vs)
     if (str == NULL) return -1;
 
     while (vs[i].strptr) {
-        if (strncasecmp(str, vs[i].strptr, length) == 0)
+        if (g_ascii_strncasecmp(str, vs[i].strptr, length) == 0)
             return i;
         i++;
     }
index 584b2c2eb8844dd870c14fe9fe721d204ad73344..8a0cc319c1de473a058ccdbf6eb9d0c3baa562fa 100644 (file)
 #include "packet-tcp.h"
 #include <wiretap/file_util.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /*
  * Set to 1 for DEBUG output - TODO make this a runtime option
  */
@@ -1473,7 +1477,7 @@ static gchar * get_modname_from_repoid(gchar *repoid) {
 
   /* Must start with IDL: , otherwise I get confused */
 
-  if (g_strncasecmp("IDL:",repoid,4))
+  if (g_ascii_strncasecmp("IDL:",repoid,4))
     return NULL;
 
   /* Looks like a RepoID to me, so get Module or interface name */
index 55c989a99be594ecc727fd3e258684051498ba19..a06f628c6f47357c413ec3fbe515b3090f4935ed 100644 (file)
@@ -62,6 +62,10 @@ typedef enum _http_type {
 
 #include <epan/tap.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static int http_tap = -1;
 static int http_eo_tap = -1;
 
@@ -983,9 +987,9 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
                 * Handle *transfer* encodings other than "identity".
                 */
                if (headers.transfer_encoding != NULL &&
-                   strcasecmp(headers.transfer_encoding, "identity") != 0) {
+                   g_ascii_strcasecmp(headers.transfer_encoding, "identity") != 0) {
                        if (http_dechunk_body &&
-                           (strncasecmp(headers.transfer_encoding, "chunked", 7)
+                           (g_ascii_strncasecmp(headers.transfer_encoding, "chunked", 7)
                            == 0)) {
 
                                chunks_decoded = chunked_encoding_dissector(
@@ -1031,7 +1035,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
                 * we handle it in any case).
                 */
                if (headers.content_encoding != NULL &&
-                   strcasecmp(headers.content_encoding, "identity") != 0) {
+                   g_ascii_strcasecmp(headers.content_encoding, "identity") != 0) {
                        /*
                         * We currently can't handle, for example, "compress";
                         * just handle them as data for now.
@@ -1046,8 +1050,8 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
                        proto_tree *e_tree = NULL;
 
                        if (http_decompress_body &&
-                           (strcasecmp(headers.content_encoding, "gzip") == 0 ||
-                           strcasecmp(headers.content_encoding, "deflate")
+                           (g_ascii_strcasecmp(headers.content_encoding, "gzip") == 0 ||
+                           g_ascii_strcasecmp(headers.content_encoding, "deflate")
                            == 0)) {
 
                                uncomp_tvb = tvb_uncompress(next_tvb, 0,
index 4f7130d65bb0778fccf996978f07cb4a426e1848..ba664e225db22b5026c0c141df6f0cdaeb245453 100644 (file)
 #define MAX_ENCRYPTION_KEYS 64
 #endif
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #ifndef roundup2
 #define        roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
 #endif
@@ -10272,7 +10276,7 @@ static gboolean
 wep_str_to_bytes(const char *hex_str, GByteArray *bytes) {
   char *first_nibble = (char *) hex_str;
 
-  if (g_strncasecmp(hex_str, STRING_KEY_TYPE_WEP ":", 4) == 0) {
+  if (g_ascii_strncasecmp(hex_str, STRING_KEY_TYPE_WEP ":", 4) == 0) {
     first_nibble += 4;
   }
 
index 567096c22e3f30cf44fc65bfb53c6941999057e7..06c709cfebaa7da555f668b3e26a9d33e56060ab 100644 (file)
@@ -85,6 +85,10 @@ HMAC-SHA256 : any keylen
 #include <gcrypt.h>
 #endif /* HAVE_LIBGCRYPT */
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static int proto_ah = -1;
 static int hf_ah_spi = -1;
 static int hf_ah_iv = -1;
@@ -702,12 +706,12 @@ esp_sa_parse_protocol_typ(const gchar *sa, guint index_start, gint *pt_protocol_
       (sa[index_start + IPSEC_TYP_LEN] != IPSEC_SA_SEPARATOR))
     return FALSE;
 
-  if(g_strncasecmp(&sa[index_start], "IPV6", IPSEC_TYP_LEN) == 0)
+  if(g_ascii_strncasecmp(&sa[index_start], "IPV6", IPSEC_TYP_LEN) == 0)
     {
       *pt_protocol_typ = IPSEC_SA_IPV6;
       done_flag = TRUE;
     }
-  else if (g_strncasecmp(&sa[index_start], "IPV4", IPSEC_TYP_LEN) == 0)
+  else if (g_ascii_strncasecmp(&sa[index_start], "IPV4", IPSEC_TYP_LEN) == 0)
     {
       *pt_protocol_typ = IPSEC_SA_IPV4;
       done_flag = TRUE;
index 8a4e2f3e64162e47c2e49a5141b8a3db973056cf..e8a498f098c583a55724528908dae6c4a89e80d0 100644 (file)
 #include <epan/gcp.h>
 #include <epan/tap.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define PORT_MEGACO_TXT 2944
 #define PORT_MEGACO_BIN 2945
 
@@ -368,7 +372,7 @@ dissect_megaco_text(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
 
 
-       if (strncasecmp(word, "MEGACO", 6) != 0 && tvb_get_guint8(tvb, tvb_offset ) != '!'){
+       if (g_ascii_strncasecmp(word, "MEGACO", 6) != 0 && tvb_get_guint8(tvb, tvb_offset ) != '!'){
                gint8 class;
                gboolean pc;
                gint32 tag;
index 5d8fa91678fd3d948b7397386eba4066b31711d3..6a21fd211f158564653766a93f49c20abbd2ec86 100644 (file)
 #include <epan/tap.h>
 #include "packet-mgcp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define TCP_PORT_MGCP_GATEWAY 2427
 #define UDP_PORT_MGCP_GATEWAY 2427
 #define TCP_PORT_MGCP_CALLAGENT 2727
@@ -992,16 +996,16 @@ static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const g
        /* Read the string into 'word' and see if it looks like the start of a verb */
        if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), word))
        {
-               if (((strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
-                   ((strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
-                   ((strncasecmp(word, "MDCX", 4) == 0) && (*verb_name = "ModifyConnection")) ||
-                   ((strncasecmp(word, "DLCX", 4) == 0) && (*verb_name = "DeleteConnection")) ||
-                   ((strncasecmp(word, "RQNT", 4) == 0) && (*verb_name = "NotificationRequest")) ||
-                   ((strncasecmp(word, "NTFY", 4) == 0) && (*verb_name = "Notify")) ||
-                   ((strncasecmp(word, "AUEP", 4) == 0) && (*verb_name = "AuditEndpoint")) ||
-                   ((strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
-                   ((strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
-                   ((strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
+               if (((g_ascii_strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
+                   ((g_ascii_strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
+                   ((g_ascii_strncasecmp(word, "MDCX", 4) == 0) && (*verb_name = "ModifyConnection")) ||
+                   ((g_ascii_strncasecmp(word, "DLCX", 4) == 0) && (*verb_name = "DeleteConnection")) ||
+                   ((g_ascii_strncasecmp(word, "RQNT", 4) == 0) && (*verb_name = "NotificationRequest")) ||
+                   ((g_ascii_strncasecmp(word, "NTFY", 4) == 0) && (*verb_name = "Notify")) ||
+                   ((g_ascii_strncasecmp(word, "AUEP", 4) == 0) && (*verb_name = "AuditEndpoint")) ||
+                   ((g_ascii_strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
+                   ((g_ascii_strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
+                   ((g_ascii_strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
                    (word[0] == 'X' && is_rfc2234_alpha(word[1]) && is_rfc2234_alpha(word[2]) &&
                                       is_rfc2234_alpha(word[3]) && (*verb_name = "*Experimental*")))
                {
@@ -1884,50 +1888,50 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse
                typval = ep_strsplit(tokens[i], "=", 2);
                if ((typval[0] != NULL) && (typval[1] != NULL))
                {
-                       if (!strcasecmp(g_strstrip(typval[0]), "PS"))
+                       if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_ps;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "OS"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_os;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PR"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PR"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pr;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "OR"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OR"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_or;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PL"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PL"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pl;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "JI"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "JI"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_ji;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "LA"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "LA"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_la;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RPS"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrps;
-                       } else if (!strcasecmp(g_strstrip(typval[0]), "PC/ROS"))
+                       } else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/ROS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcros;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RPL"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPL"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrpl;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RJI"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RJI"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrji;
                        }
-                       else if (!strncasecmp(g_strstrip(typval[0]), "X-", 2))
+                       else if (!g_ascii_strncasecmp(g_strstrip(typval[0]), "X-", 2))
                        {
                                hf_string = hf_mgcp_param_connectionparam_x;
                        }
@@ -1998,95 +2002,95 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint
                typval = ep_strsplit(tokens[i], ":", 2);
                if ((typval[0] != NULL) && (typval[1] != NULL))
                {
-                       if (!strcasecmp(g_strstrip(typval[0]), "p"))
+                       if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "p"))
                        {
                                hf_uint = hf_mgcp_param_localconnoptions_p;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "a"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "a"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_a;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "s"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "s"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_s;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "e"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "e"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_e;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_scrtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_scrtcp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "b"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "b"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_b;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "es-ccd"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-ccd"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_esccd;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "es-cci"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-cci"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_escci;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-gi"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-gi"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqgi;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-rd"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rd"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqrd;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-ri"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-ri"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqri;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-rr"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rr"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqrr;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "k"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "k"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_k;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "gc"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "gc"))
                        {
                                hf_uint = hf_mgcp_param_localconnoptions_gc;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "fmtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "fmtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_fmtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "nt"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "nt"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_nt;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_ofmtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_r;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "t"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "t"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_t;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-cnf"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-cnf"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rcnf;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-dir"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-dir"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rdir;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-sh"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-sh"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rsh;
                        }
index fe2ceb393c5ea0d19434b3ad4588ae4779f75c3a..bbfcccd55f448c1dfa7add855ae89a7931d70ffd 100644 (file)
 
 #include "packet-imf.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Dissector table for media requiring special attention in multipart
  * encapsulation. */
 static dissector_table_t multipart_media_subdissector_table;
@@ -338,7 +342,7 @@ static char *find_parameter(char *parameters, const char *key, int *retlen)
                while ((*p) && isspace((guchar)*p))
                        p++; /* Skip white space */
                
-               if (strncasecmp(p, key, keylen) == 0)
+               if (g_ascii_strncasecmp(p, key, keylen) == 0)
                        break;
                /* Skip to next parameter */
                p = strchr(p, ';');
@@ -757,7 +761,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
 
                        if(content_encoding_str && remove_base64_encoding) {
 
-                               if(!strncasecmp(content_encoding_str, "base64", 6))
+                               if(!g_ascii_strncasecmp(content_encoding_str, "base64", 6))
                                        tmp_tvb = base64_decode(pinfo, tmp_tvb, filename ? filename : (typename ? typename : content_type_str));
 
                        }
@@ -915,11 +919,11 @@ is_known_multipart_header(const char *header_str, guint len)
 
        for (i = 1; i < array_length(multipart_headers); i++) {
                if (len == strlen(multipart_headers[i].name) &&
-                   strncasecmp(header_str, multipart_headers[i].name, len) == 0)
+                   g_ascii_strncasecmp(header_str, multipart_headers[i].name, len) == 0)
                        return i;
                if (multipart_headers[i].compact_name != NULL &&
                    len == strlen(multipart_headers[i].compact_name) &&
-                   strncasecmp(header_str, multipart_headers[i].compact_name, len) == 0)
+                   g_ascii_strncasecmp(header_str, multipart_headers[i].compact_name, len) == 0)
                        return i;
        }
 
index 0c7d799092d4ef14fae53bc4e0ceb475e1af6c83..996dfc921f204ba81db5f3919b6305d4ace50d92 100644 (file)
 #include <epan/strutil.h>
 #include "packet-tcp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define TCP_PORT_PVFS2 3334
 
 #define PVFS2_FH_LENGTH 8
@@ -1194,7 +1198,7 @@ dissect_pvfs_distribution(tvbuff_t *tvb, proto_tree *tree, int offset)
                total_len = roundup8(4 + distlen + 1);
 
                if (((distlen + 1) == PVFS_DIST_SIMPLE_STRIPE_NAME_SIZE) && 
-                               (strncasecmp(tmpstr, PVFS_DIST_SIMPLE_STRIPE_NAME, 
+                               (g_ascii_strncasecmp(tmpstr, PVFS_DIST_SIMPLE_STRIPE_NAME, 
                                                                 distlen) == 0))
                {
                        /* Parameter for 'simple_stripe' is 8 bytes */
index dc37d55dea4b3a3d3bb0b08dfb6bff1ce396c2e2..f6378280ca7ae36bc1572d4b491bd6b09fc34b2f 100644 (file)
 #include <epan/emem.h>
 #include <epan/expert.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 
 /* Version is the first 2 bits of the first octet*/
 #define RTCP_VERSION(octet)    ((octet) >> 6)
@@ -695,7 +699,7 @@ dissect_rtcp_app( tvbuff_t *tvb,packet_info *pinfo, int offset, proto_tree *tree
                               ascii_name );
 
        /* See if we can handle this application type */
-       if ( strncasecmp(ascii_name, poc1_app_name_str,4 ) == 0 )
+       if ( g_ascii_strncasecmp(ascii_name, poc1_app_name_str,4 ) == 0 )
        {
                /* PoC1 Application */
                guint8 t2timer_code, participants_code;
index 2a19b13c6fd9811afe2ba1be284d4aba3f781b0b..bbb90d833dd446de8ed216646c94969314a391e7 100644 (file)
 #include "packet-e164.h"
 #include <epan/emem.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static int proto_rtsp          = -1;
 
 static gint ett_rtsp           = -1;
@@ -346,7 +350,7 @@ is_rtsp_request_or_reply(const guchar *line, size_t linelen, rtsp_type_t *type)
        unsigned        ii;
 
        /* Is this an RTSP reply? */
-       if (linelen >= 5 && strncasecmp("RTSP/", line, 5) == 0) {
+       if (linelen >= 5 && g_ascii_strncasecmp("RTSP/", line, 5) == 0) {
                /*
                 * Yes.
                 */
@@ -362,7 +366,7 @@ is_rtsp_request_or_reply(const guchar *line, size_t linelen, rtsp_type_t *type)
        for (ii = 0; ii < RTSP_NMETHODS; ii++) {
                size_t len = strlen(rtsp_methods[ii]);
                if (linelen >= len &&
-                   strncasecmp(rtsp_methods[ii], line, len) == 0 &&
+                   g_ascii_strncasecmp(rtsp_methods[ii], line, len) == 0 &&
                    (len == linelen || isspace(line[len])))
                {
                        *type = RTSP_REQUEST;
@@ -412,11 +416,11 @@ rtsp_create_conversation(packet_info *pinfo, const guchar *line_begin,
                tmp++;
 
        /* Work out which transport type is here */
-       if (strncasecmp(tmp, rtsp_rtp, strlen(rtsp_rtp)) == 0)
+       if (g_ascii_strncasecmp(tmp, rtsp_rtp, strlen(rtsp_rtp)) == 0)
                rtp_transport = TRUE;
        else
-       if (strncasecmp(tmp, rtsp_real_rdt, strlen(rtsp_real_rdt)) == 0 ||
-           strncasecmp(tmp, rtsp_real_tng, strlen(rtsp_real_tng)) == 0)
+       if (g_ascii_strncasecmp(tmp, rtsp_real_rdt, strlen(rtsp_real_rdt)) == 0 ||
+           g_ascii_strncasecmp(tmp, rtsp_real_tng, strlen(rtsp_real_tng)) == 0)
                rdt_transport = TRUE;
        else
        {
@@ -914,7 +918,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
                         */
 #define HDR_MATCHES(header) \
        ( (size_t)linelen > STRLEN_CONST(header) && \
-        strncasecmp(line, (header), STRLEN_CONST(header)) == 0)
+        g_ascii_strncasecmp(line, (header), STRLEN_CONST(header)) == 0)
 
                        if (HDR_MATCHES(rtsp_transport))
                        {
@@ -1153,7 +1157,7 @@ process_rtsp_request(tvbuff_t *tvb, int offset, const guchar *data,
        for (ii = 0; ii < RTSP_NMETHODS; ii++) {
                size_t len = strlen(rtsp_methods[ii]);
                if (linelen >= len &&
-                   strncasecmp(rtsp_methods[ii], data, len) == 0 &&
+                   g_ascii_strncasecmp(rtsp_methods[ii], data, len) == 0 &&
                    (len == linelen || isspace(data[len])))
                        break;
        }
index 203a5bf09e43b1f6dfc80bc9c113fdcb9ad2939d..b2d15571b73ffa111c6e94263d6f6e9ef975e0d9 100644 (file)
 #include "tap.h"
 #include <epan/uat.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static Standard_Type decode_mtp3_standard;
 #define SCCP_SI 3
 
@@ -1272,7 +1276,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree,
              item = proto_tree_add_text(call_tree, tvb, offset - 1, ADDRESS_SSN_LENGTH, "Linked to %s", ssn_dissector_short_name);
              PROTO_ITEM_SET_GENERATED(item);
 
-             if (strncasecmp("TCAP", ssn_dissector_short_name, 4)== 0) {
+             if (g_ascii_strncasecmp("TCAP", ssn_dissector_short_name, 4)== 0) {
                      tcap_ssn_dissector = get_itu_tcap_subdissector(ssn);
 
                      if(tcap_ssn_dissector){
index 84da7bca63d4884f5d8f6661c0e426d31d07390e..0b7d0f67feee0ffefd30a506870d08015abcf65a 100644 (file)
 #include "packet-tcp.h"
 #include "packet-ssl.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define TCP_PORT_SIP 5060
 #define UDP_PORT_SIP 5060
 #define TLS_PORT_SIP 5061
@@ -1178,7 +1182,7 @@ dissect_sip_authorization_item(tvbuff_t *tvb, proto_tree *tree, gint start_offse
             i < array_length(auth_parameters_hf_array);
             i++, auth_parameter++)
        {
-               if (strcasecmp(name, auth_parameter->param_name) == 0)
+               if (g_ascii_strcasecmp(name, auth_parameter->param_name) == 0)
                {
                        proto_tree_add_item(tree, *(auth_parameter->hf_item), tvb,
                                            equals_offset+1, current_offset-equals_offset-1,
@@ -1222,7 +1226,7 @@ dissect_sip_reason_header(tvbuff_t *tvb, proto_tree *tree, gint start_offset, gi
                "Reason Protocols: %s", tvb_format_text(tvb, start_offset, length));
 
        param_name = tvb_get_ephemeral_string(tvb, start_offset, length);
-       if (strcasecmp(param_name, "Q.850") == 0){
+       if (g_ascii_strcasecmp(param_name, "Q.850") == 0){
                current_offset = tvb_find_guint8(tvb, semi_colon_offset, line_end_offset-semi_colon_offset, '=')+1;
                length = line_end_offset - current_offset;
 
@@ -1426,7 +1430,7 @@ static void dissect_sip_via_header(tvbuff_t *tvb, proto_tree *tree, gint start_o
                         i < array_length(via_parameters_hf_array);
                         i++, via_parameter++)
                {
-                       if (strcasecmp(param_name, via_parameter->param_name) == 0)
+                       if (g_ascii_strcasecmp(param_name, via_parameter->param_name) == 0)
                        {
                                if (equals_found)
                                {
index e6d3cd7f4061751fd9cfe5a52c9d04407702e81c..55286fc8d9548e617584efdd3b533ded2f14960a 100644 (file)
 #include <epan/emem.h>
 #include <epan/reassemble.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define TCP_PORT_SMTP 25
 
 static int proto_smtp = -1;
@@ -370,7 +374,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
          if (linelen >= 4 && ISALPHA(line[0]) && ISALPHA(line[1]) &&
              ISALPHA(line[2]) && ISALPHA(line[3]) &&
              (linelen == 4 || line[4] == ' ')) {
-           if (strncasecmp(line, "DATA", 4) == 0) {
+           if (g_ascii_strncasecmp(line, "DATA", 4) == 0) {
 
              /*
               * DATA command.
@@ -381,7 +385,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
              request_val->reading_data = TRUE;
              request_val->data_seen = TRUE;
 
-           } else if (strncasecmp(line, "BDAT", 4) == 0) {
+           } else if (g_ascii_strncasecmp(line, "BDAT", 4) == 0) {
 
              /*
               * BDAT command.
@@ -403,7 +407,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                request_val->reading_data = TRUE;
              }
 
-             if (strncasecmp(line+linelen-4, "LAST", 4) == 0) {
+             if (g_ascii_strncasecmp(line+linelen-4, "LAST", 4) == 0) {
                /*
                 * This is the last data chunk.
                 */
@@ -429,9 +433,9 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
            }
          } else {
-               if ((linelen >= 7) && line[0] == 'X' && ( (strncasecmp(line, "X-EXPS ", 7) == 0) ||
-                       ((linelen >=13) && (strncasecmp(line, "X-LINK2STATE ", 13) == 0)) || 
-                       ((linelen >= 8) && (strncasecmp(line, "XEXCH50 ", 8) == 0)) ))
+               if ((linelen >= 7) && line[0] == 'X' && ( (g_ascii_strncasecmp(line, "X-EXPS ", 7) == 0) ||
+                       ((linelen >=13) && (g_ascii_strncasecmp(line, "X-LINK2STATE ", 13) == 0)) || 
+                       ((linelen >= 8) && (g_ascii_strncasecmp(line, "XEXCH50 ", 8) == 0)) ))
                                frame_data->pdu_type = SMTP_PDU_CMD;
                else
            /*
index d631f58e3ed601081ae099b1eea57af6b2adb242..f944302ce3092290958f4cde2ab55e3ed11b8c89 100644 (file)
 #include <string.h>
 #include <epan/packet.h>
 #include "packet-sqloracle.h"
+
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define SWAP_UI16(ui16)        (((ui16)>>8 & 0xff) | ((ui16)<<8 & 0xff00))
 
 /* option flag 1 */
@@ -325,7 +330,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
        appMsg = (I8_P)m_pCurQuery;
 #endif
 
-       if (strncasecmp((I8_P)m_pCurQuery, "update", 6) == 0)
+       if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "update", 6) == 0)
        {
                m_numOfUpdate++;
 #if 0
@@ -334,7 +339,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                    m_pServerNode->m_numOfUpdate++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "select", 6) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "select", 6) == 0)
        {
                m_numOfSelect++;
 #if 0
@@ -343,7 +348,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                    m_pServerNode->m_numOfSelect++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "insert", 6) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "insert", 6) == 0)
        {
                m_numOfInsert++;
 #if 0
@@ -352,7 +357,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                        m_pServerNode->m_numOfInsert++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "delete", 6) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "delete", 6) == 0)
        {
                m_numOfDelete++;
 #if 0
@@ -361,7 +366,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                        m_pServerNode->m_numOfDelete++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "rollback", 8) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "rollback", 8) == 0)
        {
                m_numOfRollback++;
 #if 0
@@ -370,7 +375,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                        m_pServerNode->m_numOfRollback++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "set", 3) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "set", 3) == 0)
        {
                m_numOfSet++;
 #if 0
@@ -379,7 +384,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                        m_pServerNode->m_numOfSet++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "start", 5) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "start", 5) == 0)
        {
                m_numOfStart++;
 #if 0
@@ -388,7 +393,7 @@ static void ParseSqlStatement(/*char  *appMsg,*/ UI8_P pSqlData, UI16_T dataLen)
                        m_pServerNode->m_numOfStart++;
 #endif
        }
-       else if (strncasecmp((I8_P)m_pCurQuery, "commit", 6) == 0)
+       else if (g_ascii_strncasecmp((I8_P)m_pCurQuery, "commit", 6) == 0)
        {
                m_numOfCommit++;
 #if 0
index 29ec49183f5bee6b4284815ba380713238773dea..c8921313267abac4db1ad51e5c0eec4fcd735085 100644 (file)
 #include <epan/emem.h>
 #include <epan/expert.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Things we may want to remember for a whole conversation */
 typedef struct _tftp_conv_info_t {
        guint16 blocksize;
@@ -139,7 +143,7 @@ tftp_dissect_options(tvbuff_t *tvb, packet_info *pinfo, int offset,
          }
 
          /* Special code to handle individual options */
-         if (!strcasecmp((const char *)optionname, "blksize") &&
+         if (!g_ascii_strcasecmp((const char *)optionname, "blksize") &&
              opcode == TFTP_OACK) {
                gint blocksize = strtol((const char *)optionvalue, NULL, 10);
                if (blocksize < 8 || blocksize > 65464) {
index 670c7acbf4477d95931d2ec460ab9e10bcfc7074..b4d17b51ad66a6db7ccfa0e4fecbae98df9e2fe9 100644 (file)
 #include <epan/prefs.h>
 #include <epan/ipproto.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Forward declaration we need below */
 void proto_reg_handoff_tivoconnect(void);
 
@@ -126,39 +130,39 @@ dissect_tivoconnect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             *value++='\0';
             fieldlen=strlen(field)+1;
 
-            if ( strcasecmp(field,"tivoconnect") == 0 ) {
+            if ( g_ascii_strcasecmp(field,"tivoconnect") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_flavor, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
             }
-            else if ( strcasecmp(field,"method") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"method") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_method, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
             }
-            else if ( strcasecmp(field,"platform") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"platform") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_platform, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
             }
-            else if ( strcasecmp(field,"machine") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"machine") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_machine, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
                 packet_machine = value;
             }
-            else if ( strcasecmp(field,"identity") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"identity") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_identity, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
                 packet_identity = value;
             }
-            else if ( strcasecmp(field,"services") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"services") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_services, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
             }
-            else if ( strcasecmp(field,"swversion") == 0 ) {
+            else if ( g_ascii_strcasecmp(field,"swversion") == 0 ) {
                 proto_tree_add_item(tivoconnect_tree,
                     hf_tivoconnect_version, tvb, offset+fieldlen,
                     length-fieldlen-1, FALSE);
index 0440eeccf8df0ac424f88b271301c0e2b7798f31..72b69f963159aaac55f612b1dbc5cdfa82afd39f 100644 (file)
 #include "packet-x11-keysym.h" /* This contains the X11 value_string
                                * "keysym_vals_source" that VNC also uses. */
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static const value_string security_types_vs[] = {
        { 0,  "Invalid"  },
        { 1,  "None"     },
@@ -653,13 +657,13 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
                ti = proto_tree_add_string(tree, hf_vnc_vendor_code, tvb,
                                           offset, 4, vendor);
 
-               if(strcasecmp(vendor, "STDV") == 0)
+               if(g_ascii_strcasecmp(vendor, "STDV") == 0)
                        proto_item_append_text(ti, " (Standard VNC vendor)");
 
-               else if(strcasecmp(vendor, "TRDV") == 0)
+               else if(g_ascii_strcasecmp(vendor, "TRDV") == 0)
                        proto_item_append_text(ti, " (Tridia VNC vendor)");
 
-               else if(strcasecmp(vendor, "TGHT") == 0)
+               else if(g_ascii_strcasecmp(vendor, "TGHT") == 0)
                        proto_item_append_text(ti, " (Tight VNC vendor)");
                        
                offset += 4;
index 8040560202239fdacfb7fbc516d3f9b9c7ce2ebb..6a5e1580d491be4637ce4dc6dec1c12afd423181 100644 (file)
 /* We need the function tvb_get_guintvar() */
 #include "packet-wap.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* General-purpose debug logger.
  * Requires double parentheses because of variable arguments of printf().
  *
@@ -5983,7 +5987,7 @@ static const wbxml_decoding *get_wbxml_decoding_from_content_type (
                const wbxml_literal_list *item = content_type_list;
 
                while (item && item->content_type) {
-                       if (strcasecmp(content_type, item->content_type) == 0) {
+                       if (g_ascii_strcasecmp(content_type, item->content_type) == 0) {
                                /* Try the discriminator */
                                if (item->discriminator != NULL) {
                                        map = item->discriminator(tvb, offset);
index e5a6f410c0e833bd4a65503a94d93a680fcb65ef..76f1b538af4fe849e485a3bac6cd01cefef7f5c7 100644 (file)
 #include "packet-wap.h"
 #include "packet-wsp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* General-purpose debug logger.
  * Requires double parentheses because of variable arguments of printf().
  *
@@ -1795,7 +1799,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo)
                        } else {
                                /* Old-style X-WAP-TOD uses a non-textual value
                                 * after a textual header. */
-                               if (strcasecmp(hdr_str, "x-wap.tod") == 0) {
+                               if (g_ascii_strcasecmp(hdr_str, "x-wap.tod") == 0) {
                                        get_delta_seconds_value(val, tvb, val_start, val_len, ok);
                                        if (ok) {
                                                if (val == 0) {
@@ -5397,7 +5401,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                         * Content type is a string.
                                         */
                                        /*
-                                       if (strcasecmp(contentTypeStr, "application/vnd.wap.sia") == 0) {
+                                       if (g_ascii_strcasecmp(contentTypeStr, "application/vnd.wap.sia") == 0) {
                                                dissect_sir(tree, tmp_tvb);
                                        } else
                                        */
@@ -5586,25 +5590,25 @@ add_capabilities (proto_tree *tree, tvbuff_t *tvb, guint8 pdu_type)
                                return;
                        }
                        /* 2. Look up the string capability name */
-                       if (strcasecmp(capaName, "client-sdu-size") == 0) {
+                       if (g_ascii_strcasecmp(capaName, "client-sdu-size") == 0) {
                                peek = WSP_CAPA_CLIENT_SDU_SIZE;
-                       } else if (strcasecmp(capaName, "server-sdu-size") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "server-sdu-size") == 0) {
                                peek = WSP_CAPA_SERVER_SDU_SIZE;
-                       } else if (strcasecmp(capaName, "protocol options") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "protocol options") == 0) {
                                peek = WSP_CAPA_PROTOCOL_OPTIONS;
-                       } else if (strcasecmp(capaName, "method-mor") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "method-mor") == 0) {
                                peek = WSP_CAPA_METHOD_MOR;
-                       } else if (strcasecmp(capaName, "push-mor") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "push-mor") == 0) {
                                peek = WSP_CAPA_PUSH_MOR;
-                       } else if (strcasecmp(capaName, "extended methods") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "extended methods") == 0) {
                                peek = WSP_CAPA_EXTENDED_METHODS;
-                       } else if (strcasecmp(capaName, "header code pages") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "header code pages") == 0) {
                                peek = WSP_CAPA_HEADER_CODE_PAGES;
-                       } else if (strcasecmp(capaName, "aliases") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "aliases") == 0) {
                                peek = WSP_CAPA_ALIASES;
-                       } else if (strcasecmp(capaName, "client-message-size") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "client-message-size") == 0) {
                                peek = WSP_CAPA_CLIENT_MESSAGE_SIZE;
-                       } else if (strcasecmp(capaName, "server-message-size") == 0) {
+                       } else if (g_ascii_strcasecmp(capaName, "server-message-size") == 0) {
                                peek = WSP_CAPA_SERVER_MESSAGE_SIZE;
                        } else {
                                DebugLog(("add_capabilities(): unknown capability '%s' at offset %u\n",
@@ -5855,7 +5859,7 @@ add_post_data (proto_tree *tree, tvbuff_t *tvb, guint contentType,
        }
 
        if ( (contentTypeStr == NULL && contentType == 0x12)
-                       || (contentTypeStr && (strcasecmp(contentTypeStr,
+                       || (contentTypeStr && (g_ascii_strcasecmp(contentTypeStr,
                                                "application/x-www-form-urlencoded") == 0)) )
        {
                if (tree) {
index 10522105df4dbf3b4b8cec91222837fe5cce1e94..f204b5ec1538c38353d1a3c6e70f7bb92534eb16 100644 (file)
 #include <epan/prefs.h>
 #include <epan/garrayfix.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 typedef struct _xml_ns_t {
     /* the name of this namespace */
        gchar* name;
@@ -1151,7 +1155,7 @@ static void init_xml_names(void) {
                    filename = GETFNAME_OP(file);
 
                    namelen = strlen(filename);
-                   if ( namelen > 4 && ( g_strcasecmp(filename+(namelen-4),".dtd")  == 0 ) ) {
+                   if ( namelen > 4 && ( g_ascii_strcasecmp(filename+(namelen-4),".dtd")  == 0 ) ) {
                        GString* errors = g_string_new("");
                        GString* preparsed = dtd_preparse(dirname, filename, errors);
                        dtd_build_data_t* dtd_data;
index c29040ca6235056c8cd67372a254be1d1776cef0..6749dfb5567b20e045b10846e99eaa4f3fdd0f56 100644 (file)
 #include "dtd_parse.h"
 #include "dtd_parse_lex.h"
        
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
        struct _proto_xmlpi_attr {
                gchar* name;
                void (*act)(gchar*);
@@ -80,7 +84,7 @@
        static void set_media_type (gchar* val) { if(build_data->media_type) g_free(build_data->media_type); build_data->media_type = g_strdup(val); }
        static void set_proto_root (gchar* val) { if(build_data->proto_root) g_free(build_data->proto_root); build_data->proto_root = g_strdup(val); }
        static void set_description (gchar* val) { if(build_data->description) g_free(build_data->description); build_data->description = g_strdup(val); }
-       static void set_recursive (gchar* val) { build_data->recursion = ( g_strcasecmp(val,"yes") == 0 ) ? TRUE : FALSE; }
+       static void set_recursive (gchar* val) { build_data->recursion = ( g_ascii_strcasecmp(val,"yes") == 0 ) ? TRUE : FALSE; }
 
        static struct _proto_xmlpi_attr proto_attrs[] =
        {
@@ -228,7 +232,7 @@ squoted        ['][^\']*[']
        gboolean got_it = FALSE;
        
        for(pa = proto_attrs; pa->name; pa++) {
-               if (g_strcasecmp(attr_name,pa->name) == 0) {
+               if (g_ascii_strcasecmp(attr_name,pa->name) == 0) {
                        pa->act(yytext);
                        got_it = TRUE;
                        break;
diff --git a/epan/g_ascii_strcasecmp.c b/epan/g_ascii_strcasecmp.c
new file mode 100644 (file)
index 0000000..1607a22
--- /dev/null
@@ -0,0 +1,120 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GLib Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/. 
+ */
+
+/*
+ * $Id$
+ *
+ * "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from
+ * GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]).
+ */
+
+#include "g_ascii_strcasecmp.h"
+
+#define ISUPPER(c)             ((c) >= 'A' && (c) <= 'Z')
+#define ISLOWER(c)             ((c) >= 'a' && (c) <= 'z')
+#define        TOUPPER(c)              (ISLOWER (c) ? (c) - 'a' + 'A' : (c))
+#define        TOLOWER(c)              (ISUPPER (c) ? (c) - 'A' + 'a' : (c))
+
+/**
+ * g_ascii_strcasecmp:
+ * @s1: string to compare with @s2.
+ * @s2: string to compare with @s1.
+ * 
+ * Compare two strings, ignoring the case of ASCII characters.
+ *
+ * Unlike the BSD strcasecmp() function, this only recognizes standard
+ * ASCII letters and ignores the locale, treating all non-ASCII
+ * characters as if they are not letters.
+ * 
+ * Return value: an integer less than, equal to, or greater than
+ *               zero if @s1 is found, respectively, to be less than,
+ *               to match, or to be greater than @s2.
+ **/
+gint
+g_ascii_strcasecmp (const gchar *s1,
+                   const gchar *s2)
+{
+  gint c1, c2;
+
+  g_return_val_if_fail (s1 != NULL, 0);
+  g_return_val_if_fail (s2 != NULL, 0);
+
+  while (*s1 && *s2)
+    {
+      c1 = (gint)(guchar) TOLOWER (*s1);
+      c2 = (gint)(guchar) TOLOWER (*s2);
+      if (c1 != c2)
+       return (c1 - c2);
+      s1++; s2++;
+    }
+
+  return (((gint)(guchar) *s1) - ((gint)(guchar) *s2));
+}
+
+/**
+ * g_ascii_strncasecmp:
+ * @s1: string to compare with @s2.
+ * @s2: string to compare with @s1.
+ * @n:  number of characters to compare.
+ * 
+ * Compare @s1 and @s2, ignoring the case of ASCII characters and any
+ * characters after the first @n in each string.
+ *
+ * Unlike the BSD strcasecmp() function, this only recognizes standard
+ * ASCII letters and ignores the locale, treating all non-ASCII
+ * characters as if they are not letters.
+ * 
+ * Return value: an integer less than, equal to, or greater than zero
+ *               if the first @n bytes of @s1 is found, respectively,
+ *               to be less than, to match, or to be greater than the
+ *               first @n bytes of @s2.
+ **/
+gint
+g_ascii_strncasecmp (const gchar *s1,
+                    const gchar *s2,
+                    gsize n)
+{
+  gint c1, c2;
+
+  g_return_val_if_fail (s1 != NULL, 0);
+  g_return_val_if_fail (s2 != NULL, 0);
+
+  while (n && *s1 && *s2)
+    {
+      n -= 1;
+      c1 = (gint)(guchar) TOLOWER (*s1);
+      c2 = (gint)(guchar) TOLOWER (*s2);
+      if (c1 != c2)
+       return (c1 - c2);
+      s1++; s2++;
+    }
+
+  if (n)
+    return (((gint) (guchar) *s1) - ((gint) (guchar) *s2));
+  else
+    return 0;
+}
+
diff --git a/epan/g_ascii_strcasecmp.h b/epan/g_ascii_strcasecmp.h
new file mode 100644 (file)
index 0000000..0562173
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * $Id$
+ *
+ * "g_ascii_strcasecmp()" and "g_ascii_strncasecmp()" extracted from
+ * GLib 2.4.8, for use with GLibs that don't have it (e.g., GLib 1.2[.x]).
+ */
+
+#ifndef __WIRESHARK_G_ASCII_STRCASECMP_H__
+#define __WIRESHARK_G_ASCII_STRCASECMP_H__
+
+extern gint g_ascii_strcasecmp (const gchar *s1,
+                               const gchar *s2);
+
+extern gint g_ascii_strncasecmp (const gchar *s1,
+                                const gchar *s2,
+                                gsize n);
+
+#endif
index e447aed95c2e2d7fef1f3bbf294dff5afd8d8042..684d1494d5fd75f1ef8c98860cb6935052e86b22 100644 (file)
 #include <epan/prefs-int.h>
 #include <epan/uat-int.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /* Internal functions */
 static module_t *find_subtree(module_t *parent, const char *name);
 static module_t *prefs_register_module_or_subtree(module_t *parent,
@@ -120,7 +124,7 @@ module_compare_name(gconstpointer p1_arg, gconstpointer p2_arg)
        const module_t *p1 = p1_arg;
        const module_t *p2 = p2_arg;
 
-       return g_strcasecmp(p1->name, p2->name);
+       return g_ascii_strcasecmp(p1->name, p2->name);
 }
 
 static gint
@@ -129,7 +133,7 @@ module_compare_title(gconstpointer p1_arg, gconstpointer p2_arg)
        const module_t *p1 = p1_arg;
        const module_t *p2 = p2_arg;
 
-       return g_strcasecmp(p1->title, p2->title);
+       return g_ascii_strcasecmp(p1->title, p2->title);
 }
 
 /*
@@ -1016,12 +1020,12 @@ find_val_for_string(const char *needle, const enum_val_t *haystack,
        int i;
 
        for (i = 0; haystack[i].name != NULL; i++) {
-               if (strcasecmp(needle, haystack[i].name) == 0) {
+               if (g_ascii_strcasecmp(needle, haystack[i].name) == 0) {
                        return haystack[i].value;
                }
        }
        for (i = 0; haystack[i].name != NULL; i++) {
-               if (strcasecmp(needle, haystack[i].description) == 0) {
+               if (g_ascii_strcasecmp(needle, haystack[i].description) == 0) {
                        return haystack[i].value;
                }
        }
@@ -1764,28 +1768,28 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
     prefs.st_server_bg.green = GREEN_COMPONENT(cval);
     prefs.st_server_bg.blue  = BLUE_COMPONENT(cval);
   } else if (strcmp(pref_name, PRS_GUI_SCROLLBAR_ON_RIGHT) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_scrollbar_on_right = TRUE;
     }
     else {
            prefs.gui_scrollbar_on_right = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_PLIST_SEL_BROWSE) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_plist_sel_browse = TRUE;
     }
     else {
            prefs.gui_plist_sel_browse = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_PTREE_SEL_BROWSE) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_ptree_sel_browse = TRUE;
     }
     else {
            prefs.gui_ptree_sel_browse = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_ALTERN_COLORS) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
             prefs.gui_altern_colors = TRUE;
     }
     else {
@@ -1801,7 +1805,7 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
     prefs.gui_hex_dump_highlight_style =
        find_index_from_string_array(value, gui_hex_dump_highlight_style_text, 1);
   } else if (strcmp(pref_name, PRS_GUI_FILTER_TOOLBAR_IN_STATUSBAR) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
             prefs.filter_toolbar_show_in_statusbar = TRUE;
     }
     else {
@@ -1843,21 +1847,21 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
       g_free(prefs.gui_colorized_bg);
     prefs.gui_colorized_bg = g_strdup(value);
   } else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_POSITION) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_geometry_save_position = TRUE;
     }
     else {
            prefs.gui_geometry_save_position = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_SIZE) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_geometry_save_size = TRUE;
     }
     else {
            prefs.gui_geometry_save_size = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_GEOMETRY_SAVE_MAXIMIZED) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_geometry_save_maximized = TRUE;
     }
     else {
@@ -1889,21 +1893,21 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
   } else if (strcmp(pref_name, PRS_GUI_FILEOPEN_PREVIEW) == 0) {
     prefs.gui_fileopen_preview = strtoul(value, NULL, 10);
   } else if (strcmp(pref_name, PRS_GUI_ASK_UNSAVED) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_ask_unsaved = TRUE;
     }
     else {
            prefs.gui_ask_unsaved = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_FIND_WRAP) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_find_wrap = TRUE;
     }
     else {
            prefs.gui_find_wrap = FALSE;
     }
   } else if (strcmp(pref_name, PRS_GUI_USE_PREF_SAVE) == 0) {
-    if (strcasecmp(value, "true") == 0) {
+    if (g_ascii_strcasecmp(value, "true") == 0) {
            prefs.gui_use_pref_save = TRUE;
     }
     else {
@@ -1950,13 +1954,13 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
       g_free(prefs.capture_devices_hide);
     prefs.capture_devices_hide = g_strdup(value);
   } else if (strcmp(pref_name, PRS_CAP_PROM_MODE) == 0) {
-    prefs.capture_prom_mode = ((strcasecmp(value, "true") == 0)?TRUE:FALSE);
+    prefs.capture_prom_mode = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
   } else if (strcmp(pref_name, PRS_CAP_REAL_TIME) == 0) {
-    prefs.capture_real_time = ((strcasecmp(value, "true") == 0)?TRUE:FALSE);
+    prefs.capture_real_time = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
   } else if (strcmp(pref_name, PRS_CAP_AUTO_SCROLL) == 0) {
-    prefs.capture_auto_scroll = ((strcasecmp(value, "true") == 0)?TRUE:FALSE);
+    prefs.capture_auto_scroll = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
   } else if (strcmp(pref_name, PRS_CAP_SHOW_INFO) == 0) {
-    prefs.capture_show_info = ((strcasecmp(value, "true") == 0)?TRUE:FALSE);
+    prefs.capture_show_info = ((g_ascii_strcasecmp(value, "true") == 0)?TRUE:FALSE);
 
 /* handle the global options */
   } else if (strcmp(pref_name, PRS_NAME_RESOLVE) == 0 ||
@@ -1967,9 +1971,9 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
      *
      * Otherwise, we treat it as a list of name types we want to resolve.
      */
-    if (strcasecmp(value, "true") == 0)
+    if (g_ascii_strcasecmp(value, "true") == 0)
       prefs.name_resolve = RESOLV_ALL;
-    else if (strcasecmp(value, "false") == 0)
+    else if (g_ascii_strcasecmp(value, "false") == 0)
       prefs.name_resolve = RESOLV_NONE;
     else {
       prefs.name_resolve = RESOLV_NONE;        /* start out with none set */
@@ -2231,7 +2235,7 @@ set_pref(gchar *pref_name, gchar *value, void *private_data _U_)
 
     case PREF_BOOL:
       /* XXX - give an error if it's neither "true" nor "false"? */
-      if (strcasecmp(value, "true") == 0)
+      if (g_ascii_strcasecmp(value, "true") == 0)
         bval = TRUE;
       else
         bval = FALSE;
index 02a0555c11dc2686e4a4fbb9941ec731099b7cef..48d567c447d7fd54503ae550a3740a08f184880c 100644 (file)
 #include "emem.h"
 #include "charsets.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define SUBTREE_ONCE_ALLOCATION_NUMBER 8
 #define SUBTREE_MAX_LEVELS 256
 
@@ -303,7 +307,7 @@ proto_compare_name(gconstpointer p1_arg, gconstpointer p2_arg)
        const protocol_t *p1 = p1_arg;
        const protocol_t *p2 = p2_arg;
 
-       return g_strcasecmp(p1->short_name, p2->short_name);
+       return g_ascii_strcasecmp(p1->short_name, p2->short_name);
 }
 
 
index e1267a37e84b7d909eac4c54b9ea6d5b22591c21..99bee6705d97d61fadd26eee60c923b01cd471be 100644 (file)
 
 #include <epan/req_resp_hdrs.h>
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /*
  * Optionally do reassembly of the request/response line, headers, and body.
  */
@@ -171,7 +175,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, const int offset, packet_info *pinfo,
                                                while(*header_val==' '){
                                                        header_val++;
                                                }
-                                               if(!strncasecmp(header_val, "Keep-Alive", 10)){
+                                               if(!g_ascii_strncasecmp(header_val, "Keep-Alive", 10)){
                                                        keepalive_found = TRUE;
                                                }
                                        }
@@ -196,7 +200,7 @@ req_resp_hdrs_do_reassembly(tvbuff_t *tvb, const int offset, packet_info *pinfo,
                                            (*p == ' ' || *p == '\t'))
                                                p++;
                                        if (p <= header_val + len) {
-                                               if (strncasecmp(p, "chunked", 7)
+                                               if (g_ascii_strncasecmp(p, "chunked", 7)
                                                    == 0) {
                                                        /*
                                                         * Don't bother looking
index ea72e67c45c19685d3362bdd06f5f7498f4e013f..baef77cfd8e926fdf6cb3064de43f051f4ddab48 100644 (file)
 #include <wchar.h>
 #endif
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
                              '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
 
@@ -1039,7 +1043,7 @@ epan_strcasestr(const char *haystack, const char *needle)
        gsize nlen = strlen(needle);
 
        while (hlen-- >= nlen) {
-               if (!g_strncasecmp(haystack, needle, nlen))
+               if (!g_ascii_strncasecmp(haystack, needle, nlen))
                        return (char*) haystack;
                haystack++;
        }
index a4c658ede92ca11e547911dbd9622c56b667f6fe..a7a315684a0fa37f5be1f0a098fe566323ddd17a 100644 (file)
 #include "emem.h"
 #include "proto.h"     /* XXX - only used for DISSECTOR_ASSERT, probably a new header file? */
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 static const guint8*
 ensure_contiguous_no_exception(tvbuff_t *tvb, gint offset, gint length,
                int *exception);
@@ -1877,8 +1881,8 @@ tvb_strneql(tvbuff_t *tvb, gint offset, const gchar *str, gint size)
 }
 
 /*
- * Call strncasecmp after checking if enough chars left, returning 0 if
- * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
+ * Call g_ascii_strncasecmp after checking if enough chars left, returning
+ * 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
  */
 gint
 tvb_strncaseeql(tvbuff_t *tvb, gint offset, const gchar *str, gint size)
@@ -1888,7 +1892,7 @@ tvb_strncaseeql(tvbuff_t *tvb, gint offset, const gchar *str, gint size)
        ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL);
 
        if (ptr) {
-               int cmp = strncasecmp((const char *)ptr, str, size);
+               int cmp = g_ascii_strncasecmp((const char *)ptr, str, size);
 
                /*
                 * Return 0 if equal, -1 otherwise.
index 6b06c210ee19fe8e6d42d1b2d577c53109709acb..b8f7e62206ac378e38ba7e5f6ff515c0afe7704a 100644 (file)
 #include <epan/guid-utils.h>
 #include "exceptions.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /** @file
  * "testy, virtual(-izable) buffer".  They are testy in that they get mad when
  * an attempt is made to access data beyond the bounds of their array. In that
@@ -560,8 +564,8 @@ extern gint tvb_strneql(tvbuff_t *tvb, gint offset, const gchar *str,
     gint size);
 
 /**
- * Call strncasecmp after checking if enough chars left, returning 0 if
- * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
+ * Call g_ascii_strncasecmp after checking if enough chars left, returning
+ * 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
  */
 extern gint tvb_strncaseeql(tvbuff_t *tvb, gint offset, const gchar *str,
     gint size);
index 1616efc55ced54c682a25ba02d485c9cfbeb349a..6a0997dae6c32612a15182c55d34a75d2102fce3 100644 (file)
 
 #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);
index 92316761e3dae927e42d4bc3f0252ea420f0200d..cd65a1f230d6e07b10f22674cb410670382a0221 100644 (file)
 
 #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);
index dcbfc7685eca04a738b0020c755572210e99b56b..066465118341f4ff316a66a9724e514bc5899aa6 100644 (file)
 #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;
   }
index 1beacd4994b482e77198fcfaa8395cf7794b4fbc..1f46cced77caccbcbba0e798e640b4d91aa8c0d2 100644 (file)
 #include "decode_as_ber.h"
 #include "help_dlg.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #undef DEBUG
 
 /**************************************************/
index 16625f1571ca5148d6bb82f5a3dafd60c18d13f6..520095b0f6240b10c867c6501cf2794069c92576 100644 (file)
 #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
index e7b7cbc6479c4df706e074fdd412352528cb7615..375c301dc566b8e67c810d95b212e4f70f18fffa 100644 (file)
 /* 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 {
index 72677903b43bd1c9f9465db8df30e4cf9b8ac542..0228bfa0524e9888deb101b00396f3da342b4737 100644 (file)
 /* 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)
             {
index 48bb9da317afb31c3f253c40997c00f6e7e2f6f0..f9f7c673d4a532deb440fbb26b28d881cdadfd23 100644 (file)
 #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 ||
index 62af80364297ee99280ac0abc88e0331878c43db..5daa8d38955f7c72dd01b39723017732015d24fa 100644 (file)
 #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 {
index 9447f60207522cfc4545aea46d9843d16db73094..e6da8c72ac12fb1c9dfedb0eab508312cc9e5fd6 100644 (file)
 #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;
index 361cd2807af67103baa0c72e28611ee579f8b504..5dfa13f26eb5a441071e3c3b146451c9dd5d4785 100644 (file)
 #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 {
index 9ffb9e3afbcb577d8dffbd03e2429d91d56e0841..ace4ca206d7694741282ddefae87c50bf50b9f46 100644 (file)
 #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;
        }
 
index 01390be224595225e9e1b04774ec750016bf0497..6a47ef5b301497189167a517543bfd46af34a41b 100644 (file)
 #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
index 870e0d6e3085c31b7268dcba27841dd576decc28..85f6db015eccdc1d59e78c6d9c24ee4ba6fd20ed 100644 (file)
 #include <epan/tap.h>
 #include "packet-mgcp.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define TCP_PORT_MGCP_GATEWAY 2427
 #define UDP_PORT_MGCP_GATEWAY 2427
 #define TCP_PORT_MGCP_CALLAGENT 2727
@@ -960,16 +964,16 @@ static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const g
        /* Read the string into 'word' and see if it looks like the start of a verb */
        if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), word))
        {
-               if (((strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
-                   ((strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
-                   ((strncasecmp(word, "MDCX", 4) == 0) && (*verb_name = "ModifyConnection")) ||
-                   ((strncasecmp(word, "DLCX", 4) == 0) && (*verb_name = "DeleteConnection")) ||
-                   ((strncasecmp(word, "RQNT", 4) == 0) && (*verb_name = "NotificationRequest")) ||
-                   ((strncasecmp(word, "NTFY", 4) == 0) && (*verb_name = "Notify")) ||
-                   ((strncasecmp(word, "AUEP", 4) == 0) && (*verb_name = "AuditEndpoint")) ||
-                   ((strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
-                   ((strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
-                   ((strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
+               if (((g_ascii_strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
+                   ((g_ascii_strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
+                   ((g_ascii_strncasecmp(word, "MDCX", 4) == 0) && (*verb_name = "ModifyConnection")) ||
+                   ((g_ascii_strncasecmp(word, "DLCX", 4) == 0) && (*verb_name = "DeleteConnection")) ||
+                   ((g_ascii_strncasecmp(word, "RQNT", 4) == 0) && (*verb_name = "NotificationRequest")) ||
+                   ((g_ascii_strncasecmp(word, "NTFY", 4) == 0) && (*verb_name = "Notify")) ||
+                   ((g_ascii_strncasecmp(word, "AUEP", 4) == 0) && (*verb_name = "AuditEndpoint")) ||
+                   ((g_ascii_strncasecmp(word, "AUCX", 4) == 0) && (*verb_name = "AuditConnection")) ||
+                   ((g_ascii_strncasecmp(word, "RSIP", 4) == 0) && (*verb_name = "RestartInProgress")) ||
+                   ((g_ascii_strncasecmp(word, "MESG", 4) == 0) && (*verb_name = "Message")) ||
                    (word[0] == 'X' && is_rfc2234_alpha(word[1]) && is_rfc2234_alpha(word[2]) &&
                                       is_rfc2234_alpha(word[3]) && (*verb_name = "*Experimental*")))
                {
@@ -1852,50 +1856,50 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse
                typval = ep_strsplit(tokens[i], "=", 2);
                if ((typval[0] != NULL) && (typval[1] != NULL))
                {
-                       if (!strcasecmp(g_strstrip(typval[0]), "PS"))
+                       if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_ps;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "OS"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_os;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PR"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PR"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pr;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "OR"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "OR"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_or;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PL"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PL"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pl;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "JI"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "JI"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_ji;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "LA"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "LA"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_la;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RPS"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrps;
-                       } else if (!strcasecmp(g_strstrip(typval[0]), "PC/ROS"))
+                       } else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/ROS"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcros;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RPL"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RPL"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrpl;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "PC/RJI"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "PC/RJI"))
                        {
                                hf_uint = hf_mgcp_param_connectionparam_pcrji;
                        }
-                       else if (!strncasecmp(g_strstrip(typval[0]), "X-", 2))
+                       else if (!g_ascii_strncasecmp(g_strstrip(typval[0]), "X-", 2))
                        {
                                hf_string = hf_mgcp_param_connectionparam_x;
                        }
@@ -1966,95 +1970,95 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint
                typval = ep_strsplit(tokens[i], ":", 2);
                if ((typval[0] != NULL) && (typval[1] != NULL))
                {
-                       if (!strcasecmp(g_strstrip(typval[0]), "p"))
+                       if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "p"))
                        {
                                hf_uint = hf_mgcp_param_localconnoptions_p;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "a"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "a"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_a;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "s"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "s"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_s;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "e"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "e"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_e;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_scrtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "sc-rtcp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_scrtcp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "b"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "b"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_b;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "es-ccd"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-ccd"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_esccd;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "es-cci"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "es-cci"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_escci;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-gi"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-gi"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqgi;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-rd"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rd"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqrd;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-ri"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-ri"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqri;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "dq-rr"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "dq-rr"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_dqrr;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "k"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "k"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_k;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "gc"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "gc"))
                        {
                                hf_uint = hf_mgcp_param_localconnoptions_gc;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "fmtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "fmtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_fmtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "nt"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "nt"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_nt;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "o-fmtp"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_ofmtp;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_r;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "t"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "t"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_t;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-cnf"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-cnf"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rcnf;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-dir"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-dir"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rdir;
                        }
-                       else if (!strcasecmp(g_strstrip(typval[0]), "r-sh"))
+                       else if (!g_ascii_strcasecmp(g_strstrip(typval[0]), "r-sh"))
                        {
                                hf_string = hf_mgcp_param_localconnoptions_rsh;
                        }
index 964ad13f357f7485de7d13d0fcfb1b3f91f4ff22..59d41d92d7566f9dc990136abf1b83a384ceaba8 100644 (file)
 #include "epan/dissectors/packet-mgcp.h"
 #include "timestats.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 #define NUM_TIMESTATS 11
 
 /* used to keep track of the statistics for an entire program interface */
@@ -105,31 +109,31 @@ mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
 
                        time_stat_update(&(ms->rtd[0]),&delta, pinfo);
 
-                       if (strncasecmp(mi->code, "EPCF", 4) == 0 ) {
+                       if (g_ascii_strncasecmp(mi->code, "EPCF", 4) == 0 ) {
                                time_stat_update(&(ms->rtd[1]),&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[2]),&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[3]),&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[4]),&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[5]),&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[6]),&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[7]),&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[8]),&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[9]),&delta, pinfo);
                        }
                        else {
diff --git a/util.c b/util.c
index 80fe8d8f1eb3937e5bc70a6d443aa73b27d4ad21..2adede418d136c1636497f1737d03350ff7a6330 100644 (file)
--- a/util.c
+++ b/util.c
 
 #include "util.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "g_ascii_strcasecmp.h"
+#endif
+
 /*
  * Collect command-line arguments as a string consisting of the arguments,
  * separated by spaces.
@@ -163,7 +167,7 @@ const gchar *get_conn_cfilter(void) {
                        "and tcp port %s)", tokens[1], host_ip_af(tokens[0]), tokens[0], tokens[2]);
                return filter_str->str;
        } else if ((env = getenv("REMOTEHOST")) != NULL) {
-               if (strcasecmp(env, "localhost") == 0 || strcmp(env, "127.0.0.1") == 0) {
+               if (g_ascii_strcasecmp(env, "localhost") == 0 || strcmp(env, "127.0.0.1") == 0) {
                        return "";
                }
                g_string_sprintf(filter_str, "not %s host %s", host_ip_af(env), env);
@@ -219,7 +223,7 @@ const gchar *get_conn_cfilter(void) {
                        pprotocol = p;
 
                        /* Is it TCP? */
-                       if (p - lastp != 3 || strncasecmp(lastp, "tcp", 3) != 0)
+                       if (p - lastp != 3 || g_ascii_strncasecmp(lastp, "tcp", 3) != 0)
                                return "";      /* not TCP */
                        p++;                    /* skip the '/' */
                } else
@@ -269,7 +273,7 @@ const gchar *get_conn_cfilter(void) {
                         * XXX - compare against our host name?
                         * _X11TransConnectDisplay() does.
                         */
-                       if (strcasecmp(phostname, "localhost") == 0 ||
+                       if (g_ascii_strcasecmp(phostname, "localhost") == 0 ||
                            strcmp(phostname, "127.0.0.1") == 0) {
                                g_free(phostname);
                                return "";
@@ -310,7 +314,7 @@ const gchar *get_conn_cfilter(void) {
                 * XXX - There's a better way to do this described at
                 * http://www.microsoft.com/technet/archive/termsrv/maintain/featusability/tsrvapi.mspx?mfr=true
                 */
-               if (g_strncasecmp(env, "rdp", 3) == 0) {
+               if (g_ascii_strncasecmp(env, "rdp", 3) == 0) {
                        g_string_sprintf(filter_str, "not tcp port 3389");
                        return filter_str->str;
                }