aboutsummaryrefslogtreecommitdiffstats
path: root/mergecap.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 /mergecap.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 'mergecap.c')
-rw-r--r--mergecap.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/mergecap.c b/mergecap.c
index 3f7b08d65a..e59a16d364 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -117,7 +117,6 @@ string_elem_print(gpointer data, gpointer not_used _U_)
((struct string_elem *)data)->lstr);
}
-#ifdef HAVE_PLUGINS
/*
* General errors and warnings are reported with an console message
* in mergecap.
@@ -129,7 +128,6 @@ failure_warning_message(const char *msg_format, va_list ap)
vfprintf(stderr, msg_format, ap);
fprintf(stderr, "\n");
}
-#endif
static void
list_capture_types(void) {
@@ -298,23 +296,10 @@ main(int argc, char *argv[])
g_free(init_progfile_dir_error);
}
- wtap_init();
-
-#ifdef HAVE_PLUGINS
init_report_message(failure_warning_message, failure_warning_message,
NULL, NULL, NULL);
- /* Scan for plugins. This does *not* call their registration routines;
- that's done later.
-
- Don't report failures to load plugins because most (non-wiretap)
- plugins *should* fail to load (because we're not linked against
- libwireshark and dissector plugins need libwireshark).*/
- scan_plugins(DONT_REPORT_LOAD_FAILURE);
-
- /* Register all libwiretap plugin modules. */
- register_all_wiretap_modules();
-#endif
+ wtap_init();
/* Process the options first */
while ((opt = getopt_long(argc, argv, "aF:hI:s:vVw:", long_options, NULL)) != -1) {
@@ -485,9 +470,6 @@ main(int argc, char *argv[])
clean_exit:
wtap_cleanup();
free_progdirs();
-#ifdef HAVE_PLUGINS
- plugins_cleanup();
-#endif
return (status == MERGE_OK) ? 0 : 2;
}