diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-11-13 10:13:26 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-11-13 10:13:26 +0000 |
commit | b830fb6a5f4de64a0a4f804a74256894e50ac21f (patch) | |
tree | fa8aa4df7c07ace9d432ad901317468116c3acb9 /plugins | |
parent | 3503bd353bc23aafa2adef7d2c2cd0894e397c9f (diff) | |
download | wireshark-b830fb6a5f4de64a0a4f804a74256894e50ac21f.tar.gz wireshark-b830fb6a5f4de64a0a4f804a74256894e50ac21f.tar.bz2 wireshark-b830fb6a5f4de64a0a4f804a74256894e50ac21f.zip |
Add "dissector_delete()", "proto_item_get_len()",
"proto_item_set_len()", "proto_item_set_text()", and the preference
routines expected to be used by dissectors to the table of function
pointers handed to dissectors on platforms where dynamically-loaded
modules can't access symbols from the main program.
svn path=/trunk/; revision=2638
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/plugin_api.c | 11 | ||||
-rw-r--r-- | plugins/plugin_api.h | 13 | ||||
-rw-r--r-- | plugins/plugin_table.h | 43 |
3 files changed, 56 insertions, 11 deletions
diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c index cfed71362f..71f5216dab 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.10 2000/11/13 08:00:09 guy Exp $ + * $Id: plugin_api.c,v 1.11 2000/11/13 10:13:21 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez <gram@xiexie.org> @@ -49,9 +49,14 @@ plugin_address_table_init(plugin_address_table_t *pat) p_proto_register_subtree_array = pat->p_proto_register_subtree_array; p_dissector_add = pat->p_dissector_add; p_old_dissector_add = pat->p_old_dissector_add; + p_dissector_delete = pat->p_old_dissector_delete; p_heur_dissector_add = pat->p_heur_dissector_add; + p_dissect_data = pat->p_dissect_data; p_old_dissect_data = pat->p_old_dissect_data; p_proto_is_protocol_enabled = pat->p_proto_is_protocol_enabled; + p_proto_item_get_len = pat->p_proto_item_get_len; + p_proto_item_set_len = pat->p_proto_item_set_len; + p_proto_item_set_text = pat->p_proto_item_set_text; p_proto_item_add_subtree = pat->p_proto_item_add_subtree; p_proto_tree_add_item = pat->p_proto_tree_add_item; p_proto_tree_add_item_hidden = pat->p_proto_tree_add_item_hidden; @@ -124,4 +129,8 @@ plugin_address_table_init(plugin_address_table_t *pat) p_tvb_strneql = pat->p_tvb_strneql; p_tvb_strncaseeql = pat->p_tvb_strncaseeql; p_tvb_bytes_to_str = pat->p_tvb_bytes_to_str; + p_prefs_register_module = pat->p_prefs_register_module; + p_prefs_register_uint_preference = pat->p_prefs_register_uint_preference; + p_prefs_register_bool_preference = pat->p_prefs_register_bool_preference; + p_prefs_register_enum_preference = pat->p_prefs_register_enum_preference; } diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h index 09fbee0725..bcbb475826 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.9 2000/11/13 08:00:11 guy Exp $ + * $Id: plugin_api.h,v 1.10 2000/11/13 10:13:24 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez <gram@xiexie.org> @@ -53,13 +53,18 @@ #define dissector_add (*p_dissector_add) #define old_dissector_add (*p_old_dissector_add) +#define dissector_delete (*p_dissector_delete) #define heur_dissector_add (*p_heur_dissector_add) +#define dissect_data (*p_old_dissect_data) #define old_dissect_data (*p_old_dissect_data) #define proto_is_protocol_enabled (*p_proto_is_protocol_enabled) +#define proto_item_get_len (*p_proto_item_get_len) +#define proto_item_set_len (*p_proto_item_set_len) +#define proto_item_set_text (*p_proto_item_set_text) #define proto_item_add_subtree (*p_proto_item_add_subtree) #define proto_tree_add_item (*p_proto_tree_add_item) #define proto_tree_add_item_hidden (*p_proto_tree_add_item_hidden) @@ -147,6 +152,11 @@ #define tvb_bytes_to_str (*p_tvb_bytes_to_str) +#define prefs_register_module (*p_prefs_register_module) +#define prefs_register_uint_preference (*p_prefs_register_uint_preference) +#define prefs_register_bool_preference (*p_prefs_register_bool_preference) +#define prefs_register_enum_preference (*p_prefs_register_enum_preference) + #define pi (*p_pi) #else @@ -157,6 +167,7 @@ #endif #include "packet.h" +#include "prefs.h" #include "dfilter.h" #include "plugin_table.h" diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h index c37e7a4741..687fdf80a3 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.6 2000/11/13 08:00:12 guy Exp $ + * $Id: plugin_table.h,v 1.7 2000/11/13 10:13:26 guy Exp $ * * Ethereal - Network traffic analyzer * Copyright 2000 by Gilbert Ramirez <gram@xiexie.org> @@ -45,13 +45,18 @@ typedef void (*addr_proto_register_subtree_array)(int**, int); typedef void (*addr_dissector_add)(const char *, guint32, dissector_t); typedef void (*addr_old_dissector_add)(const char *, guint32, old_dissector_t); +typedef void (*addr_dissector_delete)(const char *, guint32, dissector_t); typedef void (*addr_heur_dissector_add)(const char *, heur_dissector_t); +typedef void (*addr_dissect_data)(tvbuff_t *, packet_info *, proto_tree *); typedef void (*addr_old_dissect_data)(const u_char *, int, frame_data *, proto_tree *); typedef gboolean (*addr_proto_is_protocol_enabled)(int); +typedef int (*addr_proto_item_get_len)(proto_item*); +typedef void (*addr_proto_item_set_len)(proto_item*, gint); +typedef void (*addr_proto_item_set_text)(proto_item*, const char*, ...); typedef proto_tree* (*addr_proto_item_add_subtree)(proto_item*, gint); typedef proto_item* (*addr_proto_tree_add_item)(proto_tree*, int, tvbuff_t*, gint, gint, gboolean); typedef proto_item* (*addr_proto_tree_add_item_hidden)(proto_tree*, int, tvbuff_t*, gint, gint, gboolean); @@ -138,18 +143,27 @@ typedef gint (*addr_tvb_pbrk_guint8)(tvbuff_t *, gint, guint, guint8 *); typedef gint (*addr_tvb_strnlen)(tvbuff_t*, gint, guint); -typedef guint8 * (*addr_tvb_format_text)(tvbuff_t *tvb, gint, gint); +typedef guint8 * (*addr_tvb_format_text)(tvbuff_t*, gint, gint); -typedef gint (*addr_tvb_get_nstringz)(tvbuff_t *tvb, gint, guint, guint8*); -typedef gint (*addr_tvb_get_nstringz0)(tvbuff_t *tvb, gint, guint, guint8*); +typedef gint (*addr_tvb_get_nstringz)(tvbuff_t*, gint, guint, guint8*); +typedef gint (*addr_tvb_get_nstringz0)(tvbuff_t*, gint, guint, guint8*); -typedef gint (*addr_tvb_find_line_end)(tvbuff_t *tvb, gint, int, gint *); -typedef gint (*addr_tvb_find_line_end_unquoted)(tvbuff_t *tvb, gint, int, gint *); +typedef gint (*addr_tvb_find_line_end)(tvbuff_t*, gint, int, gint *); +typedef gint (*addr_tvb_find_line_end_unquoted)(tvbuff_t*, gint, int, gint *); -typedef gint (*addr_tvb_strneql)(tvbuff_t *tvb, gint, const guint8 *str, gint); -typedef gint (*addr_tvb_strncaseeql)(tvbuff_t *tvb, gint, const guint8 *str, gint); +typedef gint (*addr_tvb_strneql)(tvbuff_t*, gint, const guint8 *, gint); +typedef gint (*addr_tvb_strncaseeql)(tvbuff_t*, gint, const guint8 *, gint); -typedef gchar *(*addr_tvb_bytes_to_str)(tvbuff_t *tvb, gint, gint len); +typedef gchar *(*addr_tvb_bytes_to_str)(tvbuff_t*, gint, gint len); + +typedef module_t *(*addr_prefs_register_module(const char *, const char *, + void (*)(void)); +typedef void (*addr_prefs_register_uint_preference(module_t *, const char *, + const char *, const char *, guint, guint *); +typedef void (*addr_prefs_register_bool_preference)(module_t *, const char *, + const char *, const char *, gboolean *); +typedef void (*addr_prefs_register_enum_preference)(module_t *, const char *, + const char *, const char *, gint *, const enum_val *, gboolean); typedef struct { addr_check_col p_check_col; @@ -169,12 +183,18 @@ typedef struct { addr_dissector_add p_dissector_add; addr_old_dissector_add p_old_dissector_add; + addr_dissector_delete p_dissector_delete; + addr_heur_dissector_add p_heur_dissector_add; + addr_dissect_data p_dissect_data; addr_old_dissect_data p_old_dissect_data; addr_proto_is_protocol_enabled p_proto_is_protocol_enabled; + addr_proto_item_get_len p_proto_item_get_len; + addr_proto_item_set_len p_proto_item_set_len; + addr_proto_item_set_text p_proto_item_set_text; addr_proto_item_add_subtree p_proto_item_add_subtree; addr_proto_tree_add_item p_proto_tree_add_item; addr_proto_tree_add_item_hidden p_proto_tree_add_item_hidden; @@ -261,6 +281,11 @@ typedef struct { addr_tvb_strncaseeql p_tvb_strncaseeql; addr_tvb_bytes_to_str p_tvb_bytes_to_str; + + addr_prefs_register_module p_prefs_register_module; + addr_prefs_register_uint_preference p_prefs_register_uint_preference; + addr_prefs_register_bool_preference p_prefs_register_bool_preference; + addr_prefs_register_enum_preference p_prefs_register_enum_preference; } plugin_address_table_t; #else /* ! PLUGINS_NEED_ACCESS_TABLE */ |