aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
committerGuy Harris <guy@alum.mit.edu>2007-11-27 18:52:51 +0000
commit9c89cdaaa3eccfe74d4e17705f38508c640b5047 (patch)
tree593646c7e1eb44302243659672c5fc691f0d4272 /epan/dissectors
parenta189f34b84345d6851a489c484c01c1bf21f56d1 (diff)
strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-3com-njack.c6
-rw-r--r--epan/dissectors/packet-afp.c12
-rw-r--r--epan/dissectors/packet-cigi.c12
-rw-r--r--epan/dissectors/packet-diameter.c41
-rw-r--r--epan/dissectors/packet-edonkey.c6
-rw-r--r--epan/dissectors/packet-giop.c6
-rw-r--r--epan/dissectors/packet-http.c14
-rw-r--r--epan/dissectors/packet-ieee80211.c6
-rw-r--r--epan/dissectors/packet-ipsec.c8
-rw-r--r--epan/dissectors/packet-megaco.c6
-rw-r--r--epan/dissectors/packet-mgcp.c94
-rw-r--r--epan/dissectors/packet-multipart.c12
-rw-r--r--epan/dissectors/packet-pvfs2.c6
-rw-r--r--epan/dissectors/packet-rtcp.c6
-rw-r--r--epan/dissectors/packet-rtsp.c18
-rw-r--r--epan/dissectors/packet-sccp.c6
-rw-r--r--epan/dissectors/packet-sip.c10
-rw-r--r--epan/dissectors/packet-smtp.c16
-rw-r--r--epan/dissectors/packet-sqloracle.c21
-rw-r--r--epan/dissectors/packet-tftp.c6
-rw-r--r--epan/dissectors/packet-tivoconnect.c18
-rw-r--r--epan/dissectors/packet-vnc.c10
-rw-r--r--epan/dissectors/packet-wbxml.c6
-rw-r--r--epan/dissectors/packet-wsp.c30
-rw-r--r--epan/dissectors/packet-xml.c6
25 files changed, 252 insertions, 130 deletions
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index cc0334880a..724b47852c 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -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;
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index 149ce22a42..4b0ad27405 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -41,6 +41,10 @@
#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;
}
diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c
index d0db7ef365..dc062c827a 100644
--- a/epan/dissectors/packet-cigi.c
+++ b/epan/dissectors/packet-cigi.c
@@ -42,6 +42,10 @@
#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";
}
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 129c887327..d235b9d99d 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -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);
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index e7b13be61d..0826364d89 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -45,6 +45,10 @@
#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++;
}
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 584b2c2eb8..8a0cc319c1 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -303,6 +303,10 @@
#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 */
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 55c989a99b..a06f628c6f 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -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,
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 4f7130d65b..ba664e225d 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -89,6 +89,10 @@
#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;
}
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 567096c22e..06c709cfeb 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -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;
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 8a4e2f3e64..e8a498f098 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -67,6 +67,10 @@
#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;
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index 5d8fa91678..6a21fd211f 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -47,6 +47,10 @@
#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;
}
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index fe2ceb393c..bbfcccd55f 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -73,6 +73,10 @@
#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;
}
diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c
index 0c7d799092..996dfc921f 100644
--- a/epan/dissectors/packet-pvfs2.c
+++ b/epan/dissectors/packet-pvfs2.c
@@ -48,6 +48,10 @@
#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 */
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c
index dc37d55dea..f6378280ca 100644
--- a/epan/dissectors/packet-rtcp.c
+++ b/epan/dissectors/packet-rtcp.c
@@ -67,6 +67,10 @@
#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;
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index 2a19b13c6f..bbb90d833d 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -48,6 +48,10 @@
#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;
}
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 203a5bf09e..b2d15571b7 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -56,6 +56,10 @@
#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){
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index 84da7bca63..0b7d0f67fe 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -66,6 +66,10 @@
#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)
{
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index e6d3cd7f40..55286fc8d9 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -42,6 +42,10 @@
#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
/*
diff --git a/epan/dissectors/packet-sqloracle.c b/epan/dissectors/packet-sqloracle.c
index d631f58e3e..f944302ce3 100644
--- a/epan/dissectors/packet-sqloracle.c
+++ b/epan/dissectors/packet-sqloracle.c
@@ -33,6 +33,11 @@
#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
diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c
index 29ec49183f..c892131326 100644
--- a/epan/dissectors/packet-tftp.c
+++ b/epan/dissectors/packet-tftp.c
@@ -51,6 +51,10 @@
#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) {
diff --git a/epan/dissectors/packet-tivoconnect.c b/epan/dissectors/packet-tivoconnect.c
index 670c7acbf4..b4d17b51ad 100644
--- a/epan/dissectors/packet-tivoconnect.c
+++ b/epan/dissectors/packet-tivoconnect.c
@@ -51,6 +51,10 @@
#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);
diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c
index 0440eeccf8..72b69f9631 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -59,6 +59,10 @@
#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;
diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c
index 8040560202..6a5e1580d4 100644
--- a/epan/dissectors/packet-wbxml.c
+++ b/epan/dissectors/packet-wbxml.c
@@ -62,6 +62,10 @@
/* 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);
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index e5a6f410c0..76f1b538af 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -59,6 +59,10 @@
#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) {
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 10522105df..f204b5ec15 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -54,6 +54,10 @@
#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;