aboutsummaryrefslogtreecommitdiffstats
path: root/epan/plugins.c
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:22:32 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:22:32 +0000
commit11f06217ced22efb25ff4157216622ea24da7cab (patch)
tree2ff6203726b046cb044b2ba9f79980fd79fea61d /epan/plugins.c
parentc22f70ec1be27d319953eaa4e37e73fec6810d42 (diff)
Have editcap and capinfos loading the wiretap plugins.
epan/filesystem.c have get_plugin_dir() calling init_plugin_dir() if necessary epan/epan.c and epan/report_err.c move the report_failure family into the new report_err.c file, have epan_init() calling the initializer epan/plugins.h and epan/proto.c do not have init_plugins() calling the proto_reg functions instead do it in init_proto() gtk/main.c and tshark.c init_plugin_dir() has become suprefluous capinfos.c and editcap.c load the wiretap plugins Makefiles do what's needed to build withe the above changes. svn path=/trunk/; revision=21935
Diffstat (limited to 'epan/plugins.c')
-rw-r--r--epan/plugins.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/epan/plugins.c b/epan/plugins.c
index 4841751311..8425945ad9 100644
--- a/epan/plugins.c
+++ b/epan/plugins.c
@@ -173,6 +173,7 @@ plugins_scan_dir(const char *dirname)
if ((dir = eth_dir_open(dirname, 0, NULL)) != NULL)
{
+
while ((file = eth_dir_read_name(dir)) != NULL)
{
name = eth_dir_get_name(file);
@@ -344,14 +345,6 @@ plugins_scan_dir(const char *dirname)
continue;
}
- /*
- * Call its register routine if it has one.
- * XXX - just save this and call it with the built-in
- * dissector register routines?
- */
- if (register_protoinfo != NULL)
- register_protoinfo();
-
}
eth_dir_close(dir);
}
@@ -441,6 +434,27 @@ init_plugins(void)
}
void
+register_all_plugin_registrations(void)
+{
+ plugin *pt_plug;
+
+ /*
+ * For all plugins with register-handoff routines, call the routines.
+ * This is called from "proto_init()"; it must be called after
+ * "register_all_protocols()" and "init_plugins()" are called,
+ * in case one plugin registers itself either with a built-in
+ * dissector or with another plugin; we must first register all
+ * dissectors, whether built-in or plugin, so their dissector tables
+ * are initialized, and only then register all handoffs.
+ */
+ for (pt_plug = plugin_list; pt_plug != NULL; pt_plug = pt_plug->next)
+ {
+ if (pt_plug->register_protoinfo)
+ (pt_plug->register_protoinfo)();
+ }
+}
+
+void
register_all_plugin_handoffs(void)
{
plugin *pt_plug;