aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-meta.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-23 02:20:13 +0000
commit9b7fb8a81120f99babc82e25416f9e25fe616c73 (patch)
tree5dc37cedfddb9588b91957f7da7aeaac83d75543 /epan/dissectors/packet-meta.c
parentb3a24c5cc401498535ffdb64aaa212e46e587698 (diff)
Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
Diffstat (limited to 'epan/dissectors/packet-meta.c')
-rw-r--r--epan/dissectors/packet-meta.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-meta.c b/epan/dissectors/packet-meta.c
index 47c87fcfc9..fe94bdc031 100644
--- a/epan/dissectors/packet-meta.c
+++ b/epan/dissectors/packet-meta.c
@@ -403,10 +403,10 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
break;
case META_ID_AAL5PROTO:
aal5proto = tvb_get_guint8(tvb, offs);
- p_sscop_info = (sscop_payload_info *)p_get_proto_data(pinfo->fd, proto_sscop, 0);
+ p_sscop_info = (sscop_payload_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_sscop, 0);
if (!p_sscop_info) {
p_sscop_info = wmem_new0(wmem_file_scope(), sscop_payload_info);
- p_add_proto_data(pinfo->fd, proto_sscop, 0, p_sscop_info);
+ p_add_proto_data(wmem_file_scope(), pinfo, proto_sscop, 0, p_sscop_info);
}
switch (aal5proto) {
case META_AAL5PROTO_MTP3:
@@ -429,7 +429,7 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
/* TODO: check for additional protos on Iu 802 LLC/SNAP ... */
default:
/* TODO: add warning */
- p_remove_proto_data(pinfo->fd, proto_sscop, 0);
+ p_remove_proto_data(wmem_file_scope(), pinfo, proto_sscop, 0);
}
proto_tree_add_uint(meta_tree, hf_meta_item_aal5proto, tvb,
offs, 1, aal5proto);