3
* $Id: epan.c 19327 2006-09-26 10:22:20Z lego $
3
* $Id: epan.c 20261 2007-01-02 06:49:40Z guy $
5
5
* Wireshark Protocol Analyzer Library
7
* Copyright (c) 2001 by Gerald Combs <gerald@wireshark.org>
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License
11
* as published by the Free Software Foundation; either version 2
12
* of the License, or (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8
24
#ifdef HAVE_CONFIG_H
55
* XXX - this takes the plugin directory as an argument, because
56
* libwireshark now has its own configure script and "config.h" file,
57
* which is what code in the "epan" directory includes, but we need
58
* to define PLUGIN_DIR in the top-level directory, as it's used by,
59
* for example, the Makefile for the Gryphon plugin, so it knows
60
* where to install the plugin.
62
* Eventually, we should probably have an "epan-configure" script
63
* (or "libwireshark-configure", or whatever), along the lines of what
64
* GTK+ and GLib have, that can print, among other things, the directory
65
* into which plugins should be installed. That way, only libwireshark
66
* need know what directory that is; programs using it won't, *and*
67
* Makefiles for plugins can just use "epan-configure" to figure out
68
* where to install the plugins.
70
* (Would that *more* libraries had configure scripts like that, so
71
* that configure scripts didn't have to go through various contortions
72
* to figure out where the header files and libraries for various
73
* libraries are located.)
76
epan_init(const char *plugin_dir, void (*register_all_protocols)(void),
71
epan_init(void (*register_all_protocols)(void),
77
72
void (*register_all_handoffs)(void),
78
73
void (*report_failure)(const char *, va_list),
79
74
void (*report_open_failure)(const char *, int, gboolean),
82
77
report_failure_func = report_failure;
83
78
report_open_failure_func = report_open_failure;
84
79
report_read_failure_func = report_read_failure;
81
/* initialize memory allocation subsystem */
85
/* initialize the GUID to name mapping table */
86
89
#ifdef HAVE_LIBGNUTLS
87
90
gnutls_global_init();
94
proto_init(plugin_dir,register_all_protocols,register_all_handoffs);
97
proto_init(register_all_protocols, register_all_handoffs);
97
100
final_registration_all_protocols();