summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-02-17 17:21:25 -0800
committerGuy Harris <guy@alum.mit.edu>2015-02-18 01:23:42 +0000
commit909d891b267852d386f0e47cb4ccd818b7f99176 (patch)
treee3035c13d3b6bf8fec8bfd793d0e8d65d5eea500
parentb10bad126a7bb605216badebce6f4ba30eef0106 (diff)
downloadwireshark-909d891b267852d386f0e47cb4ccd818b7f99176.tar.gz
Some additional UAT update callback changes.
I guess the signature mismatch must just be a warning with Clang; it's not with MSVC. Change-Id: Ic1f4cb88471f7e13019e891f111978310dfada73 Reviewed-on: https://code.wireshark.org/review/7225 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--asn1/ldap/packet-ldap-template.c9
-rw-r--r--asn1/snmp/packet-snmp-template.c7
-rw-r--r--epan/dissectors/packet-ldap.c17
-rw-r--r--epan/dissectors/packet-snmp.c13
4 files changed, 25 insertions, 21 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 423b9f1549..77c4b8f485 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -406,7 +406,7 @@ static guint num_attribute_types = 0;
static GHashTable* attribute_types_hash = NULL;
-static void
+static gboolean
attribute_types_update_cb(void *r, char **err)
{
attribute_type_t *rec = (attribute_type_t *)r;
@@ -414,13 +414,13 @@ attribute_types_update_cb(void *r, char **err)
if (rec->attribute_type == NULL) {
*err = g_strdup("Attribute type can't be empty");
- return;
+ return FALSE;
}
g_strstrip(rec->attribute_type);
if (rec->attribute_type[0] == 0) {
*err = g_strdup("Attribute type can't be empty");
- return;
+ return FALSE;
}
/* Check for invalid characters (to avoid asserting out when
@@ -429,10 +429,11 @@ attribute_types_update_cb(void *r, char **err)
c = proto_check_field_name(rec->attribute_type);
if (c) {
*err = g_strdup_printf("Attribute type can't contain '%c'", c);
- return;
+ return FALSE;
}
*err = NULL;
+ return TRUE;
}
static void *
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 222ffc3ead..cf2d8b7bfe 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -1368,7 +1368,7 @@ snmp_users_free_cb(void* p)
g_free(ue->engine.data);
}
-static void
+static gboolean
snmp_users_update_cb(void* p _U_, char** err)
{
snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p;
@@ -1379,7 +1379,7 @@ snmp_users_update_cb(void* p _U_, char** err)
if (num_ueas == 0)
/* Nothing to update */
- return;
+ return FALSE;
if (! ue->user.userName.len)
g_string_append_printf(es,"no userName\n");
@@ -1414,9 +1414,10 @@ snmp_users_update_cb(void* p _U_, char** err)
if (es->len) {
es = g_string_truncate(es,es->len-1);
*err = g_string_free(es, FALSE);
+ return FALSE;
}
- return;
+ return TRUE;
}
static void
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 49ae9276fe..cac8af7414 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -620,7 +620,7 @@ static guint num_attribute_types = 0;
static GHashTable* attribute_types_hash = NULL;
-static void
+static gboolean
attribute_types_update_cb(void *r, char **err)
{
attribute_type_t *rec = (attribute_type_t *)r;
@@ -628,13 +628,13 @@ attribute_types_update_cb(void *r, char **err)
if (rec->attribute_type == NULL) {
*err = g_strdup("Attribute type can't be empty");
- return;
+ return FALSE;
}
g_strstrip(rec->attribute_type);
if (rec->attribute_type[0] == 0) {
*err = g_strdup("Attribute type can't be empty");
- return;
+ return FALSE;
}
/* Check for invalid characters (to avoid asserting out when
@@ -643,10 +643,11 @@ attribute_types_update_cb(void *r, char **err)
c = proto_check_field_name(rec->attribute_type);
if (c) {
*err = g_strdup_printf("Attribute type can't contain '%c'", c);
- return;
+ return FALSE;
}
*err = NULL;
+ return TRUE;
}
static void *
@@ -3806,7 +3807,7 @@ static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_inf
/*--- End of included file: packet-ldap-fn.c ---*/
-#line 882 "../../asn1/ldap/packet-ldap-template.c"
+#line 883 "../../asn1/ldap/packet-ldap-template.c"
static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) {
int offset = 0;
@@ -5699,7 +5700,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ldap-hfarr.c ---*/
-#line 2206 "../../asn1/ldap/packet-ldap-template.c"
+#line 2207 "../../asn1/ldap/packet-ldap-template.c"
};
/* List of subtrees */
@@ -5773,7 +5774,7 @@ void proto_register_ldap(void) {
&ett_ldap_T_warning,
/*--- End of included file: packet-ldap-ettarr.c ---*/
-#line 2220 "../../asn1/ldap/packet-ldap-template.c"
+#line 2221 "../../asn1/ldap/packet-ldap-template.c"
};
/* UAT for header fields */
static uat_field_t custom_attribute_types_uat_fields[] = {
@@ -5939,7 +5940,7 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
-#line 2369 "../../asn1/ldap/packet-ldap-template.c"
+#line 2370 "../../asn1/ldap/packet-ldap-template.c"
}
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index 7499c575ea..01377388ed 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -1470,7 +1470,7 @@ snmp_users_free_cb(void* p)
g_free(ue->engine.data);
}
-static void
+static gboolean
snmp_users_update_cb(void* p _U_, char** err)
{
snmp_ue_assoc_t* ue = (snmp_ue_assoc_t*)p;
@@ -1481,7 +1481,7 @@ snmp_users_update_cb(void* p _U_, char** err)
if (num_ueas == 0)
/* Nothing to update */
- return;
+ return FALSE;
if (! ue->user.userName.len)
g_string_append_printf(es,"no userName\n");
@@ -1516,9 +1516,10 @@ snmp_users_update_cb(void* p _U_, char** err)
if (es->len) {
es = g_string_truncate(es,es->len-1);
*err = g_string_free(es, FALSE);
+ return FALSE;
}
- return;
+ return TRUE;
}
static void
@@ -3076,7 +3077,7 @@ static int dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
/*--- End of included file: packet-snmp-fn.c ---*/
-#line 1864 "../../asn1/snmp/packet-snmp-template.c"
+#line 1865 "../../asn1/snmp/packet-snmp-template.c"
guint
@@ -3898,7 +3899,7 @@ void proto_register_snmp(void) {
NULL, HFILL }},
/*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 2421 "../../asn1/snmp/packet-snmp-template.c"
+#line 2422 "../../asn1/snmp/packet-snmp-template.c"
};
/* List of subtrees */
@@ -3938,7 +3939,7 @@ void proto_register_snmp(void) {
&ett_snmp_RReqPDU_U,
/*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 2437 "../../asn1/snmp/packet-snmp-template.c"
+#line 2438 "../../asn1/snmp/packet-snmp-template.c"
};
static ei_register_info ei[] = {
{ &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }},