aboutsummaryrefslogtreecommitdiffstats
path: root/epan/decode_as.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/decode_as.h
parent11d3224142c0531879fb8e415daf9639a4eace66 (diff)
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/decode_as.h')
-rw-r--r--epan/decode_as.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/epan/decode_as.h b/epan/decode_as.h
index 69648fd90d..a7b03b7025 100644
--- a/epan/decode_as.h
+++ b/epan/decode_as.h
@@ -97,6 +97,47 @@ WS_DLL_PUBLIC gboolean decode_as_default_change(const gchar *name, gconstpointer
*/
WS_DLL_PUBLIC GList *decode_as_list;
+/* Some useful utilities for Decode As */
+
+/** Reset the "decode as" entries and reload ones of the current profile.
+ */
+WS_DLL_PUBLIC void load_decode_as_entries(void);
+
+/** Write out the "decode as" entries of the current profile.
+ */
+WS_DLL_PUBLIC int save_decode_as_entries(gchar** err);
+
+/** Clear all "decode as" settings.
+ */
+WS_DLL_PUBLIC void decode_clear_all(void);
+
+/** This routine creates one entry in the list of protocol dissector
+ * that need to be reset. It is called by the g_hash_table_foreach
+ * routine once for each changed entry in a dissector table.
+ * Unfortunately it cannot delete the entry immediately as this screws
+ * up the foreach function, so it builds a list of dissectors to be
+ * reset once the foreach routine finishes.
+ *
+ * @param table_name The table name in which this dissector is found.
+ *
+ * @param key A pointer to the key for this entry in the dissector
+ * hash table. This is generally the numeric selector of the
+ * protocol, i.e. the ethernet type code, IP port number, TCP port
+ * number, etc.
+ *
+ * @param selector_type The type of the selector in that dissector table
+ *
+ * @param value A pointer to the value for this entry in the dissector
+ * hash table. This is an opaque pointer that can only be handed back
+ * to routine in the file packet.c - but it's unused.
+ *
+ * @param user_data Unused.
+ */
+WS_DLL_PUBLIC void decode_build_reset_list (const gchar *table_name, ftenum_t selector_type,
+ gpointer key, gpointer value _U_,
+ gpointer user_data _U_);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */