summaryrefslogtreecommitdiff
path: root/capinfos.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-12-02 08:30:29 +0000
committerGuy Harris <guy@alum.mit.edu>2013-12-02 08:30:29 +0000
commit0cc1545d05be6f655c950904b1da776190f3af16 (patch)
treeb82725615b527304bfb2e9e7d9f3b6dfc50ce7fd /capinfos.c
parentbaf569188ac49ad38912b82d23ff241321cd654f (diff)
downloadwireshark-0cc1545d05be6f655c950904b1da776190f3af16.tar.gz
Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/capinfos.c b/capinfos.c
index 893901579c..29a3fe03dc 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -78,17 +78,9 @@
#include <wsutil/privileges.h>
#include <wsutil/filesystem.h>
-/*
- * The symbols declared in the below are exported from libwireshark,
- * but we don't want to link whole libwireshark to capinfos.
- * We link the object directly instead and this needs a little trick
- * with the WS_BUILD_DLL #define.
- */
-#define WS_BUILD_DLL
-#define RESET_SYMBOL_EXPORT
-#include <epan/plugins.h>
-#undef WS_BUILD_DLL
-#define RESET_SYMBOL_EXPORT
+#ifdef HAVE_PLUGINS
+#include <wsutil/plugins.h>
+#endif
#include "wtap.h"
#include <wsutil/report_err.h>
@@ -1144,14 +1136,21 @@ main(int argc, char *argv[])
init_process_policies();
#ifdef HAVE_PLUGINS
- /* Register wiretap plugins */
-
if ((init_progfile_dir_error = init_progfile_dir(argv[0], main))) {
g_warning("capinfos: init_progfile_dir(): %s", init_progfile_dir_error);
g_free(init_progfile_dir_error);
} else {
+ /* Register all the plugin types we have. */
+ wtap_register_plugin_types(); /* Types known to libwiretap */
+
init_report_err(failure_message,NULL,NULL,NULL);
- init_plugins();
+
+ /* Scan for plugins. This does *not* call their registration routines;
+ that's done later. */
+ scan_plugins();
+
+ /* Register all libwiretap plugin modules. */
+ register_all_wiretap_modules();
}
#endif