From d939032a249c1e2d21155fd7fdb9aeace6bba6f4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 14 Aug 2002 19:18:20 +0000 Subject: From Tomas Kukosa: add some more routines to the plugin API. While we're at it, add "extern" to a bunch of function declaration the preceding change *didn't* require to have the "extern" added. svn path=/trunk/; revision=5995 --- epan/except.h | 38 +++++++++++++++++++------------------- epan/frame_data.h | 10 +++++----- epan/plugins.c | 8 +++++++- plugins/plugin_api.c | 8 +++++++- plugins/plugin_api.h | 8 +++++++- plugins/plugin_api_decls.h | 9 ++++++++- plugins/plugin_table.h | 8 +++++++- 7 files changed, 60 insertions(+), 29 deletions(-) diff --git a/epan/except.h b/epan/except.h index 01a6beefb8..74f507be7d 100644 --- a/epan/except.h +++ b/epan/except.h @@ -14,7 +14,7 @@ * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * - * $Id: except.h,v 1.2 2001/07/27 16:20:39 gram Exp $ + * $Id: except.h,v 1.3 2002/08/14 19:18:15 guy Exp $ * $Name: $ */ @@ -72,28 +72,28 @@ struct except_stacknode { }; /* private functions made external so they can be used in macros */ -void except_setup_clean(struct except_stacknode *, +extern void except_setup_clean(struct except_stacknode *, struct except_cleanup *, void (*)(void *), void *); -void except_setup_try(struct except_stacknode *, +extern void except_setup_try(struct except_stacknode *, struct except_catch *, const except_id_t [], size_t); -struct except_stacknode *except_pop(void); +extern struct except_stacknode *except_pop(void); /* public interface functions */ -int except_init(void); -void except_deinit(void); -void except_rethrow(except_t *); -void except_throw(long, long, const char *); -void except_throwd(long, long, const char *, void *); -void except_throwf(long, long, const char *, ...); -void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *); -unsigned long except_code(except_t *); -unsigned long except_group(except_t *); -const char *except_message(except_t *); -void *except_data(except_t *); -void *except_take_data(except_t *); -void except_set_allocator(void *(*)(size_t), void (*)(void *)); -void *except_alloc(size_t); -void except_free(void *); +extern int except_init(void); +extern void except_deinit(void); +extern void except_rethrow(except_t *); +extern void except_throw(long, long, const char *); +extern void except_throwd(long, long, const char *, void *); +extern void except_throwf(long, long, const char *, ...); +extern void (*except_unhandled_catcher(void (*)(except_t *)))(except_t *); +extern unsigned long except_code(except_t *); +extern unsigned long except_group(except_t *); +extern const char *except_message(except_t *); +extern void *except_data(except_t *); +extern void *except_take_data(except_t *); +extern void except_set_allocator(void *(*)(size_t), void (*)(void *)); +extern void *except_alloc(size_t); +extern void except_free(void *); #define except_code(E) ((E)->except_id.except_code) #define except_group(E) ((E)->except_id.except_group) diff --git a/epan/frame_data.h b/epan/frame_data.h index 2e709f846d..99e0745610 100644 --- a/epan/frame_data.h +++ b/epan/frame_data.h @@ -1,7 +1,7 @@ /* frame_data.h * Definitions for frame_data structures and routines * - * $Id: frame_data.h,v 1.5 2002/06/04 07:03:54 guy Exp $ + * $Id: frame_data.h,v 1.6 2002/08/14 19:18:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -65,13 +65,13 @@ typedef struct { /* Utility routines used by packet*.c */ -void p_add_proto_data(frame_data *, int, void *); -void *p_get_proto_data(frame_data *, int); +extern void p_add_proto_data(frame_data *, int, void *); +extern void *p_get_proto_data(frame_data *, int); /* An init routine to be called by epan_init */ -void frame_data_init(void); +extern void frame_data_init(void); /* A cleanup routine to be called by epan_cleanup */ -void frame_data_cleanup(void); +extern void frame_data_cleanup(void); #endif /* __FRAME_DATA__ */ diff --git a/epan/plugins.c b/epan/plugins.c index 849881bb87..751004e437 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -1,7 +1,7 @@ /* plugins.c * plugin routines * - * $Id: plugins.c,v 1.57 2002/08/02 21:29:39 jmayer Exp $ + * $Id: plugins.c,v 1.58 2002/08/14 19:18:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -458,6 +458,12 @@ init_plugins(const char *plugin_dir) patable.p_register_dissector_table = register_dissector_table; patable.p_except_throw = except_throw; patable.p_dissector_try_port = dissector_try_port; + + patable.p_conversation_add_proto_data = conversation_add_proto_data; + patable.p_conversation_get_proto_data = conversation_get_proto_data; + patable.p_conversation_delete_proto_data = conversation_delete_proto_data; + patable.p_p_add_proto_data = p_add_proto_data; + patable.p_p_get_proto_data = p_get_proto_data; #endif #ifdef WIN32 diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c index 25aaf8c368..13f3beab72 100644 --- a/plugins/plugin_api.c +++ b/plugins/plugin_api.c @@ -1,7 +1,7 @@ /* plugin_api.c * Routines for Ethereal plugins. * - * $Id: plugin_api.c,v 1.40 2002/07/12 22:52:39 guy Exp $ + * $Id: plugin_api.c,v 1.41 2002/08/14 19:18:20 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -175,4 +175,10 @@ plugin_address_table_init(plugin_address_table_t *pat) p_register_dissector_table = pat->p_register_dissector_table; p_except_throw = pat->p_except_throw; p_dissector_try_port = pat->p_dissector_try_port; + + p_conversation_add_proto_data = pat->p_conversation_add_proto_data; + p_conversation_get_proto_data = pat->p_conversation_get_proto_data; + p_conversation_delete_proto_data = pat->p_conversation_delete_proto_data; + p_p_add_proto_data = pat->p_p_add_proto_data; + p_p_get_proto_data = pat->p_p_get_proto_data; } diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h index 531dfae1b0..01ca5d83e5 100644 --- a/plugins/plugin_api.h +++ b/plugins/plugin_api.h @@ -1,7 +1,7 @@ /* plugin_api.h * Routines for Ethereal plugins. * - * $Id: plugin_api.h,v 1.41 2002/07/12 22:52:39 guy Exp $ + * $Id: plugin_api.h,v 1.42 2002/08/14 19:18:20 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -206,6 +206,12 @@ #define except_throw (*p_except_throw) #define dissector_try_port (*p_dissector_try_port) +#define conversation_add_proto_data (*p_conversation_add_proto_data) +#define conversation_get_proto_data (*p_conversation_get_proto_data) +#define conversation_delete_proto_data (*p_conversation_delete_proto_data) +#define p_add_proto_data (*p_p_add_proto_data) +#define p_get_proto_data (*p_p_get_proto_data) + #endif #include diff --git a/plugins/plugin_api_decls.h b/plugins/plugin_api_decls.h index 1a79e2ada8..98b1091d8d 100644 --- a/plugins/plugin_api_decls.h +++ b/plugins/plugin_api_decls.h @@ -2,7 +2,7 @@ * Declarations of a list of "p_" names; included in various places * to declare them as variables or as function members. * - * $Id: plugin_api_decls.h,v 1.3 2002/07/12 22:52:39 guy Exp $ + * $Id: plugin_api_decls.h,v 1.4 2002/08/14 19:18:20 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -214,3 +214,10 @@ addr_decode_enumerated_bitfield p_decode_enumerated_bitfield; addr_register_dissector_table p_register_dissector_table; addr_except_throw p_except_throw; addr_dissector_try_port p_dissector_try_port; + +addr_conversation_add_proto_data p_conversation_add_proto_data; +addr_conversation_get_proto_data p_conversation_get_proto_data; +addr_conversation_delete_proto_data p_conversation_delete_proto_data; +addr_p_add_proto_data p_p_add_proto_data; +addr_p_get_proto_data p_p_get_proto_data; + diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h index 76c8da448a..e3c067dde2 100644 --- a/plugins/plugin_table.h +++ b/plugins/plugin_table.h @@ -1,7 +1,7 @@ /* plugin_table.h * Table of exported addresses for Ethereal plugins. * - * $Id: plugin_table.h,v 1.51 2002/07/17 06:55:26 guy Exp $ + * $Id: plugin_table.h,v 1.52 2002/08/14 19:18:20 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez @@ -240,6 +240,12 @@ typedef dissector_table_t (*addr_register_dissector_table)(const char *, char *, typedef void (*addr_except_throw)(long, long, const char *); typedef gboolean (*addr_dissector_try_port)(dissector_table_t, guint32, tvbuff_t *, packet_info *, proto_tree *); +typedef void (*addr_conversation_add_proto_data)(conversation_t *, int, void *); +typedef void *(*addr_conversation_get_proto_data)(conversation_t *, int); +typedef void (*addr_conversation_delete_proto_data)(conversation_t *, int); +typedef void (*addr_p_add_proto_data)(frame_data *, int, void *); +typedef void *(*addr_p_get_proto_data)(frame_data *, int); + typedef struct { #include "plugin_api_decls.h" -- cgit v1.2.3