diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-23 02:20:13 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-23 02:20:13 +0000 |
commit | 9b7fb8a81120f99babc82e25416f9e25fe616c73 (patch) | |
tree | 5dc37cedfddb9588b91957f7da7aeaac83d75543 /epan/dissectors/packet-ethertype.c | |
parent | b3a24c5cc401498535ffdb64aaa212e46e587698 (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-ethertype.c')
-rw-r--r-- | epan/dissectors/packet-ethertype.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c index 878067bf56..979786aa12 100644 --- a/epan/dissectors/packet-ethertype.c +++ b/epan/dissectors/packet-ethertype.c @@ -191,12 +191,12 @@ const value_string etype_vals[] = { static void eth_prompt(packet_info *pinfo, gchar* result) { g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as", - GPOINTER_TO_UINT(p_get_proto_data(pinfo->fd, proto_ethertype, 0))); + GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, 0))); } static gpointer eth_value(packet_info *pinfo) { - return p_get_proto_data(pinfo->fd, proto_ethertype, 0); + return p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, 0); } static void add_dix_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, @@ -288,7 +288,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat next_tvb = tvb_new_subset(tvb, ethertype_data->offset_after_ethertype, captured_length, reported_length); - p_add_proto_data(pinfo->fd, proto_ethertype, 0, GUINT_TO_POINTER((guint)ethertype_data->etype)); + p_add_proto_data(pinfo->pool, pinfo, proto_ethertype, 0, GUINT_TO_POINTER((guint)ethertype_data->etype)); /* Look for sub-dissector, and call it if found. Catch exceptions, so that if the reported length of "next_tvb" |