summaryrefslogtreecommitdiff
path: root/epan/packet.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-07 16:25:01 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-08 02:44:53 +0000
commit268841f3e00b7cf0f16c81dd2b3b952172130b8b (patch)
tree359e01cf5eba83308760531888713fe0ff0bc10b /epan/packet.h
parent11d3224142c0531879fb8e415daf9639a4eace66 (diff)
downloadwireshark-268841f3e00b7cf0f16c81dd2b3b952172130b8b.tar.gz
Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/packet.h')
-rw-r--r--epan/packet.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/packet.h b/epan/packet.h
index c869b93b11..461a07e0ac 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -215,10 +215,18 @@ WS_DLL_PUBLIC void dissector_dump_dissector_tables(void);
WS_DLL_PUBLIC void dissector_add_uint(const char *name, const guint32 pattern,
dissector_handle_t handle);
+/* Add an entry to a uint dissector table with "preference" automatically added. */
+WS_DLL_PUBLIC void dissector_add_uint_with_preference(const char *name, const guint32 pattern,
+ dissector_handle_t handle);
+
/* Add an range of entries to a uint dissector table. */
WS_DLL_PUBLIC void dissector_add_uint_range(const char *abbrev, struct epan_range *range,
dissector_handle_t handle);
+/* Add an range of entries to a uint dissector table with "preference" automatically added. */
+WS_DLL_PUBLIC void dissector_add_uint_range_with_preference(const char *abbrev, const char* range_str,
+ dissector_handle_t handle);
+
/* Delete the entry for a dissector in a uint dissector table
with a particular pattern. */
WS_DLL_PUBLIC void dissector_delete_uint(const char *name, const guint32 pattern,
@@ -366,10 +374,18 @@ WS_DLL_PUBLIC dissector_handle_t dissector_get_guid_handle(
WS_DLL_PUBLIC void dissector_add_for_decode_as(const char *name,
dissector_handle_t handle);
+/* Same as dissector_add_for_decode_as, but adds preference for dissector table value */
+WS_DLL_PUBLIC void dissector_add_for_decode_as_with_preference(const char *name,
+ dissector_handle_t handle);
+
/** Get the list of handles for a dissector table
*/
WS_DLL_PUBLIC GSList *dissector_table_get_dissector_handles(dissector_table_t dissector_table);
+/** Get a handle to dissector out of a dissector table
+ */
+WS_DLL_PUBLIC dissector_handle_t dissector_table_get_dissector_handle(dissector_table_t dissector_table, gchar* short_name);
+
/** Get a dissector table's type
*/
WS_DLL_PUBLIC ftenum_t dissector_table_get_type(dissector_table_t dissector_table);