aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-05-13 19:46:11 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-05-13 19:46:11 +0000
commitc91a384702e6d17254918e2291d28bfd2deddbdd (patch)
treee3d1280ddcbb3ea542ab9588b0e888da296a8cfe
parentfbd05f0fce6a10a1f3059c40628962bc056e10ef (diff)
Apply some of the patches from:
http://wiki.wireshark.org/Development/Optimization svn path=/trunk/; revision=28356
-rw-r--r--asn1/spnego/packet-spnego-template.c3
-rw-r--r--epan/base64.c4
-rw-r--r--epan/base64.h2
-rw-r--r--epan/dissectors/packet-ber.c4
-rw-r--r--epan/dissectors/packet-bssap.c2
-rw-r--r--epan/dissectors/packet-bthci_acl.c3
-rw-r--r--epan/dissectors/packet-btl2cap.c3
-rw-r--r--epan/dissectors/packet-btrfcomm.c3
-rw-r--r--epan/dissectors/packet-cdt.c3
-rw-r--r--epan/dissectors/packet-dcerpc-mapi.c6
-rw-r--r--epan/dissectors/packet-dcerpc-spoolss.c3
-rw-r--r--epan/dissectors/packet-dcerpc.c15
-rw-r--r--epan/dissectors/packet-dcp-etsi.c6
-rw-r--r--epan/dissectors/packet-dnp.c3
-rw-r--r--epan/dissectors/packet-dtls.c9
-rw-r--r--epan/dissectors/packet-eap.c3
-rw-r--r--epan/dissectors/packet-edonkey.c37
-rw-r--r--epan/dissectors/packet-fc.c3
-rw-r--r--epan/dissectors/packet-gssapi.c6
-rw-r--r--epan/dissectors/packet-h223.c4
-rw-r--r--epan/dissectors/packet-http.c6
-rw-r--r--epan/dissectors/packet-iax2.c3
-rw-r--r--epan/dissectors/packet-icq.c7
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c3
-rw-r--r--epan/dissectors/packet-kink.c3
-rw-r--r--epan/dissectors/packet-lapd.c3
-rw-r--r--epan/dissectors/packet-megaco.c6
-rw-r--r--epan/dissectors/packet-mpeg-pes.c2
-rw-r--r--epan/dissectors/packet-mq.c3
-rw-r--r--epan/dissectors/packet-msrp.c6
-rw-r--r--epan/dissectors/packet-multipart.c2
-rw-r--r--epan/dissectors/packet-ncp2222.inc4
-rw-r--r--epan/dissectors/packet-ndps.c4
-rw-r--r--epan/dissectors/packet-netbios.c4
-rw-r--r--epan/dissectors/packet-ntlmssp.c7
-rw-r--r--epan/dissectors/packet-per.c12
-rw-r--r--epan/dissectors/packet-ppi.c3
-rw-r--r--epan/dissectors/packet-ppp.c6
-rw-r--r--epan/dissectors/packet-q931.c3
-rw-r--r--epan/dissectors/packet-radius.c8
-rw-r--r--epan/dissectors/packet-sctp.c6
-rw-r--r--epan/dissectors/packet-sdp.c12
-rw-r--r--epan/dissectors/packet-sigcomp.c15
-rw-r--r--epan/dissectors/packet-slsk.c12
-rw-r--r--epan/dissectors/packet-smb-pipe.c6
-rw-r--r--epan/dissectors/packet-sna.c6
-rw-r--r--epan/dissectors/packet-spnego.c6
-rw-r--r--epan/dissectors/packet-ssl.c10
-rw-r--r--epan/dissectors/packet-tacacs.c7
-rw-r--r--epan/dissectors/packet-telnet.c3
-rw-r--r--epan/dissectors/packet-uts.c2
-rw-r--r--epan/dissectors/packet-vj.c6
-rw-r--r--epan/dissectors/packet-vnc.c3
-rw-r--r--epan/dissectors/packet-wcp.c5
-rw-r--r--epan/dissectors/packet-x25.c3
55 files changed, 106 insertions, 213 deletions
diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c
index 0357465f8c..74e068bc7a 100644
--- a/asn1/spnego/packet-spnego-template.c
+++ b/asn1/spnego/packet-spnego-template.c
@@ -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;
}
diff --git a/epan/base64.c b/epan/base64.c
index d528497e8b..949e995c0a 100644
--- a/epan/base64.c
+++ b/epan/base64.c
@@ -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);
diff --git a/epan/base64.h b/epan/base64.h
index ffef8ebf17..2235237415 100644
--- a/epan/base64.h
+++ b/epan/base64.h
@@ -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
}
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index e599c3de89..dd2c119985 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -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");
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index ad97a25aba..6b61227db8 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -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){
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index e3462e5186..2cc0eb4fee 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -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 */
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index 6a40ad2294..45144cbd6a 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -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*/
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 2d4734ce74..fac6d1224f 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -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);
}
diff --git a/epan/dissectors/packet-cdt.c b/epan/dissectors/packet-cdt.c
index 4306d15457..6430d7359a 100644
--- a/epan/dissectors/packet-cdt.c
+++ b/epan/dissectors/packet-cdt.c
@@ -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) {
diff --git a/epan/dissectors/packet-dcerpc-mapi.c b/epan/dissectors/packet-dcerpc-mapi.c
index b1b5f081c3..84b5dc8076 100644
--- a/epan/dissectors/packet-dcerpc-mapi.c
+++ b/epan/dissectors/packet-dcerpc-mapi.c
@@ -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);
diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c
index 2ca9c2498b..ee7f11e183 100644
--- a/epan/dissectors/packet-dcerpc-spoolss.c
+++ b/epan/dissectors/packet-dcerpc-spoolss.c
@@ -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;
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 6fee1c1d06..5472a72e7e 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -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);
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index 8e74b2212f..b3dc069fd0 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -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);
}
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c
index 4e44a8bcb4..6f42e490ab 100644
--- a/epan/dissectors/packet-dnp.c
+++ b/epan/dissectors/packet-dnp.c
@@ -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;
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index f3d4d1aa82..6f02817624 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -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,
diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c
index 762f360ccb..373e0f5bfb 100644
--- a/epan/dissectors/packet-eap.c
+++ b/epan/dissectors/packet-eap.c
@@ -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,
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index cb6d7d55e4..a9520c7c73 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -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);
+ }
+ }
}
}
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 0cf18f2466..31e12400e7 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -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");
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index 352bff55fc..ce11ca3ddc 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -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 {
diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c
index 552a3ac4c4..2c49edef29 100644
--- a/epan/dissectors/packet-h223.c
+++ b/epan/dissectors/packet-h223.c
@@ -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);
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index f719c3e9c5..4b1c8da51f 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -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 {
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index 673b40aa98..24ae6b0ecf 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -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);
diff --git a/epan/dissectors/packet-icq.c b/epan/dissectors/packet-icq.c
index 2c3a47fc43..367490c2eb 100644
--- a/epan/dissectors/packet-icq.c
+++ b/epan/dissectors/packet-icq.c
@@ -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");
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index 28cc9e83a9..0a65d61297 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -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;
diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c
index c92fc9135e..573507ab73 100644
--- a/epan/dissectors/packet-kink.c
+++ b/epan/dissectors/packet-kink.c
@@ -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);
}
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index ed719f57b7..5f19ebd519 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -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;
diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c
index 3248d3f721..2ceff64b10 100644
--- a/epan/dissectors/packet-megaco.c
+++ b/epan/dissectors/packet-megaco.c
@@ -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
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 9475101db1..93ec9caeee 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -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)
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 701f5f2291..a891f04d23 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -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
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index 6f9ece491e..9133e1b6f2 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -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;
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 63f23860a3..bf6bc2d17b 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -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;
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 489a16073f..64b9924890 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -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");
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index 9c082bd370..cd526d41c4 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -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");
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index f755d7bf95..74f7b4bf16 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -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");
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 9382ecc058..2175271d85 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -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;
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index ebb8518c30..04a9eb057d 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -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);
}
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 03d198cba8..d4712dfdf8 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -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) {
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 18ebcc6400..65ea1ba428 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -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;
}
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 50cfe925f2..824fc40cc7 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -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) {
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 59f62620e6..6fd8f2dea2 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -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;
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index 456a5efef8..b1f0a55d2f 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -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 */
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index cb40cad84b..e7a0c47384 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -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);
}
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index e65b6f26bd..9a160488c8 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -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);
diff --git a/epan/dissectors/packet-slsk.c b/epan/dissectors/packet-slsk.c
index 6484e2ce6e..0098ef74a2 100644
--- a/epan/dissectors/packet-slsk.c
+++ b/epan/dissectors/packet-slsk.c
@@ -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;
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c
index fb7f97a9fe..e30c793a28 100644
--- a/epan/dissectors/packet-smb-pipe.c
+++ b/epan/dissectors/packet-smb-pipe.c
@@ -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;
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index 3f5f5adf71..bfc32a75d5 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -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,
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index 841b4d407b..2573082255 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -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;
}
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index a436b6b9d1..d6c840870f 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -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");
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 847148a90a..0a2b90cb7b 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -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");
diff --git a/epan/dissectors/packet-telnet.c b/epan/dissectors/packet-telnet.c
index 495a362c37..eddcdcd3b1 100644
--- a/epan/dissectors/packet-telnet.c
+++ b/epan/dissectors/packet-telnet.c
@@ -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;
diff --git a/epan/dissectors/packet-uts.c b/epan/dissectors/packet-uts.c
index 29b2b3476a..c71b91c66c 100644
--- a/epan/dissectors/packet-uts.c
+++ b/epan/dissectors/packet-uts.c
@@ -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;
diff --git a/epan/dissectors/packet-vj.c b/epan/dissectors/packet-vj.c
index a029aa426d..5ee51f0dd3 100644
--- a/epan/dissectors/packet-vj.c
+++ b/epan/dissectors/packet-vj.c
@@ -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;
}
diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c
index 6a1e61cf9e..0346eaea33 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -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");
diff --git a/epan/dissectors/packet-wcp.c b/epan/dissectors/packet-wcp.c
index d4f4a2e210..7814741f75 100644
--- a/epan/dissectors/packet-wcp.c
+++ b/epan/dissectors/packet-wcp.c
@@ -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;
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index 8a174d82a4..2662b0477d 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -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,