#include <epan/prefs.h>
#include <epan/dfilter/dfilter.h>
+#ifdef HAVE_PLUGINS
#include <wsutil/plugins.h>
+#endif
#include <wsutil/filesystem.h>
#include <wsutil/privileges.h>
#include <wsutil/report_err.h>
int gpf_open_errno, gpf_read_errno;
int pf_open_errno, pf_read_errno;
dfilter_t *df;
+ gchar *err_msg;
/*
* Get credential information for later use.
timestamp_set_type(TS_RELATIVE);
timestamp_set_seconds_type(TS_SECONDS_DEFAULT);
+#ifdef HAVE_PLUGINS
+ /* Register all the plugin types we have. */
+ epan_register_plugin_types(); /* Types known to libwireshark */
+
+ /* Scan for plugins. This does *not* call their registration routines;
+ that's done later. */
+ scan_plugins();
+#endif
+
/* Register all dissectors; we must do this before checking for the
"-g" flag, as the "-g" flag dumps a list of fields registered
by the dissectors, and we must do it before we read the preferences,
in case any dissectors register preferences. */
- epan_init(register_all_protocols, register_all_protocol_handoffs,
- NULL, NULL);
+ if (!epan_init(register_all_protocols, register_all_protocol_handoffs,
+ NULL, NULL))
+ return 2;
/* set the c-language locale to the native environment. */
setlocale(LC_ALL, "");
printf("Filter: \"%s\"\n", text);
/* Compile it */
- if (!dfilter_compile(text, &df)) {
- fprintf(stderr, "dftest: %s\n", dfilter_error_msg);
+ if (!dfilter_compile(text, &df, &err_msg)) {
+ fprintf(stderr, "dftest: %s\n", err_msg);
+ g_free(err_msg);
epan_cleanup();
exit(2);
}