From 4b0bce7f97567ec663930a1776c8c0efcd7d2dc1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 31 Oct 2001 07:47:27 +0000 Subject: Put "extern" in front of a pile of function declarations. It makes no difference if they really are function declarations; however, in plugins, when building on OSes that don't let dynamically-loaded modules access functions in the main program (e.g., Windows), when compiling a plugin, defines the names of those functions as (*pointer_name), so they turn into declarations of pointer variables pointing to the functions in question, and, on platforms with a def/ref model in the linker, if a plugin has more than one source file that gets linked into the plugin, the linker may get upset at two definitions of the same variable. svn path=/trunk/; revision=4114 --- epan/column-utils.h | 32 ++++----- epan/packet.h | 83 ++++++++++++---------- epan/proto.h | 199 ++++++++++++++++++++++++++-------------------------- epan/tvbuff.h | 114 ++++++++++++++++-------------- packet-giop.h | 92 ++++++++++++++---------- prefs.h | 41 +++++------ 6 files changed, 296 insertions(+), 265 deletions(-) diff --git a/epan/column-utils.h b/epan/column-utils.h index 0a5f8c1286..cafe5622e1 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -1,12 +1,11 @@ /* column-utils.h * Definitions for column utility structures and routines * - * $Id: column-utils.h,v 1.2 2001/07/22 10:25:49 guy Exp $ + * $Id: column-utils.h,v 1.3 2001/10/31 07:47:26 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs + * By Gerald Combs * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,7 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifndef __COLUMN_UTILS_H__ #define __COLUMN_UTILS_H__ @@ -37,27 +35,27 @@ /* Allocate all the data structures for constructing column data, given the number of columns. */ -void col_init(column_info *, gint); +extern void col_init(column_info *, gint); /* Utility routines used by packet*.c */ -void col_set_writable(frame_data *fd, gboolean writable); -gint check_col(frame_data *, gint); -void col_clear(frame_data *, gint); -void col_set_str(frame_data *, gint, gchar *); +extern void col_set_writable(frame_data *fd, gboolean writable); +extern gint check_col(frame_data *, gint); +extern void col_clear(frame_data *, gint); +extern void col_set_str(frame_data *, gint, gchar *); #if __GNUC__ >= 2 -void col_add_fstr(frame_data *, gint, gchar *, ...) +extern void col_add_fstr(frame_data *, gint, gchar *, ...) __attribute__((format (printf, 3, 4))); -void col_append_fstr(frame_data *, gint, gchar *, ...) +extern void col_append_fstr(frame_data *, gint, gchar *, ...) __attribute__((format (printf, 3, 4))); #else -void col_add_fstr(frame_data *, gint, gchar *, ...); -void col_append_fstr(frame_data *, gint, gchar *, ...); +extern void col_add_fstr(frame_data *, gint, gchar *, ...); +extern void col_append_fstr(frame_data *, gint, gchar *, ...); #endif -void col_add_str(frame_data *, gint, const gchar *); -void col_append_str(frame_data *, gint, gchar *); -void col_set_cls_time(frame_data *, int); -void fill_in_columns(frame_data *); +extern void col_add_str(frame_data *, gint, const gchar *); +extern void col_append_str(frame_data *, gint, gchar *); +extern void col_set_cls_time(frame_data *, int); +extern void fill_in_columns(frame_data *); #endif /* __COLUMN_UTILS_H__ */ diff --git a/epan/packet.h b/epan/packet.h index 8d3243da1e..d3e88429e8 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.36 2001/10/31 05:59:19 guy Exp $ + * $Id: packet.h,v 1.37 2001/10/31 07:47:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -86,8 +86,8 @@ typedef struct true_false_string { char *false_string; } true_false_string; -void packet_init(void); -void packet_cleanup(void); +extern void packet_init(void); +extern void packet_cleanup(void); /* Hash table for matching port numbers and dissectors */ typedef GHashTable* dissector_table_t; @@ -101,35 +101,39 @@ typedef void (*DATFunc) (gchar *table_name, gpointer key, gpointer value, gpoint /* Opaque structure - provides type checking but no access to components */ typedef struct dtbl_entry dtbl_entry_t; -gint dissector_get_proto (dtbl_entry_t * entry); -gint dissector_get_initial_proto (dtbl_entry_t * entry); -void dissector_table_foreach_changed (char *name, DATFunc func, gpointer user_data); -void dissector_table_foreach (char *name, DATFunc func, gpointer user_data); -void dissector_all_tables_foreach_changed (DATFunc func, gpointer user_data); +extern gint dissector_get_proto (dtbl_entry_t * entry); +extern gint dissector_get_initial_proto (dtbl_entry_t * entry); +extern void dissector_table_foreach_changed (char *name, DATFunc func, + gpointer user_data); +extern void dissector_table_foreach (char *name, DATFunc func, + gpointer user_data); +extern void dissector_all_tables_foreach_changed (DATFunc func, + gpointer user_data); /* a protocol uses the function to register a sub-dissector table */ -dissector_table_t register_dissector_table(const char *name); +extern dissector_table_t register_dissector_table(const char *name); /* Add a sub-dissector to a dissector table. Called by the protocol routine */ /* that wants to register a sub-dissector. */ -void dissector_add(const char *abbrev, guint32 pattern, +extern void dissector_add(const char *abbrev, guint32 pattern, dissector_t dissector, int proto); /* Add a sub-dissector to a dissector table. Called by the protocol routine */ /* that wants to de-register a sub-dissector. */ -void dissector_delete(const char *name, guint32 pattern, dissector_t dissector); +extern void dissector_delete(const char *name, guint32 pattern, + dissector_t dissector); -void dissector_change(const char *abbrev, guint32 pattern, +extern void dissector_change(const char *abbrev, guint32 pattern, dissector_t dissector, int proto); /* Reset a dissector in a sub-dissector table to its initial value. */ -void dissector_reset(const char *name, guint32 pattern); +extern void dissector_reset(const char *name, guint32 pattern); /* Look for a given port in a given dissector table and, if found, call the dissector with the arguments supplied, and return TRUE, otherwise return FALSE. */ -gboolean dissector_try_port(dissector_table_t sub_dissectors, guint32 port, - tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +extern gboolean dissector_try_port(dissector_table_t sub_dissectors, + guint32 port, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* List of "heuristic" dissectors (which get handed a packet, look at it, and either recognize it as being for their protocol, dissect it, and @@ -142,17 +146,18 @@ typedef gboolean (*heur_dissector_t)(tvbuff_t *, packet_info *, proto_tree *); /* A protocol uses this function to register a heuristic dissector list */ -void register_heur_dissector_list(const char *name, heur_dissector_list_t *list); +extern void register_heur_dissector_list(const char *name, + heur_dissector_list_t *list); /* Add a sub-dissector to a heuristic dissector list. Called by the protocol routine that wants to register a sub-dissector. */ -void heur_dissector_add(const char *name, heur_dissector_t dissector, +extern void heur_dissector_add(const char *name, heur_dissector_t dissector, int proto); /* Try all the dissectors in a given heuristic dissector list until we find one that recognizes the protocol, in which case we return TRUE, or we run out of dissectors, in which case we return FALSE. */ -gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors, +extern gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* List of "conversation" dissectors (they're not heuristic, but are @@ -170,19 +175,21 @@ gboolean dissector_try_heuristic(heur_dissector_list_t sub_dissectors, typedef GSList *conv_dissector_list_t; /* A protocol uses this function to register a conversation dissector list */ -void register_conv_dissector_list(const char *name, conv_dissector_list_t *list); +extern void register_conv_dissector_list(const char *name, + conv_dissector_list_t *list); /* Add a sub-dissector to a conversation dissector list. Called by the protocol routine that wants to register a sub-dissector. */ -void conv_dissector_add(const char *name, dissector_t dissector, +extern void conv_dissector_add(const char *name, dissector_t dissector, int proto); /* Opaque structure - provides type checking but no access to components */ typedef struct conv_dtbl_entry conv_dtbl_entry_t; -gint conv_dissector_get_proto (conv_dtbl_entry_t * entry); -void dissector_conv_foreach(char *name, DATFunc func, gpointer user_data); -void dissector_all_conv_foreach(DATFunc func, gpointer user_data); +extern gint conv_dissector_get_proto (conv_dtbl_entry_t * entry); +extern void dissector_conv_foreach(char *name, DATFunc func, + gpointer user_data); +extern void dissector_all_conv_foreach(DATFunc func, gpointer user_data); /* Handle for dissectors you call directly. This handle is opaque outside of "packet.c". */ @@ -190,19 +197,20 @@ struct dissector_handle; typedef struct dissector_handle *dissector_handle_t; /* Register a dissector. */ -void register_dissector(const char *name, dissector_t dissector, int proto); +extern void register_dissector(const char *name, dissector_t dissector, + int proto); /* Find a dissector by name. */ -dissector_handle_t find_dissector(const char *name); +extern dissector_handle_t find_dissector(const char *name); /* Call a dissector through a handle. */ -void call_dissector(dissector_handle_t handle, tvbuff_t *tvb, +extern void call_dissector(dissector_handle_t handle, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* Do all one-time initialization. */ -void dissect_init(void); +extern void dissect_init(void); -void dissect_cleanup(void); +extern void dissect_cleanup(void); /* * Given a tvbuff, a packet_info *, and a length from a packet header, @@ -210,29 +218,32 @@ void dissect_cleanup(void); * members of the "packet_info" structure, to reflect the specified * length. */ -void set_actual_length(tvbuff_t *tvb, packet_info *pinfo, guint specified_len); +extern void set_actual_length(tvbuff_t *tvb, packet_info *pinfo, + guint specified_len); /* Allow protocols to register "init" routines, which are called before we make a pass through a capture file and dissect all its packets (e.g., when we read in a new capture file, or run a "filter packets" or "colorize packets" pass over the current capture file). */ -void register_init_routine(void (*func)(void)); +extern void register_init_routine(void (*func)(void)); /* Call all the registered "init" routines. */ -void init_all_protocols(void); +extern void init_all_protocols(void); /* * Dissectors should never modify the packet data. */ -void dissect_packet(tvbuff_t **p_tvb, union wtap_pseudo_header *pseudo_header, - const u_char *pd, frame_data *fd, proto_tree *tree); -void dissect_data(tvbuff_t *tvb, int, packet_info *pinfo, proto_tree *tree); +extern void dissect_packet(tvbuff_t **p_tvb, + union wtap_pseudo_header *pseudo_header, const u_char *pd, + frame_data *fd, proto_tree *tree); +extern void dissect_data(tvbuff_t *tvb, int, packet_info *pinfo, + proto_tree *tree); /* These functions are in packet-ethertype.c */ -void capture_ethertype(guint16 etype, int offset, +extern void capture_ethertype(guint16 etype, int offset, const u_char *pd, packet_counts *ld); -void ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_ethertype, +extern void ethertype(guint16 etype, tvbuff_t *tvb, int offset_after_ethertype, packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, int etype_id, int trailer_id); diff --git a/epan/proto.h b/epan/proto.h index 68ab9cca66..5153e0695e 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.18 2001/10/31 05:59:19 guy Exp $ + * $Id: proto.h,v 1.19 2001/10/31 07:47:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -22,7 +22,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #ifndef __PROTO_H__ #define __PROTO_H__ @@ -123,307 +122,307 @@ typedef struct field_info { #define NullTVB NULL /* Sets up memory used by proto routines. Called at program startup */ -void proto_init(const char *plugin_dir, void (register_all_protocols)(void), - void (register_all_handoffs)(void)); +extern void proto_init(const char *plugin_dir, + void (register_all_protocols)(void), void (register_all_handoffs)(void)); /* Frees memory used by proto routines. Called at program shutdown */ -void proto_cleanup(void); +extern void proto_cleanup(void); /* Set text of proto_item after having already been created. */ #if __GNUC__ >= 2 -void proto_item_set_text(proto_item *ti, const char *format, ...) +extern void proto_item_set_text(proto_item *ti, const char *format, ...) __attribute__((format (printf, 2, 3))); #else -void proto_item_set_text(proto_item *ti, const char *format, ...); +extern void proto_item_set_text(proto_item *ti, const char *format, ...); #endif /* Append to text of proto_item after having already been created. */ #if __GNUC__ >= 2 -void proto_item_append_text(proto_item *ti, const char *format, ...) +extern void proto_item_append_text(proto_item *ti, const char *format, ...) __attribute__((format (printf, 2, 3))); #else -void proto_item_append_text(proto_item *ti, const char *format, ...); +extern void proto_item_append_text(proto_item *ti, const char *format, ...); #endif /* Set length of proto_item after having already been created. */ -void proto_item_set_len(proto_item *ti, gint length); +extern void proto_item_set_len(proto_item *ti, gint length); /* Get length of proto_item. Useful after using proto_tree_add_item() * to add a variable-length field (e.g., FT_NSTRING_UINT8) */ -int proto_item_get_len(proto_item *ti); +extern int proto_item_get_len(proto_item *ti); /* Creates new proto_tree root */ -proto_tree* proto_tree_create_root(void); +extern proto_tree* proto_tree_create_root(void); /* Clear memory for entry proto_tree. Clears proto_tree struct also. */ -void proto_tree_free(proto_tree *tree); +extern void proto_tree_free(proto_tree *tree); /* Create a subtree under an existing item; returns tree pointer */ -proto_tree* proto_item_add_subtree(proto_item *ti, gint idx); +extern proto_tree* proto_item_add_subtree(proto_item *ti, gint idx); -int +extern int proto_register_field(char *name, char *abbrev, enum ftenum type, int parent, struct value_string* vals); -int +extern int proto_register_protocol(char *name, char *short_name, char *filter_name); -void +extern void proto_register_field_array(int parent, hf_register_info *hf, int num_records); -void +extern void proto_register_subtree_array(gint **indices, int num_indices); /* Add an item to a proto_tree, using the text label registered to that item; the item is extracted from the tvbuff handed to it. */ -proto_item * +extern proto_item * proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian); -proto_item * +extern proto_item * proto_tree_add_item_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gboolean little_endian); /* Add a FT_NONE to a proto_tree */ #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_none_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...) __attribute__((format (printf, 6, 7))); #else -proto_item * +extern proto_item * proto_tree_add_none_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...); #endif /* Add a FT_PROTOCOL to a proto_tree */ #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...) __attribute__((format (printf, 6, 7))); #else -proto_item * +extern proto_item * proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char *format, ...); #endif /* Add a FT_BYTES to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_bytes(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* start_ptr); -proto_item * +extern proto_item * proto_tree_add_bytes_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* start_ptr); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* start_ptr, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* start_ptr, const char *format, ...); #endif /* Add a FT_*TIME to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_time(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t* value_ptr); -proto_item * +extern proto_item * proto_tree_add_time_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t* value_ptr); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t* value_ptr, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, nstime_t* value_ptr, const char *format, ...); #endif /* Add a FT_IPXNET to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_ipxnet(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); -proto_item * +extern proto_item * proto_tree_add_ipxnet_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...); #endif /* Add a FT_IPv4 to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_ipv4(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); -proto_item * +extern proto_item * proto_tree_add_ipv4_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...); #endif /* Add a FT_IPv6 to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_ipv6(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value_ptr); -proto_item * +extern proto_item * proto_tree_add_ipv6_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value_ptr); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value_ptr, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value_ptr, const char *format, ...); #endif /* Add a FT_ETHER to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_ether(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value); -proto_item * +extern proto_item * proto_tree_add_ether_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const guint8* value, const char *format, ...); #endif /* Add a FT_STRING to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_string(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char* value); -proto_item * +extern proto_item * proto_tree_add_string_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char* value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char* value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, const char* value, const char *format, ...); #endif /* Add a FT_BOOLEAN to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_boolean(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); -proto_item * +extern proto_item * proto_tree_add_boolean_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...); #endif /* Add a FT_DOUBLE to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_double(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value); -proto_item * +extern proto_item * proto_tree_add_double_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, double value, const char *format, ...); #endif /* Add any FT_UINT* to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); -proto_item * +extern proto_item * proto_tree_add_uint_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...); #endif /* Add any FT_INT* to a proto_tree */ -proto_item * +extern proto_item * proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value); -proto_item * +extern proto_item * proto_tree_add_int_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value); #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value, const char *format, ...) __attribute__((format (printf, 7, 8))); #else -proto_item * +extern proto_item * proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, gint32 value, const char *format, ...); #endif @@ -431,16 +430,16 @@ proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta /* Add a text-only node to the proto_tree */ #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *, ...) __attribute__((format (printf, 5, 6))); #else -proto_item * +extern proto_item * proto_tree_add_text(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *, ...); #endif -proto_item * +extern proto_item * proto_tree_add_text_valist(proto_tree *tree, tvbuff_t *tvb, gint start, gint length, const char *format, va_list ap); @@ -448,89 +447,89 @@ proto_tree_add_text_valist(proto_tree *tree, tvbuff_t *tvb, gint start, /* Useful for quick debugging. Also sends string to STDOUT, so don't * leave call to this function in production code. */ #if __GNUC__ >= 2 -proto_item * +extern proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format, ...) __attribute__((format (printf, 2, 3))); #else -proto_item * +extern proto_item * proto_tree_add_debug_text(proto_tree *tree, const char *format, ...); #endif -void +extern void proto_item_fill_label(field_info *fi, gchar *label_str); /* Returns number of items (protocols or header fields) registered. */ -int proto_registrar_n(void); +extern int proto_registrar_n(void); /* Returns char* to name for item # n (0-indexed) */ -char* proto_registrar_get_name(int n); +extern char* proto_registrar_get_name(int n); /* Returns char* to abbrev for item # n (0-indexed) */ -char* proto_registrar_get_abbrev(int n); +extern char* proto_registrar_get_abbrev(int n); /* get the header field information based upon a field or protocol id */ -header_field_info* proto_registrar_get_nth(int hfindex); +extern header_field_info* proto_registrar_get_nth(int hfindex); /* Returns enum ftenum for item # n */ -int proto_registrar_get_ftype(int n); +extern int proto_registrar_get_ftype(int n); /* Returns parent protocol for item # n. * Returns -1 if item _is_ a protocol */ -int proto_registrar_get_parent(int n); +extern int proto_registrar_get_parent(int n); /* Is item #n a protocol? */ -gboolean proto_registrar_is_protocol(int n); +extern gboolean proto_registrar_is_protocol(int n); /* Is item #n decoding enabled ? */ -gboolean proto_is_protocol_enabled(int proto_id); +extern gboolean proto_is_protocol_enabled(int proto_id); /* Can item #n decoding be disabled? */ -gboolean proto_can_disable_protocol(int proto_id); +extern gboolean proto_can_disable_protocol(int proto_id); /* Routines to use to iterate over the protocols; they return the item * number of the protocol in question, and keep state in "*cookie". */ -int proto_get_first_protocol(void **cookie); -int proto_get_next_protocol(void **cookie); +extern int proto_get_first_protocol(void **cookie); +extern int proto_get_next_protocol(void **cookie); /* Given a protocol's filter_name, return it's proto_id */ -int proto_get_id_by_filter_name(gchar* filter_name); +extern int proto_get_id_by_filter_name(gchar* filter_name); /* Given a protocol's item number, return its name. */ -char *proto_get_protocol_name(int n); +extern char *proto_get_protocol_name(int n); /* Given a protocol's item number, return its short name. */ -char *proto_get_protocol_short_name(int proto_id); +extern char *proto_get_protocol_short_name(int proto_id); /* Given a protocol's item number, return its filter name. */ -char *proto_get_protocol_filter_name(int proto_id); +extern char *proto_get_protocol_filter_name(int proto_id); /* Enable / Disable protocol */ -void proto_set_decoding(int proto_id, gboolean enabled); +extern void proto_set_decoding(int proto_id, gboolean enabled); /* Disable disabling of protocol */ -void proto_set_cant_disable(int proto_id); +extern void proto_set_cant_disable(int proto_id); gpointer proto_get_protocol_dissector(int proto_id); -void proto_set_protocol_dissector(int proto_id, gpointer dissector); +extern void proto_set_protocol_dissector(int proto_id, gpointer dissector); /* Get length of registered field according to field type. * 0 means undeterminable at registration time. * -1 means unknown field */ -gint proto_registrar_get_length(int n); +extern gint proto_registrar_get_length(int n); /* Checks for existence any protocol or field within a tree. * "Protocols" are assumed to be a child of the [empty] root node. * TRUE = found, FALSE = not found */ -gboolean proto_check_for_protocol_or_field(proto_tree* tree, int id); +extern gboolean proto_check_for_protocol_or_field(proto_tree* tree, int id); /* Return GPtrArray* of field_info pointers for all hfindex that appear in * tree. Assume that a field will only appear under its registered parent's * subtree, and that the parent's subtree is a child of the * [empty] root node. */ -GPtrArray* proto_get_finfo_ptr_array(proto_tree *tree, int hfindex); +extern GPtrArray* proto_get_finfo_ptr_array(proto_tree *tree, int hfindex); /* Dumps a glossary of the protocol and field registrations to STDOUT */ -void proto_registrar_dump(void); +extern void proto_registrar_dump(void); /* Is the parsing being done for a visible proto_tree or an invisible one? * By setting this correctly, the proto_tree creation is sped up by not @@ -554,20 +553,20 @@ extern int num_tree_types; #define g_ptr_array_len(a) ((a)->len) #endif -int +extern int hfinfo_bitwidth(header_field_info *hfinfo); /* * Returns TRUE if we can do a "match selected" on the field, FALSE * otherwise. */ -gboolean +extern gboolean proto_can_match_selected(field_info *finfo); -char* +extern char* proto_alloc_dfilter_string(field_info *finfo, guint8 *pd); -field_info* +extern field_info* proto_find_field_from_offset(proto_tree *tree, guint offset, gchar *ds_name); #endif /* proto.h */ diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 32681d4568..2799e04aa5 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -9,14 +9,13 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.h,v 1.16 2001/10/29 21:56:48 guy Exp $ + * $Id: tvbuff.h,v 1.17 2001/10/31 07:47:27 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez * * Ethereal - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -71,17 +70,17 @@ typedef enum { /* "class" initialization. Called once during execution of program * so that tvbuff.c can initialize its data. */ -void tvbuff_init(void); +extern void tvbuff_init(void); /* "class" cleanup. Called once during execution of program * so that tvbuff.c can clean up its data. */ -void tvbuff_cleanup(void); +extern void tvbuff_cleanup(void); /* Returns a pointer to a newly initialized tvbuff. Note that * tvbuff's of types TVBUFF_SUBSET and TVBUFF_COMPOSITE * require further initialization via the appropriate functions */ -tvbuff_t* tvb_new(tvbuff_type); +extern tvbuff_t* tvb_new(tvbuff_type); /* Marks a tvbuff for freeing. The guint8* data of a TVBUFF_REAL_DATA * is *never* freed by the tvbuff routines. The tvbuff itself is actually freed @@ -102,26 +101,26 @@ tvbuff_t* tvb_new(tvbuff_type); * The caller can artificially increment/decrement the usage count * with tvbuff_increment_usage_count()/tvbuff_decrement_usage_count(). */ -void tvb_free(tvbuff_t*); +extern void tvb_free(tvbuff_t*); /* Free the tvbuff_t and all tvbuff's created from it. */ -void tvb_free_chain(tvbuff_t*); +extern void tvb_free_chain(tvbuff_t*); /* Both return the new usage count, after the increment or decrement */ -guint tvb_increment_usage_count(tvbuff_t*, guint count); +extern guint tvb_increment_usage_count(tvbuff_t*, guint count); /* If a decrement causes the usage count to drop to 0, a the tvbuff * is immediately freed. Be sure you know exactly what you're doing * if you decide to use this function, as another tvbuff could * still have a pointer to the just-freed tvbuff, causing corrupted data * or a segfault in the future */ -guint tvb_decrement_usage_count(tvbuff_t*, guint count); +extern guint tvb_decrement_usage_count(tvbuff_t*, guint count); /* Set a callback function to call when a tvbuff is actually freed * (once the usage count drops to 0). One argument is passed to * that callback --- a void* that points to the real data. * Obviously, this only applies to a TVBUFF_REAL_DATA tvbuff. */ -void tvb_set_free_cb(tvbuff_t*, tvbuff_free_cb_t); +extern void tvb_set_free_cb(tvbuff_t*, tvbuff_free_cb_t); /* Attach a TVBUFF_REAL_DATA tvbuff to a parent tvbuff. This connection @@ -133,13 +132,15 @@ void tvb_set_free_cb(tvbuff_t*, tvbuff_free_cb_t); * is that the new tvbuff *is* part of the "chain of creation", but in a way * that these tvbuff routines is ignorant of. Use this function to make * the tvbuff routines knowledgable of this fact. */ -void tvb_set_child_real_data_tvbuff(tvbuff_t* parent, tvbuff_t* child); +extern void tvb_set_child_real_data_tvbuff(tvbuff_t* parent, tvbuff_t* child); /* Sets parameters for TVBUFF_REAL_DATA. Can throw ReportedBoundsError. */ -void tvb_set_real_data(tvbuff_t*, const guint8* data, guint length, gint reported_length); +extern void tvb_set_real_data(tvbuff_t*, const guint8* data, guint length, + gint reported_length); /* Combination of tvb_new() and tvb_set_real_data(). Can throw ReportedBoundsError. */ -tvbuff_t* tvb_new_real_data(const guint8* data, guint length, gint reported_length, const gchar *name); +extern tvbuff_t* tvb_new_real_data(const guint8* data, guint length, + gint reported_length, const gchar *name); /* Define the subset of the backing buffer to use. @@ -155,12 +156,12 @@ tvbuff_t* tvb_new_real_data(const guint8* data, guint length, gint reported_leng * Will throw BoundsError if 'backing_offset'/'length' * is beyond the bounds of the backing tvbuff. * Can throw ReportedBoundsError. */ -void tvb_set_subset(tvbuff_t* tvb, tvbuff_t* backing, +extern void tvb_set_subset(tvbuff_t* tvb, tvbuff_t* backing, gint backing_offset, gint backing_length, gint reported_length); /* Combination of tvb_new() and tvb_set_subset() * Can throw ReportedBoundsError. */ -tvbuff_t* tvb_new_subset(tvbuff_t* backing, +extern tvbuff_t* tvb_new_subset(tvbuff_t* backing, gint backing_offset, gint backing_length, gint reported_length); @@ -169,43 +170,43 @@ tvbuff_t* tvb_new_subset(tvbuff_t* backing, * the 'member' tvbuff. */ /* Append to the list of tvbuffs that make up this composite tvbuff */ -void tvb_composite_append(tvbuff_t* tvb, tvbuff_t* member); +extern void tvb_composite_append(tvbuff_t* tvb, tvbuff_t* member); /* Prepend to the list of tvbuffs that make up this composite tvbuff */ -void tvb_composite_prepend(tvbuff_t* tvb, tvbuff_t* member); +extern void tvb_composite_prepend(tvbuff_t* tvb, tvbuff_t* member); /* Helper function that calls tvb_new(TVBUFF_COMPOSITE). * Provided only to maintain symmetry with other constructors */ -tvbuff_t* tvb_new_composite(void); +extern tvbuff_t* tvb_new_composite(void); /* Mark a composite tvbuff as initialized. No further appends or prepends * occur, data access can finally happen after this finalization. */ -void tvb_composite_finalize(tvbuff_t* tvb); +extern void tvb_composite_finalize(tvbuff_t* tvb); /* Get total length of buffer */ -guint tvb_length(tvbuff_t*); +extern guint tvb_length(tvbuff_t*); /* Computes bytes to end of buffer, from offset (which can be negative, * to indicate bytes from end of buffer). Function returns -1 to * indicate that offset is out of bounds. No exception is thrown. */ -gint tvb_length_remaining(tvbuff_t*, gint offset); +extern gint tvb_length_remaining(tvbuff_t*, gint offset); -/* Checks (w/o throwing exception) that the bytes referred to by 'offset'/'length' - * actualy exist in the buffer */ -gboolean tvb_bytes_exist(tvbuff_t*, gint offset, gint length); +/* Checks (w/o throwing exception) that the bytes referred to by + * 'offset'/'length' actually exist in the buffer */ +extern gboolean tvb_bytes_exist(tvbuff_t*, gint offset, gint length); /* Checks (w/o throwing exception) that offset exists in buffer */ -gboolean tvb_offset_exists(tvbuff_t*, gint offset); +extern gboolean tvb_offset_exists(tvbuff_t*, gint offset); /* Get reported length of buffer */ -guint tvb_reported_length(tvbuff_t*); +extern guint tvb_reported_length(tvbuff_t*); /* Computes bytes of reported packet data to end of buffer, from offset * (which can be negative, to indicate bytes from end of buffer). Function * returns -1 to indicate that offset is out of bounds. No exception is * thrown. */ -gint tvb_reported_length_remaining(tvbuff_t *tvb, gint offset); +extern gint tvb_reported_length_remaining(tvbuff_t *tvb, gint offset); /* Set the reported length of a tvbuff to a given value; used for protocols whose headers contain an explicit length and where the calling @@ -213,24 +214,24 @@ gint tvb_reported_length_remaining(tvbuff_t *tvb, gint offset); this protocol. Also adjusts the data length. */ -void tvb_set_reported_length(tvbuff_t*, guint); +extern void tvb_set_reported_length(tvbuff_t*, guint); /* Returns the offset from the first byte of real data. This is * the same value as 'offset' in tvb_compat() */ -gint tvb_raw_offset(tvbuff_t*); +extern gint tvb_raw_offset(tvbuff_t*); /************** START OF ACCESSORS ****************/ /* All accessors will throw BoundsError or ReportedBoundsError if appropriate */ -guint8 tvb_get_guint8(tvbuff_t*, gint offset); +extern guint8 tvb_get_guint8(tvbuff_t*, gint offset); -guint16 tvb_get_ntohs(tvbuff_t*, gint offset); -guint32 tvb_get_ntoh24(tvbuff_t*, gint offset); -guint32 tvb_get_ntohl(tvbuff_t*, gint offset); +extern guint16 tvb_get_ntohs(tvbuff_t*, gint offset); +extern guint32 tvb_get_ntoh24(tvbuff_t*, gint offset); +extern guint32 tvb_get_ntohl(tvbuff_t*, gint offset); -guint16 tvb_get_letohs(tvbuff_t*, gint offset); -guint32 tvb_get_letoh24(tvbuff_t*, gint offset); -guint32 tvb_get_letohl(tvbuff_t*, gint offset); +extern guint16 tvb_get_letohs(tvbuff_t*, gint offset); +extern guint32 tvb_get_letoh24(tvbuff_t*, gint offset); +extern guint32 tvb_get_letohl(tvbuff_t*, gint offset); /* Returns target for convenience. Does not suffer from possible * expense of tvb_get_ptr(), since this routine is smart enough @@ -238,11 +239,11 @@ guint32 tvb_get_letohl(tvbuff_t*, gint offset); * different TVBUFF_REAL_DATA tvbuffs. This function assumes that the * target memory is already allocated; it does not allocate or free the * target memory. */ -guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint offset, gint length); +extern guint8* tvb_memcpy(tvbuff_t*, guint8* target, gint offset, gint length); /* It is the user's responsibility to g_free() the memory allocated by * tvb_memdup(). Calls tvb_memcpy() */ -guint8* tvb_memdup(tvbuff_t*, gint offset, gint length); +extern guint8* tvb_memdup(tvbuff_t*, gint offset, gint length); /* WARNING! This function is possibly expensive, temporarily allocating * another copy of the packet data. Furthermore, it's dangerous because once @@ -262,7 +263,7 @@ guint8* tvb_memdup(tvbuff_t*, gint offset, gint length); * and the pointer to the newly-contiguous data is returned. This dynamically- * allocated memory will be freed when the tvbuff is freed, after the * tvbuff_free_cb_t() is called, if any. */ -const guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length); +extern const guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length); /* Find first occurence of any of the needles in tvbuff, starting at offset. * Searches at most maxlength number of bytes; if maxlength is -1, searches @@ -271,32 +272,34 @@ const guint8* tvb_get_ptr(tvbuff_t*, gint offset, gint length); * Will not throw an exception, even if maxlength exceeds boundary of tvbuff; * in that case, -1 will be returned if the boundary is reached before * finding needle. */ -gint tvb_find_guint8(tvbuff_t*, gint offset, gint maxlength, guint8 needle); +extern gint tvb_find_guint8(tvbuff_t*, gint offset, gint maxlength, + guint8 needle); /* Find first occurence of any of the needles in tvbuff, starting at offset. * Searches at most maxlength number of bytes. Returns the offset of the * found needle, or -1 if not found. Will not throw an exception, even if * maxlength exceeds boundary of tvbuff; in that case, -1 will be returned if * the boundary is reached before finding needle. */ -gint tvb_pbrk_guint8(tvbuff_t *, gint offset, gint maxlength, guint8 *needles); +extern gint tvb_pbrk_guint8(tvbuff_t *, gint offset, gint maxlength, + guint8 *needles); /* Find size of stringz (NUL-terminated string) by looking for terminating * NUL. The size of the string includes the terminating NUL. * * If the NUL isn't found, it throws the appropriate exception. */ -guint tvb_strsize(tvbuff_t *tvb, gint offset); +extern guint tvb_strsize(tvbuff_t *tvb, gint offset); /* Find length of string by looking for end of string ('\0'), up to * 'maxlength' characters'; if 'maxlength' is -1, searches to end * of tvbuff. * Returns -1 if 'maxlength' reached before finding EOS. */ -gint tvb_strnlen(tvbuff_t*, gint offset, guint maxlength); +extern gint tvb_strnlen(tvbuff_t*, gint offset, guint maxlength); /* * Format the data in the tvb from offset for size ... */ -guint8 * tvb_format_text(tvbuff_t *tvb, gint offset, gint size); +extern guint8 * tvb_format_text(tvbuff_t *tvb, gint offset, gint size); /* Looks for a stringz (NUL-terminated string) in tvbuff and copies * no more than maxlength number of bytes, including terminating NUL, to buffer. @@ -304,13 +307,15 @@ guint8 * tvb_format_text(tvbuff_t *tvb, gint offset, gint size); * truncated in the buffer due to not having reached the terminating NUL. * In this way, it acts like snprintf(). */ -gint tvb_get_nstringz(tvbuff_t *tvb, gint offset, guint maxlength, guint8* buffer); +extern gint tvb_get_nstringz(tvbuff_t *tvb, gint offset, guint maxlength, + guint8* buffer); /* Like tvb_get_nstringz(), but never returns -1. The string is guaranteed to * have a terminating NUL. If the string was truncated when copied into buffer, * a NUL is placed at the end of buffer to terminate it. */ -gint tvb_get_nstringz0(tvbuff_t *tvb, gint offset, guint maxlength, guint8* buffer); +extern gint tvb_get_nstringz0(tvbuff_t *tvb, gint offset, guint maxlength, + guint8* buffer); /* * Given a tvbuff, an offset into the tvbuff, and a length that starts @@ -322,7 +327,7 @@ gint tvb_get_nstringz0(tvbuff_t *tvb, gint offset, guint maxlength, guint8* buff * Return the offset right past the end of the line as the return value, * and return the offset of the EOL character(s) in "*eol". */ -gint tvb_find_line_end(tvbuff_t *tvb, gint offset, int len, gint *eol); +extern gint tvb_find_line_end(tvbuff_t *tvb, gint offset, int len, gint *eol); /* * Given a tvbuff, an offset into the tvbuff, and a length that starts @@ -342,34 +347,37 @@ gint tvb_find_line_end(tvbuff_t *tvb, gint offset, int len, gint *eol); * terminator, or past the end of the buffer if we don't find a line * terminator. */ -gint tvb_find_line_end_unquoted(tvbuff_t *tvb, gint offset, int len, +extern gint tvb_find_line_end_unquoted(tvbuff_t *tvb, gint offset, int len, gint *next_offset); /* * Call strncmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -gint tvb_strneql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size); +extern gint tvb_strneql(tvbuff_t *tvb, gint offset, const guint8 *str, + gint size); /* * Call strncasecmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -gint tvb_strncaseeql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size); +extern gint tvb_strncaseeql(tvbuff_t *tvb, gint offset, const guint8 *str, + gint size); /* * Call memcmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -gint tvb_memeql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size); +extern gint tvb_memeql(tvbuff_t *tvb, gint offset, const guint8 *str, + gint size); /* * Format a bunch of data from a tvbuff as bytes, returning a pointer * to the string with the formatted data. */ -gchar *tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len); +extern gchar *tvb_bytes_to_str(tvbuff_t *tvb, gint offset, gint len); -gchar *tvb_get_name(tvbuff_t *tvb); +extern gchar *tvb_get_name(tvbuff_t *tvb); /************** END OF ACCESSORS ****************/ diff --git a/packet-giop.h b/packet-giop.h index a32eb4704c..1262418bd2 100644 --- a/packet-giop.h +++ b/packet-giop.h @@ -4,7 +4,7 @@ * * Based on CORBAv2.4.2 Chapter 15 GIOP Description. * - * $Id: packet-giop.h,v 1.6 2001/08/03 20:51:49 guy Exp $ + * $Id: packet-giop.h,v 1.7 2001/10/31 07:47:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -111,21 +111,22 @@ typedef struct giop_sub_handle { /* Main GIOP entry point */ -gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */ +extern gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new interface */ /* * GIOP Users register interest via this function. * This is for heuristic dissection */ -void register_giop_user(giop_sub_dissector_t *sub, gchar *name, int sub_proto); +extern void register_giop_user(giop_sub_dissector_t *sub, gchar *name, + int sub_proto); /* * GIOP Users remove interest via this function. * This is for heuristic dissection */ -void delete_giop_user(giop_sub_dissector_t *sub, gchar *name); +extern void delete_giop_user(giop_sub_dissector_t *sub, gchar *name); /* @@ -133,14 +134,16 @@ void delete_giop_user(giop_sub_dissector_t *sub, gchar *name); * This is for explicit dissection. */ -void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module, int sub_proto); +extern void register_giop_user_module(giop_sub_dissector_t *sub, gchar *name, + gchar *module, int sub_proto); /* * GIOP Users remove their module and interface names via this function. * This is for explicit dissection. */ -void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *module); +extern void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name, + gchar *module); /* @@ -166,8 +169,8 @@ void delete_giop_user_module(giop_sub_dissector_t *sub, gchar *name, gchar *modu * Data is added to tree directly if present. */ -void get_CDR_any(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean stream_is_big_endian, - int boundary, MessageHeader * header ); +extern void get_CDR_any(tvbuff_t *tvb, proto_tree *tree, gint *offset, + gboolean stream_is_big_endian, int boundary, MessageHeader * header ); /* Copy a 1 octet sequence from the tvbuff @@ -177,7 +180,7 @@ void get_CDR_any(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean stream_ * has been processed. */ -gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset); +extern gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset); /* Copy a 1 octet sequence from the tvbuff @@ -187,7 +190,7 @@ gboolean get_CDR_boolean(tvbuff_t *tvb, int *offset); * has been processed. */ -guint8 get_CDR_char(tvbuff_t *tvb, int *offset); +extern guint8 get_CDR_char(tvbuff_t *tvb, int *offset); @@ -203,7 +206,8 @@ guint8 get_CDR_char(tvbuff_t *tvb, int *offset); * have been processed. */ -gdouble get_CDR_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern gdouble get_CDR_double(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); /* Copy a 4 octet sequence from the tvbuff @@ -217,7 +221,8 @@ gdouble get_CDR_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian * Enum values are encoded as unsigned long. */ -guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); @@ -253,7 +258,8 @@ guint32 get_CDR_enum(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, * */ -void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset, guint32 digits, gint32 scale); +extern void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset, + guint32 digits, gint32 scale); @@ -269,15 +275,16 @@ void get_CDR_fixed(tvbuff_t *tvb, gchar **seq, gint *offset, guint32 digits, gin * have been processed. */ -gfloat get_CDR_float(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern gfloat get_CDR_float(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); /* * Decode an Interface type, and display it on the tree. */ -void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, - gboolean stream_is_big_endian, int boundary); +extern void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary); /* Copy a 4 octet sequence from the tvbuff @@ -289,7 +296,8 @@ void get_CDR_interface(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int * have been processed. */ -gint32 get_CDR_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern gint32 get_CDR_long(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); @@ -304,14 +312,14 @@ gint32 get_CDR_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, i #ifdef G_HAVE_GLONG_DOUBLE -glong_double get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, - int boundary); +extern glong_double get_CDR_long_double(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); #else /* FIX -- Cast long double to gdouble until I figure this out -- FS*/ -gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, - int boundary); +extern gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); #endif @@ -326,15 +334,16 @@ gdouble get_CDR_long_double(tvbuff_t *tvb, int *offset, gboolean stream_is_big_e */ #ifdef G_HAVE_GINT64 -gint64 get_CDR_long_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern gint64 get_CDR_long_long(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); #endif /* * Decode an Object type, and display it on the tree. */ -void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, - gboolean stream_is_big_endian, int boundary); +extern void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree, int *offset, gboolean stream_is_big_endian, int boundary); /* Copy a 1 octet sequence from the tvbuff @@ -344,7 +353,7 @@ void get_CDR_object(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *of * has been processed. */ -guint8 get_CDR_octet(tvbuff_t *tvb, int *offset); +extern guint8 get_CDR_octet(tvbuff_t *tvb, int *offset); /* Copy a sequence of octets from the tvbuff. @@ -353,7 +362,7 @@ guint8 get_CDR_octet(tvbuff_t *tvb, int *offset); * This function also increments offset by len. */ -void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, int len); +extern void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, int len); /* Copy a 2 octet sequence from the tvbuff * which represents a signed short value, and convert @@ -364,7 +373,8 @@ void get_CDR_octet_seq(tvbuff_t *tvb, gchar **seq, int *offset, int len); * have been processed. */ -gint16 get_CDR_short(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern gint16 get_CDR_short(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); /* Copy an octet sequence from the tvbuff @@ -385,8 +395,8 @@ gint16 get_CDR_short(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, * */ -guint32 get_CDR_string(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream_is_big_endian, - int boundary); +extern guint32 get_CDR_string(tvbuff_t *tvb, gchar **seq, int *offset, + gboolean stream_is_big_endian, int boundary); /* Process a sequence of octets that represent the @@ -400,8 +410,8 @@ guint32 get_CDR_string(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream_ * It returns a guint32 representing a TCKind value. */ -guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean stream_is_big_endian, - int boundary, MessageHeader * header ); +extern guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, + gboolean stream_is_big_endian, int boundary, MessageHeader * header ); /* Copy a 4 octet sequence from the tvbuff * which represents an unsigned long value, and convert @@ -412,7 +422,8 @@ guint32 get_CDR_typeCode(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean * have been processed. */ -guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); /* Copy an 8 octet sequence from the tvbuff @@ -425,7 +436,8 @@ guint32 get_CDR_ulong(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, */ #ifdef G_HAVE_GINT64 -guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); #endif @@ -438,7 +450,8 @@ guint64 get_CDR_ulong_long(tvbuff_t *tvb, int *offset, gboolean stream_is_big_en * have been processed. */ -guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian, int boundary); +extern guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, + gboolean stream_is_big_endian, int boundary); /* Copy a wchar from the tvbuff. @@ -471,7 +484,8 @@ guint16 get_CDR_ushort(tvbuff_t *tvb, int *offset, gboolean stream_is_big_endian * Wchar is not supported for GIOP 1.0. */ -gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, MessageHeader * header); +extern gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, + MessageHeader * header); /* Copy a wstring from the tvbuff. @@ -493,8 +507,8 @@ gint8 get_CDR_wchar(tvbuff_t *tvb, gchar **seq, int *offset, MessageHeader * hea * Wstring is not supported for GIOP 1.0. */ -guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream_is_big_endian, - int boundary, MessageHeader * header); +extern guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset, + gboolean stream_is_big_endian, int boundary, MessageHeader * header); @@ -508,7 +522,7 @@ guint32 get_CDR_wstring(tvbuff_t *tvb, gchar **seq, int *offset, gboolean stream /* Determine the byte order from the GIOP MessageHeader */ -gboolean is_big_endian (MessageHeader * header); +extern gboolean is_big_endian (MessageHeader * header); /* * get_encap_info() for any encapsulation (eg:sequences) @@ -516,7 +530,7 @@ gboolean is_big_endian (MessageHeader * header); * and *offset, and returns the sequence length. */ -guint32 get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, gint *offset, +extern guint32 get_CDR_encap_info(tvbuff_t *tvb, proto_tree *tree, gint *offset, gboolean old_stream_is_big_endian, guint32 old_boundary, gboolean *new_stream_is_big_endian_ptr, guint32 *new_boundary_ptr ); diff --git a/prefs.h b/prefs.h index bca7c7664e..b637f7f046 100644 --- a/prefs.h +++ b/prefs.h @@ -1,7 +1,7 @@ /* prefs.h * Definitions for preference handling routines * - * $Id: prefs.h,v 1.32 2001/10/22 22:59:23 guy Exp $ + * $Id: prefs.h,v 1.33 2001/10/31 07:47:25 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -94,7 +94,7 @@ typedef struct pref_module module_t; * name specified at the proto_register_protocol() call in order to * make the "Protocol Properties..." menu item work. */ -module_t *prefs_register_module(const char *name, const char *title, +extern module_t *prefs_register_module(const char *name, const char *title, void (*apply_cb)(void)); typedef void (*module_cb)(module_t *module, gpointer user_data); @@ -102,12 +102,12 @@ typedef void (*module_cb)(module_t *module, gpointer user_data); /* * Register that a protocol has preferences. */ -module_t *prefs_register_protocol(int id, void (*apply_cb)(void)); +extern module_t *prefs_register_protocol(int id, void (*apply_cb)(void)); /* * Call a callback function, with a specified argument, for each module. */ -void prefs_module_foreach(module_cb callback, gpointer user_data); +extern void prefs_module_foreach(module_cb callback, gpointer user_data); /* * Call the "apply" callback function for each module if any of its @@ -115,32 +115,32 @@ void prefs_module_foreach(module_cb callback, gpointer user_data); * preferences have changed, as the module has been notified of that * fact. */ -void prefs_apply_all(void); +extern void prefs_apply_all(void); struct preference; typedef struct preference pref_t; /* - * Returns TRUE if the given protocol has registered preferences + * Returns TRUE if the given protocol has registered preferences. */ -gboolean prefs_is_registered_protocol(char *name); +extern gboolean prefs_is_registered_protocol(char *name); /* - * Returns the module title of a registered protocol (or NULL if unknown) + * Returns the module title of a registered protocol (or NULL if unknown). */ -const char *prefs_get_title_by_name(char *name); +extern const char *prefs_get_title_by_name(char *name); /* * Register a preference with an unsigned integral value. */ -void prefs_register_uint_preference(module_t *module, const char *name, +extern void prefs_register_uint_preference(module_t *module, const char *name, const char *title, const char *description, guint base, guint *var); /* * Register a preference with an Boolean value. */ -void prefs_register_bool_preference(module_t *module, const char *name, +extern void prefs_register_bool_preference(module_t *module, const char *name, const char *title, const char *description, gboolean *var); /* @@ -151,14 +151,14 @@ typedef struct { gint value; } enum_val_t; -void prefs_register_enum_preference(module_t *module, const char *name, +extern void prefs_register_enum_preference(module_t *module, const char *name, const char *title, const char *description, gint *var, const enum_val_t *enumvals, gboolean radio_buttons); /* * Register a preference with a character-string value. */ -void prefs_register_string_preference(module_t *module, const char *name, +extern void prefs_register_string_preference(module_t *module, const char *name, const char *title, const char *description, char **var); typedef void (*pref_cb)(pref_t *pref, gpointer user_data); @@ -167,12 +167,13 @@ typedef void (*pref_cb)(pref_t *pref, gpointer user_data); * Call a callback function, with a specified argument, for each preference * in a given module. */ -void prefs_pref_foreach(module_t *module, pref_cb callback, gpointer user_data); +extern void prefs_pref_foreach(module_t *module, pref_cb callback, + gpointer user_data); /* * Register all non-dissector modules' preferences. */ -void prefs_register_modules(void); +extern void prefs_register_modules(void); /* Read the preferences file, fill in "prefs", and return a pointer to it. @@ -185,19 +186,19 @@ void prefs_register_modules(void); the user's preferences file, stuff the errno into "*pf_errno_return" and a pointer to the path of the file into "*pf_path_return", and return NULL. */ -e_prefs *read_prefs(int *, char **, int *, const char **); +extern e_prefs *read_prefs(int *, char **, int *, const char **); /* Write out "prefs" to the user's preferences file, and return 0. If we got an error, stuff a pointer to the path of the preferences file into "*pf_path_return", and return the errno. */ -int write_prefs(const char **); +extern int write_prefs(const char **); /* Copy a set of preferences. */ -void copy_prefs(e_prefs *dest, e_prefs *src); +extern void copy_prefs(e_prefs *dest, e_prefs *src); /* Free a set of preferences. */ -void free_prefs(e_prefs *pr); +extern void free_prefs(e_prefs *pr); /* * Given a string of the form ":", as might appear @@ -212,6 +213,6 @@ void free_prefs(e_prefs *pr); #define PREFS_SET_SYNTAX_ERR 1 /* syntax error in string */ #define PREFS_SET_NO_SUCH_PREF 2 /* no such preference */ -int prefs_set_pref(char *prefarg); +extern int prefs_set_pref(char *prefarg); #endif /* prefs.h */ -- cgit v1.2.3