Add "dissector_delete()", "proto_item_get_len()",
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 13 Nov 2000 10:13:26 +0000 (10:13 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 13 Nov 2000 10:13:26 +0000 (10:13 +0000)
"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.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2638 f5534014-38df-0310-8fa8-9805f1628bb7

epan/plugins.c
plugins/plugin_api.c
plugins/plugin_api.h
plugins/plugin_table.h

index a6c546852d798e1b2e48efa66191369872f8deba..5420a33a883dd611ab97496eb901c02c1510ef64 100644 (file)
@@ -1,7 +1,7 @@
 /* plugins.c
  * plugin routines
  *
- * $Id: plugins.c,v 1.7 2000/11/13 08:00:06 guy Exp $
+ * $Id: plugins.c,v 1.8 2000/11/13 10:13:18 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -616,13 +616,18 @@ init_plugins(const char *plugin_dir)
 
        patable.p_dissector_add                 = dissector_add;
        patable.p_old_dissector_add             = old_dissector_add;
+       patable.p_dissector_delete              = dissector_delete;
 
        patable.p_heur_dissector_add            = heur_dissector_add;
 
+       patable.p_dissect_data                  = dissect_data;
        patable.p_old_dissect_data              = old_dissect_data;
 
        patable.p_proto_is_protocol_enabled     = proto_is_protocol_enabled;
 
+       patable.p_proto_item_get_len            = proto_item_get_len;
+       patable.p_proto_item_set_len            = proto_item_set_len;
+       patable.p_proto_item_set_text           = proto_item_set_text;
        patable.p_proto_item_add_subtree        = proto_item_add_subtree;
        patable.p_proto_tree_add_item           = proto_tree_add_item;
        patable.p_proto_tree_add_item_hidden    = proto_tree_add_item_hidden;
@@ -709,6 +714,11 @@ init_plugins(const char *plugin_dir)
        patable.p_tvb_strncaseeql               = tvb_strncaseeql;
 
        patable.p_tvb_bytes_to_str              = tvb_bytes_to_str;
+
+       patable.p_prefs_register_module         = prefs_register_module;
+       patable.p_prefs_register_uint_preference = prefs_register_uint_preference;
+       patable.p_prefs_register_bool_preference = prefs_register_bool_preference;
+       patable.p_prefs_register_enum_preference = prefs_register_enum_preference;
 #endif
 
        plugins_scan_dir(std_plug_dir);
index cfed71362f2d96d6520d1b771aeb43620e68c66e..71f5216dab4b374b3a62dbab2619bb3108b5938a 100644 (file)
@@ -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;
 }
index 09fbee072554a7ac2b8a70503ebe657911f97f97..bcbb4758265c0e2e77e5e551a7c6430635068376 100644 (file)
@@ -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>
 
 #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)
 
 #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
 #endif
 
 #include "packet.h"
+#include "prefs.h"
 #include "dfilter.h"
 
 #include "plugin_table.h"
index c37e7a47415e7f05b91a006a02151adc4ec76aa0..687fdf80a3975375f73f9b3fa7a9aba997af004d 100644 (file)
@@ -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 */