Add support for Cisco ISL.
[obnox/wireshark/wip.git] / plugins.h
1 /* plugins.h
2  * definitions for plugins structures
3  *
4  * $Id: plugins.h,v 1.5 2000/01/15 00:22:34 gram Exp $
5  *
6  * Ethereal - Network traffic analyzer
7  * By Gerald Combs <gerald@zing.org>
8  * Copyright 1999 Gerald Combs
9  *
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __PLUGINS_H__
27 #define __PLUGINS_H__
28
29 #include <glib.h>
30 #include <gmodule.h>
31
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #ifdef HAVE_DLFCN_H
35 #define HAVE_PLUGINS 1
36 #endif
37 #endif /* HAVE_CONFIG_H */
38
39 #ifndef __DFILTER_H__
40 #include "dfilter.h"
41 #endif
42
43 #ifndef __PACKET_H__
44 #include "packet.h"
45 #endif
46
47 #ifdef HAVE_WINSOCK_H
48 #include <winsock.h>
49 #endif
50
51 typedef struct _plugin {
52     GModule     *handle;          /* handle returned by dlopen */
53     gchar       *name;            /* plugin name */
54     gchar       *version;         /* plugin version */
55     gboolean     enabled;         /* is it active ? */
56     gchar       *protocol;        /* protocol which should call the dissector
57                                    * for this plugin eg "tcp" */
58     gchar       *filter_string;   /* display filter string matching frames for
59                                    * which the dissector should be used */
60     dfilter     *filter;          /* compiled display filter */
61     /* the dissector */
62     void (*dissector) (const u_char *, int, frame_data *, proto_tree *);
63     struct _plugin *next;     /* forward link */
64 } plugin;
65
66 extern plugin *plugin_list;
67
68 int add_plugin(void *, gchar *, gchar *, gchar *, gchar *, dfilter *,
69                   void (*) (const u_char *, int, frame_data *, proto_tree *));
70 void *enable_plugin(const gchar *, const gchar *);
71 void *disable_plugin(const gchar *, const gchar *);
72 void *find_plugin(const gchar *, const gchar *);
73 gboolean is_enabled(const gchar *, const gchar *);
74 void plugin_replace_filter(const gchar *, const gchar *, const gchar *, dfilter *);
75 int save_plugin_status();
76 void init_plugins();
77
78 #endif /* __PLUGINS_H__ */