aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/about_dlg.c7
-rw-r--r--ui/gtk/main.c22
-rw-r--r--ui/gtk/main_menubar.c1
-rw-r--r--ui/gtk/packet_win.c1
-rw-r--r--ui/gtk/plugins_dlg.c63
-rw-r--r--ui/gtk/rtp_player.c3
-rw-r--r--ui/qt/main.cpp25
7 files changed, 66 insertions, 56 deletions
diff --git a/ui/gtk/about_dlg.c b/ui/gtk/about_dlg.c
index 8d22e55665..c4e38346f6 100644
--- a/ui/gtk/about_dlg.c
+++ b/ui/gtk/about_dlg.c
@@ -25,12 +25,12 @@
#include "config.h"
-#include <gtk/gtk.h>
-
#include <string.h>
+#include <gtk/gtk.h>
+
#include <wsutil/filesystem.h>
-#include <epan/plugins.h>
+#include <wsutil/plugins.h>
#ifdef HAVE_LIBSMI
#include <epan/oids.h>
#endif
@@ -43,6 +43,7 @@
#include "../log.h"
#include "../version_info.h"
+#include "../register.h"
#include "ui/last_open_dir.h"
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 72739e55b3..6affd20ea1 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -76,7 +76,6 @@
#include <epan/disabled_protos.h>
#include <epan/epan.h>
#include <epan/epan_dissect.h>
-#include <epan/plugins.h>
#include <epan/dfilter/dfilter.h>
#include <epan/strutil.h>
#include <epan/emem.h>
@@ -92,6 +91,8 @@
#include <epan/print.h>
#include <epan/timestamp.h>
+#include <wsutil/plugins.h>
+
/* general (not GTK specific) */
#include "../file.h"
#include "../frame_tvbuff.h"
@@ -124,6 +125,8 @@
#include "ui/iface_lists.h"
#endif
+#include "codecs/codecs.h"
+
#ifdef HAVE_LIBPCAP
#include "capture_ui_utils.h"
#include "capture-pcap-util.h"
@@ -2518,6 +2521,23 @@ main(int argc, char *argv[])
g_free(init_progfile_dir_error);
}
+#ifdef HAVE_PLUGINS
+ /* Register all the plugin types we have. */
+ epan_register_plugin_types(); /* Types known to libwireshark */
+ wtap_register_plugin_types(); /* Types known to libwiretap */
+ codec_register_plugin_types(); /* Types known to libcodec */
+
+ /* 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();
+
+ /* Register all audio codec plugins. */
+ register_all_codecs();
+#endif
+
splash_update(RA_DISSECTORS, NULL, (gpointer)splash_win);
/* Register all dissectors; we must do this before checking for the
diff --git a/ui/gtk/main_menubar.c b/ui/gtk/main_menubar.c
index 03e617623b..ed677ba858 100644
--- a/ui/gtk/main_menubar.c
+++ b/ui/gtk/main_menubar.c
@@ -39,7 +39,6 @@
#include <epan/etypes.h>
#include <epan/dissector_filters.h>
#include <epan/strutil.h>
-#include <epan/plugins.h>
#include <epan/epan_dissect.h>
#include <epan/column.h>
#include <epan/stats_tree_priv.h>
diff --git a/ui/gtk/packet_win.c b/ui/gtk/packet_win.c
index adc2c6c0a2..8b7de8906e 100644
--- a/ui/gtk/packet_win.c
+++ b/ui/gtk/packet_win.c
@@ -47,7 +47,6 @@
#include <epan/prefs.h>
#include <epan/column.h>
#include <epan/addr_resolv.h>
-#include <epan/plugins.h>
#include <epan/epan_dissect.h>
#include <epan/strutil.h>
#include <epan/tvbuff-int.h>
diff --git a/ui/gtk/plugins_dlg.c b/ui/gtk/plugins_dlg.c
index 3658969163..7cea52b5a7 100644
--- a/ui/gtk/plugins_dlg.c
+++ b/ui/gtk/plugins_dlg.c
@@ -26,7 +26,9 @@
#include <gtk/gtk.h>
-#include "epan/plugins.h"
+#include <epan/wslua/init_wslua.h>
+
+#include <wsutil/plugins.h>
#include "ui/gtk/dlg_utils.h"
#include "ui/gtk/gui_utils.h"
@@ -72,59 +74,24 @@ about_plugins_callback(GtkWidget *widget, GdkEventButton *event, gint id _U_)
* XXX - We might want to combine this with plugins_dump_all().
*/
static void
-plugins_scan(GtkWidget *list)
+plugins_add_description(const char *name, const char *version,
+ const char *types, const char *filename,
+ void *user_data)
{
-#ifdef HAVE_PLUGINS
- plugin *pt_plug;
- const char *sep;
-#endif
-#ifdef HAVE_LUA
- wslua_plugin *lua_plug;
-#endif
- GString *type;
+ GtkWidget *list = (GtkWidget *)user_data;
+ simple_list_append(list, 0, name, 1, version,
+ 2, types, 3, filename, -1);
+}
+static void
+plugins_scan(GtkWidget *list)
+{
#ifdef HAVE_PLUGINS
- for (pt_plug = plugin_list; pt_plug != NULL; pt_plug = pt_plug->next)
- {
- type = g_string_new("");
- sep = "";
- if (pt_plug->register_protoinfo)
- {
- type = g_string_append(type, "dissector");
- sep = ", ";
- }
- if (pt_plug->register_tap_listener)
- {
- type = g_string_append(type, sep);
- type = g_string_append(type, "tap");
- sep = ", ";
- }
- if (pt_plug->register_wtap_module)
- {
- type = g_string_append(type, sep);
- type = g_string_append(type, "file format");
- sep = ", ";
- }
- if (pt_plug->register_codec_module)
- {
- type = g_string_append(type, sep);
- type = g_string_append(type, "codec");
- }
- simple_list_append(list, 0, pt_plug->name, 1, pt_plug->version,
- 2, type->str, 3, g_module_name(pt_plug->handle), -1);
- g_string_free(type, TRUE);
- }
+ plugins_get_descriptions(plugins_add_description, list);
#endif
#ifdef HAVE_LUA
- for (lua_plug = wslua_plugin_list; lua_plug != NULL; lua_plug = lua_plug->next)
- {
- type = g_string_new("");
- type = g_string_append(type, "lua script");
-
- simple_list_append(list, 0, lua_plug->name, 1, lua_plug->version, 2, type->str, 3, lua_plug->filename, -1);
- g_string_free(type, TRUE);
- }
+ wslua_plugins_get_descriptions(plugins_add_description, list);
#endif
}
diff --git a/ui/gtk/rtp_player.c b/ui/gtk/rtp_player.c
index 98a20f8795..acee55f804 100644
--- a/ui/gtk/rtp_player.c
+++ b/ui/gtk/rtp_player.c
@@ -64,9 +64,10 @@
#include <epan/addr_resolv.h>
#include <epan/dissectors/packet-rtp.h>
#include <epan/rtp_pt.h>
-#include <../codecs/codecs.h>
#include <epan/prefs.h>
+#include <codecs/codecs.h>
+
#include "../globals.h"
#include "../codecs/G711a/G711adecode.h"
#include "../codecs/G711u/G711udecode.h"
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 85b8dbb004..b63692dac9 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -40,6 +40,9 @@
#include <wsutil/filesystem.h>
#include <wsutil/file_util.h>
#include <wsutil/privileges.h>
+#ifdef HAVE_PLUGINS
+#include <wsutil/plugins.h>
+#endif
#include <wsutil/u3.h>
#include <wiretap/merge.h>
@@ -48,7 +51,6 @@
#include <epan/epan_dissect.h>
#include <epan/timestamp.h>
#include <epan/packet.h>
-#include <epan/plugins.h>
#include <epan/dfilter/dfilter.h>
#include <epan/strutil.h>
#include <epan/addr_resolv.h>
@@ -66,6 +68,10 @@
#include <epan/disabled_protos.h>
#include <epan/print.h>
+#ifdef HAVE_PLUGINS
+#include <codecs/codecs.h>
+#endif
+
/* general (not Qt specific) */
#include "file.h"
#include "summary.h"
@@ -821,6 +827,23 @@ int main(int argc, char *argv[])
capture_session_init(&global_capture_session, (void *)&cfile);
#endif
+#ifdef HAVE_PLUGINS
+ /* Register all the plugin types we have. */
+ epan_register_plugin_types(); /* Types known to libwireshark */
+ wtap_register_plugin_types(); /* Types known to libwiretap */
+ codec_register_plugin_types(); /* Types known to libcodec */
+
+ /* 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();
+
+ /* Register all audio codec plugins. */
+ register_all_codecs();
+#endif
+
/* Register all dissectors; we must do this before checking for the
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in