aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/main.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2017-10-01 00:56:03 +0100
committerJoão Valverde <j@v6e.pt>2017-12-14 08:43:57 +0000
commit995812c5f1add94df1c237596939130c1704b099 (patch)
tree42542c56b9a70c7d2d231c8bc36649be35af46b4 /ui/gtk/main.c
parenta9821caab8a1f2c6e265bd5b63a060f1f241c704 (diff)
Refactor plugin registration and loading
Put different types of plugins (libwiretap, libwireshark) in different subdirectories, give libwiretap and libwireshark init routines that load the plugins, and have them scan the appropriate subdirectories so that we don't even *try* to, for example, load libwireshark plugins in programs that only use libwiretap. Compiled plugins are stored in subfolders of the plugin folders, with the subfolder name being the Wireshark minor version number (X.Y). There is another hierarchical level for each Wireshark library (libwireshark, libwscodecs and libwiretap). The folder names are respectively plugins/X.Y/{epan,codecs,wiretap}. Currently we only distribute "epan" (libwireshark) plugins. Change-Id: I3438787a6f45820d64ba4ca91cbe3c8864708acb Reviewed-on: https://code.wireshark.org/review/23983 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'ui/gtk/main.c')
-rw-r--r--ui/gtk/main.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 075f4995bf..3153a214e2 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -2196,22 +2196,6 @@ main(int argc, char *argv[])
wtap_init();
-#ifdef HAVE_PLUGINS
- /* Register all the plugin types we have. */
- epan_register_plugin_types(); /* Types known to libwireshark */
- codec_register_plugin_types(); /* Types known to libwscodecs */
-
- /* Scan for plugins. This does *not* call their registration routines;
- that's done later. */
- scan_plugins(REPORT_LOAD_FAILURE);
-
- /* Register all libwiretap plugin modules. */
- register_all_wiretap_modules();
-#endif
-
- /* Register all audio codec plugins. */
- register_all_codecs();
-
splash_update(RA_DISSECTORS, NULL, (gpointer)splash_win);
/* Register all dissectors; we must do this before checking for the
@@ -2224,6 +2208,9 @@ main(int argc, char *argv[])
goto clean_exit;
}
+ /* Register all audio codecs. */
+ codecs_init();
+
splash_update(RA_LISTENERS, NULL, (gpointer)splash_win);
/* Register all tap listeners; we do this before we parse the arguments,
@@ -2680,11 +2667,9 @@ clean_exit:
#endif
col_cleanup(&cfile.cinfo);
free_filter_lists();
+ codecs_cleanup();
wtap_cleanup();
free_progdirs();
-#ifdef HAVE_PLUGINS
- plugins_cleanup();
-#endif
return ret;
}