summaryrefslogtreecommitdiff
path: root/epan/frame_data.h
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/frame_data.h
parentb3a24c5cc401498535ffdb64aaa212e46e587698 (diff)
downloadwireshark-9b7fb8a81120f99babc82e25416f9e25fe616c73.tar.gz
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/frame_data.h')
-rw-r--r--epan/frame_data.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/epan/frame_data.h b/epan/frame_data.h
index 1276510147..2bf074ad3b 100644
--- a/epan/frame_data.h
+++ b/epan/frame_data.h
@@ -95,11 +95,12 @@ typedef struct {
#endif
/* Utility routines used by packet*.c */
+struct _packet_info;
-WS_DLL_PUBLIC void p_add_proto_data(frame_data *fd, int proto, guint8 key, void *proto_data);
-WS_DLL_PUBLIC void *p_get_proto_data(frame_data *fd, int proto, guint8 key);
-void p_remove_proto_data(frame_data *fd, int proto, guint8 key);
-gchar *p_get_proto_name_and_key(frame_data *fd, guint pfd_index);
+WS_DLL_PUBLIC void p_add_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint8 key, void *proto_data);
+WS_DLL_PUBLIC void *p_get_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint8 key);
+void p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint8 key);
+gchar *p_get_proto_name_and_key(wmem_allocator_t *scope, struct _packet_info* pinfo, guint pfd_index);
/* no sense to include epan.h + dependencies for opaque epan session type */
struct epan_session;