aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-02-03 23:19:54 +0000
committerGuy Harris <guy@alum.mit.edu>2004-02-03 23:19:54 +0000
commit78461c0180dee2336db99b91cfd126dfbb4ecff3 (patch)
treeb788c711cc367cc7b12ebb25e4b0c2f39dfb1a13
parent880010fbd1d7cd94a66c74a19025d6b4d5085984 (diff)
From Peter J. Creath: add a heuristic dissector table, so that
dissectors for protocols that put non-802.3 packets inside 802.3 frames can intercept 802.3/Ethernet frames before they're dissected as 802.3/Ethernet packets. svn path=/trunk/; revision=9976
-rw-r--r--AUTHORS1
-rw-r--r--doc/ethereal.pod1
-rw-r--r--packet-eth.c15
3 files changed, 16 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 696200d9b1..ddcb496f14 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2056,6 +2056,7 @@ And assorted fixes and enhancements by the people listed above and by:
Shusaku Ueda <ueda [AT] sra.co.jp>
Jonathan Perkins <jonathan.perkins [AT] ipaccess.com>
Holger Schurig <h.schurig [AT] mn-logistik.de>
+ Peter J. Creath <peter-ethereal [AT] creath.net>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
diff --git a/doc/ethereal.pod b/doc/ethereal.pod
index 539c2426c7..55a815ccb6 100644
--- a/doc/ethereal.pod
+++ b/doc/ethereal.pod
@@ -2122,6 +2122,7 @@ B<http://www.ethereal.com>.
Shusaku Ueda <ueda [AT] sra.co.jp>
Jonathan Perkins <jonathan.perkins [AT] ipaccess.com>
Holger Schurig <h.schurig [AT] mn-logistik.de>
+ Peter J. Creath <peter-ethereal [AT] creath.net>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.
diff --git a/packet-eth.c b/packet-eth.c
index dbe2e8a6b7..ecfc644f3c 100644
--- a/packet-eth.c
+++ b/packet-eth.c
@@ -1,7 +1,7 @@
/* packet-eth.c
* Routines for ethernet packet disassembly
*
- * $Id: packet-eth.c,v 1.88 2003/10/01 07:11:44 guy Exp $
+ * $Id: packet-eth.c,v 1.89 2004/02/03 23:19:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -56,6 +56,7 @@ static gint ett_ether2 = -1;
static dissector_handle_t isl_handle;
static dissector_handle_t fw1_handle;
+static heur_dissector_list_t heur_subdissector_list;
static int eth_tap = -1;
@@ -190,6 +191,15 @@ dissect_eth_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
ehdr->type = tvb_get_ntohs(tvb, 12);
/*
+ * In case the packet is a non-Ethernet packet inside
+ * Ethernet framing, allow heuristic dissectors to take
+ * a first look before we assume that it's actually an
+ * Ethernet packet.
+ */
+ if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree))
+ goto end_of_eth;
+
+ /*
* If the type/length field is <= the maximum 802.3 length,
* and is not zero, this is an 802.3 frame, and it's a length
* field; it might be an Novell "raw 802.3" frame, with no
@@ -425,6 +435,9 @@ proto_register_eth(void)
proto_register_field_array(proto_eth, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ /* subdissector code */
+ register_heur_dissector_list("eth", &heur_subdissector_list);
+
/* Register configuration preferences */
eth_module = prefs_register_protocol(proto_eth, NULL);
prefs_register_bool_preference(eth_module, "interpret_as_fw1_monitor",