summaryrefslogtreecommitdiff
path: root/asn1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-19 21:22:31 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-19 21:22:31 +0000
commit7c56677cf9e703e6dde30529b24e27dd2a4960a9 (patch)
tree5d78d22112806bca22edbc8e069f77503269b381 /asn1
parentb8481499646f07512ceddac567887072822dffdb (diff)
downloadwireshark-7c56677cf9e703e6dde30529b24e27dd2a4960a9.tar.gz
From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48429
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ansi_tcap/packet-ansi_tcap-template.c2
-rw-r--r--asn1/camel/packet-camel-template.c4
-rw-r--r--asn1/h225/h225.cnf4
-rw-r--r--asn1/h248/h248.cnf2
-rw-r--r--asn1/h248/packet-h248-template.c9
-rw-r--r--asn1/h323/packet-h323-template.c4
-rw-r--r--asn1/kerberos/packet-kerberos-template.c13
-rw-r--r--asn1/ocsp/ocsp.cnf4
-rw-r--r--asn1/pkix1explicit/pkix1explicit.cnf4
-rw-r--r--asn1/pres/packet-pres-template.c10
-rw-r--r--asn1/q932/packet-q932-template.c6
-rw-r--r--asn1/qsig/packet-qsig-template.c6
-rw-r--r--asn1/ranap/ranap.cnf6
-rw-r--r--asn1/rrc/packet-rrc-template.c2
-rw-r--r--asn1/s1ap/s1ap.cnf2
15 files changed, 36 insertions, 42 deletions
diff --git a/asn1/ansi_tcap/packet-ansi_tcap-template.c b/asn1/ansi_tcap/packet-ansi_tcap-template.c
index 9a5497d0f9..2f31674f37 100644
--- a/asn1/ansi_tcap/packet-ansi_tcap-template.c
+++ b/asn1/ansi_tcap/packet-ansi_tcap-template.c
@@ -236,7 +236,7 @@ find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U
}
/* The hash string needs to contain src and dest to distiguish differnt flows */
- buf = ep_alloc(MAX_TID_STR_LEN);
+ buf = (char *)ep_alloc(MAX_TID_STR_LEN);
buf[0] = '\0';
/* Reverse order to invoke */
g_snprintf(buf, MAX_TID_STR_LEN, "%s%s%s",
diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c
index 6a6599442c..6a500dc418 100644
--- a/asn1/camel/packet-camel-template.c
+++ b/asn1/camel/packet-camel-template.c
@@ -336,10 +336,10 @@ dissect_camel_camelPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn
opcode = 0;
application_context_version = 0;
if (actx->pinfo->private_data != NULL){
- p_private_tcap=actx->pinfo->private_data;
+ p_private_tcap=(struct tcap_private_t *)actx->pinfo->private_data;
if (p_private_tcap->acv==TRUE ){
- version_ptr = strrchr(p_private_tcap->oid,'.');
+ version_ptr = strrchr((char *)p_private_tcap->oid,'.');
if (version_ptr)
application_context_version = atoi(version_ptr+1);
}
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf
index 6f4845cc59..5e2420a00b 100644
--- a/asn1/h225/h225.cnf
+++ b/asn1/h225/h225.cnf
@@ -544,11 +544,11 @@ IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
%(ACTX)s->value_ptr = &guid_tvb;
%(DEFAULT_BODY)s
if (guid_tvb)
- tvb_get_ntohguid(guid_tvb, 0, call_id_guid = ep_alloc(sizeof(e_guid_t)));
+ tvb_get_ntohguid(guid_tvb, 0, call_id_guid = ep_new(e_guid_t));
%(ACTX)s->value_ptr = NULL;
#.END
#----------------------------------------------------------------------------------------
-#.FN_PARS GloballyUniqueID VAL_PTR = %(ACTX)s->value_ptr
+#.FN_PARS GloballyUniqueID VAL_PTR = (tvbuff_t **)%(ACTX)s->value_ptr
#----------------------------------------------------------------------------------------
#.FN_PARS RequestSeqNum VAL_PTR = &(h225_pi->requestSeqNum)
#----------------------------------------------------------------------------------------
diff --git a/asn1/h248/h248.cnf b/asn1/h248/h248.cnf
index 2981f51acb..4f632d49f1 100644
--- a/asn1/h248/h248.cnf
+++ b/asn1/h248/h248.cnf
@@ -339,7 +339,7 @@ AuditReplyV1/auditResult audit_result
curr_info.term->type = 0; /* unknown */
if (curr_info.term->len) {
- curr_info.term->buffer = ep_tvb_memdup(new_tvb,0,curr_info.term->len);
+ curr_info.term->buffer = (guint8 *)ep_tvb_memdup(new_tvb,0,curr_info.term->len);
curr_info.term->str = bytes_to_str(curr_info.term->buffer,curr_info.term->len);
}
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c
index c7ec114d58..b5e13761e2 100644
--- a/asn1/h248/packet-h248-template.c
+++ b/asn1/h248/packet-h248-template.c
@@ -88,7 +88,6 @@ static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}};
#include "packet-h248-ett.c"
-static dissector_handle_t h248_term_handle;
static dissector_table_t subdissector_table;
static emem_tree_t* msgs = NULL;
@@ -877,7 +876,7 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
s_h248_package_t *s_find_package_id(guint16 pkgid) {
s_h248_package_t *s_pkg = NULL;
- s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid)));
+ s_pkg = (s_h248_package_t *)g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid)));
return s_pkg;
}
@@ -894,7 +893,7 @@ static gint32 comparePkgID(gconstpointer a, gconstpointer b) {
gboolean is_pkg_default(guint16 pkgid) {
s_h248_package_t *s_pkg = NULL;
- s_pkg = g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid)));
+ s_pkg = (s_h248_package_t *)g_tree_lookup(packages, GUINT_TO_POINTER((guint32)(pkgid)));
if(! s_pkg ) return TRUE;
return s_pkg->is_default;
}
@@ -912,7 +911,7 @@ void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action)
while (base_package_name_vals[i].strptr != NULL) {
pkg_found = g_new0(h248_package_t, 1); /* create a h248 package structure */
pkg_found->id = base_package_name_vals[i].value;
- vst = wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*2);
+ vst = (value_string *)wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*2);
vst[0].strptr = base_package_name_vals[i].strptr;
pkg_found->param_names = vst;
pkg_found->hfid = &hf_h248_pkg_name;
@@ -925,7 +924,7 @@ void h248_register_package(const h248_package_t* pkg, pkg_reg_action reg_action)
j++;
};
if (idx < j) {
- vst = wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*(j-idx+1));
+ vst = (value_string *)wmem_alloc0(wmem_epan_scope(), sizeof(value_string)*(j-idx+1));
for (k=0;idx<j;k++) {
vst[k].strptr = base_event_name_vals[idx].strptr;
vst[k].value = (base_event_name_vals[idx].value & 0xffff);
diff --git a/asn1/h323/packet-h323-template.c b/asn1/h323/packet-h323-template.c
index 0a243d7cd6..cece8c4901 100644
--- a/asn1/h323/packet-h323-template.c
+++ b/asn1/h323/packet-h323-template.c
@@ -43,7 +43,7 @@
gef_ctx_t* gef_ctx_alloc(gef_ctx_t *parent, const gchar *type) {
gef_ctx_t *gefx;
- gefx = ep_alloc0(sizeof(gef_ctx_t));
+ gefx = ep_new0(gef_ctx_t);
gefx->signature = GEF_CTX_SIGNATURE;
gefx->parent = parent;
gefx->type = type;
@@ -62,7 +62,7 @@ gef_ctx_t* gef_ctx_get(void *ptr) {
actx = NULL;
if (actx)
- gefx = actx->private_data;
+ gefx = (gef_ctx_t *)actx->private_data;
if (!gef_ctx_check_signature(gefx))
gefx = NULL;
diff --git a/asn1/kerberos/packet-kerberos-template.c b/asn1/kerberos/packet-kerberos-template.c
index da5f26fc0d..56ea8ddb71 100644
--- a/asn1/kerberos/packet-kerberos-template.c
+++ b/asn1/kerberos/packet-kerberos-template.c
@@ -843,18 +843,13 @@ g_warning("woohoo decrypted keytype:%d in frame:%u\n", keytype, pinfo->fd->num);
#define KRB5_TD_REQ_NONCE 107
#define KRB5_TD_REQ_SEQ 108
/* preauthentication types >127 (i.e. negative ones) are app specific.
- Hopefully there will be no collisions here or we will have to
- come up with something better.
- XXX: Although KRB5_PA_PAC_REQUEST is " >127 " and thus presumably
- would be encoded as a negative number, various captures seen all
- have this pa-data-type encoded as a positive number (0x0080).
- We'll assume that KRB5_PA_S4U2SELF is also encoded as a positive number.
+ however since Microsoft is the dominant(only?) user of types in this range
+ we also treat the type as unsigned.
*/
#define KRB5_PA_PAC_REQUEST 128 /* (Microsoft extension) */
-#define KRB5_PA_S4U2SELF 129 /* Impersonation (Microsoft extension) */
+#define KRB5_PA_FOR_USER 129 /* Impersonation (Microsoft extension) See [MS-SFU] */
#define KRB5_PA_PROV_SRV_LOCATION 0xffffffff /* (gint32)0xFF) packetcable stuff */
-
/* Principal name-type */
#define KRB5_NT_UNKNOWN 0
#define KRB5_NT_PRINCIPAL 1
@@ -1095,7 +1090,7 @@ static const value_string krb5_preauthentication_types[] = {
{ KRB5_TD_REQ_NONCE , "TD-REQ-NONCE" },
{ KRB5_TD_REQ_SEQ , "TD-REQ-SEQ" },
{ KRB5_PA_PAC_REQUEST , "PA-PAC-REQUEST" },
- { KRB5_PA_S4U2SELF , "PA-S4U2SELF" },
+ { KRB5_PA_FOR_USER , "PA-FOR-USER" },
{ KRB5_PA_PROV_SRV_LOCATION , "PA-PROV-SRV-LOCATION" },
{ 0 , NULL },
};
diff --git a/asn1/ocsp/ocsp.cnf b/asn1/ocsp/ocsp.cnf
index 537880d372..134c7e2a32 100644
--- a/asn1/ocsp/ocsp.cnf
+++ b/asn1/ocsp/ocsp.cnf
@@ -35,12 +35,12 @@ ServiceLocator B "1.3.6.1.5.5.7.48.1.7" "id-pkix-ocsp-service-locator"
FN_VARIANT = _str HF_INDEX = hf_ocsp_responseType_id VAL_PTR = &responseType_id
#.FN_BODY ResponseBytes/response
- gint8 class;
+ gint8 appclass;
gboolean pc, ind;
gint32 tag;
guint32 len;
/* skip past the T and L */
- offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
+ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree);
diff --git a/asn1/pkix1explicit/pkix1explicit.cnf b/asn1/pkix1explicit/pkix1explicit.cnf
index ccd8f8b8f2..fab977e840 100644
--- a/asn1/pkix1explicit/pkix1explicit.cnf
+++ b/asn1/pkix1explicit/pkix1explicit.cnf
@@ -53,12 +53,12 @@ ASIdentifiers B "1.3.6.1.5.5.7.1.8" "id-pe-autonomousSysIds"
FN_VARIANT = _str HF_INDEX = hf_pkix1explicit_object_identifier_id VAL_PTR = &object_identifier_id
#.FN_BODY Extension/extnValue
- gint8 class;
+ gint8 appclass;
gboolean pc, ind;
gint32 tag;
guint32 len;
/* skip past the T and L */
- offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
+ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index 2a3fb99a68..dc6872daf6 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -139,7 +139,7 @@ register_ctx_id_and_oid(packet_info *pinfo _U_, guint32 idx, const char *oid)
return;
}
- pco=se_alloc(sizeof(pres_ctx_oid_t));
+ pco=se_new(pres_ctx_oid_t);
pco->ctx_id=idx;
pco->oid=se_strdup(oid);
conversation=find_conversation (pinfo->fd->num, &pinfo->src, &pinfo->dst,
@@ -203,8 +203,8 @@ find_oid_by_pres_ctx_id(packet_info *pinfo, guint32 idx)
static void *
pres_copy_cb(void *dest, const void *orig, size_t len _U_)
{
- pres_user_t *u = dest;
- const pres_user_t *o = orig;
+ pres_user_t *u = (pres_user_t *)dest;
+ const pres_user_t *o = (const pres_user_t *)orig;
u->ctx_id = o->ctx_id;
u->oid = g_strdup(o->oid);
@@ -215,7 +215,7 @@ pres_copy_cb(void *dest, const void *orig, size_t len _U_)
static void
pres_free_cb(void *r)
{
- pres_user_t *u = r;
+ pres_user_t *u = (pres_user_t *)r;
g_free(u->oid);
}
@@ -411,7 +411,7 @@ void proto_register_pres(void) {
sizeof(pres_user_t),
"pres_context_list",
TRUE,
- (void*) &pres_users,
+ (void**) &pres_users,
&num_pres_users,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"ChPresContextList",
diff --git a/asn1/q932/packet-q932-template.c b/asn1/q932/packet-q932-template.c
index a16a08cdb5..ab22f07751 100644
--- a/asn1/q932/packet-q932-template.c
+++ b/asn1/q932/packet-q932-template.c
@@ -135,7 +135,7 @@ static const value_string str_nd[] = {
/*--- dissect_q932_facility_ie -------------------------------------------------------*/
/*static*/ void
dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int length) {
- gint8 class;
+ gint8 appclass;
gboolean pc;
gint32 tag;
guint32 len;
@@ -148,11 +148,11 @@ dissect_q932_facility_ie(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
offset++;
while (offset < ie_end) {
hoffset = offset;
- offset = get_ber_identifier(tvb, offset, &class, &pc, &tag);
+ offset = get_ber_identifier(tvb, offset, &appclass, &pc, &tag);
offset = get_ber_length(tvb, offset, &len, NULL);
eoffset = offset + len;
next_tvb = tvb_new_subset(tvb, hoffset, eoffset - hoffset, eoffset - hoffset);
- switch (class) {
+ switch (appclass) {
case BER_CLASS_CON:
switch (tag) {
case 10 : /* Network Facility Extension */
diff --git a/asn1/qsig/packet-qsig-template.c b/asn1/qsig/packet-qsig-template.c
index 583a7977e4..beb5c4fe3a 100644
--- a/asn1/qsig/packet-qsig-template.c
+++ b/asn1/qsig/packet-qsig-template.c
@@ -387,7 +387,7 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
opcode = rctx->d.code_local;
op_ptr = get_op(opcode);
} else if (rctx->d.code == 1) { /* global */
- op_ptr = g_hash_table_lookup(qsig_oid2op_hashtable, rctx->d.code_global);
+ op_ptr = (qsig_op_t *)g_hash_table_lookup(qsig_oid2op_hashtable, rctx->d.code_global);
if (op_ptr) opcode = op_ptr->opcode;
} else {
return offset;
@@ -603,7 +603,7 @@ static void qsig_init_tables(void) {
for (i=0; i<array_length(qsig_op_tab); i++) {
opcode = qsig_op_tab[i].opcode;
oid = g_strdup_printf("1.3.12.9.%d", opcode);
- key = g_malloc(sizeof(gint));
+ key = (gint *)g_malloc(sizeof(gint));
*key = opcode;
g_hash_table_insert(qsig_opcode2oid_hashtable, key, oid);
g_hash_table_insert(qsig_oid2op_hashtable, g_strdup(oid), (gpointer)&qsig_op_tab[i]);
@@ -692,7 +692,7 @@ void proto_reg_handoff_qsig(void) {
dissector_add_uint("q932.ros.local.arg", qsig_op_tab[i].opcode, qsig_arg_handle);
dissector_add_uint("q932.ros.local.res", qsig_op_tab[i].opcode, qsig_res_handle);
key = qsig_op_tab[i].opcode;
- oid = g_hash_table_lookup(qsig_opcode2oid_hashtable, &key);
+ oid = (const gchar *)g_hash_table_lookup(qsig_opcode2oid_hashtable, &key);
if (oid) {
dissector_add_string("q932.ros.global.arg", oid, qsig_arg_handle);
dissector_add_string("q932.ros.global.res", oid, qsig_res_handle);
diff --git a/asn1/ranap/ranap.cnf b/asn1/ranap/ranap.cnf
index 25f8e9096e..38b243c7c7 100644
--- a/asn1/ranap/ranap.cnf
+++ b/asn1/ranap/ranap.cnf
@@ -118,7 +118,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
static const asn1_par_def_t ProtocolIE_ContainerList_pars[] = {
{ "lowerBound", ASN1_PAR_INTEGER },
{ "upperBound", ASN1_PAR_INTEGER },
- { NULL, 0 }
+ { NULL, (asn1_par_type)0 }
};
asn1_stack_frame_check(actx, "ProtocolIE-ContainerList", ProtocolIE_ContainerList_pars);
#.END
@@ -134,7 +134,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
static const asn1_par_def_t ProtocolIE_ContainerPairList_pars[] = {
{ "lowerBound", ASN1_PAR_INTEGER },
{ "upperBound", ASN1_PAR_INTEGER },
- { NULL, 0 }
+ { NULL, (asn1_par_type)0 }
};
asn1_stack_frame_check(actx, "ProtocolIE-ContainerPairList", ProtocolIE_ContainerPairList_pars);
#.END
@@ -201,7 +201,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
&& ! actx->pinfo->sccp_info->data.co.assoc->calling_party ) {
guint len = tvb_length(imsi_tvb);
- guint8* bytes = ep_tvb_memdup(imsi_tvb,0,len);
+ guint8* bytes = (guint8 *)ep_tvb_memdup(imsi_tvb,0,len);
actx->pinfo->sccp_info->data.co.assoc->calling_party =
se_strdup_printf("IMSI: %%s", bytes_to_str(bytes, len) );
diff --git a/asn1/rrc/packet-rrc-template.c b/asn1/rrc/packet-rrc-template.c
index bf993433b9..984df58ef3 100644
--- a/asn1/rrc/packet-rrc-template.c
+++ b/asn1/rrc/packet-rrc-template.c
@@ -193,7 +193,7 @@ dissect_rrc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct rrc_info *rrcinf;
top_tree = tree;
- rrcinf = p_get_proto_data(pinfo->fd, proto_rrc);
+ rrcinf = (struct rrc_info *)p_get_proto_data(pinfo->fd, proto_rrc);
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
diff --git a/asn1/s1ap/s1ap.cnf b/asn1/s1ap/s1ap.cnf
index e4dc19424b..2e5d4d950e 100644
--- a/asn1/s1ap/s1ap.cnf
+++ b/asn1/s1ap/s1ap.cnf
@@ -131,7 +131,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
static const asn1_par_def_t ProtocolIE_ContainerList_pars[] = {
{ "lowerBound", ASN1_PAR_INTEGER },
{ "upperBound", ASN1_PAR_INTEGER },
- { NULL, 0 }
+ { NULL, (asn1_par_type)0 }
};
asn1_stack_frame_check(actx, "ProtocolIE-ContainerList", ProtocolIE_ContainerList_pars);
#.END