aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-btl2cap.c36
-rw-r--r--epan/dissectors/packet-ntlmssp.c40
-rw-r--r--epan/dissectors/packet-rlc-lte.c38
-rw-r--r--epan/dissectors/packet-tcp.c43
4 files changed, 79 insertions, 78 deletions
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index d79cdb0201..e1d1f4306b 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -462,7 +462,7 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
key[5].length = 0;
key[5].key = NULL;
- psm_service = se_tree_lookup32_array_le(psm_to_service_table, key);
+ psm_service = (psm_service_t *)se_tree_lookup32_array_le(psm_to_service_table, key);
if (psm_service && psm_service->interface_id == interface_id &&
psm_service->adapter_id == adapter_id &&
psm_service->chandle == chandle &&
@@ -494,7 +494,7 @@ dissect_connrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t
k_cid = scid | ((pinfo->p2p_dir == P2P_DIR_RECV) ? 0x80000000 : 0x00000000);
k_frame_number = pinfo->fd->num;
- psm_data = se_alloc(sizeof(psm_data_t));
+ psm_data = se_new(psm_data_t);
psm_data->scid = (scid | ((pinfo->p2p_dir == P2P_DIR_RECV) ? 0x80000000 : 0x00000000));
psm_data->dcid = 0;
psm_data->psm = psm;
@@ -740,7 +740,7 @@ dissect_configrequest(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -928,7 +928,7 @@ dissect_configresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -1012,7 +1012,7 @@ dissect_connresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -1203,7 +1203,7 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, pr
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -1231,7 +1231,7 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo, pr
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -1296,7 +1296,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
key[5].length = 0;
key[5].key = NULL;
- psm_service = se_tree_lookup32_array_le(psm_to_service_table, key);
+ psm_service = (psm_service_t *)se_tree_lookup32_array_le(psm_to_service_table, key);
if (psm_service && psm_service->interface_id == interface_id &&
psm_service->adapter_id == adapter_id &&
psm_service->chandle == chandle &&
@@ -1403,16 +1403,16 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
}
if (!pinfo->fd->flags.visited) {
- mfp = se_alloc(sizeof(sdu_reassembly_t));
+ mfp = se_new(sdu_reassembly_t);
mfp->first_frame = pinfo->fd->num;
mfp->last_frame = 0;
mfp->tot_len = sdulen;
- mfp->reassembled = se_alloc(sdulen);
+ mfp->reassembled = (guint8 *)se_alloc(sdulen);
tvb_memcpy(tvb, mfp->reassembled, offset, sdulen);
mfp->cur_off = sdulen;
se_tree_insert32(config_data->start_fragments, pinfo->fd->num, mfp);
} else {
- mfp = se_tree_lookup32(config_data->start_fragments, pinfo->fd->num);
+ mfp = (sdu_reassembly_t *)se_tree_lookup32(config_data->start_fragments, pinfo->fd->num);
}
if (mfp != NULL && mfp->last_frame) {
proto_item *item;
@@ -1429,7 +1429,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
length -= 4; /*Control, FCS*/
}
if (segment == 0x02 || segment == 0x03) {
- mfp = se_tree_lookup32_le(config_data->start_fragments, pinfo->fd->num);
+ mfp = (sdu_reassembly_t *)se_tree_lookup32_le(config_data->start_fragments, pinfo->fd->num);
if (!pinfo->fd->flags.visited) {
if (mfp != NULL && !mfp->last_frame && (mfp->tot_len>=mfp->cur_off + length)) {
tvb_memcpy(tvb, mfp->reassembled + mfp->cur_off, offset, length);
@@ -1497,7 +1497,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
key[5].length = 0;
key[5].key = NULL;
- psm_service = se_tree_lookup32_array_le(psm_to_service_table, key);
+ psm_service = (psm_service_t *)se_tree_lookup32_array_le(psm_to_service_table, key);
if (psm_service && psm_service->interface_id == interface_id &&
psm_service->adapter_id == adapter_id &&
psm_service->chandle == chandle &&
@@ -1633,7 +1633,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
acl_data = (bthci_acl_data_t *)pinfo->private_data;
- l2cap_data = ep_alloc(sizeof(btl2cap_data_t));
+ l2cap_data = ep_new(btl2cap_data_t);
l2cap_data->interface_id = (acl_data) ? acl_data->interface_id : HCI_INTERFACE_AMP;
l2cap_data->adapter_id = (acl_data) ? acl_data->adapter_id : HCI_ADAPTER_DEFAULT;
@@ -1809,7 +1809,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[5].length = 0;
key[5].key = NULL;
- psm_service = se_tree_lookup32_array_le(psm_to_service_table, key);
+ psm_service = (psm_service_t *)se_tree_lookup32_array_le(psm_to_service_table, key);
if (!(psm_service && psm_service->interface_id == interface_id &&
psm_service->adapter_id == adapter_id &&
psm_service->chandle == chandle &&
@@ -1893,7 +1893,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
key[5].length = 0;
key[5].key = NULL;
- psm_data = se_tree_lookup32_array_le(cid_to_psm_table, key);
+ psm_data = (psm_data_t *)se_tree_lookup32_array_le(cid_to_psm_table, key);
if (psm_data && psm_data->interface_id == interface_id &&
psm_data->adapter_id == adapter_id &&
psm_data->chandle == chandle &&
@@ -1985,12 +1985,12 @@ btl2cap_sdp_tap_packet(void *arg _U_, packet_info *pinfo _U_, epan_dissect_t *ed
key[5].key = NULL;
- psm_service = se_tree_lookup32_array_le(psm_to_service_table, key);
+ psm_service = (psm_service_t *)se_tree_lookup32_array_le(psm_to_service_table, key);
if (!(psm_service && psm_service->interface_id == interface_id &&
psm_service->adapter_id == adapter_id &&
psm_service->chandle == chandle &&
psm_service->psm == psm)) {
- psm_service = se_alloc0(sizeof(psm_service_t));
+ psm_service = se_new0(psm_service_t);
psm_service->interface_id = interface_id;
psm_service->adapter_id = adapter_id;
psm_service->chandle = chandle;
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 180d0554e3..953edc2568 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -491,7 +491,7 @@ get_md4pass_list(md4_pass** p_pass_list, const char* nt_password)
return 0;
}
i = 0;
- *p_pass_list = ep_alloc(nb_pass*sizeof(md4_pass));
+ *p_pass_list = (md4_pass *)ep_alloc(nb_pass*sizeof(md4_pass));
pass_list = *p_pass_list;
if (memcmp(nt_password_hash, gbl_zeros, NTLMSSP_KEY_LEN) != 0) {
@@ -1515,13 +1515,13 @@ dissect_ntlmssp_challenge (tvbuff_t *tvb, packet_info *pinfo, int offset,
tvb_memcpy(tvb, tmp, offset, 8); /* challenge */
/* We can face more than one NTLM exchange over the same couple of IP and ports ...*/
- conv_ntlmssp_info = conversation_get_proto_data(conversation, proto_ntlmssp);
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation, proto_ntlmssp);
/* XXX: The following code is (re)executed every time a particular frame is dissected
* (in whatever order). Thus it seems to me that "multiple exchanges" might not be
* handled well depending on the order that frames are visited after the initial dissection.
*/
if (!conv_ntlmssp_info || memcmp(tmp, conv_ntlmssp_info->server_challenge, 8) != 0) {
- conv_ntlmssp_info = se_alloc(sizeof(ntlmssp_info));
+ conv_ntlmssp_info = se_new(ntlmssp_info);
/* Insert the flags into the conversation */
conv_ntlmssp_info->flags = negotiate_flags;
/* Insert the RC4 state information into the conversation */
@@ -1642,7 +1642,7 @@ dissect_ntlmssp_auth (tvbuff_t *tvb, packet_info *pinfo, int offset,
* - has the AUTHENTICATE message in a second TCP connection;
* (The authentication aparently succeeded).
*/
- conv_ntlmssp_info = p_get_proto_data(pinfo->fd, proto_ntlmssp);
+ conv_ntlmssp_info = (ntlmssp_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
/*
* There isn't any. Is there any from this conversation? If so,
@@ -1653,9 +1653,9 @@ dissect_ntlmssp_auth (tvbuff_t *tvb, packet_info *pinfo, int offset,
/* so we'll have a place to store flags. */
/* This is a bit brute-force but looks like it will be OK. */
conversation = find_or_create_conversation(pinfo);
- conv_ntlmssp_info = conversation_get_proto_data(conversation, proto_ntlmssp);
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation, proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
- conv_ntlmssp_info = se_alloc0(sizeof(ntlmssp_info));
+ conv_ntlmssp_info = se_new0(ntlmssp_info);
conversation_add_proto_data(conversation, proto_ntlmssp, conv_ntlmssp_info);
}
/* XXX: The *conv_ntlmssp_info struct attached to the frame is the
@@ -1849,7 +1849,7 @@ get_sign_key(packet_info *pinfo, int cryptpeer)
}
else {
/* We have a conversation, check for encryption state */
- conv_ntlmssp_info = conversation_get_proto_data(conversation,
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation,
proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
/* No encryption state tied to the conversation. Therefore, we
@@ -1889,7 +1889,7 @@ get_encrypted_state(packet_info *pinfo, int cryptpeer)
}
else {
/* We have a conversation, check for encryption state */
- conv_ntlmssp_info = conversation_get_proto_data(conversation,
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation,
proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
/* No encryption state tied to the conversation. Therefore, we
@@ -2010,10 +2010,10 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
ntlmssp_packet_info *stored_packet_ntlmssp_info = NULL;
/* Check to see if we already have state for this packet */
- packet_ntlmssp_info = p_get_proto_data(pinfo->fd, proto_ntlmssp);
+ packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp);
if (packet_ntlmssp_info == NULL) {
/* We don't have any packet state, so create one */
- packet_ntlmssp_info = se_alloc0(sizeof(ntlmssp_packet_info));
+ packet_ntlmssp_info = se_new0(ntlmssp_packet_info);
p_add_proto_data(pinfo->fd, proto_ntlmssp, packet_ntlmssp_info);
}
if (!packet_ntlmssp_info->payload_decrypted) {
@@ -2029,7 +2029,7 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
return ;
}
- conv_ntlmssp_info = conversation_get_proto_data(conversation,
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation,
proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
/* There is no NTLMSSP state tied to the conversation */
@@ -2041,7 +2041,7 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
return;
}
if (key != NULL) {
- stored_packet_ntlmssp_info = g_hash_table_lookup(hash_packet, key);
+ stored_packet_ntlmssp_info = (ntlmssp_packet_info *)g_hash_table_lookup(hash_packet, key);
}
if (stored_packet_ntlmssp_info != NULL && stored_packet_ntlmssp_info->payload_decrypted == TRUE) {
/* Mat TBD (stderr, "Found a already decrypted packet\n");*/
@@ -2072,7 +2072,7 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
/* Store the decrypted contents in the packet state struct
(of course at this point, they aren't decrypted yet) */
- packet_ntlmssp_info->decrypted_payload = tvb_memdup(tvb, offset,
+ packet_ntlmssp_info->decrypted_payload = (guint8 *)tvb_memdup(tvb, offset,
encrypted_block_length);
packet_ntlmssp_info->payload_len = encrypted_block_length;
decrypted_payloads = g_slist_prepend(decrypted_payloads,
@@ -2092,7 +2092,7 @@ decrypt_data_payload(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
in case of KEY_EXCH we have independent key so this is not needed*/
if (!(NTLMSSP_NEGOTIATE_KEY_EXCH & conv_ntlmssp_info->flags)) {
guint8 *peer_block;
- peer_block = ep_memdup(packet_ntlmssp_info->decrypted_payload, encrypted_block_length);
+ peer_block = (guint8 *)ep_memdup(packet_ntlmssp_info->decrypted_payload, encrypted_block_length);
crypt_rc4(rc4_state_peer, peer_block, encrypted_block_length);
}
@@ -2119,7 +2119,7 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ntlmssp_header_t *ntlmssph;
void *pd_save;
- ntlmssph = ep_alloc(sizeof(ntlmssp_header_t));
+ ntlmssph = ep_new(ntlmssp_header_t);
ntlmssph->type = 0;
ntlmssph->domain_name = NULL;
ntlmssph->acct_name = NULL;
@@ -2234,7 +2234,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
int sequence = 0;
ntlmssp_packet_info *stored_packet_ntlmssp_info = NULL;
- packet_ntlmssp_info = p_get_proto_data(pinfo->fd, proto_ntlmssp);
+ packet_ntlmssp_info = (ntlmssp_packet_info *)p_get_proto_data(pinfo->fd, proto_ntlmssp);
if (packet_ntlmssp_info == NULL) {
/* We don't have data for this packet */
return;
@@ -2246,7 +2246,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
/* There is no conversation, thus no encryption state */
return;
}
- conv_ntlmssp_info = conversation_get_proto_data(conversation,
+ conv_ntlmssp_info = (ntlmssp_info *)conversation_get_proto_data(conversation,
proto_ntlmssp);
if (conv_ntlmssp_info == NULL) {
/* There is no NTLMSSP state tied to the conversation */
@@ -2254,7 +2254,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
}
if (key != NULL) {
- stored_packet_ntlmssp_info = g_hash_table_lookup(hash_packet, key);
+ stored_packet_ntlmssp_info = (ntlmssp_packet_info *)g_hash_table_lookup(hash_packet, key);
}
if (stored_packet_ntlmssp_info != NULL && stored_packet_ntlmssp_info->verifier_decrypted == TRUE) {
/* Mat TBD fprintf(stderr, "Found a already decrypted packet\n");*/
@@ -2303,7 +2303,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
* Some analysis need to be done ...
*/
if (sign_key != NULL) {
- check_buf = ep_alloc(packet_ntlmssp_info->payload_len+4);
+ check_buf = (guint8 *)ep_alloc(packet_ntlmssp_info->payload_len+4);
tvb_memcpy(tvb, &sequence, offset+8, 4);
memcpy(check_buf, &sequence, 4);
memcpy(check_buf+4, packet_ntlmssp_info->decrypted_payload, packet_ntlmssp_info->payload_len);
@@ -2328,7 +2328,7 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
This is not needed when we just have EXTENDED SECURITY because the signature is not crypted
and it's also not needed when we have key exchange because server and client have independent keys */
if (!(NTLMSSP_NEGOTIATE_KEY_EXCH & conv_ntlmssp_info->flags) && !(NTLMSSP_NEGOTIATE_EXTENDED_SECURITY & conv_ntlmssp_info->flags)) {
- peer_block = ep_memdup(packet_ntlmssp_info->verifier, encrypted_block_length);
+ peer_block = (guint8 *)ep_memdup(packet_ntlmssp_info->verifier, encrypted_block_length);
crypt_rc4(rc4_state_peer, peer_block, encrypted_block_length);
}
diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c
index c3c506c2e3..172fc36f7c 100644
--- a/epan/dissectors/packet-rlc-lte.c
+++ b/epan/dissectors/packet-rlc-lte.c
@@ -425,7 +425,7 @@ static GHashTable *reassembly_report_hash = NULL;
/* Create a new struct for reassembly */
static void reassembly_reset(channel_sequence_analysis_status *status)
{
- status->reassembly_info = se_alloc0(sizeof(rlc_channel_reassembly_info));
+ status->reassembly_info = se_new0(rlc_channel_reassembly_info);
}
/* Hide previous one */
@@ -449,7 +449,7 @@ static void reassembly_add_segment(channel_sequence_analysis_status *status,
return;
}
- segment_data = se_alloc(length);
+ segment_data = (guint8 *)se_alloc(length);
/* TODO: is there a better way to do this? */
memcpy(segment_data, tvb_get_ptr(tvb, offset, length), length);
@@ -488,7 +488,7 @@ static tvbuff_t* reassembly_get_reassembled_tvb(rlc_channel_reassembly_info *rea
for (n=0; n < reassembly_info->number_of_segments; n++) {
combined_length += reassembly_info->segments[n].length;
}
- combined_data = ep_alloc(combined_length);
+ combined_data = (guint8 *)ep_alloc(combined_length);
/* Copy data into contiguous buffer */
for (n=0; n < reassembly_info->number_of_segments; n++) {
@@ -763,9 +763,9 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
}
/* Reuse or allocate struct */
- p_pdcp_lte_info = p_get_proto_data(pinfo->fd, proto_pdcp_lte);
+ p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(pinfo->fd, proto_pdcp_lte);
if (p_pdcp_lte_info == NULL) {
- p_pdcp_lte_info = se_alloc0(sizeof(struct pdcp_lte_info));
+ p_pdcp_lte_info = se_new0(pdcp_lte_info);
/* Store info in packet */
p_add_proto_data(pinfo->fd, proto_pdcp_lte, p_pdcp_lte_info);
}
@@ -874,8 +874,8 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
/* Equal keys */
static gint rlc_channel_equal(gconstpointer v, gconstpointer v2)
{
- const channel_hash_key* val1 = v;
- const channel_hash_key* val2 = v2;
+ const channel_hash_key* val1 = (const channel_hash_key *)v;
+ const channel_hash_key* val2 = (const channel_hash_key *)v2;
/* All fields must match */
/* N.B. Currently fits into one word, so could return (*v == *v2)
@@ -889,7 +889,7 @@ static gint rlc_channel_equal(gconstpointer v, gconstpointer v2)
/* Compute a hash value for a given key. */
static guint rlc_channel_hash_func(gconstpointer v)
{
- const channel_hash_key* val1 = v;
+ const channel_hash_key* val1 = (const channel_hash_key *)v;
/* TODO: check/reduce multipliers */
return ((val1->ueId * 1024) + (val1->channelType*64) + (val1->channelId*2) + val1->direction);
@@ -1363,8 +1363,8 @@ static sequence_analysis_state checkChannelSequenceInfo(packet_info *pinfo, tvbu
createdChannel = TRUE;
/* Allocate a new value and duplicate key contents */
- p_channel_status = se_alloc0(sizeof(channel_sequence_analysis_status));
- p_channel_key = se_memdup(&channel_key, sizeof(channel_hash_key));
+ p_channel_status = se_new0(channel_sequence_analysis_status);
+ p_channel_key = (channel_hash_key *)se_memdup(&channel_key, sizeof(channel_hash_key));
/* Set mode */
p_channel_status->rlcMode = p_rlc_lte_info->rlcMode;
@@ -1374,7 +1374,7 @@ static sequence_analysis_state checkChannelSequenceInfo(packet_info *pinfo, tvbu
}
/* Create space for frame state_report */
- p_report_in_frame = se_alloc0(sizeof(sequence_analysis_report));
+ p_report_in_frame = se_new0(sequence_analysis_report);
/* Deal with according to channel mode */
@@ -1762,8 +1762,8 @@ static void checkChannelRepeatedNACKInfo(packet_info *pinfo,
if (p_channel_status == NULL) {
/* Allocate a new key and value */
- p_channel_key = se_alloc(sizeof(channel_hash_key));
- p_channel_status = se_alloc0(sizeof(channel_repeated_nack_status));
+ p_channel_key = se_new(channel_hash_key);
+ p_channel_status = se_new0(channel_repeated_nack_status);
/* Copy key contents */
memcpy(p_channel_key, &channel_key, sizeof(channel_hash_key));
@@ -1795,7 +1795,7 @@ static void checkChannelRepeatedNACKInfo(packet_info *pinfo,
if (noOfNACKsRepeated >= 1) {
/* Create space for frame state_report */
- p_report_in_frame = se_alloc(sizeof(channel_repeated_nack_report));
+ p_report_in_frame = se_new(channel_repeated_nack_report);
/* Copy in found duplicates */
for (n=0; n < MIN(tap_info->noOfNACKs, MAX_NACKs); n++) {
@@ -1873,7 +1873,7 @@ static void checkChannelACKWindow(guint16 ack_sn,
if (((1024 + p_channel_status->previousSequenceNumber+1 - ack_sn) % 1024) > 512) {
/* Set result */
- p_report_in_frame = se_alloc0(sizeof(sequence_analysis_report));
+ p_report_in_frame = se_new0(sequence_analysis_report);
p_report_in_frame->state = ACK_Out_of_Window;
p_report_in_frame->previousFrameNum = p_channel_status->previousFrameNum;
p_report_in_frame->sequenceExpected = p_channel_status->previousSequenceNumber;
@@ -2619,10 +2619,10 @@ static gboolean dissect_rlc_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
/* If redissecting, use previous info struct (if available) */
- p_rlc_lte_info = p_get_proto_data(pinfo->fd, proto_rlc_lte);
+ p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(pinfo->fd, proto_rlc_lte);
if (p_rlc_lte_info == NULL) {
/* Allocate new info struct for this frame */
- p_rlc_lte_info = se_alloc0(sizeof(struct rlc_lte_info));
+ p_rlc_lte_info = se_new0(struct rlc_lte_info);
infoAlreadySet = FALSE;
}
else {
@@ -2712,7 +2712,7 @@ static void dissect_rlc_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct rlc_lte_info *p_rlc_lte_info = NULL;
/* Allocate and Zero tap struct */
- rlc_lte_tap_info *tap_info = ep_alloc0(sizeof(rlc_lte_tap_info));
+ rlc_lte_tap_info *tap_info = ep_new0(rlc_lte_tap_info);
/* Set protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC-LTE");
@@ -2723,7 +2723,7 @@ static void dissect_rlc_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Look for packet info! */
- p_rlc_lte_info = p_get_proto_data(pinfo->fd, proto_rlc_lte);
+ p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(pinfo->fd, proto_rlc_lte);
/* Can't dissect anything without it... */
if (p_rlc_lte_info == NULL) {
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 73fd2f4ef0..3b1ccd8ff6 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -469,7 +469,7 @@ init_tcp_conversation_data(packet_info *pinfo)
struct tcp_analysis *tcpd;
/* Initialize the tcp protocol data structure to add to the tcp conversation */
- tcpd=se_alloc0(sizeof(struct tcp_analysis));
+ tcpd=se_new0(struct tcp_analysis);
tcpd->flow1.win_scale=-1;
tcpd->flow1.window = G_MAXUINT32;
tcpd->flow1.multisegment_pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "tcp_multisegment_pdus");
@@ -508,7 +508,7 @@ get_tcp_conversation_data(conversation_t *conv, packet_info *pinfo)
conv = find_or_create_conversation(pinfo);
/* Get the data for this conversation */
- tcpd=conversation_get_proto_data(conv, proto_tcp);
+ tcpd=(struct tcp_analysis *)conversation_get_proto_data(conv, proto_tcp);
/* If the conversation was just created or it matched a
* conversation with template options, tcpd will not
@@ -555,7 +555,7 @@ add_tcp_process_info(guint32 frame_num, address *local_addr, address *remote_add
return;
}
- tcpd = conversation_get_proto_data(conv, proto_tcp);
+ tcpd = (struct tcp_analysis *)conversation_get_proto_data(conv, proto_tcp);
if (!tcpd) {
return;
}
@@ -582,7 +582,7 @@ tcp_calculate_timestamps(packet_info *pinfo, struct tcp_analysis *tcpd,
struct tcp_per_packet_data_t *tcppd)
{
if( !tcppd ) {
- tcppd = se_alloc(sizeof(struct tcp_per_packet_data_t));
+ tcppd = se_new(struct tcp_per_packet_data_t);
p_add_proto_data(pinfo->fd, proto_tcp, tcppd);
}
@@ -615,7 +615,7 @@ tcp_print_timestamps(packet_info *pinfo, tvbuff_t *tvb, proto_tree *parent_tree,
PROTO_ITEM_SET_GENERATED(item);
if( !tcppd )
- tcppd = p_get_proto_data(pinfo->fd, proto_tcp);
+ tcppd = (struct tcp_per_packet_data_t *)p_get_proto_data(pinfo->fd, proto_tcp);
if( tcppd ) {
item = proto_tree_add_time(tree, hf_tcp_ts_delta, tvb, 0, 0,
@@ -645,7 +645,7 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o
struct tcp_multisegment_pdu *msp=NULL;
if(!pinfo->fd->flags.visited) {
- msp=se_tree_lookup32_le(multisegment_pdus, seq-1);
+ msp=(struct tcp_multisegment_pdu *)se_tree_lookup32_le(multisegment_pdus, seq-1);
if(msp) {
/* If this is a continuation of a PDU started in a
* previous segment we need to update the last_frame
@@ -680,7 +680,7 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o
* this segment we also verify that the found PDU does span
* beyond the end of this segment.
*/
- msp=se_tree_lookup32_le(multisegment_pdus, nxtseq-1);
+ msp=(struct tcp_multisegment_pdu *)se_tree_lookup32_le(multisegment_pdus, nxtseq-1);
if(msp) {
if(pinfo->fd->num==msp->first_frame) {
proto_item *item;
@@ -699,7 +699,7 @@ scan_for_next_pdu(tvbuff_t *tvb, proto_tree *tcp_tree, packet_info *pinfo, int o
/* Second we check if this segment is part of a PDU started
* prior to the segment (seq-1)
*/
- msp=se_tree_lookup32_le(multisegment_pdus, seq-1);
+ msp=(struct tcp_multisegment_pdu *)se_tree_lookup32_le(multisegment_pdus, seq-1);
if(msp) {
/* If this segment is completely within a previous PDU
* then we just skip this packet
@@ -727,7 +727,7 @@ pdu_store_sequencenumber_of_next_pdu(packet_info *pinfo, guint32 seq, guint32 nx
{
struct tcp_multisegment_pdu *msp;
- msp=se_alloc(sizeof(struct tcp_multisegment_pdu));
+ msp=se_new(struct tcp_multisegment_pdu);
msp->nxtpdu=nxtpdu;
msp->seq=seq;
msp->first_frame=pinfo->fd->num;
@@ -792,9 +792,9 @@ tcp_analyze_get_acked_struct(guint32 frame, guint32 seq, guint32 ack, gboolean c
return;
}
- tcpd->ta = se_tree_lookup32_array(tcpd->acked_table, key);
+ tcpd->ta = (struct tcp_acked *)se_tree_lookup32_array(tcpd->acked_table, key);
if((!tcpd->ta) && createflag) {
- tcpd->ta = se_alloc0(sizeof(struct tcp_acked));
+ tcpd->ta = se_new0(struct tcp_acked);
se_tree_insert32_array(tcpd->acked_table, key, (void *)tcpd->ta);
}
}
@@ -1692,7 +1692,7 @@ desegment_tcp(tvbuff_t *tvb, packet_info *pinfo, int offset,
proto_tree *tree, proto_tree *tcp_tree,
struct tcp_analysis *tcpd)
{
- struct tcpinfo *tcpinfo = pinfo->private_data;
+ struct tcpinfo *tcpinfo = (struct tcpinfo *)pinfo->private_data;
fragment_data *ipfd_head;
int last_fragment_len;
gboolean must_desegment;
@@ -1733,7 +1733,7 @@ again:
/* Have we seen this PDU before (and is it the start of a multi-
* segment PDU)?
*/
- if ((msp = se_tree_lookup32(tcpd->fwd->multisegment_pdus, seq))) {
+ if ((msp = (struct tcp_multisegment_pdu *)se_tree_lookup32(tcpd->fwd->multisegment_pdus, seq))) {
const char* str;
/* Yes. This could be because we've dissected this frame before
@@ -1762,7 +1762,7 @@ again:
}
/* Else, find the most previous PDU starting before this sequence number */
- msp = se_tree_lookup32_le(tcpd->fwd->multisegment_pdus, seq-1);
+ msp = (struct tcp_multisegment_pdu *)se_tree_lookup32_le(tcpd->fwd->multisegment_pdus, seq-1);
}
if (msp && msp->seq <= seq && msp->nxtpdu > seq) {
@@ -2240,7 +2240,8 @@ tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* Display the PDU length as a field
*/
- item=proto_tree_add_uint(pinfo->tcp_tree, hf_tcp_pdu_size,
+ item=proto_tree_add_uint((proto_tree *)pinfo->tcp_tree,
+ hf_tcp_pdu_size,
tvb, offset, plen, plen);
PROTO_ITEM_SET_GENERATED(item);
#if 0
@@ -4110,7 +4111,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *item;
proto_tree *checksum_tree;
- tcph=ep_alloc(sizeof(struct tcpheader));
+ tcph=ep_new(struct tcpheader);
SET_ADDRESS(&tcph->ip_src, pinfo->src.type, pinfo->src.len, pinfo->src.data);
SET_ADDRESS(&tcph->ip_dst, pinfo->dst.type, pinfo->dst.len, pinfo->dst.data);
@@ -4216,7 +4217,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Do we need to calculate timestamps relative to the tcp-stream? */
if (tcp_calculate_ts) {
- tcppd = p_get_proto_data(pinfo->fd, proto_tcp);
+ tcppd = (struct tcp_per_packet_data_t *)p_get_proto_data(pinfo->fd, proto_tcp);
/*
* Calculate the timestamps relative to this conversation (but only on the
@@ -4494,9 +4495,9 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* We haven't turned checksum checking off; checksum it. */
/* Set up the fields of the pseudo-header. */
- cksum_vec[0].ptr = pinfo->src.data;
+ cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
cksum_vec[0].len = pinfo->src.len;
- cksum_vec[1].ptr = pinfo->dst.data;
+ cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
cksum_vec[1].len = pinfo->dst.len;
cksum_vec[2].ptr = (const guint8 *)phdr;
switch (pinfo->src.type) {
@@ -4667,7 +4668,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
optlen = tcph->th_hlen - TCPH_MIN_LEN; /* length of options, in bytes */
tvb_ensure_bytes_exist(tvb, offset + 20, optlen);
if (tcp_tree != NULL) {
- guint8 *p_options = ep_tvb_memdup(tvb, offset + 20, optlen);
+ guint8 *p_options = (guint8 *)ep_tvb_memdup(tvb, offset + 20, optlen);
tf = proto_tree_add_bytes_format(tcp_tree, hf_tcp_options, tvb, offset + 20,
optlen, p_options, "Options: (%u bytes)", optlen);
field_tree = proto_item_add_subtree(tf, ett_tcp_options);
@@ -4749,7 +4750,7 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
struct tcp_multisegment_pdu *msp;
/* find the most previous PDU starting before this sequence number */
- msp=se_tree_lookup32_le(tcpd->fwd->multisegment_pdus, tcph->th_seq-1);
+ msp=(struct tcp_multisegment_pdu *)se_tree_lookup32_le(tcpd->fwd->multisegment_pdus, tcph->th_seq-1);
if(msp) {
fragment_data *ipfd_head;