aboutsummaryrefslogtreecommitdiffstats
path: root/epan/epan.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2019-07-18 10:28:04 +0100
committerJoão Valverde <j@v6e.pt>2019-07-21 22:46:57 +0000
commit1d1679f061cbd035cdc68c7d0ceaa4b08f0f7e0e (patch)
tree73ba04cdf34ff4d3b8f4ebd5e0b69fdeec440110 /epan/epan.c
parent687ae12b6103330f365381b7df2764cc984bce88 (diff)
Extend epan library plugins with a tap registration callback
tap_register_plugin() is not sufficient for an extension language implementation because the epan plugin is initialized before proto_init(), therefore before dissectors have registered taps. Change-Id: Ief213f85ff4f7182f9af985e5f45476355cc2b86 Reviewed-on: https://code.wireshark.org/review/34048 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c
index 04d9d08cef..ed9762abfd 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -178,6 +178,13 @@ void epan_register_plugin(const epan_plugin *plug)
if (plug->register_all_handoffs)
epan_plugin_register_all_handoffs = g_slist_prepend(epan_plugin_register_all_handoffs, plug->register_all_handoffs);
}
+
+void epan_plugin_register_all_tap_listeners(gpointer data, gpointer user_data _U_)
+{
+ epan_plugin *plug = (epan_plugin *)data;
+ if (plug->register_all_tap_listeners)
+ plug->register_all_tap_listeners();
+}
#endif
gboolean
@@ -242,6 +249,9 @@ epan_init(register_cb cb, gpointer client_data, gboolean load_plugins)
g_slist_foreach(epan_plugins, epan_plugin_init, NULL);
#endif
proto_init(epan_plugin_register_all_procotols, epan_plugin_register_all_handoffs, cb, client_data);
+#ifdef HAVE_PLUGINS
+ g_slist_foreach(epan_plugins, epan_plugin_register_all_tap_listeners, NULL);
+#endif
packet_cache_proto_handles();
dfilter_init();
final_registration_all_protocols();