aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-05-05 09:32:36 +0000
committerGuy Harris <guy@alum.mit.edu>2000-05-05 09:32:36 +0000
commit6bbfd97bde03e01dbf64173b9fd4e85747fabf8e (patch)
tree950d9eb832f91889530022ffd446ddf3b4772801 /plugins
parentdedc615898ca05105579430990f44a441fa44009 (diff)
downloadwireshark-6bbfd97bde03e01dbf64173b9fd4e85747fabf8e.tar.gz
wireshark-6bbfd97bde03e01dbf64173b9fd4e85747fabf8e.tar.bz2
wireshark-6bbfd97bde03e01dbf64173b9fd4e85747fabf8e.zip
Add routines to:
register lists of "heuristic" dissectors, which are handed a frame that may or may contain a payload for the protocol they dissect, and that return FALSE if it's not or dissect the packet and return TRUE if it is; add a dissector to such a list; go through such a list, calling each dissector until either a dissector returns TRUE, in which case the routine returns TRUE, or it runs out of entries in the list, in which case the routine returns FALSE. Have lists of heuristic dissectors for TCP and for COTP when used with the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger dissectors to the first list and the Sinec H1 dissector to the second list. Make the dissector name argument to "dissector_add()" and "dissector_delete()" a "const char *" rarther than just a "char *". Add "heur_dissector_add()", the routine to add a heuristic dissector to a list of heuristic dissectors, to the set of routines we can export to plugins through a table on platforms where dynamically-loaded code can't call stuff in the main program, and initialize the element in the table in question for "dissector_add()" (which we'd forgotten to do). svn path=/trunk/; revision=1909
Diffstat (limited to 'plugins')
-rw-r--r--plugins/plugin_api.c3
-rw-r--r--plugins/plugin_api.h4
-rw-r--r--plugins/plugin_table.h8
3 files changed, 11 insertions, 4 deletions
diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c
index c5831e8ab8..7de21def62 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.6 2000/04/04 21:46:29 guy Exp $
+ * $Id: plugin_api.c,v 1.7 2000/05/05 09:32:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@@ -48,6 +48,7 @@ plugin_address_table_init(plugin_address_table_t *pat)
p_proto_register_field_array = pat->p_proto_register_field_array;
p_proto_register_subtree_array = pat->p_proto_register_subtree_array;
p_dissector_add = pat->p_dissector_add;
+ p_heur_dissector_add = pat->p_heur_dissector_add;
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;
diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h
index 50ca1749b9..c009d5bc1d 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.4 2000/04/04 21:46:29 guy Exp $
+ * $Id: plugin_api.h,v 1.5 2000/05/05 09:32:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@@ -50,6 +50,8 @@
#define dissector_add (*p_dissector_add)
+#define heur_dissector_add (*p_heur_dissector_add)
+
#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)
diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h
index ac8d3d5cf9..d00a5a948e 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.2 2000/04/04 21:46:29 guy Exp $
+ * $Id: plugin_table.h,v 1.3 2000/05/05 09:32:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@@ -43,7 +43,9 @@ typedef int (*addr_proto_register_protocol)(char*, char*);
typedef void (*addr_proto_register_field_array)(int, hf_register_info*, int);
typedef void (*addr_proto_register_subtree_array)(int**, int);
-typedef void (*addr_dissector_add)(char *, guint32, dissector_t);
+typedef void (*addr_dissector_add)(const char *, guint32, dissector_t);
+
+typedef void (*addr_heur_dissector_add)(const char *, heur_dissector_t);
typedef proto_tree* (*addr_proto_item_add_subtree)(proto_item*, gint);
typedef proto_item* (*addr_proto_tree_add_item)(proto_tree*, int, gint, gint, ...);
@@ -79,6 +81,8 @@ typedef struct {
addr_dissector_add p_dissector_add;
+ addr_heur_dissector_add p_heur_dissector_add;
+
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;