From beroset:

remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48356
This commit is contained in:
Anders Broman 2013-03-17 17:52:26 +00:00
parent 81e80f2c0b
commit 3e38475176
14 changed files with 146 additions and 146 deletions

View File

@ -81,7 +81,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
#----------------------------------------------------------------------------------------
#.FN_HDR MultiplexElement
/*MultiplexElement*/
h223_mux_element* me = se_alloc(sizeof(h223_mux_element));
h223_mux_element* me = se_new(h223_mux_element);
h223_me->next = me;
h223_me = me;
h223_me->next = NULL;
@ -129,7 +129,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
#.FN_BODY OpenLogicalChannel
gint32 temp;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_alloc0(sizeof(olc_info_t)) : NULL;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_new0(olc_info_t) : NULL;
h223_fw_lc_num = 0;
h223_lc_params_temp = NULL;
@ -137,7 +137,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
%(DEFAULT_BODY)s
if(h223_fw_lc_num != 0 && h223_fw_lc_params) {
h223_pending_olc *pending = se_alloc(sizeof(h223_pending_olc));
h223_pending_olc *pending = se_new(h223_pending_olc);
pending->fw_channel_params = h223_fw_lc_params;
pending->rev_channel_params = h223_rev_lc_params;
temp = h223_fw_lc_num;
@ -183,7 +183,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR OpenLogicalChannel/forwardLogicalChannelParameters/multiplexParameters/h223LogicalChannelParameters
h223_fw_lc_params = se_alloc(sizeof(h223_lc_params));
h223_fw_lc_params = se_new(h223_lc_params);
h223_fw_lc_params->al_type = al_nonStandard;
h223_fw_lc_params->al_params = NULL;
h223_fw_lc_params->segmentable = 0;
@ -204,7 +204,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR OpenLogicalChannel/reverseLogicalChannelParameters/multiplexParameters/h223LogicalChannelParameters
h223_rev_lc_params = se_alloc(sizeof(h223_lc_params));
h223_rev_lc_params = se_new(h223_lc_params);
h223_rev_lc_params->al_type = al_nonStandard;
h223_rev_lc_params->al_params = NULL;
h223_rev_lc_params->segmentable = 0;
@ -222,7 +222,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
const gchar *olc_key;
olc_info_t *olc_req;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_alloc0(sizeof(olc_info_t)) : NULL;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_new0(olc_info_t) : NULL;
h223_fw_lc_num = 0;
h223_rev_lc_num = 0;
@ -236,7 +236,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
%(ACTX)s->pinfo->p2p_dir = P2P_DIR_RECV;
else
%(ACTX)s->pinfo->p2p_dir = P2P_DIR_SENT;
pend = g_hash_table_lookup( h223_pending_olc_reqs[%(ACTX)s->pinfo->p2p_dir], GINT_TO_POINTER(temp) );
pend = (h223_pending_olc *)g_hash_table_lookup( h223_pending_olc_reqs[%(ACTX)s->pinfo->p2p_dir], GINT_TO_POINTER(temp) );
if (pend) {
DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params)
|| (!h223_rev_lc_num && !pend->rev_channel_params) );
@ -252,7 +252,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
if (upcoming_olc) {
olc_key = gen_olc_key(upcoming_olc->fwd_lc_num, &%(ACTX)s->pinfo->src, &%(ACTX)s->pinfo->dst);
olc_req = g_hash_table_lookup(h245_pending_olc_reqs, olc_key);
olc_req = (olc_info_t *)g_hash_table_lookup(h245_pending_olc_reqs, olc_key);
if (olc_req) {
update_unicast_addr(&olc_req->fwd_lc.media_addr, &upcoming_olc->fwd_lc.media_addr);
update_unicast_addr(&olc_req->fwd_lc.media_control_addr, &upcoming_olc->fwd_lc.media_control_addr);
@ -314,7 +314,7 @@ Rfc2733Format FECCapability/rfc2733Format FECMode/rfc2733Format
#.FN_HDR H223LogicalChannelParameters/adaptationLayerType/al3
if(h223_lc_params_temp) {
h223_lc_params_temp->al_type = al3;
h223_lc_params_temp->al_params = se_alloc(sizeof(h223_al3_params));
h223_lc_params_temp->al_params = se_new(h223_al3_params);
}
#.END
#----------------------------------------------------------------------------------------
@ -775,7 +775,7 @@ if (h245_pi != NULL)
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint8));
buf = ep_new(guint8);
buf[0] = value;
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint8), sizeof(guint8));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/
@ -792,7 +792,7 @@ if (h245_pi != NULL)
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint16));
buf = (guint8 *)ep_new(guint16);
phtons(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/
@ -809,7 +809,7 @@ if (h245_pi != NULL)
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint16));
buf = (guint8 *)ep_new(guint16);
phtons(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/
@ -826,7 +826,7 @@ if (h245_pi != NULL)
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint32));
buf = (guint8 *)ep_new(guint32);
phtonl(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/
@ -843,7 +843,7 @@ if (h245_pi != NULL)
%(DEFAULT_BODY)s
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint32));
buf = (guint8 *)ep_new(guint32);
phtonl(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %%s", gefx->key);*/

View File

@ -354,17 +354,17 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
/* (S)RTP, (S)RTCP */
if (upcoming_channel_lcl->rfc2198 > 0) {
encoding_name_and_rate_t *encoding_name_and_rate = se_alloc( sizeof(encoding_name_and_rate_t));
encoding_name_and_rate_t *encoding_name_and_rate = se_new(encoding_name_and_rate_t);
rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal);
encoding_name_and_rate->encoding_name = se_strdup("red");
encoding_name_and_rate->sample_rate = 8000;
key = se_alloc(sizeof(gint));
key = se_new(gint);
*key = upcoming_channel_lcl->rfc2198;
g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
}
if (upcoming_channel_lcl->srtp_flag) {
dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
dummy_srtp_info = se_new0(struct srtp_info);
}
/* DEBUG g_warning("h245_setup_channels media_addr.addr.type %u port %u",upcoming_channel_lcl->media_addr.addr.type, upcoming_channel_lcl->media_addr.port );
@ -432,7 +432,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* assume that whilst there is more tvb data, there are more h245 commands */
while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=ep_alloc(sizeof(h245_packet_info));
h245_pi=ep_new(h245_packet_info);
init_h245_packet_info(h245_pi);
asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn1_ctx, tr, hf_h245_pdu_type);

