tvb_new_real_data -> tvb_new_child_real_data

svn path=/trunk/; revision=28517
This commit is contained in:
Anders Broman 2009-05-29 06:16:43 +00:00
parent 96505bc99d
commit b4aeb97ed5
6 changed files with 9 additions and 19 deletions

View File

@ -12157,9 +12157,8 @@ static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len) {
if (wep_decrypt(tmp, len, i) == 0) {
/* decrypt successful, let's set up a new data tvb. */
decr_tvb = tvb_new_real_data(tmp, len-8, len-8);
decr_tvb = tvb_new_child_real_data(tvb, tmp, len-8, len-8);
tvb_set_free_cb(decr_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
break;
}

View File

@ -483,7 +483,7 @@ dissect_avps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *avp_tree)
"AVP Value (EAP packet)");
avp_eap_tree = proto_item_add_subtree(avp_eap_item, ett_pana_avp);
eap_tvb = tvb_new_subset(tvb, offset, avp_data_length, avp_data_length);
if (avp_eap_tree != NULL && eap_handle != NULL) {
if (eap_handle != NULL) {
call_dissector(eap_handle, eap_tvb, pinfo, avp_eap_tree);
}
break;

View File

@ -3223,15 +3223,9 @@ dissect_rpc_fragment(tvbuff_t *tvb, int offset, packet_info *pinfo,
* Create a new TVB structure for
* defragmented data.
*/
rec_tvb = tvb_new_real_data(ipfd_head->data,
rec_tvb = tvb_new_child_real_data(tvb, ipfd_head->data,
ipfd_head->datalen, ipfd_head->datalen);
/*
* Add this tvb as a child to the original
* one.
*/
tvb_set_child_real_data_tvbuff(tvb, rec_tvb);
/*
* Add defragmented data to the data source list.
*/

View File

@ -15140,9 +15140,8 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
if(r_fd){
proto_item *frag_tree_item;
pd_tvb = tvb_new_real_data(r_fd->data, r_fd->datalen,
pd_tvb = tvb_new_child_real_data(tvb, r_fd->data, r_fd->datalen,
r_fd->datalen);
tvb_set_child_real_data_tvbuff(tvb, pd_tvb);
add_new_data_source(pinfo, pd_tvb, "Reassembled SMB");
show_fragment_tree(r_fd, &smb_frag_items, tree, pinfo, pd_tvb, &frag_tree_item);
}

View File

@ -3577,11 +3577,10 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(ipfd_head){
tvbuff_t *next_tvb;
/* create a new TVB structure for desegmented data */
next_tvb = tvb_new_real_data(ipfd_head->data, ipfd_head->datalen, ipfd_head->datalen);
/* add this tvb as a child to the original one */
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
/* create a new TVB structure for desegmented data
* datalen-1 to strip the dummy FIN byte off
*/
next_tvb = tvb_new_child_real_data(tvb, ipfd_head->data, ipfd_head->datalen, ipfd_head->datalen);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Reassembled TCP");

View File

@ -579,8 +579,7 @@ dissect_zbee_secure(tvbuff_t *tvb, packet_info *pinfo, proto_tree* tree, guint o
}
/* Setup the new tvbuff_t and return */
payload_tvb = tvb_new_real_data(dec_buffer, payload_len, payload_len);
tvb_set_child_real_data_tvbuff(tvb, payload_tvb);
payload_tvb = tvb_new_child_real_data(tvb, dec_buffer, payload_len, payload_len);
add_new_data_source(pinfo, payload_tvb, "Decrypted ZigBee Payload");
/* Done! */
return payload_tvb;