diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-20 20:13:28 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-21 04:14:24 +0000 |
commit | 2b006ad30e38b015cfd13c33b265e2f48ddf36b2 (patch) | |
tree | c3c9a0de47a59d414477143a7ad24be694f28672 /epan/packet.h | |
parent | 81798009b97549ad0879d1c01a3b9c60ed726ed9 (diff) | |
download | wireshark-2b006ad30e38b015cfd13c33b265e2f48ddf36b2.tar.gz |
Have a heur_dissector_list_t be an opaque handle.
This allows dissector lists to be looked up by name, so they can be
shared by multiple dissectors.
(This means that there's no "udplite" heuristic dissector list, but
there shouldn't be one - protocols can run atop UDP or UDPLite equally
well, and they share a port namespace and uint dissector table, so they
should share a heuristic dissector table as well.)
Change-Id: Ifb2d2c294938c06d348a159adea7a57db8d770a7
Reviewed-on: https://code.wireshark.org/review/5936
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/packet.h')
-rw-r--r-- | epan/packet.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/packet.h b/epan/packet.h index f37b2c0805..f64870ae5a 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -341,8 +341,11 @@ WS_DLL_PUBLIC ftenum_t dissector_table_get_type(dissector_table_t dissector_tabl /* List of "heuristic" dissectors (which get handed a packet, look at it, and either recognize it as being for their protocol, dissect it, and return TRUE, or don't recognize it and return FALSE) to be called - by another dissector. */ -typedef GSList *heur_dissector_list_t; + by another dissector. + + This is opaque outside of "packet.c". */ +struct heur_dissector_list; +typedef struct heur_dissector_list *heur_dissector_list_t; typedef struct { @@ -358,8 +361,7 @@ typedef struct { * @param name the name of this protocol * @param list the list of heuristic sub-dissectors to be registered */ -WS_DLL_PUBLIC void register_heur_dissector_list(const char *name, - heur_dissector_list_t *list); +WS_DLL_PUBLIC heur_dissector_list_t register_heur_dissector_list(const char *name); typedef void (*DATFunc_heur) (const gchar *table_name, heur_dtbl_entry_t *entry, gpointer user_data); @@ -412,7 +414,7 @@ WS_DLL_PUBLIC gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissect * @param name name of the dissector table * @return pointer to the table on success, NULL if no such table exists */ -WS_DLL_PUBLIC heur_dissector_list_t *find_heur_dissector_list(const char *name); +WS_DLL_PUBLIC heur_dissector_list_t find_heur_dissector_list(const char *name); /** Add a sub-dissector to a heuristic dissector list. * Call this in the proto_handoff function of the sub-dissector. |