diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-10-31 10:40:58 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-10-31 10:40:58 +0000 |
commit | 97a05828cd6320744f7c305516b7bf87c422eb23 (patch) | |
tree | 02f5ddaeac4e94b9361c1b64476885f52747d6c8 /plugins | |
parent | e829a56e24285b288d957ded274db07e88c50d95 (diff) | |
download | wireshark-97a05828cd6320744f7c305516b7bf87c422eb23.tar.gz wireshark-97a05828cd6320744f7c305516b7bf87c422eb23.tar.bz2 wireshark-97a05828cd6320744f7c305516b7bf87c422eb23.zip |
Sigh. Well, if you make the function declarations external, that means
that they're external when the plugin is compiled, and there's no
definition to satisfy the extern, so plugins fail to compile.
Add a "plugins/plugin_api_defs.h" header file that defines them, and
include that in one (and only one) source file for a particular plugin.
svn path=/trunk/; revision=4117
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 3 | ||||
-rw-r--r-- | plugins/giop/packet-coseventcomm.c | 2 | ||||
-rw-r--r-- | plugins/giop/packet-cosnaming.c | 2 | ||||
-rw-r--r-- | plugins/gryphon/packet-gryphon.c | 4 | ||||
-rw-r--r-- | plugins/mgcp/packet-mgcp.c | 4 | ||||
-rw-r--r-- | plugins/plugin_api_defs.h | 193 |
6 files changed, 205 insertions, 3 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 2d0dffbd27..f4c28806a0 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.7 2001/07/19 21:30:16 guy Exp $ +# $Id: Makefile.am,v 1.8 2001/10/31 10:40:54 guy Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@zing.org> @@ -29,5 +29,6 @@ plugindir = @PLUGIN_DIR@ EXTRA_DIST = \ plugin_api.c \ plugin_api.h \ + plugin_api_defs.h \ plugin_table.h \ Makefile.nmake diff --git a/plugins/giop/packet-coseventcomm.c b/plugins/giop/packet-coseventcomm.c index 5882102482..da88c46bbc 100644 --- a/plugins/giop/packet-coseventcomm.c +++ b/plugins/giop/packet-coseventcomm.c @@ -64,6 +64,8 @@ #include "proto.h" #include "packet-giop.h" +#include "plugins/plugin_api_defs.h" + #ifndef __ETHEREAL_STATIC__ G_MODULE_EXPORT const gchar version[] = "0.0.1"; #endif diff --git a/plugins/giop/packet-cosnaming.c b/plugins/giop/packet-cosnaming.c index 54b846d96a..cc76a50c63 100644 --- a/plugins/giop/packet-cosnaming.c +++ b/plugins/giop/packet-cosnaming.c @@ -65,6 +65,8 @@ #include "proto.h" #include "packet-giop.h" +#include "plugins/plugin_api_defs.h" + #ifndef __ETHEREAL_STATIC__ G_MODULE_EXPORT const gchar version[] = "0.0.1"; #endif diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index 7355dc1837..70a97d3df0 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -1,7 +1,7 @@ /* packet-gryphon.c * Routines for Gryphon protocol packet disassembly * - * $Id: packet-gryphon.c,v 1.23 2001/07/08 21:51:32 hagbard Exp $ + * $Id: packet-gryphon.c,v 1.24 2001/10/31 10:40:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Steve Limkemann <stevelim@dgtech.com> @@ -48,6 +48,8 @@ #include "packet.h" #include "packet-gryphon.h" +#include "plugins/plugin_api_defs.h" + #ifndef __ETHEREAL_STATIC__ G_MODULE_EXPORT const gchar version[] = VERSION; #endif diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c index 5dcdd294f4..85f32f6a2e 100644 --- a/plugins/mgcp/packet-mgcp.c +++ b/plugins/mgcp/packet-mgcp.c @@ -2,7 +2,7 @@ * Routines for mgcp packet disassembly * RFC 2705 * - * $Id: packet-mgcp.c,v 1.26 2001/07/08 21:51:34 hagbard Exp $ + * $Id: packet-mgcp.c,v 1.27 2001/10/31 10:40:58 guy Exp $ * * Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu> * @@ -51,6 +51,8 @@ #include "prefs.h" #include "strutil.h" +#include "plugins/plugin_api_defs.h" + #ifndef __ETHEREAL_STATIC__ G_MODULE_EXPORT const gchar version[] = VERSION; #endif diff --git a/plugins/plugin_api_defs.h b/plugins/plugin_api_defs.h new file mode 100644 index 0000000000..d12cb73fb8 --- /dev/null +++ b/plugins/plugin_api_defs.h @@ -0,0 +1,193 @@ +/* plugin_api_defs.h + * Define the variables that hold pointers to plugin API functions + * + * $Id: plugin_api_defs.h,v 1.1 2001/10/31 10:40:54 guy Exp $ + * + * Ethereal - Network traffic analyzer + * Copyright 2000 by Gilbert Ramirez <gram@xiexie.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef PLUGINS_NEED_ADDRESS_TABLE + +gint (*p_check_col)(frame_data*, gint); +void (*p_col_clear)(frame_data*, gint); +void (*p_col_add_fstr)(frame_data*, gint, gchar*, ...); +void (*p_col_append_fstr)(frame_data*, gint, gchar*, ...); +void (*p_col_add_str)(frame_data*, gint, const gchar*); +void (*p_col_append_str)(frame_data*, gint, gchar*); +void (*p_col_set_str)(frame_data*, gint, gchar*); + +int (*p_proto_register_protocol)(char*, char*, char*); +void (*p_proto_register_field_array)(int, hf_register_info*, int); +void (*p_proto_register_subtree_array)(int**, int); + +void (*p_dissector_add)(const char *, guint32, dissector_t, int); +void (*p_dissector_delete)(const char *, guint32, dissector_t); + +void (*p_heur_dissector_add)(const char *, heur_dissector_t, int); + +void (*p_register_dissector)(const char *, dissector_t, int); +dissector_handle_t (*p_find_dissector)(const char *); +void (*p_call_dissector)(dissector_handle_t, tvbuff_t *, + packet_info *, proto_tree *); + +void (*p_dissect_data)(tvbuff_t *, int, packet_info *, proto_tree *); + +gboolean (*p_proto_is_protocol_enabled)(int); + +int (*p_proto_item_get_len)(proto_item*); +void (*p_proto_item_set_len)(proto_item*, gint); +void (*p_proto_item_set_text)(proto_item*, const char*, ...); +void (*p_proto_item_append_text)(proto_item*, const char*, ...); +proto_tree* (*p_proto_item_add_subtree)(proto_item*, gint); +proto_item* (*p_proto_tree_add_item)(proto_tree*, int, tvbuff_t*, gint, gint, gboolean); +proto_item* (*p_proto_tree_add_item_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, gboolean); +proto_item* (*p_proto_tree_add_protocol_format)(proto_tree*, int, tvbuff_t*, gint, gint, const char*, ...); + +proto_item* (*p_proto_tree_add_bytes)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_bytes_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_bytes_format)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...); + +proto_item* (*p_proto_tree_add_time)(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*); +proto_item* (*p_proto_tree_add_time_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*); +proto_item* (*p_proto_tree_add_time_format)(proto_tree*, int, tvbuff_t*, gint, gint, nstime_t*, const char*, ...); + +proto_item* (*p_proto_tree_add_ipxnet)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_ipxnet_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_ipxnet_format)(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...); + +proto_item* (*p_proto_tree_add_ipv4)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_ipv4_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_ipv4_format)(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...); + +proto_item* (*p_proto_tree_add_ipv6)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_ipv6_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_ipv6_format)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...); + +proto_item* (*p_proto_tree_add_ether)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_ether_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*); +proto_item* (*p_proto_tree_add_ether_format)(proto_tree*, int, tvbuff_t*, gint, gint, const guint8*, const char*, ...); + +proto_item* (*p_proto_tree_add_string)(proto_tree*, int, tvbuff_t*, gint, gint, const char*); +proto_item* (*p_proto_tree_add_string_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, const char*); +proto_item* (*p_proto_tree_add_string_format)(proto_tree*, int, tvbuff_t*, gint, gint, const char*, const char*, ...); + +proto_item* (*p_proto_tree_add_boolean)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_boolean_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_boolean_format)(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...); + +proto_item* (*p_proto_tree_add_double)(proto_tree*, int, tvbuff_t*, gint, gint, double); +proto_item* (*p_proto_tree_add_double_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, double); +proto_item* (*p_proto_tree_add_double_format)(proto_tree*, int, tvbuff_t*, gint, gint, double, const char*, ...); + +proto_item* (*p_proto_tree_add_uint)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_uint_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, guint32); +proto_item* (*p_proto_tree_add_uint_format)(proto_tree*, int, tvbuff_t*, gint, gint, guint32, const char*, ...); + +proto_item* (*p_proto_tree_add_int)(proto_tree*, int, tvbuff_t*, gint, gint, gint32); +proto_item* (*p_proto_tree_add_int_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, gint32); +proto_item* (*p_proto_tree_add_int_format)(proto_tree*, int, tvbuff_t*, gint, gint, gint32, const char*, ...); + +proto_item* (*p_proto_tree_add_text)(proto_tree*, tvbuff_t*, gint, gint, const char*, ...); + +tvbuff_t* (*p_tvb_new_subset)(tvbuff_t*, gint, gint, gint); + +guint (*p_tvb_length)(tvbuff_t*); +gint (*p_tvb_length_remaining)(tvbuff_t*, gint); +gboolean (*p_tvb_bytes_exist)(tvbuff_t*, gint, gint); +gboolean (*p_tvb_offset_exists)(tvbuff_t*, gint); +guint (*p_tvb_reported_length)(tvbuff_t*); +gint (*p_tvb_reported_length_remaining)(tvbuff_t*, gint); + +guint8 (*p_tvb_get_guint8)(tvbuff_t*, gint); + +guint16 (*p_tvb_get_ntohs)(tvbuff_t*, gint); +guint32 (*p_tvb_get_ntoh24)(tvbuff_t*, gint); +guint32 (*p_tvb_get_ntohl)(tvbuff_t*, gint); + +guint16 (*p_tvb_get_letohs)(tvbuff_t*, gint); +guint32 (*p_tvb_get_letoh24)(tvbuff_t*, gint); +guint32 (*p_tvb_get_letohl)(tvbuff_t*, gint); + +guint8* (*p_tvb_memcpy)(tvbuff_t*, guint8* target, gint, gint); +guint8* (*p_tvb_memdup)(tvbuff_t*, gint, gint); + +const guint8* (*p_tvb_get_ptr)(tvbuff_t*, gint, gint); + +gint (*p_tvb_find_guint8)(tvbuff_t*, gint, guint, guint8); +gint (*p_tvb_pbrk_guint8)(tvbuff_t *, gint, guint, guint8 *); + +gint (*p_tvb_strnlen)(tvbuff_t*, gint, guint); + +guint8 * (*p_tvb_format_text)(tvbuff_t*, gint, gint); + +gint (*p_tvb_get_nstringz)(tvbuff_t*, gint, guint, guint8*); +gint (*p_tvb_get_nstringz0)(tvbuff_t*, gint, guint, guint8*); + +gint (*p_tvb_find_line_end)(tvbuff_t*, gint, int, gint *); +gint (*p_tvb_find_line_end_unquoted)(tvbuff_t*, gint, int, gint *); + +gint (*p_tvb_strneql)(tvbuff_t*, gint, const guint8 *, gint); +gint (*p_tvb_strncaseeql)(tvbuff_t*, gint, const guint8 *, gint); + +gchar *(*p_tvb_bytes_to_str)(tvbuff_t*, gint, gint len); + +struct pref_module *(*p_prefs_register_protocol)(int, + void (*)(void)); +void (*p_prefs_register_uint_preference)(struct pref_module *, + const char *, const char *, const char *, guint, guint *); +void (*p_prefs_register_bool_preference)(struct pref_module *, + const char *, const char *, const char *, gboolean *); +void (*p_prefs_register_enum_preference)(struct pref_module *, + const char *, const char *, const char *, gint *, const enum_val_t *, + gboolean); +void (*p_prefs_register_string_preference)(struct pref_module *, + const char *, const char *, const char *, char**); + +void (*p_register_giop_user)(giop_sub_dissector_t *, gchar *, int); +gboolean (*p_is_big_endian)(MessageHeader *); +guint32 (*p_get_CDR_encap_info)(tvbuff_t *, proto_tree *, gint *, + gboolean, guint32, gboolean *, guint32 *); +void (*p_get_CDR_any)(tvbuff_t *, proto_tree *, gint *, + gboolean, int, MessageHeader *); +gboolean (*p_get_CDR_boolean)(tvbuff_t *, int *); +guint8 (*p_get_CDR_char)(tvbuff_t *, int *); +gdouble (*p_get_CDR_double)(tvbuff_t *, int *, gboolean, int); +guint32 (*p_get_CDR_enum)(tvbuff_t *, int *, gboolean, int); +void (*p_get_CDR_fixed)(tvbuff_t *, gchar **, gint *, guint32, + gint32); +gfloat (*p_get_CDR_float)(tvbuff_t *, int *, gboolean, int); +void (*p_get_CDR_interface)(tvbuff_t *, packet_info *, proto_tree *, + int *, gboolean, int); +gint32 (*p_get_CDR_long)(tvbuff_t *, int *, gboolean, int); +void (*p_get_CDR_object)(tvbuff_t *, packet_info *, proto_tree *, + int *, gboolean, int); +guint8 (*p_get_CDR_octet)(tvbuff_t *, int *); +void (*p_get_CDR_octet_seq)(tvbuff_t *, gchar **, int *, int); +gint16 (*p_get_CDR_short)(tvbuff_t *, int *, gboolean, int); +guint32 (*p_get_CDR_string)(tvbuff_t *, gchar **, int *, gboolean, + int); +guint32 (*p_get_CDR_typeCode)(tvbuff_t *, proto_tree *, gint *, + gboolean, int, MessageHeader *); +guint32 (*p_get_CDR_ulong)(tvbuff_t *, int *, gboolean, int); +guint16 (*p_get_CDR_ushort)(tvbuff_t *, int *, gboolean, int); +gint8 (*p_get_CDR_wchar)(tvbuff_t *, gchar **, int *, + MessageHeader *); +guint32 (*p_get_CDR_wstring)(tvbuff_t *, gchar **, int *, gboolean, + int, MessageHeader *); + +#endif /* PLUGINS_NEED_ACCESS_TABLE */ |