diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-03-14 06:45:23 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-03-14 06:45:23 +0000 |
commit | 44be81ba93b822dd5f2173d232b936ff4740f7f5 (patch) | |
tree | e7e9ac0c306dfd5d240fc8949ef207da1516c1d3 /epan/dissectors/packet-rpc.c | |
parent | 672a54c1561824419f317dd7817e12df81d17525 (diff) |
From beroset:
changed implicit casts to explicit and substituted se_new for se_alloc
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416
svn path=/trunk/; revision=48288
Diffstat (limited to 'epan/dissectors/packet-rpc.c')
-rw-r--r-- | epan/dissectors/packet-rpc.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 61ceacd1db..5111fcbf2e 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -343,7 +343,7 @@ rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table, * program. */ rpc_prog_key.prog = prog; - rpc_prog = g_hash_table_lookup(rpc_progs, &rpc_prog_key); + rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs, &rpc_prog_key); DISSECTOR_ASSERT(rpc_prog != NULL); rpc_prog->procedure_hfs = g_array_set_size(rpc_prog->procedure_hfs, vers); @@ -380,7 +380,7 @@ rpc_proc_name(guint32 prog, guint32 vers, guint32 proc) key.vers = vers; key.proc = proc; - if ((value = g_hash_table_lookup(rpc_procs,&key)) != NULL) + if ((value = (rpc_proc_info_value *)g_hash_table_lookup(rpc_procs,&key)) != NULL) procname = (char *)value->name; else { /* happens only with strange program versions or @@ -451,7 +451,7 @@ rpc_prog_hf(guint32 prog, guint32 vers) rpc_prog_info_value *rpc_prog; rpc_prog_key.prog = prog; - if ((rpc_prog = g_hash_table_lookup(rpc_progs,&rpc_prog_key))) { + if ((rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs,&rpc_prog_key))) { return g_array_index(rpc_prog->procedure_hfs, int, vers); } return -1; @@ -468,7 +468,7 @@ rpc_prog_name(guint32 prog) rpc_prog_info_value *rpc_prog; rpc_prog_key.prog = prog; - if ((rpc_prog = g_hash_table_lookup(rpc_progs,&rpc_prog_key)) == NULL) { + if ((rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs,&rpc_prog_key)) == NULL) { progname = "Unknown"; } else { @@ -643,7 +643,7 @@ dissect_rpc_opaque_data(tvbuff_t *tvb, int offset, if (string_data) { string_buffer = tvb_get_ephemeral_string(tvb, data_offset, string_length_copy); } else { - string_buffer = tvb_memcpy(tvb, ep_alloc(string_length_copy+1), data_offset, string_length_copy); + string_buffer = (char *)tvb_memcpy(tvb, ep_alloc(string_length_copy+1), data_offset, string_length_copy); } string_buffer[string_length_copy] = '\0'; /* calculate a nice printable string */ @@ -948,7 +948,7 @@ dissect_rpc_authgss_context(proto_tree *tree, tvbuff_t *tvb, int offset, tkey[1].length = 0; tkey[1].key = NULL; - context_info = se_tree_lookup32_array(authgss_contexts, &tkey[0]); + context_info = (gssauth_context_info_t *)se_tree_lookup32_array(authgss_contexts, &tkey[0]); if(context_info == NULL) { tvb_memcpy(tvb, key, context_offset, context_length); tkey[0].length = 4; @@ -956,7 +956,7 @@ dissect_rpc_authgss_context(proto_tree *tree, tvbuff_t *tvb, int offset, tkey[1].length = 0; tkey[1].key = NULL; - context_info = se_alloc(sizeof(gssauth_context_info_t)); + context_info = se_new(gssauth_context_info_t); context_info->create_frame = 0; context_info->destroy_frame = 0; se_tree_insert32_array(authgss_contexts, &tkey[0], context_info); @@ -1560,7 +1560,7 @@ dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, key.prog = prog; key.vers = vers; key.proc = proc; - if ((value = g_hash_table_lookup(rpc_procs,&key)) != NULL) { + if ((value = (rpc_proc_info_value *)g_hash_table_lookup(rpc_procs,&key)) != NULL) { dissect_function = value->dissect_call; /* Keep track of the address whence the call came, and the @@ -1618,12 +1618,12 @@ dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* * Do we already have a state structure for this conv */ - rpc_conv_info = conversation_get_proto_data(conversation, proto_rpc); + rpc_conv_info = (rpc_conv_info_t *)conversation_get_proto_data(conversation, proto_rpc); if (!rpc_conv_info) { /* No. Attach that information to the conversation, and add * it to the list of information structures. */ - rpc_conv_info = se_alloc(sizeof(rpc_conv_info_t)); + rpc_conv_info = se_new(rpc_conv_info_t); rpc_conv_info->xids=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rpc_xids"); conversation_add_proto_data(conversation, proto_rpc, rpc_conv_info); @@ -1640,13 +1640,13 @@ dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, as such, the XID is at offset 0 in this tvbuff. */ /* look up the request */ xid = tvb_get_ntohl(tvb, offset); - rpc_call = se_tree_lookup32(rpc_conv_info->xids, xid); + rpc_call = (rpc_call_info_value *)se_tree_lookup32(rpc_conv_info->xids, xid); if (rpc_call == NULL) { /* We didn't find it; create a new entry. Prepare the value data. Not all of it is needed for handling indirect calls, so we set a bunch of items to 0. */ - rpc_call = se_alloc(sizeof(rpc_call_info_value)); + rpc_call = se_new(rpc_call_info_value); rpc_call->req_num = 0; rpc_call->rep_num = 0; rpc_call->prog = prog; @@ -1750,19 +1750,19 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* * Do we already have a state structure for this conv */ - rpc_conv_info = conversation_get_proto_data(conversation, proto_rpc); + rpc_conv_info = (rpc_conv_info_t *)conversation_get_proto_data(conversation, proto_rpc); if (!rpc_conv_info) { /* No. Attach that information to the conversation, and add * it to the list of information structures. */ - rpc_conv_info = se_alloc(sizeof(rpc_conv_info_t)); + rpc_conv_info = se_new(rpc_conv_info_t); rpc_conv_info->xids=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rpc_xids"); conversation_add_proto_data(conversation, proto_rpc, rpc_conv_info); } /* The XIDs of the call and reply must match. */ xid = tvb_get_ntohl(tvb, 0); - rpc_call = se_tree_lookup32(rpc_conv_info->xids, xid); + rpc_call = (rpc_call_info_value *)se_tree_lookup32(rpc_conv_info->xids, xid); if (rpc_call == NULL) { /* The XID doesn't match a call from that conversation, so it's probably not an RPC reply. @@ -2005,7 +2005,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, version=tvb_get_ntohl(tvb, offset+16); make_fake_rpc_prog_if_needed (&rpc_prog_key, version); } - if( (rpc_prog = g_hash_table_lookup(rpc_progs, &rpc_prog_key)) == NULL) { + if( (rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs, &rpc_prog_key)) == NULL) { /* They're not, so it's probably not an RPC call. */ return FALSE; } @@ -2055,12 +2055,12 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* * Do we already have a state structure for this conv */ - rpc_conv_info = conversation_get_proto_data(conversation, proto_rpc); + rpc_conv_info = (rpc_conv_info_t *)conversation_get_proto_data(conversation, proto_rpc); if (!rpc_conv_info) { /* No. Attach that information to the conversation, and add * it to the list of information structures. */ - rpc_conv_info = se_alloc(sizeof(rpc_conv_info_t)); + rpc_conv_info = se_new(rpc_conv_info_t); rpc_conv_info->xids=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rpc_xids"); conversation_add_proto_data(conversation, proto_rpc, rpc_conv_info); @@ -2068,7 +2068,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* The XIDs of the call and reply must match. */ xid = tvb_get_ntohl(tvb, offset); - rpc_call = se_tree_lookup32(rpc_conv_info->xids, xid); + rpc_call = (rpc_call_info_value *)se_tree_lookup32(rpc_conv_info->xids, xid); if (rpc_call == NULL) { /* The XID doesn't match a call from that conversation, so it's probably not an RPC reply. */ @@ -2080,7 +2080,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* in parse-partials, so define a dummy conversation for this reply */ - rpc_call = se_alloc(sizeof(rpc_call_info_value)); + rpc_call = se_new(rpc_call_info_value); rpc_call->req_num = 0; rpc_call->rep_num = pinfo->fd->num; rpc_call->prog = 0; @@ -2197,7 +2197,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, key.vers = vers; key.proc = proc; - if ((value = g_hash_table_lookup(rpc_procs,&key)) != NULL) { + if ((value = (rpc_proc_info_value *)g_hash_table_lookup(rpc_procs,&key)) != NULL) { dissect_function = value->dissect_call; procname = (char *)value->name; } @@ -2333,12 +2333,12 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* * Do we already have a state structure for this conv */ - rpc_conv_info = conversation_get_proto_data(conversation, proto_rpc); + rpc_conv_info = (rpc_conv_info_t *)conversation_get_proto_data(conversation, proto_rpc); if (!rpc_conv_info) { /* No. Attach that information to the conversation, and add * it to the list of information structures. */ - rpc_conv_info = se_alloc(sizeof(rpc_conv_info_t)); + rpc_conv_info = se_new(rpc_conv_info_t); rpc_conv_info->xids=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rpc_xids"); conversation_add_proto_data(conversation, proto_rpc, rpc_conv_info); } @@ -2350,7 +2350,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, (pinfo->ptype == PT_TCP) ? rpc_tcp_handle : rpc_handle); /* look up the request */ - rpc_call = se_tree_lookup32(rpc_conv_info->xids, xid); + rpc_call = (rpc_call_info_value *)se_tree_lookup32(rpc_conv_info->xids, xid); if (rpc_call) { /* We've seen a request with this XID, with the same source and destination, before - but was it @@ -2375,7 +2375,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, frame numbers are 1-origin, so we use 0 to mean "we don't yet know in which frame the reply for this call appears". */ - rpc_call = se_alloc(sizeof(rpc_call_info_value)); + rpc_call = se_new(rpc_call_info_value); rpc_call->req_num = pinfo->fd->num; rpc_call->rep_num = 0; rpc_call->prog = prog; @@ -2459,7 +2459,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } rpc_prog_key.prog = prog; - if ((rpc_prog = g_hash_table_lookup(rpc_progs,&rpc_prog_key)) == NULL) { + if ((rpc_prog = (rpc_prog_info_value *)g_hash_table_lookup(rpc_progs,&rpc_prog_key)) == NULL) { proto = NULL; proto_id = 0; ett = 0; @@ -3123,7 +3123,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, if (pinfo == NULL || pinfo->private_data == NULL) { return 0; } - tcpinfo = pinfo->private_data; + tcpinfo = (struct tcpinfo *)pinfo->private_data; if (tcpinfo == NULL) { return 0; @@ -3254,7 +3254,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, old_rfk.conv_id = conversation->index; old_rfk.seq = seq; old_rfk.port = pinfo->srcport; - rfk = g_hash_table_lookup(rpc_reassembly_table, &old_rfk); + rfk = (rpc_fragment_key *)g_hash_table_lookup(rpc_reassembly_table, &old_rfk); if (rfk == NULL) { /* @@ -3291,7 +3291,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, * We must remember this fragment. */ - rfk = se_alloc(sizeof(rpc_fragment_key)); + rfk = se_new(rpc_fragment_key); rfk->conv_id = conversation->index; rfk->seq = seq; rfk->port = pinfo->srcport; @@ -3313,7 +3313,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, * set on it. */ if (ipfd_head == NULL) { - new_rfk = se_alloc(sizeof(rpc_fragment_key)); + new_rfk = se_new(rpc_fragment_key); new_rfk->conv_id = rfk->conv_id; new_rfk->seq = seq + len; new_rfk->port = pinfo->srcport; @@ -3379,7 +3379,7 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo, * RPC fragments aren't guaranteed to be provided * in order, either. */ - new_rfk = se_alloc(sizeof(rpc_fragment_key)); + new_rfk = se_new(rpc_fragment_key); new_rfk->conv_id = rfk->conv_id; new_rfk->seq = seq + len; new_rfk->port = pinfo->srcport; |