aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.h
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 /wiretap/wtap.h
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 'wiretap/wtap.h')
-rw-r--r--wiretap/wtap.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 567c961e24..4e11751d4c 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -29,6 +29,9 @@
#include "wtap_opttypes.h"
#include "ws_symbol_export.h"
#include "ws_attributes.h"
+#ifdef HAVE_PLUGINS
+#include "wsutil/plugins.h"
+#endif
#ifdef __cplusplus
extern "C" {
@@ -2002,10 +2005,17 @@ GSList *wtap_get_file_extension_type_extensions(guint extension_type);
/*** dynamically register new file types and encapsulations ***/
WS_DLL_PUBLIC
-void register_all_wiretap_modules(void);
-WS_DLL_PUBLIC
void wtap_register_file_type_extension(const struct file_extension_info *ei);
+#ifdef HAVE_PLUGINS
+typedef struct {
+ void (*register_wtap_module)(void); /* routine to call to register a wiretap module */
+} wtap_plugin;
+
+WS_DLL_PUBLIC
+void wtap_register_plugin(const wtap_plugin *plug);
+#endif
+
WS_DLL_PUBLIC
void wtap_register_open_info(struct open_info *oi, const gboolean first_routine);
WS_DLL_PUBLIC