aboutsummaryrefslogtreecommitdiffstats
path: root/epan/decode_as.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-07-08 21:48:36 -0400
committerAnders Broman <a.broman58@gmail.com>2017-07-11 08:41:49 +0000
commit9b3c8d4515c9a1a307c141c25fa59694391efe3a (patch)
treeb71ff7c6590321de7a9f7141f2e4f3cf39bb426b /epan/decode_as.h
parentd4d30faeb85c5adf39aca3ae5e52db225c88ea48 (diff)
Expand register_decode_as_next_proto to include prompt string.
Many dissectors don't have an identifier to pass to a dissector table. When using Decode As they all have a "value" function that returns 0 just so something is returned. A first step to a cleaner refactor of the functionality is to allow dissectors to provide a "prompt" function when registering Decode As with register_decode_as_next_proto() so that the text exposed in the GUI can vary, but the function that returns 0 (nothing) can be consolidated under decode as registration functionality. This casts a wider net for register_decode_as_next_proto() use. Change-Id: I2995b3c251dae70f5f529b672473d25c6288ed5c Reviewed-on: https://code.wireshark.org/review/22562 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/decode_as.h')
-rw-r--r--epan/decode_as.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/epan/decode_as.h b/epan/decode_as.h
index 63398efdf4..99383e0436 100644
--- a/epan/decode_as.h
+++ b/epan/decode_as.h
@@ -86,12 +86,18 @@ typedef struct decode_as_s {
WS_DLL_PUBLIC void register_decode_as(decode_as_t* reg);
/** Register a "Decode As" entry for the special case where there is no
- indication for the next protocol (such as port number etc.).
- For now, this will use a uint32 dissector table internally and
- assign all registered protocols to 0. The framework to do this can
- be kept internal to epan. */
+ * indication for the next protocol (such as port number etc.).
+ * For now, this will use a uint32 dissector table internally and
+ * assign all registered protocols to 0. The framework to do this can
+ * be kept internal to epan.
+ *
+ * @param name The table name in which this dissector is found.
+ * @param title The table name in which this dissector is found.
+ * @param table_name The table name in which this dissector is found.
+ * @param label_func Optional prompt text for dissector. If NULL, "Next level protocol as" is used.
+*/
WS_DLL_PUBLIC void register_decode_as_next_proto(
- const char *name, const gchar *title, const gchar *table_name);
+ const char *name, const gchar *title, const gchar *table_name, build_label_func* label_func);
/* Walk though the dissector table and provide dissector_handle_t for each item in the table */
WS_DLL_PUBLIC void decode_as_default_populate_list(const gchar *table_name, decode_as_add_to_list_func add_to_list, gpointer ui_element);