diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-10-01 00:56:03 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-12-14 08:43:57 +0000 |
commit | 995812c5f1add94df1c237596939130c1704b099 (patch) | |
tree | 42542c56b9a70c7d2d231c8bc36649be35af46b4 /wireshark-qt.cpp | |
parent | a9821caab8a1f2c6e265bd5b63a060f1f241c704 (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 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 059f2e0335..94b20298a6 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -598,22 +598,6 @@ int main(int argc, char *qt_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, NULL); #ifdef DEBUG_STARTUP_TIME g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "Calling epan init, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); @@ -635,6 +619,9 @@ int main(int argc, char *qt_argv[]) g_log(LOG_DOMAIN_MAIN, G_LOG_LEVEL_INFO, "epan done, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); #endif + /* Register all audio codecs. */ + codecs_init(); + // Read the dynamic part of the recent file. This determines whether or // not the recent list appears in the main window so the earlier we can // call this the better. @@ -958,11 +945,9 @@ clean_exit: capture_opts_cleanup(&global_capture_opts); #endif col_cleanup(&CaptureFile::globalCapFile()->cinfo); + codecs_cleanup(); wtap_cleanup(); free_progdirs(); -#ifdef HAVE_PLUGINS - plugins_cleanup(); -#endif return ret_val; } |