Apply some of the patches from:

http://wiki.wireshark.org/Development/Optimization

svn path=/trunk/; revision=28356
This commit is contained in:
Anders Broman 2009-05-13 19:46:11 +00:00
parent fbd05f0fce
commit c91a384702
55 changed files with 106 additions and 213 deletions

View File

@ -634,10 +634,9 @@ decrypt_gssapi_krb_arcfour_wrap(proto_tree *tree, packet_info *pinfo, tvbuff_t *
);
if (ret >= 0) {
proto_tree_add_text(tree, NULL, 0, 0, "[Decrypted using: %s]", ek->key_origin);
pinfo->gssapi_decrypted_tvb=tvb_new_real_data(
pinfo->gssapi_decrypted_tvb=tvb_new_child_real_data(tvb,
output_message_buffer,
ret, ret);
tvb_set_child_real_data_tvbuff(tvb, pinfo->gssapi_decrypted_tvb);
add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
return;
}

View File

@ -71,14 +71,14 @@ size_t epan_base64_decode(char *s)
string */
tvbuff_t *
base64_to_tvb(const char *base64)
base64_to_tvb(tvbuff_t *parent, const char *base64)
{
tvbuff_t *tvb;
char *data = g_strdup(base64);
gint len;
len = (gint) epan_base64_decode(data);
tvb = tvb_new_real_data((const guint8 *)data, len, len);
tvb = tvb_new_child_real_data(parent, (const guint8 *)data, len, len);
tvb_set_free_cb(tvb, g_free);

View File

@ -32,7 +32,7 @@ extern "C" {
/* In-place decoding of a base64 string. */
size_t epan_base64_decode(char *s);
extern tvbuff_t* base64_to_tvb(const char *base64);
extern tvbuff_t* base64_to_tvb(tvbuff_t *parent, const char *base64);
#ifdef __cplusplus
}

View File

@ -925,12 +925,10 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int o
if(fd_head) {
if(fd_head->next) {
reassembled_tvb = tvb_new_real_data(fd_head->data,
reassembled_tvb = tvb_new_child_real_data(next_tvb, fd_head->data,
fd_head->len,
fd_head->len);
tvb_set_child_real_data_tvbuff(next_tvb, reassembled_tvb);
/* not sure I really want to do this here - should be nearer the application where we can give it a better name*/
add_new_data_source(actx->pinfo, reassembled_tvb, "Reassembled OCTET STRING");

View File

@ -1669,7 +1669,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset++;
if (check_col(pinfo->cinfo, COL_INFO)){
col_set_str(pinfo->cinfo,COL_INFO, val_to_str(message_type,bssap_plus_message_type_values,"Unknown %u"));
col_add_str(pinfo->cinfo,COL_INFO, val_to_str(message_type,bssap_plus_message_type_values,"Unknown %u"));
}
switch(message_type){

View File

@ -210,8 +210,7 @@ dissect_btacl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if(mfp && mfp->last_frame==pinfo->fd->num){
next_tvb = tvb_new_real_data((guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, (guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
add_new_data_source(pinfo, next_tvb, "Reassembled BTHCI ACL");
/* call L2CAP dissector */

View File

@ -704,8 +704,7 @@ static void dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
if(segment == 0x02 && mfp && mfp->last_frame==pinfo->fd->num){
next_tvb = tvb_new_real_data((guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, (guint8*)mfp->reassembled, mfp->tot_len, mfp->tot_len);
add_new_data_source(pinfo, next_tvb, "Reassembled L2CAP");
}
/*pass up to higher layer if we have a complete packet*/

View File

@ -760,8 +760,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
rfcomm_ppp_frame *p;
for (p = rps->ppp_first; p; p = p->next) {
next_tvb = tvb_new_real_data((guint8 *) (p + 1), p->len, p->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, (guint8 *) (p + 1), p->len, p->len);
add_new_data_source(pinfo, next_tvb, "Reassembled PPP frame");
call_dissector(ppp_handle, next_tvb, pinfo, tree);
}

View File

@ -263,7 +263,7 @@ dissect_cdt_CompressedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
return offset;
}
next_tvb = tvb_uncompress (compr_tvb, 0, tvb_length (compr_tvb));
next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_length (compr_tvb));
if (next_tvb == NULL) {
tf = proto_tree_add_text (top_tree, tvb, save_offset, -1,
@ -276,7 +276,6 @@ dissect_cdt_CompressedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
return offset;
}
tvb_set_child_real_data_tvbuff (tvb, next_tvb);
add_new_data_source (actx->pinfo, next_tvb, "Uncompressed Content");
switch (content_type) {

View File

@ -4064,10 +4064,9 @@ mapi_dissect_element_EcDoRpc_request_(tvbuff_t *tvb _U_, int offset _U_, packet_
for (i = 0; i < size; i++) {
decrypted_data[i] = ptr[i] ^ 0xA5;
}
decrypted_tvb = tvb_new_real_data(decrypted_data, size, reported_len);
decrypted_tvb=tvb_new_child_real_data(tvb, decrypted_data, size, reported_len);
tvb_set_free_cb(decrypted_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, decrypted_tvb);
add_new_data_source(pinfo, decrypted_tvb, "Decrypted MAPI");
it = proto_tree_add_text(tree, decrypted_tvb, 0, size, "Decrypted MAPI PDU");
tr = proto_item_add_subtree(it, ett_mapi_mapi_request);
@ -4311,9 +4310,8 @@ mapi_dissect_element_EcDoRpc_response_(tvbuff_t *tvb _U_, int offset _U_, packet
for (i = 0; i < size; i++) {
decrypted_data[i] = ptr[i] ^ 0xA5;
}
decrypted_tvb = tvb_new_real_data(decrypted_data, size, reported_len);
decrypted_tvb=tvb_new_child_real_data(tvb, decrypted_data, size, reported_len);
tvb_set_free_cb(decrypted_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, decrypted_tvb);
add_new_data_source(pinfo, decrypted_tvb, "Decrypted MAPI");
it = proto_tree_add_text(tree, decrypted_tvb, 0, size, "Decrypted MAPI PDU");
tr = proto_item_add_subtree(it, ett_mapi_mapi_response);

View File

@ -452,8 +452,7 @@ dissect_spoolss_buffer_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
between the 'DCERPC over SMB' tvb and the buffer
tvb with no visual cues as to what is going on. */
b->tvb = tvb_new_real_data(data, size, size);
tvb_set_child_real_data_tvbuff(tvb, b->tvb);
b->tvb = tvb_new_child_real_data(tvb, data, size, size);
add_new_data_source(pinfo, b->tvb, "SPOOLSS buffer");
b->item = item;

View File

@ -3114,12 +3114,9 @@ end_cn_stub:
tvbuff_t *next_tvb;
proto_item *frag_tree_item;
next_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
if(decrypted_tvb){
tvb_set_child_real_data_tvbuff(decrypted_tvb, next_tvb);
} else {
tvb_set_child_real_data_tvbuff(payload_tvb, next_tvb);
}
next_tvb = tvb_new_child_real_data((decrypted_tvb)?decrypted_tvb:payload_tvb,
fd_head->data, fd_head->len, fd_head->len);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_tree(fd_head, &dcerpc_frag_items,
tree, pinfo, next_tvb, &frag_tree_item);
@ -3797,8 +3794,7 @@ dissect_dcerpc_cn_fault (tvbuff_t *tvb, gint offset, packet_info *pinfo,
tvbuff_t *next_tvb;
proto_item *frag_tree_item;
next_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_tree(fd_head, &dcerpc_frag_items,
dcerpc_tree, pinfo, next_tvb, &frag_tree_item);
@ -4505,8 +4501,7 @@ dissect_dcerpc_dg_stub (tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We completed reassembly... */
if(pinfo->fd->num==fd_head->reassembled_in) {
/* ...and this is the reassembled RPC PDU */
next_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
add_new_data_source(pinfo, next_tvb, "Reassembled DCE/RPC");
show_fragment_seq_tree(fd_head, &dcerpc_frag_items,
tree, pinfo, next_tvb, &pi);

View File

@ -345,8 +345,7 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
guint8 *output = (guint8*) g_malloc (decoded_size);
rs_deinterleave(input, deinterleaved, plen, fcount);
dtvb = tvb_new_real_data(deinterleaved, reassembled_size, reassembled_size);
tvb_set_child_real_data_tvbuff(tvb, dtvb);
dtvb = tvb_new_child_real_data(tvb, deinterleaved, reassembled_size, reassembled_size);
add_new_data_source(pinfo, dtvb, "Deinterleaved");
tvb_set_free_cb(dtvb, g_free);
@ -354,8 +353,7 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
if(tree)
proto_tree_add_boolean (tree, hf_edcp_rs_ok, tvb, offset, 2, decoded);
new_tvb = tvb_new_real_data(output, decoded_size, decoded_size);
tvb_set_child_real_data_tvbuff(dtvb, new_tvb);
new_tvb = tvb_new_child_real_data(dtvb, output, decoded_size, decoded_size);
add_new_data_source(pinfo, new_tvb, "RS Error Corrected Data");
tvb_set_free_cb(new_tvb, g_free);
}

View File

@ -2506,8 +2506,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* if all crc OK, set up new tvb */
if (crc_OK)
{
al_tvb = tvb_new_real_data(tmp, (guint) (tmp_ptr-tmp), (gint) (tmp_ptr-tmp));
tvb_set_child_real_data_tvbuff(tvb, al_tvb);
al_tvb = tvb_new_child_real_data(tvb, tmp, (guint) (tmp_ptr-tmp), (gint) (tmp_ptr-tmp));
/* Check for fragmented packet */
save_fragmented = pinfo->fragmented;

View File

@ -801,10 +801,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
appl_data->plain_data.data_len);
/* create a new TVB structure for desegmented data */
next_tvb = tvb_new_real_data(appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
/* add this tvb as a child to the original one */
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
add_new_data_source(pinfo, next_tvb, "Decrypted DTLS data");
@ -1315,7 +1312,6 @@ dissect_dtls_hnd_hello_common(tvbuff_t *tvb, proto_tree *tree,
tvb, offset++, 1, 0);
if (session_id_length > 0)
{
tvb_ensure_bytes_exist(tvb, offset, session_id_length);
proto_tree_add_bytes_format(tree, hf_dtls_handshake_session_id,
tvb, offset, session_id_length,
tvb_get_ptr(tvb, offset, session_id_length),
@ -1433,7 +1429,6 @@ dissect_dtls_hnd_cli_hello(tvbuff_t *tvb,
if (cookie_length > 0)
{
tvb_ensure_bytes_exist(tvb, offset, cookie_length);
proto_tree_add_bytes_format(tree, hf_dtls_handshake_cookie,
tvb, offset, cookie_length,
tvb_get_ptr(tvb, offset, cookie_length),
@ -1564,7 +1559,6 @@ static void dissect_dtls_hnd_hello_verify_request(tvbuff_t *tvb,
if (cookie_length > 0)
{
tvb_ensure_bytes_exist(tvb, offset, cookie_length);
proto_tree_add_bytes_format(tree, hf_dtls_handshake_cookie,
tvb, offset, cookie_length,
tvb_get_ptr(tvb, offset, cookie_length),
@ -1805,7 +1799,6 @@ dissect_dtls_hnd_cert_req(tvbuff_t *tvb,
tvb, offset, 2, FALSE);
offset += 2;
tvb_ensure_bytes_exist(tvb, offset, name_length);
proto_tree_add_bytes_format(subtree,
hf_dtls_handshake_dname,
tvb, offset, name_length,

View File

@ -1002,10 +1002,9 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *frag_tree_item;
next_tvb = tvb_new_real_data(fd_head->data,
next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len,
fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
add_new_data_source(pinfo, next_tvb, "Reassembled EAP-TLS");
show_fragment_seq_tree(fd_head, &eaptls_frag_items,

View File

@ -2950,13 +2950,13 @@ static int dissect_kademlia_udp_compressed_message(guint8 msg_type,
{
tvbuff_t *tvbraw = NULL;
tvbraw = tvb_uncompress(tvb, offset, length);
tvbraw = tvb_child_uncompress(tvb, tvb, offset, length);
if (tvbraw) {
guint32 raw_length;
raw_length = tvb_length( tvbraw );
tvb_set_child_real_data_tvbuff(tvb, tvbraw);
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
dissect_kademlia_udp_message( msg_type, tvbraw, pinfo, 0, raw_length, tree );
@ -3067,11 +3067,11 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre
* stream.
*/
message_name = val_to_str(msg_type, edonkey_tcp_msgs, "Unknown");
tvbraw = tvb_uncompress(tvb, offset+1, msg_len-1);
if (tvbraw) {
dissector = dissect_edonkey_tcp_message;
break;
}
tvbraw = tvb_child_uncompress(tvb, tvb, offset+1, msg_len-1);
if (tvbraw) {
dissector = dissect_edonkey_tcp_message;
break;
}
default:
message_name = "Unknown";
@ -3087,18 +3087,17 @@ static void dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tre
if (edonkey_msg_tree) {
proto_tree_add_uint_format(edonkey_msg_tree, hf_edonkey_message_type, tvb, offset, 1, msg_type,
"Message Type: %s (0x%02x)", message_name, msg_type);
if (dissector && (msg_len > 1)) {
if (!tvbraw) {
(*dissector)(msg_type, tvb, pinfo, offset+1, msg_len-1, edonkey_msg_tree);
} else {
ti = proto_tree_add_item(edonkey_msg_tree, hf_emule_zlib, tvb,
offset+1, msg_len-1, FALSE);
emule_zlib_tree = proto_item_add_subtree(ti, ett_emule_zlib);
tvb_set_child_real_data_tvbuff(tvb, tvbraw);
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
(*dissector)(msg_type, tvbraw, pinfo, 0, tvb_length(tvbraw), emule_zlib_tree);
}
}
if (dissector && (msg_len > 1)) {
if (!tvbraw) {
(*dissector)(msg_type, tvb, pinfo, offset+1, msg_len-1, edonkey_msg_tree);
} else {
ti = proto_tree_add_item(edonkey_msg_tree, hf_emule_zlib, tvb,
offset+1, msg_len-1, FALSE);
emule_zlib_tree = proto_item_add_subtree(ti, ett_emule_zlib);
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
(*dissector)(msg_type, tvbraw, pinfo, 0, tvb_length(tvbraw), emule_zlib_tree);
}
}
}
}

View File

@ -1124,10 +1124,9 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
!is_lastframe_inseq);
if (fcfrag_head) {
next_tvb = tvb_new_real_data (fcfrag_head->data,
next_tvb = tvb_new_child_real_data(tvb, fcfrag_head->data,
fcfrag_head->datalen,
fcfrag_head->datalen);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
/* Add the defragmented data to the data source list. */
add_new_data_source(pinfo, next_tvb, "Reassembled FC");

View File

@ -272,8 +272,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gss_info->do_reassembly=FALSE;
fi->reassembled_in=pinfo->fd->num;
gss_tvb=tvb_new_real_data(fd_head->data, fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(tvb, gss_tvb);
gss_tvb=tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
add_new_data_source(pinfo, gss_tvb, "Reassembled GSSAPI");
}
/* We have seen this packet before.
@ -287,8 +286,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if(fd_head && (fd_head->flags&FD_DEFRAGMENTED)){
if(pinfo->fd->num==fi->reassembled_in){
proto_item *frag_tree_item;
gss_tvb=tvb_new_real_data(fd_head->data, fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(tvb, gss_tvb);
gss_tvb=tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
add_new_data_source(pinfo, gss_tvb, "Reassembled GSSAPI");
show_fragment_tree(fd_head, &gssapi_frag_items, tree, pinfo, tvb, &frag_tree_item);
} else {

View File

@ -1340,14 +1340,12 @@ static void dissect_h223_bitswapped (tvbuff_t * tvb, packet_info * pinfo, proto_
for( i=0; i<len; i++)
datax[i]=BIT_SWAP(tvb_get_guint8(tvb,i));
reversed_tvb = tvb_new_real_data(datax,len,tvb_reported_length(tvb));
/*
* Add the reversed tvbuff to the list of tvbuffs to which
* the tvbuff we were handed refers, so it'll get
* cleaned up when that tvbuff is cleaned up.
*/
tvb_set_child_real_data_tvbuff(tvb, reversed_tvb);
reversed_tvb = tvb_new_child_real_data(tvb, datax,len,tvb_reported_length(tvb));
/* Add a freer */
tvb_set_free_cb(reversed_tvb, g_free);

View File

@ -464,8 +464,7 @@ dissect_http_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
tvbuff_t *ntlmssp_tvb;
ntlmssp_tvb = base64_to_tvb(line);
tvb_set_child_real_data_tvbuff(tvb, ntlmssp_tvb);
ntlmssp_tvb = base64_to_tvb(tvb, line);
add_new_data_source(pinfo, ntlmssp_tvb, "NTLMSSP / GSSAPI Data");
if (tvb_strneql(ntlmssp_tvb, 0, "NTLMSSP", 7) == 0)
call_dissector(ntlmssp_handle, ntlmssp_tvb, pinfo, tree);
@ -1046,7 +1045,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
g_ascii_strcasecmp(headers.content_encoding, "deflate")
== 0)) {
uncomp_tvb = tvb_uncompress(next_tvb, 0,
uncomp_tvb = tvb_child_uncompress(tvb, next_tvb, 0,
tvb_length(next_tvb));
}
@ -1075,7 +1074,6 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
proto_item_append_text(e_ti, " -> %u bytes", tvb_length(uncomp_tvb));
next_tvb = uncomp_tvb;
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
add_new_data_source(pinfo, next_tvb,
"Uncompressed entity body");
} else {

View File

@ -1892,8 +1892,7 @@ static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tr
if(fd_head && (pinfo->fd->num == fd_head->reassembled_in)) {
gint32 old_len;
tvbuff_t *next_tvb = tvb_new_real_data(fd_head->data, fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
tvbuff_t *next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
add_new_data_source(pinfo, next_tvb, "Reassembled IAX2");
process_iax_pdu(next_tvb,pinfo,tree,video,iax_packet);

View File

@ -1520,17 +1520,12 @@ dissect_icqv5Client(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
decrypt_v5(decr_pd, rounded_size, key);
/* Allocate a new tvbuff, referring to the decrypted data. */
decr_tvb = tvb_new_real_data(decr_pd, capturedsize, pktsize);
decr_tvb = tvb_new_child_real_data(tvb, decr_pd, capturedsize, pktsize);
/* Arrange that the allocated packet data copy be freed when the
tvbuff is freed. */
tvb_set_free_cb(decr_tvb, g_free);
/* Add the tvbuff to the list of tvbuffs to which the tvbuff we
were handed refers, so it'll get cleaned up when that tvbuff
is cleaned up. */
tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
/* Add the decrypted data to the data source list. */
add_new_data_source(pinfo, decr_tvb, "Decrypted");

View File

@ -344,9 +344,8 @@ remove_markers(tvbuff_t *tvb, packet_info *pinfo, guint32 marker_offset,
raw_data_ptr += cur_copy + MPA_MARKER_LEN;
cur_copy = MIN(MPA_MARKER_INTERVAL, (mfree_buff_length - tot_copy));
}
mfree_tvb = tvb_new_real_data(mfree_buff, mfree_buff_length,
mfree_tvb = tvb_new_child_real_data(tvb, mfree_buff, mfree_buff_length,
mfree_buff_length);
tvb_set_child_real_data_tvbuff(tvb, mfree_tvb);
add_new_data_source(pinfo, mfree_tvb, "FPDU without Markers");
return mfree_tvb;

View File

@ -747,8 +747,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot
#ifdef HAVE_KERBEROS
plaintext=decrypt_krb5_data(tree, pinfo, 0, encrypt_length, data_value, keytype, NULL);
if(plaintext){
next_tvb=tvb_new_real_data(plaintext, encrypt_length, encrypt_length);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb=tvb_new_child_real_data(tvb, plaintext, encrypt_length, encrypt_length);
add_new_data_source(pinfo, next_tvb, "decrypted kink encrypt");
dissect_decrypt_kink_encrypt(pinfo, next_tvb, tree, encrypt_length);
}

View File

@ -277,9 +277,8 @@ dissect_lapd_bitstream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else if (ones == 6 && state == DATA) { /* probably starting flag sequence */
buff = g_memdup(data, data_len);
/* Allocate new tvb for the LAPD frame */
new_tvb = tvb_new_real_data(buff, data_len, data_len);
new_tvb = tvb_new_child_real_data(tvb, buff, data_len, data_len);
tvb_set_free_cb(new_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, new_tvb);
add_new_data_source(pinfo, new_tvb, "Decoded LAPD bitstream");
dissect_lapd(new_tvb, pinfo, tree);
last_packet_end_offset = offset -1;

View File

@ -1820,8 +1820,7 @@ dissect_megaco_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *megaco_tree,
if(i==0){
return;
}
h245_tvb = tvb_new_real_data(buf,i,i);
tvb_set_child_real_data_tvbuff(tvb,h245_tvb);
h245_tvb = tvb_new_child_real_data(tvb, buf,i,i);
add_new_data_source(pinfo, h245_tvb, "H.245 over MEGACO");
/* should go through a handle, however, the two h245 entry
points are different, one is over tpkt and the other is raw
@ -1899,8 +1898,7 @@ dissect_megaco_h324_h223caprn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *meg
if(i==0){
return;
}
h245_tvb = tvb_new_real_data(buf,i,i);
tvb_set_child_real_data_tvbuff(tvb,h245_tvb);
h245_tvb = tvb_new_child_real_data(tvb, buf,i,i);
add_new_data_source(pinfo, h245_tvb, "H.245 over MEGACO");
/* should go through a handle, however, the two h245 entry
points are different, one is over tpkt and the other is raw

View File

@ -908,7 +908,7 @@ dissect_mpeg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (!dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree)) {
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_add_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MPEG");
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
if (tree)

View File

@ -2345,8 +2345,7 @@ reassemble_mq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (fd_head->next != NULL)
{
/* 2 or more fragments */
next_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
add_new_data_source(pinfo, next_tvb, "Reassembled MQ");
}
else

View File

@ -367,6 +367,10 @@ check_msrp_header(tvbuff_t *tvb)
* "tvb_get_ptr()" calls below won't throw exceptions. *
*/
offset = 0;
if(tvb_length(tvb) < 4 || tvb_get_ntohl(tvb, 0) != 0x4d535250 /* MSRP */){
return FALSE;
}
linelen = tvb_find_line_end(tvb, 0, -1, &next_offset, FALSE);
/* Find the first SP */
space_offset = tvb_find_guint8(tvb, 0, -1, ' ');
@ -395,7 +399,7 @@ check_msrp_header(tvbuff_t *tvb)
/*
* Is the first token "MSRP"?
*/
if (token_1_len == MSRP_HDR_LEN && tvb_strneql(tvb, 0, MSRP_HDR, MSRP_HDR_LEN) == 0){
if (token_1_len == MSRP_HDR_LEN) { /* && tvb_strneql(tvb, 0, MSRP_HDR, MSRP_HDR_LEN) == 0){ */
/* This check can be made more strict but accept we do have MSRP for now */
return TRUE;

View File

@ -182,7 +182,7 @@ base64_decode(packet_info *pinfo, tvbuff_t *b64_tvb, char *name)
tvbuff_t *tvb;
data = g_strdup(tvb_get_ephemeral_string(b64_tvb, 0, tvb_length(b64_tvb)));
tvb = base64_to_tvb(data);
tvb = base64_to_tvb(b64_tvb, data);
add_new_data_source(pinfo, tvb, name);
return tvb;

View File

@ -7445,10 +7445,8 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
/* Is this the last fragment? nds_frag will indicate */
if (fd_head->next != NULL && !request_value->nds_frag)
{
frag_tvb = tvb_new_real_data(fd_head->data,
frag_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb,
frag_tvb);
add_new_data_source(pinfo,
frag_tvb,
"Reassembled NDS");

View File

@ -4406,10 +4406,8 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *frag_tree_item;
next_tvb = tvb_new_real_data(fd_head->data,
next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb,
next_tvb);
add_new_data_source(pinfo,
next_tvb,
"Reassembled NDPS");

View File

@ -1199,10 +1199,8 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len, command == NB_DATA_FIRST_MIDDLE);
if (fd_head != NULL) {
if (fd_head->next != NULL) {
next_tvb = tvb_new_real_data(fd_head->data,
next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb,
next_tvb);
add_new_data_source(pinfo,
next_tvb,
"Reassembled NetBIOS");

View File

@ -1347,10 +1347,9 @@ decrypt_verifier(tvbuff_t *tvb, int offset, guint32 encrypted_block_length,
}
/* Show the decrypted buffer in a new window */
decr_tvb = tvb_new_real_data(packet_ntlmssp_info->verifier,
decr_tvb = tvb_new_child_real_data(tvb, packet_ntlmssp_info->verifier,
encrypted_block_length,
encrypted_block_length);
tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
add_new_data_source(pinfo, decr_tvb,
"Decrypted NTLMSSP Verifier");
@ -1525,12 +1524,10 @@ dissect_ntlmssp_encrypted_payload(tvbuff_t *data_tvb,
}
/* Show the decrypted buffer in a new window */
decr_tvb = tvb_new_real_data(packet_ntlmssp_info->decrypted_payload,
decr_tvb = tvb_new_child_real_data(data_tvb, packet_ntlmssp_info->decrypted_payload,
encrypted_block_length,
encrypted_block_length);
tvb_set_child_real_data_tvbuff(data_tvb, decr_tvb);
offset += encrypted_block_length;
return decr_tvb;

View File

@ -141,8 +141,7 @@ static tvbuff_t *new_octet_aligned_subset(tvbuff_t *tvb, guint32 offset, asn1_ct
octet0 = tvb_get_guint8(tvb, boffset + i + 1);
buf[i] = (octet1 << shift1) | (octet0 >> shift0);
}
sub_tvb = tvb_new_real_data(buf, actual_length, length);
tvb_set_child_real_data_tvbuff(tvb, sub_tvb);
sub_tvb = tvb_new_child_real_data(tvb, buf, actual_length, length);
add_new_data_source(actx->pinfo, sub_tvb, "Unaligned OCTET STRING");
} else { /* aligned */
sub_tvb = tvb_new_subset(tvb, boffset, actual_length, length);
@ -222,8 +221,7 @@ tvbuff_t *new_octet_aligned_subset_bits(tvbuff_t *tvb, guint32 offset, asn1_ctx_
}
}
}
sub_tvb = tvb_new_real_data(buf, length, length);
tvb_set_child_real_data_tvbuff(tvb, sub_tvb);
sub_tvb = tvb_new_child_real_data(tvb, buf, length, length);
add_new_data_source(actx->pinfo, sub_tvb, "Unaligned OCTET STRING");
return sub_tvb;
@ -598,8 +596,7 @@ DEBUG_ENTRY("dissect_per_restricted_character_string");
/* xx.x if the length is 0 bytes there will be no encoding */
if(max_len==0){
if (value_tvb) {
*value_tvb = tvb_new_real_data(NULL, 0, 0);
tvb_set_child_real_data_tvbuff(tvb, *value_tvb);
*value_tvb = tvb_new_child_real_data(tvb, NULL, 0, 0);
}
return offset;
}
@ -704,9 +701,8 @@ DEBUG_ENTRY("dissect_per_restricted_character_string");
buf[char_pos]=0;
proto_tree_add_string(tree, hf_index, tvb, (old_offset>>3), (offset>>3)-(old_offset>>3), (char*)buf);
if (value_tvb) {
*value_tvb = tvb_new_real_data(buf, length, length);
*value_tvb = tvb_new_child_real_data(tvb, buf, length, length);
tvb_set_free_cb(*value_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, *value_tvb);
} else {
g_free(buf);
}

View File

@ -925,9 +925,8 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
mpdu_count++;
g_snprintf(mpdu_str, 12, "MPDU #%d", mpdu_count);
next_tvb = tvb_new_real_data(fd_head->data,
next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
add_new_data_source(pinfo, next_tvb, mpdu_str);
if (agg_tree) {

View File

@ -3330,8 +3330,7 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ip_packet[ip_hdr_len + 4] = (length - ip_hdr_len) >> 8;
ip_packet[ip_hdr_len + 5] = (length - ip_hdr_len);
next_tvb = tvb_new_real_data(ip_packet, length, length);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, ip_packet, length, length);
add_new_data_source(pinfo, next_tvb, "Decompressed Data");
tvb_set_free_cb(next_tvb, g_free);
@ -3702,14 +3701,13 @@ remove_escape_chars(tvbuff_t *tvb, int offset, int length)
g_free(buff);
return NULL;
}
next_tvb = tvb_new_real_data(buff,i,i);
next_tvb = tvb_new_child_real_data(tvb, buff,i,i);
/* Arrange that the allocated packet data copy be freed when the
* tvbuff is freed.
*/
tvb_set_free_cb( next_tvb, g_free );
tvb_set_child_real_data_tvbuff(tvb,next_tvb);
return next_tvb;
}

View File

@ -2585,8 +2585,7 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (fd_head) {
if (pinfo->fd->num == fd_head->reassembled_in) { /* last fragment */
if (fd_head->next != NULL) { /* 2 or more segments */
next_tvb = tvb_new_real_data(fd_head->data, fd_head->len, fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->len, fd_head->len);
add_new_data_source(pinfo, next_tvb, "Reassembled Q.931 IEs");
/* Show all fragments. */
if (tree) {

View File

@ -1069,9 +1069,8 @@ static void dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo,
tvbuff_t* vsa_tvb = NULL;
proto_tree_add_text(avp_tree, tvb, offset, avp_vsa_len, "VSA fragment");
proto_item_append_text(avp_item, ": Last VSA fragment[%u]", vsa_buffer->seg_num);
vsa_tvb = tvb_new_real_data(vsa_buffer->data, vsa_buffer->len, vsa_buffer->len);
vsa_tvb = tvb_new_child_real_data(tvb, vsa_buffer->data, vsa_buffer->len, vsa_buffer->len);
tvb_set_free_cb(vsa_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, vsa_tvb);
add_new_data_source(pinfo, vsa_tvb, "Reassembled VSA");
add_avp_to_tree(avp_tree, avp_item, pinfo, vsa_tvb, dictionary_entry, vsa_buffer->len, 0);
g_hash_table_remove(vsa_buffer_table, &(vsa_buffer->key));
@ -1187,11 +1186,10 @@ static void dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo,
eap_tree = proto_item_add_subtree(avp_item,ett_eap);
eap_tvb = tvb_new_real_data(eap_buffer,
eap_tvb = tvb_new_child_real_data(tvb, eap_buffer,
eap_tot_len_captured,
eap_tot_len);
tvb_set_free_cb(eap_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, eap_tvb);
add_new_data_source(pinfo, eap_tvb, "Reassembled EAP");
/*
@ -1799,6 +1797,8 @@ extern void radius_register_avp_dissector(guint32 vendor_id, guint32 attribute_i
dictionary_entry->type = NULL;
dictionary_entry->vs = NULL;
dictionary_entry->hf = no_dictionary_entry.hf;
dictionary_entry->tagged = 0;
dictionary_entry->hf_tag = -1;
dictionary_entry->hf_len = no_dictionary_entry.hf_len;
dictionary_entry->ett = no_dictionary_entry.ett;

View File

@ -2284,8 +2284,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment* fragment,
if (fragment == message->reassembled_in) {
/* this is the last fragment, create data source */
new_tvb = tvb_new_real_data(message->data, message->len, message->len);
tvb_set_child_real_data_tvbuff(tvb, new_tvb);
new_tvb = tvb_new_child_real_data(tvb, message->data, message->len, message->len);
add_new_data_source(pinfo, new_tvb, "Reassembled SCTP Message");
/* display reassembly info */
@ -2523,8 +2522,7 @@ fragment_reassembly(tvbuff_t *tvb, sctp_fragment* fragment,
g_free(end);
/* create data source */
new_tvb = tvb_new_real_data(message->data, len, len);
tvb_set_child_real_data_tvbuff(tvb, new_tvb);
new_tvb = tvb_new_child_real_data(tvb, message->data, len, len);
add_new_data_source(pinfo, new_tvb, "Reassembled SCTP Message");
/* display reassembly info */

View File

@ -932,8 +932,7 @@ static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti
return;
data = tvb_get_ephemeral_string(tvb, offset, len);
keymgmt_tvb = base64_to_tvb(data);
tvb_set_child_real_data_tvbuff(tvb, keymgmt_tvb);
keymgmt_tvb = base64_to_tvb(tvb, data);
add_new_data_source(pinfo, keymgmt_tvb, "Key Management Data");
if ( prtcl_id != NULL && key_mgmt_dissector_table != NULL ) {
@ -1211,8 +1210,7 @@ ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gint len, gchar *msg)
if(i==0){
return NULL;
}
bytes_tvb = tvb_new_real_data(buf,i,i);
tvb_set_child_real_data_tvbuff(tvb,bytes_tvb);
bytes_tvb = tvb_new_child_real_data(tvb, buf,i,i);
add_new_data_source(pinfo, bytes_tvb, "ASCII bytes to tvb");
return bytes_tvb;
}
@ -1398,8 +1396,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 1 string: %s", data);
/* proto_tree_add_text(tree, tvb, offset, tokenlen, "String %s",data); */
data_tvb = base64_to_tvb(data);
tvb_set_child_real_data_tvbuff(tvb, data_tvb);
data_tvb = base64_to_tvb(tvb, data);
add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets");
if(h264_handle && data_tvb){
@ -1410,8 +1407,7 @@ decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset
tokenlen = end_offset - offset;
data = tvb_get_ephemeral_string(tvb, offset, tokenlen);
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 2 string: %s", data);
data_tvb = base64_to_tvb(data);
tvb_set_child_real_data_tvbuff(tvb, data_tvb);
data_tvb = base64_to_tvb(tvb, data);
add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets 2");
dissect_h264_nal_unit(data_tvb, pinfo, tree);
}

View File

@ -490,16 +490,12 @@ try_again:
i++;
offset++;
}
unescaped_tvb = tvb_new_real_data(buff,i,i);
unescaped_tvb = tvb_new_child_real_data(tvb, buff,i,i);
/* Arrange that the allocated packet data copy be freed when the
* tvbuff is freed.
*/
tvb_set_free_cb( unescaped_tvb, g_free );
/* Add the tvbuff to the list of tvbuffs to which the tvbuff we
* were handed refers, so it'll get cleaned up when that tvbuff
* is cleaned up.
*/
tvb_set_child_real_data_tvbuff( tvb, unescaped_tvb );
add_new_data_source(pinfo, unescaped_tvb, "Unescaped Data handed to the SigComp dissector");
proto_tree_add_text(sigcomp_tree, unescaped_tvb, 0, -1,"Data handed to the Sigcomp dissector");
@ -763,16 +759,11 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
return tvb_length(tvb);
}
udvm_tvb = tvb_new_real_data(buff,state_length+state_address,state_length+state_address);
udvm_tvb = tvb_new_child_real_data(tvb, buff,state_length+state_address,state_length+state_address);
/* Arrange that the allocated packet data copy be freed when the
* tvbuff is freed.
*/
tvb_set_free_cb( udvm_tvb, g_free );
/* Add the tvbuff to the list of tvbuffs to which the tvbuff we
* were handed refers, so it'll get cleaned up when that tvbuff
* is cleaned up.
*/
tvb_set_child_real_data_tvbuff( tvb, udvm_tvb );
udvm2_tvb = tvb_new_subset(udvm_tvb, state_address, state_length, state_length);

View File

@ -476,7 +476,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (slsk_decompress == TRUE){
tvbuff_t *uncompr_tvb = tvb_uncompress(tvb, offset, comprlen);
tvbuff_t *uncompr_tvb = tvb_child_uncompress(tvb, tvb, offset, comprlen);
if (uncompr_tvb == NULL) {
proto_tree_add_text(slsk_tree, tvb, offset, -1,
@ -495,8 +495,6 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"(uncompressed packet length: %d)", uncomprlen);
/* Dissects the uncompressed tvbuffer */
tvb_set_child_real_data_tvbuff(tvb, uncompr_tvb);
add_new_data_source(pinfo, uncompr_tvb,
"Uncompressed SoulSeek data");
uncompr_tvb_offset = 0;
@ -639,7 +637,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (slsk_decompress == TRUE){
tvbuff_t *uncompr_tvb = tvb_uncompress(tvb, offset, comprlen);
tvbuff_t *uncompr_tvb = tvb_child_uncompress(tvb, tvb, offset, comprlen);
if (uncompr_tvb == NULL) {
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, tvb_length_remaining(tvb, offset), 0,
@ -658,8 +656,6 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"(uncompressed packet length: %d)", uncomprlen);
/* Dissects the uncompressed tvbuffer */
tvb_set_child_real_data_tvbuff(tvb, uncompr_tvb);
add_new_data_source(pinfo, uncompr_tvb,
"Uncompressed SoulSeek data");
uncompr_tvb_offset = 0;
@ -1185,7 +1181,7 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (slsk_decompress == TRUE){
tvbuff_t *uncompr_tvb = tvb_uncompress(tvb, offset, comprlen);
tvbuff_t *uncompr_tvb = tvb_child_uncompress(tvb, tvb, offset, comprlen);
if (uncompr_tvb == NULL) {
proto_tree_add_text(slsk_tree, tvb, offset, -1,
@ -1204,8 +1200,6 @@ static void dissect_slsk_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_tree_add_uint_format(slsk_tree, hf_slsk_integer, tvb, offset, -1, 0,
"[uncompressed packet length: %d]", uncomprlen);
/* Dissects the uncompressed tvbuffer */
tvb_set_child_real_data_tvbuff(tvb, uncompr_tvb);
add_new_data_source(pinfo, uncompr_tvb,
"Uncompressed SoulSeek data");
uncompr_tvb_offset = 0;

View File

@ -3384,9 +3384,8 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* if we completed reassembly */
if(fd_head){
new_tvb = tvb_new_real_data(fd_head->data,
new_tvb = tvb_new_child_real_data(d_tvb, fd_head->data,
fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(d_tvb, new_tvb);
add_new_data_source(pinfo, new_tvb,
"DCERPC over SMB");
pinfo->fragmented=FALSE;
@ -3435,9 +3434,8 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree
/* display the reassembled pdu */
new_tvb = tvb_new_real_data(fd_head->data,
new_tvb = tvb_new_child_real_data(d_tvb, fd_head->data,
fd_head->datalen, fd_head->datalen);
tvb_set_child_real_data_tvbuff(d_tvb, new_tvb);
add_new_data_source(pinfo, new_tvb,
"DCERPC over SMB");
pinfo->fragmented=FALSE;

View File

@ -1714,13 +1714,9 @@ defragment_by_sequence(packet_info *pinfo, tvbuff_t *tvb, int offset, int mpf,
if (fd_head != NULL) {
/* We have the complete reassembled payload. */
rh_tvb = tvb_new_real_data(fd_head->data,
rh_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len, fd_head->len);
/* Add the tvbuff to the chain of tvbuffs
* so that it will get cleaned up too. */
tvb_set_child_real_data_tvbuff(tvb, rh_tvb);
/* Add the defragmented data to the data
* source list. */
add_new_data_source(pinfo, rh_tvb,

View File

@ -1133,10 +1133,9 @@ decrypt_gssapi_krb_arcfour_wrap(proto_tree *tree, packet_info *pinfo, tvbuff_t *
);
if (ret >= 0) {
proto_tree_add_text(tree, NULL, 0, 0, "[Decrypted using: %s]", ek->key_origin);
pinfo->gssapi_decrypted_tvb=tvb_new_real_data(
pinfo->gssapi_decrypted_tvb=tvb_new_child_real_data(tvb,
output_message_buffer,
ret, ret);
tvb_set_child_real_data_tvbuff(tvb, pinfo->gssapi_decrypted_tvb);
add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
return;
}
@ -1219,11 +1218,10 @@ decrypt_gssapi_krb_cfx_wrap(proto_tree *tree _U_, packet_info *pinfo _U_, tvbuff
memcpy(outdata, output, tvb_length(tvb));
g_free(output);
pinfo->gssapi_decrypted_tvb=tvb_new_real_data(
pinfo->gssapi_decrypted_tvb=tvb_new_child_real_data(tvb,
outdata,
datalen-16,
datalen-16);
tvb_set_child_real_data_tvbuff(tvb, pinfo->gssapi_decrypted_tvb);
add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
return;
}

View File

@ -957,12 +957,9 @@ again:
int old_len;
/* create a new TVB structure for desegmented data */
next_tvb = tvb_new_real_data(ipfd_head->data,
next_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, next_tvb);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Reassembled SSL");
@ -1251,10 +1248,7 @@ dissect_ssl_payload(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *t
ssl_print_text_data("decrypted app data fragment", appl_data->plain_data.data, appl_data->plain_data.data_len);
/* create a new TVB structure for desegmented data */
next_tvb = tvb_new_real_data(appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
/* add this tvb as a child to the original one */
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, appl_data->plain_data.data, appl_data->plain_data.data_len, appl_data->plain_data.data_len);
/* add desegmented data to the data source list */
add_new_data_source(pinfo, next_tvb, "Decrypted SSL data");

View File

@ -360,17 +360,12 @@ tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pin
md5_xor( buff, key, len, session_id,version, tvb_get_guint8(tvb,2) );
/* Allocate a new tvbuff, referring to the decrypted data. */
*dst_tvb = tvb_new_real_data( buff, len, len );
*dst_tvb = tvb_new_child_real_data(tvb, buff, len, len );
/* Arrange that the allocated packet data copy be freed when the
tvbuff is freed. */
tvb_set_free_cb( *dst_tvb, g_free );
/* Add the tvbuff to the list of tvbuffs to which the tvbuff we
were handed refers, so it'll get cleaned up when that tvbuff
is cleaned up. */
tvb_set_child_real_data_tvbuff( tvb, *dst_tvb );
/* Add the decrypted data to the data source list. */
add_new_data_source(pinfo, *dst_tvb, "TACACS+ Decrypted");

View File

@ -771,9 +771,8 @@ unescape_and_tvbuffify_telnet_option(packet_info *pinfo, tvbuff_t *tvb, int offs
*(dpos++)=*(spos++);
l--;
}
krb5_tvb = tvb_new_real_data(buf, len-skip, len-skip);
krb5_tvb = tvb_new_child_real_data(tvb, buf, len-skip, len-skip);
tvb_set_free_cb(krb5_tvb, g_free);
tvb_set_child_real_data_tvbuff(tvb, krb5_tvb);
add_new_data_source(pinfo, krb5_tvb, "Unpacked Telnet Uption");
return krb5_tvb;

View File

@ -113,7 +113,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
proto_tree *uts_trailer_tree = NULL;
proto_item *ti;
int length;
gchar rid, sid, did;
gchar rid = 0, sid = 0, did = 0;
gchar *msg_msg;
int offset = 0;
int header_length = -1;

View File

@ -385,8 +385,7 @@ dissect_vjuc(tvbuff_t *tvb, packet_info *pinfo, proto_tree * tree)
ipsize = pntohs(&buffer[IP_FIELD_TOT_LEN]);
if (ipsize < isize)
isize = ipsize;
next_tvb = tvb_new_real_data(buffer, isize, ipsize);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
next_tvb = tvb_new_child_real_data(tvb, buffer, isize, ipsize);
add_new_data_source(pinfo, next_tvb, "VJ Uncompressed");
/*
@ -512,8 +511,7 @@ vjc_tvb_setup(tvbuff_t *src_tvb,
memcpy(pbuf, data_ptr, hdr_len);
tvb_memcpy(src_tvb, pbuf + hdr_len, offset, buf_len - hdr_len);
memcpy(&tot_len, data_ptr + 2, 2);
*dst_tvb = tvb_new_real_data(pbuf, buf_len, g_ntohs(tot_len));
tvb_set_child_real_data_tvbuff(src_tvb, *dst_tvb);
*dst_tvb = tvb_new_child_real_data(src_tvb, pbuf, buf_len, g_ntohs(tot_len));
add_new_data_source(pinfo, *dst_tvb, "VJ Decompressed");
return VJ_OK;
}

View File

@ -1788,10 +1788,9 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
data_len, FALSE);
#ifdef HAVE_LIBZ
uncomp_tvb = tvb_uncompress(tvb, *offset, data_len);
uncomp_tvb = tvb_child_uncompress(tvb, tvb, *offset, data_len);
if(uncomp_tvb != NULL) {
tvb_set_child_real_data_tvbuff(tvb, uncomp_tvb);
add_new_data_source(pinfo, uncomp_tvb,
"Uncompressed ZRLE data");

View File

@ -587,7 +587,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin
TRY {
tvb = tvb_new_real_data( pdata_ptr->buffer, pdata_ptr->len, pdata_ptr->len);
tvb = tvb_new_child_real_data(src_tvb, pdata_ptr->buffer, pdata_ptr->len, pdata_ptr->len);
}
CATCH(BoundsError) {
DISSECTOR_ASSERT_NOT_REACHED();
@ -599,9 +599,6 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin
if (bounds_error) return NULL;
/* link new tvbuff into tvbuff chain so cleanup is done later */
tvb_set_child_real_data_tvbuff( src_tvb, tvb);
/* Add new data to the data source list */
add_new_data_source( pinfo, tvb, "Uncompressed WCP");
return tvb;

View File

@ -2369,10 +2369,9 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item *frag_tree_item;
/* This is the last packet */
next_tvb = tvb_new_real_data(fd_head->data,
next_tvb = tvb_new_child_real_data(tvb, fd_head->data,
fd_head->len,
fd_head->len);
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
add_new_data_source(pinfo, next_tvb, "Reassembled X.25");
if (x25_tree) {
show_fragment_seq_tree(fd_head,