View File

@ -410,7 +410,7 @@ fgetline(char **buf, int *size, FILE *fp)
if (*size == 0)
*size = BUFSIZ;
*buf = g_malloc(*size);
*buf = (char *)g_malloc(*size);
}
g_assert(*buf);
@ -422,7 +422,7 @@ fgetline(char **buf, int *size, FILE *fp)
len = 0;
while ((c = getc(fp)) != EOF && c != '\r' && c != '\n') {
if (len+1 >= *size) {
*buf = g_realloc(*buf, *size += BUFSIZ);
*buf = (char *)g_realloc(*buf, *size += BUFSIZ);
}
(*buf)[len++] = c;
}
@ -950,7 +950,7 @@ solve_address_to_name(const address *addr)
switch (addr->type) {
case AT_ETHER:
return get_ether_name(addr->data);
return get_ether_name((const guint8 *)addr->data);
case AT_IPv4: {
guint32 ip4_addr;
@ -965,7 +965,7 @@ solve_address_to_name(const address *addr)
}
case AT_STRINGZ:
return addr->data;
return (const gchar *)addr->data;
default:
return NULL;
@ -978,7 +978,7 @@ se_solve_address_to_name(const address *addr)
switch (addr->type) {
case AT_ETHER:
return get_ether_name(addr->data);
return get_ether_name((const guint8 *)addr->data);
case AT_IPv4: {
guint32 ip4_addr;
@ -993,7 +993,7 @@ se_solve_address_to_name(const address *addr)
}
case AT_STRINGZ:
return se_strdup(addr->data);
return se_strdup((const gchar *)addr->data);
default:
return NULL;
@ -1327,7 +1327,7 @@ add_manuf_name(const guint8 *addr, unsigned int mask, gchar *name)
/*
* XXX - can we use Standard Annotation Language annotations to
* note that mask, as returned by parse_ether_address() (and thus
* note that mask, as returned by parse_ethe)r_address() (and thus
* by the routines that call it, and thus passed to us) cannot be > 48,
* or is SAL too weak to express that?
*/
@ -2465,7 +2465,7 @@ host_name_lookup_init(void) {
#endif /*GNU_ADNS */
if (!addrinfo_list) {
ai = se_alloc0(sizeof(struct addrinfo));
ai = se_new0(struct addrinfo);
addrinfo_list = addrinfo_list_last = ai;
}
@ -2822,15 +2822,15 @@ add_ipv4_name(const guint addr, const gchar *name)
new_resolved_objects = TRUE;
if (!addrinfo_list) {
ai = se_alloc0(sizeof(struct addrinfo));
ai = se_new0(struct addrinfo);
addrinfo_list = addrinfo_list_last = ai;
}
sa4 = se_alloc0(sizeof(struct sockaddr_in));
sa4 = se_new0(struct sockaddr_in);
sa4->sin_family = AF_INET;
sa4->sin_addr.s_addr = addr;
ai = se_alloc0(sizeof(struct addrinfo));
ai = se_new0(struct addrinfo);
ai->ai_family = AF_INET;
ai->ai_addrlen = sizeof(struct sockaddr_in);
ai->ai_canonname = (char *) tp->name;
@ -2880,15 +2880,15 @@ add_ipv6_name(const struct e_in6_addr *addrp, const gchar *name)
new_resolved_objects = TRUE;
if (!addrinfo_list) {
ai = se_alloc0(sizeof(struct addrinfo));
ai = se_new0(struct addrinfo);
addrinfo_list = addrinfo_list_last = ai;
}
sa6 = se_alloc0(sizeof(struct sockaddr_in6));
sa6 = se_new0(struct sockaddr_in6);
sa6->sin6_family = AF_INET;
memcpy(sa6->sin6_addr.s6_addr, addrp, 16);
ai = se_alloc0(sizeof(struct addrinfo));
ai = se_new0(struct addrinfo);
ai->ai_family = AF_INET6;
ai->ai_addrlen = sizeof(struct sockaddr_in);
ai->ai_canonname = (char *) tp->name;
@ -2905,7 +2905,7 @@ add_ipv6_name(const struct e_in6_addr *addrp, const gchar *name)
static gchar *
ep_utoa(guint port)
{
gchar *bp = ep_alloc(MAXNAMELEN);
gchar *bp = (gchar *)ep_alloc(MAXNAMELEN);
/* XXX, guint32_to_str() ? */
guint32_to_str_buf(port, bp, MAXNAMELEN);
@ -3202,7 +3202,7 @@ get_eui64_name(const guint64 addr_eui64)
{
gchar *cur;
hashmanuf_t *mtp;
guint8 *addr = ep_alloc(8);
guint8 *addr = (guint8 *)ep_alloc(8);
/* Copy and convert the address to network byte order. */
*(guint64 *)(void *)(addr) = pntoh64(&(addr_eui64));
@ -3226,7 +3226,7 @@ get_eui64_name_if_known(const guint64 addr_eui64)
{
gchar *cur;
hashmanuf_t *mtp;
guint8 *addr = ep_alloc(8);
guint8 *addr = (guint8 *)ep_alloc(8);
/* Copy and convert the address to network byte order. */
*(guint64 *)(void *)(addr) = pntoh64(&(addr_eui64));

View File

@ -169,7 +169,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset +=2;
}
avctp_data = ep_alloc(sizeof(btavctp_data_t));
avctp_data = ep_new(btavctp_data_t);
avctp_data->cr = cr;
avctp_data->interface_id = l2cap_data->interface_id;
avctp_data->adapter_id = l2cap_data->adapter_id;
@ -230,12 +230,12 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (packet_type == PACKET_TYPE_START) {
if (!pinfo->fd->flags.visited) {
fragment = se_alloc(sizeof(fragment_t));
fragment = se_new(fragment_t);
fragment->length = length;
fragment->data = se_alloc(fragment->length);
fragment->data = (guint8 *)se_alloc(fragment->length);
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
fragments = se_alloc(sizeof(fragments_t));
fragments = se_new(fragments_t);
fragments->number_of_packets = number_of_packets;
fragments->pid = pid;
@ -251,7 +251,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
se_tree_insert32_array(reassembling, key, fragments);
} else {
fragments = se_tree_lookup32_array_le(reassembling, key);
fragments = (fragments_t *)se_tree_lookup32_array_le(reassembling, key);
if (!(fragments && fragments->interface_id == interface_id &&
fragments->adapter_id == adapter_id &&
fragments->chandle == chandle &&
@ -262,7 +262,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle, next_tvb, pinfo, tree);
} else if (packet_type == PACKET_TYPE_CONTINUE) {
fragments = se_tree_lookup32_array_le(reassembling, key);
fragments = (fragments_t *)se_tree_lookup32_array_le(reassembling, key);
if (!(fragments && fragments->interface_id == interface_id &&
fragments->adapter_id == adapter_id &&
fragments->chandle == chandle &&
@ -270,9 +270,9 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fragments = NULL;
if (!pinfo->fd->flags.visited && fragments != NULL) {
fragment = se_alloc(sizeof(fragment_t));
fragment = se_new(fragment_t);
fragment->length = length;
fragment->data = se_alloc(fragment->length);
fragment->data = (guint8 *)se_alloc(fragment->length);
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
fragments->count++;
@ -311,7 +311,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint i_length = 0;
guint8 *reassembled;
fragments = se_tree_lookup32_array_le(reassembling, key);
fragments = (fragments_t *)se_tree_lookup32_array_le(reassembling, key);
if (!(fragments && fragments->interface_id == interface_id &&
fragments->adapter_id == adapter_id &&
fragments->chandle == chandle &&
@ -319,9 +319,9 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fragments = NULL;
if (!pinfo->fd->flags.visited && fragments != NULL) {
fragment = se_alloc(sizeof(fragment_t));
fragment = se_new(fragment_t);
fragment->length = length;
fragment->data = se_alloc(fragment->length);
fragment->data = (guint8 *)se_alloc(fragment->length);
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
fragments->count++;
@ -361,14 +361,14 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(data_handle, next_tvb, pinfo, tree);
} else {
for (i_frame = 1; i_frame <= fragments->count; ++i_frame) {
fragment = se_tree_lookup32_le(fragments->fragment, i_frame);
fragment = (fragment_t *)se_tree_lookup32_le(fragments->fragment, i_frame);
length += fragment->length;
}
reassembled = se_alloc(length);
reassembled = (guint8 *)se_alloc(length);
for (i_frame = 1; i_frame <= fragments->count; ++i_frame) {
fragment = se_tree_lookup32_le(fragments->fragment, i_frame);
fragment = (fragment_t *)se_tree_lookup32_le(fragments->fragment, i_frame);
memcpy(reassembled + i_length,
fragment->data,
fragment->length);

View File

@ -1076,7 +1076,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
k_op = pdu_id | (company_id << 8);
k_frame_number = pinfo->fd->num;
fragment = se_alloc(sizeof(fragment_t));
fragment = se_new(fragment_t);
fragment->start_frame_number = pinfo->fd->num;
fragment->end_frame_number = 0;
fragment->state = 0;
@ -1084,9 +1084,9 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fragment->count = 1;
fragment->fragments = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "btavctp fragments");
data_fragment = se_alloc(sizeof(data_fragment_t));
data_fragment = se_new(data_fragment_t);
data_fragment->length = length;
data_fragment->data = se_alloc(data_fragment->length);
data_fragment->data = (guint8 *)se_alloc(data_fragment->length);
tvb_memcpy(tvb, data_fragment->data, offset, data_fragment->length);
se_tree_insert32(fragment->fragments, fragment->count, data_fragment);
@ -1144,7 +1144,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
key[6].length = 0;
key[6].key = NULL;
fragment = se_tree_lookup32_array_le(reassembling, key);
fragment = (fragment_t *)se_tree_lookup32_array_le(reassembling, key);
if (fragment && fragment->interface_id == interface_id &&
fragment->adapter_id == adapter_id &&
fragment->chandle == chandle &&
@ -1154,9 +1154,9 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fragment->count += 1;
fragment->state = 0;
data_fragment = se_alloc(sizeof(data_fragment_t));
data_fragment = se_new(data_fragment_t);
data_fragment->length = length;
data_fragment->data = se_alloc(data_fragment->length);
data_fragment->data = (guint8 *)se_alloc(data_fragment->length);
tvb_memcpy(tvb, data_fragment->data, offset, data_fragment->length);
se_tree_insert32(fragment->fragments, fragment->count, data_fragment);
}
@ -1196,7 +1196,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
key[6].length = 0;
key[6].key = NULL;
fragment = se_tree_lookup32_array_le(reassembling, key);
fragment = (fragment_t *)se_tree_lookup32_array_le(reassembling, key);
if (fragment && fragment->interface_id == interface_id &&
fragment->adapter_id == adapter_id &&
fragment->chandle == chandle &&
@ -1207,9 +1207,9 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fragment->count += 1;
fragment->state = 2;
data_fragment = se_alloc(sizeof(data_fragment_t));
data_fragment = se_new(data_fragment_t);
data_fragment->length = length;
data_fragment->data = se_alloc(data_fragment->length);
data_fragment->data = (guint8 *)se_alloc(data_fragment->length);
tvb_memcpy(tvb, data_fragment->data, offset, data_fragment->length);
se_tree_insert32(fragment->fragments, fragment->count, data_fragment);
}
@ -1219,14 +1219,14 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *pitem = NULL;
for (i_frame = 1; i_frame <= fragment->count; ++i_frame) {
data_fragment = se_tree_lookup32_le(fragment->fragments, i_frame);
data_fragment = (data_fragment_t *)se_tree_lookup32_le(fragment->fragments, i_frame);
length += data_fragment->length;
}
reassembled = se_alloc(length);
reassembled = (guint8 *)se_alloc(length);
for (i_frame = 1; i_frame <= fragment->count; ++i_frame) {
data_fragment = se_tree_lookup32_le(fragment->fragments, i_frame);
data_fragment = (data_fragment_t *)se_tree_lookup32_le(fragment->fragments, i_frame);
memcpy(reassembled + i_length,
data_fragment->data,
data_fragment->length);
@ -1695,7 +1695,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
key[6].length = 0;
key[6].key = NULL;
fragment = se_tree_lookup32_array_le(reassembling, key);
fragment = (fragment_t *)se_tree_lookup32_array_le(reassembling, key);
if (fragment && fragment->interface_id == interface_id &&
fragment->adapter_id == adapter_id &&
fragment->chandle == chandle &&
@ -1746,7 +1746,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
key[6].length = 0;
key[6].key = NULL;
fragment = se_tree_lookup32_array_le(reassembling, key);
fragment = (fragment_t *)se_tree_lookup32_array_le(reassembling, key);
if (fragment && fragment->interface_id == interface_id &&
fragment->adapter_id == adapter_id &&
fragment->chandle == chandle &&
@ -2233,7 +2233,7 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
max_response_time = 100;
}
timing_info = se_alloc(sizeof(timing_info_t));
timing_info = se_new(timing_info_t);
timing_info->command_frame_number = pinfo->fd->num;
timing_info->command_timestamp = pinfo->fd->abs_ts;
timing_info->response_frame_number = 0;
@ -2252,7 +2252,7 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
se_tree_insert32_array(timing, key, timing_info);
} else {
timing_info = se_tree_lookup32_array_le(timing, key);
timing_info = (timing_info_t *)se_tree_lookup32_array_le(timing, key);
if (timing_info && timing_info->interface_id == interface_id &&
timing_info->adapter_id == adapter_id &&
timing_info->chandle == chandle &&
@ -2297,7 +2297,7 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
timing_info = se_tree_lookup32_array_le(timing, key);
timing_info = (timing_info_t *)se_tree_lookup32_array_le(timing, key);
if (timing_info && timing_info->interface_id == interface_id &&
timing_info->adapter_id == adapter_id &&
timing_info->chandle == chandle &&

View File

@ -485,17 +485,17 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
/* (S)RTP, (S)RTCP */
if (upcoming_channel_lcl->rfc2198 > 0) {
encoding_name_and_rate_t *encoding_name_and_rate = se_alloc( sizeof(encoding_name_and_rate_t));
encoding_name_and_rate_t *encoding_name_and_rate = se_new(encoding_name_and_rate_t);
rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal);
encoding_name_and_rate->encoding_name = se_strdup("red");
encoding_name_and_rate->sample_rate = 8000;
key = se_alloc(sizeof(gint));
key = se_new(gint);
*key = upcoming_channel_lcl->rfc2198;
g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
}
if (upcoming_channel_lcl->srtp_flag) {
dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
dummy_srtp_info = se_new0(struct srtp_info);
}
/* DEBUG g_warning("h245_setup_channels media_addr.addr.type %u port %u",upcoming_channel_lcl->media_addr.addr.type, upcoming_channel_lcl->media_addr.port );
@ -3709,7 +3709,7 @@ dissect_h245_T_booleanArray(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint8));
buf = ep_new(guint8);
buf[0] = value;
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint8), sizeof(guint8));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
@ -3736,7 +3736,7 @@ dissect_h245_T_unsignedMin(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint16));
buf = (guint8 *)ep_new(guint16);
phtons(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
@ -3763,7 +3763,7 @@ dissect_h245_T_unsignedMax(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint16));
buf = (guint8 *)ep_new(guint16);
phtons(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
@ -3790,7 +3790,7 @@ dissect_h245_T_unsigned32Min(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint32));
buf = (guint8 *)ep_new(guint32);
phtonl(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
@ -3817,7 +3817,7 @@ dissect_h245_T_unsigned32Max(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
gefx = gef_ctx_get(actx->private_data);
if (gefx) {
buf = ep_alloc(sizeof(guint32));
buf = (guint8 *)ep_new(guint32);
phtonl(buf, value);
value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32));
/* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/
@ -7390,7 +7390,7 @@ dissect_h245_T_h223_al_type_al3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
#line 315 "../../asn1/h245/h245.cnf"
if(h223_lc_params_temp) {
h223_lc_params_temp->al_type = al3;
h223_lc_params_temp->al_params = se_alloc(sizeof(h223_al3_params));
h223_lc_params_temp->al_params = se_new(h223_al3_params);
}
offset = dissect_h245_Al3(tvb, offset, actx, tree, hf_index);
@ -7800,7 +7800,7 @@ dissect_h245_H223LogicalChannelParameters(tvbuff_t *tvb _U_, int offset _U_, asn
static int
dissect_h245_OLC_fw_h223_params(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 186 "../../asn1/h245/h245.cnf"
h223_fw_lc_params = se_alloc(sizeof(h223_lc_params));
h223_fw_lc_params = se_new(h223_lc_params);
h223_fw_lc_params->al_type = al_nonStandard;
h223_fw_lc_params->al_params = NULL;
h223_fw_lc_params->segmentable = 0;
@ -8431,7 +8431,7 @@ dissect_h245_T_forwardLogicalChannelParameters(tvbuff_t *tvb _U_, int offset _U_
static int
dissect_h245_OLC_rev_h223_params(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 207 "../../asn1/h245/h245.cnf"
h223_rev_lc_params = se_alloc(sizeof(h223_lc_params));
h223_rev_lc_params = se_new(h223_lc_params);
h223_rev_lc_params->al_type = al_nonStandard;
h223_rev_lc_params->al_params = NULL;
h223_rev_lc_params->segmentable = 0;
@ -8694,7 +8694,7 @@ dissect_h245_OpenLogicalChannel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
#line 130 "../../asn1/h245/h245.cnf"
gint32 temp;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_alloc0(sizeof(olc_info_t)) : NULL;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? se_new0(olc_info_t) : NULL;
h223_fw_lc_num = 0;
h223_lc_params_temp = NULL;
@ -8704,7 +8704,7 @@ dissect_h245_OpenLogicalChannel(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
if(h223_fw_lc_num != 0 && h223_fw_lc_params) {
h223_pending_olc *pending = se_alloc(sizeof(h223_pending_olc));
h223_pending_olc *pending = se_new(h223_pending_olc);
pending->fw_channel_params = h223_fw_lc_params;
pending->rev_channel_params = h223_rev_lc_params;
temp = h223_fw_lc_num;
@ -8980,7 +8980,7 @@ static int
dissect_h245_MultiplexElement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 83 "../../asn1/h245/h245.cnf"
/*MultiplexElement*/
h223_mux_element* me = se_alloc(sizeof(h223_mux_element));
h223_mux_element* me = se_new(h223_mux_element);
h223_me->next = me;
h223_me = me;
h223_me->next = NULL;
@ -11050,7 +11050,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
const gchar *olc_key;
olc_info_t *olc_req;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_alloc0(sizeof(olc_info_t)) : NULL;
upcoming_olc = (!actx->pinfo->fd->flags.visited) ? ep_new0(olc_info_t) : NULL;
h223_fw_lc_num = 0;
h223_rev_lc_num = 0;
@ -11066,7 +11066,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
actx->pinfo->p2p_dir = P2P_DIR_RECV;
else
actx->pinfo->p2p_dir = P2P_DIR_SENT;
pend = g_hash_table_lookup( h223_pending_olc_reqs[actx->pinfo->p2p_dir], GINT_TO_POINTER(temp) );
pend = (h223_pending_olc *)g_hash_table_lookup( h223_pending_olc_reqs[actx->pinfo->p2p_dir], GINT_TO_POINTER(temp) );
if (pend) {
DISSECTOR_ASSERT( ( h223_rev_lc_num && pend->rev_channel_params)
|| (!h223_rev_lc_num && !pend->rev_channel_params) );
@ -11082,7 +11082,7 @@ dissect_h245_OpenLogicalChannelAck(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t
if (upcoming_olc) {
olc_key = gen_olc_key(upcoming_olc->fwd_lc_num, &actx->pinfo->src, &actx->pinfo->dst);
olc_req = g_hash_table_lookup(h245_pending_olc_reqs, olc_key);
olc_req = (olc_info_t *)g_hash_table_lookup(h245_pending_olc_reqs, olc_key);
if (olc_req) {
update_unicast_addr(&olc_req->fwd_lc.media_addr, &upcoming_olc->fwd_lc.media_addr);
update_unicast_addr(&olc_req->fwd_lc.media_control_addr, &upcoming_olc->fwd_lc.media_control_addr);
@ -14527,7 +14527,7 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* assume that whilst there is more tvb data, there are more h245 commands */
while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=ep_alloc(sizeof(h245_packet_info));
h245_pi=ep_new(h245_packet_info);
init_h245_packet_info(h245_pi);
asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
offset = dissect_h245_MultimediaSystemControlMessage(tvb, offset, &asn1_ctx, tr, hf_h245_pdu_type);

View File

@ -202,7 +202,7 @@ nlm_print_msgres_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb)
{
nlm_msg_res_matched_data *md;
md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
md=(nlm_msg_res_matched_data *)g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
if(md){
nstime_t ns;
proto_tree_add_uint(tree, hf_nlm_request_in, tvb, 0, 0, md->req_frame);
@ -216,7 +216,7 @@ nlm_print_msgres_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb)
{
nlm_msg_res_matched_data *md;
md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
md=(nlm_msg_res_matched_data *)g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
if(md){
proto_tree_add_uint(tree, hf_nlm_reply_in, tvb, 0, 0, md->rep_frame);
}
@ -226,7 +226,7 @@ nlm_match_fhandle_reply(packet_info *pinfo, proto_tree *tree)
{
nlm_msg_res_matched_data *md;
md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
md=(nlm_msg_res_matched_data *)g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
if(md && md->rep_frame){
dissect_fhandle_hidden(pinfo,
tree, md->req_frame);
@ -237,7 +237,7 @@ nlm_match_fhandle_request(packet_info *pinfo, proto_tree *tree)
{
nlm_msg_res_matched_data *md;
md=g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
md=(nlm_msg_res_matched_data *)g_hash_table_lookup(nlm_msg_res_matched, GINT_TO_POINTER(pinfo->fd->num));
if(md && md->rep_frame){
dissect_fhandle_hidden(pinfo,
tree, md->rep_frame);
@ -254,11 +254,11 @@ nlm_register_unmatched_res(packet_info *pinfo, tvbuff_t *tvb, int offset)
umd.cookie=tvb_get_ptr(tvb, offset+4, -1);
/* have we seen this cookie before? */
old_umd=g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)&umd);
old_umd=(nlm_msg_res_unmatched_data *)g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)&umd);
if(old_umd){
nlm_msg_res_matched_data *md;
md=g_malloc(sizeof(nlm_msg_res_matched_data));
md=(nlm_msg_res_matched_data *)g_malloc(sizeof(nlm_msg_res_matched_data));
md->req_frame=old_umd->req_frame;
md->rep_frame=pinfo->fd->num;
md->ns=old_umd->ns;
@ -278,14 +278,14 @@ nlm_register_unmatched_msg(packet_info *pinfo, tvbuff_t *tvb, int offset)
nlm_msg_res_unmatched_data *old_umd;
/* allocate and build the unmatched structure for this request */
umd=g_malloc(sizeof(nlm_msg_res_unmatched_data));
umd=(nlm_msg_res_unmatched_data *)g_malloc(sizeof(nlm_msg_res_unmatched_data));
umd->req_frame=pinfo->fd->num;
umd->ns=pinfo->fd->abs_ts;
umd->cookie_len=tvb_get_ntohl(tvb, offset);
umd->cookie=tvb_memdup(tvb, offset+4, umd->cookie_len);
umd->cookie=(const guint8 *)tvb_memdup(tvb, offset+4, umd->cookie_len);
/* remove any old duplicates */
old_umd=g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)umd);
old_umd=(nlm_msg_res_unmatched_data *)g_hash_table_lookup(nlm_msg_res_unmatched, (gconstpointer)umd);
if(old_umd){
g_hash_table_remove(nlm_msg_res_unmatched, (gconstpointer)old_umd);
g_free((gpointer)old_umd->cookie);
@ -419,7 +419,7 @@ dissect_nlm_test(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, int version)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==6){ /* NLM_TEST_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -446,7 +446,7 @@ dissect_nlm_lock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==7){ /* NLM_LOCK_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -475,7 +475,7 @@ dissect_nlm_cancel(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==8){ /* NLM_CANCEL_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -502,7 +502,7 @@ dissect_nlm_unlock(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==9){ /* NLM_UNLOCK_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -527,7 +527,7 @@ dissect_nlm_granted(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree,int version)
{
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==10){ /* NLM_GRANTED_MSG */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_msg(pinfo, tvb, offset);
@ -557,7 +557,7 @@ dissect_nlm_test_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree* lock_tree = NULL;
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if(rpc_call->proc==11){ /* NLM_TEST_RES */
if( (!pinfo->fd->flags.visited) ){
nlm_register_unmatched_res(pinfo, tvb, offset);
@ -706,7 +706,7 @@ dissect_nlm_gen_reply(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
guint32 nlm_stat;
if(nlm_match_msgres){
rpc_call_info_value *rpc_call=pinfo->private_data;
rpc_call_info_value *rpc_call=(rpc_call_info_value *)pinfo->private_data;
if((rpc_call->proc==12) /* NLM_LOCK_RES */
|| (rpc_call->proc==13) /* NLM_CANCEL_RES */
|| (rpc_call->proc==14) /* NLM_UNLOCK_RES */

View File

@ -1513,7 +1513,7 @@ dissect_amf3_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, proto_item
iArrayLength = iIntegerValue >> 1;
proto_tree_add_uint(val_tree, hf_amf_bytearraylength, tvb, iValueOffset, iValueLength, iArrayLength);
iValueOffset += iValueLength;
iByteArrayValue = ep_tvb_memdup(tvb, iValueOffset, iArrayLength);
iByteArrayValue = (guint8 *)ep_tvb_memdup(tvb, iValueOffset, iArrayLength);
proto_tree_add_bytes(val_tree, hf_amf_bytearray, tvb, iValueOffset, iArrayLength, iByteArrayValue);
proto_item_append_text(ti, " %s", bytes_to_str(iByteArrayValue, iArrayLength));
if (parent_ti != NULL)
@ -1886,15 +1886,15 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
packets = ep_stack_new();
ep_stack_push(packets, 0);
tp = se_tree_lookup32_le(rconv->packets[cdir], seq+remain-1);
tp = (rtmpt_packet_t *)se_tree_lookup32_le(rconv->packets[cdir], seq+remain-1);
while (tp && tp->lastseq>=seq) {
ep_stack_push(packets, tp);
tp = se_tree_lookup32_le(rconv->packets[cdir], tp->lastseq-1);
tp = (rtmpt_packet_t *)se_tree_lookup32_le(rconv->packets[cdir], tp->lastseq-1);
}
/* Dissect the generated list in reverse order (beginning to end) */
while ((tp=ep_stack_pop(packets))!=NULL) {
while ((tp=(rtmpt_packet_t *)ep_stack_pop(packets))!=NULL) {
if (tp->resident) {
pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have);
add_new_data_source(pinfo, pktbuf, "Unchunked RTMP");
@ -1915,7 +1915,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
/* Check for outstanding fragmented headers/chunks first */
if (offset==0) {
tf = se_tree_lookup32_le(rconv->frags[cdir], seq+offset-1);
tf = (rtmpt_frag_t *)se_tree_lookup32_le(rconv->frags[cdir], seq+offset-1);
if (tf) {
/* May need to reassemble cross-TCP-segment fragments */
@ -1923,8 +1923,8 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
if (tf->have>=tf->len || seq+offset<tf->seq || seq+offset>tf->lastseq+tf->len-tf->have) {
tf = NULL;
} else if (!tf->ishdr) {
ti = se_tree_lookup32(rconv->ids[cdir], tf->saved.id);
if (ti) tp = se_tree_lookup32_le(ti->packets, seq+offset-1);
ti = (rtmpt_id_t *)se_tree_lookup32(rconv->ids[cdir], tf->saved.id);
if (ti) tp = (rtmpt_packet_t *)se_tree_lookup32_le(ti->packets, seq+offset-1);
if (tp && tp->chunkwant) {
goto unchunk;
}
@ -1990,7 +1990,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
if (remain<basic_hlen+message_hlen) {
/* Ran out of packet mid-header, save and try again next time */
tf = se_alloc(sizeof(rtmpt_frag_t));
tf = se_new(rtmpt_frag_t);
tf->ishdr = 1;
tf->seq = seq + offset;
tf->lastseq = tf->seq + remain - 1;
@ -2020,8 +2020,8 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
/* Calculate header values, defaulting from previous packets with same id */
if (id<=RTMPT_ID_MAX) ti = se_tree_lookup32(rconv->ids[cdir], id);
if (ti) tp = se_tree_lookup32_le(ti->packets, seq+offset-1);
if (id<=RTMPT_ID_MAX) ti = (rtmpt_id_t *)se_tree_lookup32(rconv->ids[cdir], id);
if (ti) tp = (rtmpt_packet_t *)se_tree_lookup32_le(ti->packets, seq+offset-1);
if (header_type==0) src = tf ? pntohl(tf->saved.d+basic_hlen+7) : tvb_get_ntohl(tvb, offset+basic_hlen+7);
else if (ti) src = ti->src;
@ -2061,7 +2061,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
ti, tp, header_type, basic_hlen+message_hlen, id, tp?tp->have:0, tp?tp->want:0, body_len, chunk_size);
if (!ti) {
ti = se_alloc(sizeof(rtmpt_id_t));
ti = se_new(rtmpt_id_t);
ti->packets = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_packets");
ti->ts = 0;
ti->tsd = 0;
@ -2088,7 +2088,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
}
/* create a new packet structure */
tp = se_alloc(sizeof(rtmpt_packet_t));
tp = se_new(rtmpt_packet_t);
tp->seq = tp->lastseq = tf ? tf->seq : seq+offset;
tp->have = 0;
tp->want = basic_hlen + message_hlen + body_len;
@ -2136,7 +2136,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
} else {
/* Some more reassembly required */
tp->resident = TRUE;
tp->data.p = se_alloc(tp->bhlen+tp->mhlen+tp->len);
tp->data.p = (guint8 *)se_alloc(tp->bhlen+tp->mhlen+tp->len);
if (tf && tf->ishdr) {
memcpy(tp->data.p, tf->saved.d, tf->len);
@ -2209,7 +2209,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp);
} else if (tp->chunkhave<tp->chunkwant) {
/* Chunk is split across segment boundary */
rtmpt_frag_t *tf2 = se_alloc(sizeof(rtmpt_frag_t));
rtmpt_frag_t *tf2 = se_new(rtmpt_frag_t);
tf2->ishdr = 0;
tf2->seq = seq + offset - want;
tf2->lastseq = tf2->seq + remain - 1 + want;
@ -2225,7 +2225,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_
static rtmpt_conv_t*
rtmpt_init_rconv(conversation_t *conv)
{
rtmpt_conv_t *rconv = se_alloc(sizeof(rtmpt_conv_t));
rtmpt_conv_t *rconv = se_new(rtmpt_conv_t);
conversation_add_proto_data(conv, proto_rtmpt, rconv);
rconv->seqs[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_seqs0");
@ -2267,7 +2267,7 @@ dissect_rtmpt_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conv->key_ptr->port1==pinfo->srcport &&
conv->key_ptr->port2==pinfo->destport) ? 0 : 1;
tcpinfo = pinfo->private_data;
tcpinfo = (struct tcpinfo *)pinfo->private_data;
dissect_rtmpt_common(tvb, pinfo, tree, rconv, cdir, tcpinfo->seq, tcpinfo->lastackseq);
}

View File

@ -232,7 +232,7 @@ dissect_usb_audio_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre
guint offset;
guint length = tvb_length(tvb);
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBAUDIO");

View File

@ -759,7 +759,7 @@ dissect_usb_hid_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
is_request = (pinfo->srcport==NO_ENDPOINT);
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
usb_trans_info = usb_conv_info->usb_trans_info;
/* See if we can find a class specific dissector for this request */

View File

@ -620,7 +620,7 @@ dissect_usb_hub_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
is_request = (pinfo->srcport==NO_ENDPOINT);
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
usb_trans_info = usb_conv_info->usb_trans_info;
/* See if we can find a class specific dissector for this request */

View File

@ -139,7 +139,7 @@ dissect_usb_ms_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
is_request=(pinfo->srcport==NO_ENDPOINT);
usb_conv_info=pinfo->usb_conv_info;
usb_conv_info=(usb_conv_info_t *)pinfo->usb_conv_info;
usb_trans_info=usb_conv_info->usb_trans_info;
@ -190,11 +190,11 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
itl_nexus_t *itl;
itlq_nexus_t *itlq;
usb_conv_info=pinfo->usb_conv_info;
usb_conv_info=(usb_conv_info_t *)pinfo->usb_conv_info;
/* verify that we do have a usb_ms_conv_info */
usb_ms_conv_info=usb_conv_info->class_data;
usb_ms_conv_info=(usb_ms_conv_info_t *)usb_conv_info->class_data;
if(!usb_ms_conv_info){
usb_ms_conv_info=se_alloc(sizeof(usb_ms_conv_info_t));
usb_ms_conv_info=se_new(usb_ms_conv_info_t);
usb_ms_conv_info->itl=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "USB ITL");
usb_ms_conv_info->itlq=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "USB ITLQ");
usb_conv_info->class_data=usb_ms_conv_info;
@ -253,7 +253,7 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* make sure we have a ITL structure for this LUN */
itl=(itl_nexus_t *)se_tree_lookup32(usb_ms_conv_info->itl, lun);
if(!itl){
itl=se_alloc(sizeof(itl_nexus_t));
itl=se_new(itl_nexus_t);
itl->cmdset=0xff;
itl->conversation=NULL;
se_tree_insert32(usb_ms_conv_info->itl, lun, itl);
@ -262,7 +262,7 @@ dissect_usb_ms_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* make sure we have an ITLQ structure for this LUN/transaction */
itlq=(itlq_nexus_t *)se_tree_lookup32(usb_ms_conv_info->itlq, pinfo->fd->num);
if(!itlq){
itlq=se_alloc(sizeof(itlq_nexus_t));
itlq=se_new(itlq_nexus_t);
itlq->lun=lun;
itlq->scsi_opcode=0xffff;
itlq->task_flags=0;

View File

@ -1019,11 +1019,11 @@ dissect_usb_video_control_interface_descriptor(proto_tree *parent_tree, tvbuff_t
/* Switch to the usb_conv_info of the Video Control interface */
usb_conv_info = get_usb_iface_conv_info(pinfo, usb_conv_info->interfaceNum);
video_conv_info = usb_conv_info->class_data;
video_conv_info = (video_conv_info_t *)usb_conv_info->class_data;
if (!video_conv_info)
{
video_conv_info = se_alloc(sizeof(video_conv_info_t));
video_conv_info = se_new(video_conv_info_t);
video_conv_info->entities = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
"USBVIDEO Entities");
usb_conv_info->class_data = video_conv_info;
@ -1032,7 +1032,7 @@ dissect_usb_video_control_interface_descriptor(proto_tree *parent_tree, tvbuff_t
entity = (video_entity_t*) se_tree_lookup32(video_conv_info->entities, entity_id);
if (!entity)
{
entity = se_alloc(sizeof(video_entity_t));
entity = se_new(video_entity_t);
entity->entityID = entity_id;
entity->subtype = subtype;
entity->terminalType = terminal_type;
@ -1489,7 +1489,7 @@ dissect_usb_vid_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
usb_conv_info_t *usb_conv_info;
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
if (usb_conv_info->interfaceSubclass == SC_VIDEOCONTROL)
{
offset = dissect_usb_video_control_interface_descriptor(tree, desc_tvb,
@ -1602,7 +1602,7 @@ get_control_selector_values(guint8 entity_id, usb_conv_info_t *usb_conv_info)
video_entity_t *entity = NULL;
const value_string_ext *selectors = NULL;
video_conv_info = usb_conv_info->class_data;
video_conv_info = (video_conv_info_t *)usb_conv_info->class_data;
if (video_conv_info)
entity = (video_entity_t*) se_tree_lookup32(video_conv_info->entities, entity_id);
@ -2002,7 +2002,7 @@ dissect_usb_vid_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
is_request = (pinfo->srcport == NO_ENDPOINT);
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
usb_trans_info = usb_conv_info->usb_trans_info;
/* See if we can find a class specific dissector for this request */
@ -2054,7 +2054,7 @@ dissect_usb_vid_interrupt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
gint bytes_available;
int offset = 0;
usb_conv_info = pinfo->usb_conv_info;
usb_conv_info = (usb_conv_info_t *)pinfo->usb_conv_info;
bytes_available = tvb_length_remaining(tvb, offset);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBVIDEO");

View File

@ -823,10 +823,10 @@ get_usb_conv_info(conversation_t *conversation)
usb_conv_info_t *usb_conv_info;
/* do we have conversation specific data ? */
usb_conv_info = conversation_get_proto_data(conversation, proto_usb);
usb_conv_info = (usb_conv_info_t *)conversation_get_proto_data(conversation, proto_usb);
if (!usb_conv_info) {
/* no not yet so create some */
usb_conv_info = se_alloc0(sizeof(usb_conv_info_t));
usb_conv_info = se_new0(usb_conv_info_t);
usb_conv_info->interfaceClass = IF_CLASS_UNKNOWN;
usb_conv_info->interfaceSubclass = IF_SUBCLASS_UNKNOWN;
usb_conv_info->interfaceProtocol = IF_PROTOCOL_UNKNOWN;
@ -1031,7 +1031,7 @@ dissect_usb_device_qualifier_descriptor(packet_info *pinfo _U_, proto_tree *pare
key[3].length = 0;
key[3].key = NULL;
device_protocol_data = se_alloc(sizeof(device_protocol_data_t));
device_protocol_data = se_new(device_protocol_data_t);
device_protocol_data->protocol = protocol;
device_protocol_data->bus_id = bus_id;
device_protocol_data->device_address = device_address;
@ -1079,7 +1079,7 @@ dissect_usb_device_descriptor(packet_info *pinfo, proto_tree *parent_tree,
tree = proto_item_add_subtree(item, ett_descriptor_device);
}
usb_conv_info=pinfo->usb_conv_info;
usb_conv_info=(usb_conv_info_t *)pinfo->usb_conv_info;
dissect_usb_descriptor_header(tree, tvb, offset);
offset += 2;
@ -1146,14 +1146,14 @@ dissect_usb_device_descriptor(packet_info *pinfo, proto_tree *parent_tree,
key[3].length = 0;
key[3].key = NULL;
device_product_data = se_alloc(sizeof(device_product_data_t));
device_product_data = se_new(device_product_data_t);
device_product_data->vendor = vendor_id;
device_product_data->product = product_id;
device_product_data->bus_id = bus_id;
device_product_data->device_address = device_address;
se_tree_insert32_array(device_to_product_table, key, device_product_data);
device_protocol_data = se_alloc(sizeof(device_protocol_data_t));
device_protocol_data = se_new(device_protocol_data_t);
device_protocol_data->protocol = protocol;
device_protocol_data->bus_id = bus_id;
device_protocol_data->device_address = device_address;
@ -2334,7 +2334,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
setup_flag = tvb_get_guint8(tvb, 14);
offset += 40; /* skip first part of the pseudo-header */
usb_data = se_alloc(sizeof(usb_data_t));
usb_data = se_new(usb_data_t);
usb_data->bus_id = bus_id;
usb_data->device_address = device_address;
usb_data->endpoint = endpoint;
@ -2380,9 +2380,9 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
*/
if (is_request) {
/* this is a request */
usb_trans_info = se_tree_lookup32(usb_conv_info->transactions, pinfo->fd->num);
usb_trans_info = (usb_trans_info_t *)se_tree_lookup32(usb_conv_info->transactions, pinfo->fd->num);
if (!usb_trans_info) {
usb_trans_info = se_alloc0(sizeof(usb_trans_info_t));
usb_trans_info = se_new0(usb_trans_info_t);
usb_trans_info->request_in = pinfo->fd->num;
usb_trans_info->req_time = pinfo->fd->abs_ts;
usb_trans_info->header_len_64 = header_len_64_bytes;
@ -2400,9 +2400,9 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
} else {
/* this is a response */
if (pinfo->fd->flags.visited) {
usb_trans_info = se_tree_lookup32(usb_conv_info->transactions, pinfo->fd->num);
usb_trans_info = (usb_trans_info_t *)se_tree_lookup32(usb_conv_info->transactions, pinfo->fd->num);
} else {
usb_trans_info = se_tree_lookup32_le(usb_conv_info->transactions, pinfo->fd->num);
usb_trans_info = (usb_trans_info_t *)se_tree_lookup32_le(usb_conv_info->transactions, pinfo->fd->num);
if (usb_trans_info) {
usb_trans_info->response_in = pinfo->fd->num;
se_tree_insert32(usb_conv_info->transactions, pinfo->fd->num, usb_trans_info);
@ -2424,7 +2424,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
}
}
tap_data = ep_alloc(sizeof(usb_tap_data_t));
tap_data = ep_new(usb_tap_data_t);
tap_data->urb_type = tvb_get_guint8(tvb, 8);
tap_data->transfer_type = (guint8)type;
tap_data->conv_info = usb_conv_info;
@ -2920,7 +2920,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
key[3].length = 0;
key[3].key = NULL;
device_protocol_data = se_tree_lookup32_array_le(device_to_protocol_table, key);
device_protocol_data = (device_protocol_data_t *)se_tree_lookup32_array_le(device_to_protocol_table, key);
if (device_protocol_data && device_protocol_data->bus_id == bus_id &&
device_protocol_data->device_address == device_address &&
dissector_try_uint(protocol_to_dissector, (guint32) device_protocol_data->protocol, next_tvb, pinfo, parent)) {
@ -2928,7 +2928,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
} else {
device_product_data_t *device_product_data;
device_product_data = se_tree_lookup32_array_le(device_to_product_table, key);
device_product_data = (device_product_data_t *)se_tree_lookup32_array_le(device_to_product_table, key);
if (device_product_data && device_product_data->bus_id == bus_id &&
device_product_data->device_address == device_address &&
dissector_try_uint(product_to_dissector, (guint32) (device_product_data->vendor << 16 | device_product_data->product), next_tvb, pinfo, parent)) {