aboutsummaryrefslogtreecommitdiffstats
path: root/packet-clnp.c
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 /packet-clnp.c
parentdedc615898ca05105579430990f44a441fa44009 (diff)
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 'packet-clnp.c')
-rw-r--r--packet-clnp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/packet-clnp.c b/packet-clnp.c
index 66ba406951..febb4556e8 100644
--- a/packet-clnp.c
+++ b/packet-clnp.c
@@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.5 2000/04/28 19:35:39 guy Exp $
+ * $Id: packet-clnp.c,v 1.6 2000/05/05 09:32:01 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -44,7 +44,6 @@
#include "packet-clnp.h"
#include "packet-isis.h"
#include "packet-esis.h"
-#include "packet-h1.h"
#include "nlpid.h"
/* protocols and fields */
@@ -66,8 +65,6 @@ static int hf_clnp_dest = -1;
static int hf_clnp_src_length = -1;
static int hf_clnp_src = -1;
-
-
/*
* ISO 8473 OSI CLNP definition (see RFC994)
*
@@ -230,6 +227,10 @@ struct clnp_segment {
static u_char li, tpdu, cdt; /* common fields */
static u_short dst_ref;
+/* List of dissectors to call for COTP packets put atop the Inactive
+ Subset of CLNP. */
+static heur_dissector_list_t cotp_is_heur_subdissector_list;
+
/* function definitions */
static int osi_decode_DR(const u_char *pd, int offset,
@@ -428,7 +429,8 @@ static gboolean osi_decode_DT(const u_char *pd, int offset,
offset += li + 1;
if (uses_inactive_subset){
- if (dissect_h1(pd, offset, fd, tree)) {
+ if (dissector_try_heuristic(cotp_is_heur_subdissector_list, pd, offset,
+ fd, tree)) {
return TRUE;
}
/* Fill in other Dissectors using inactive subset here */
@@ -1771,6 +1773,9 @@ void proto_register_cotp(void)
proto_cotp = proto_register_protocol(PROTO_STRING_COTP, "cotp");
/* proto_register_field_array(proto_cotp, hf, array_length(hf));*/
proto_register_subtree_array(ett, array_length(ett));
+
+/* subdissector code */
+ register_heur_dissector_list("cotp_is", &cotp_is_heur_subdissector_list);
}
void