enabled. The counter is incremented in enable_plugin() and decremented
in disable_plugin().
In add_packet_to_packet_list(), we check this counter (instead of
plugin_list) to see if there is at least one enabled plugin. If this is
the case, we must build the protocol tree.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1770
f5534014-38df-0310-8fa8-
9805f1628bb7
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.173 2000/03/28 08:11:43 guy Exp $
+ * $Id: file.c,v 1.174 2000/03/31 21:42:23 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
}
else {
#ifdef HAVE_PLUGINS
- if (plugin_list)
+ if (enabled_plugins_number > 0)
protocol_tree = proto_tree_create_root();
#endif
dissect_packet(buf, fdata, protocol_tree);
/* plugins.c
* plugin routines
*
- * $Id: plugins.c,v 1.11 2000/03/15 19:09:23 guy Exp $
+ * $Id: plugins.c,v 1.12 2000/03/31 21:42:24 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
/* linked list of all plugins */
plugin *plugin_list;
+guint32 enabled_plugins_number;
#ifdef WIN32
static gchar std_plug_dir[] = "c:/program files/ethereal/plugins/0.8";
if (!strcmp(pt_plug->name, name) && !strcmp(pt_plug->version, version))
{
pt_plug->enabled = TRUE;
+ enabled_plugins_number++;
return pt_plug;
}
pt_plug = pt_plug->next;
if (!strcmp(pt_plug->name, name) && !strcmp(pt_plug->version, version))
{
pt_plug->enabled = FALSE;
+ enabled_plugins_number--;
return pt_plug;
}
pt_plug = pt_plug->next;
if (plugin_list == NULL) /* ensure init_plugins is only run once */
{
+ enabled_plugins_number = 0;
#ifdef PLUGINS_NEED_ADDRESS_TABLE
/* Intialize address table */
/* plugins.h
* definitions for plugins structures
*
- * $Id: plugins.h,v 1.5 2000/01/15 00:22:34 gram Exp $
+ * $Id: plugins.h,v 1.6 2000/03/31 21:42:24 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
} plugin;
extern plugin *plugin_list;
+extern guint32 enabled_plugins_number;
int add_plugin(void *, gchar *, gchar *, gchar *, gchar *, dfilter *,
void (*) (const u_char *, int, frame_data *, proto_tree *));