aboutsummaryrefslogtreecommitdiffstats
path: root/packet-eth.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-12-28 09:49:09 +0000
committerGuy Harris <guy@alum.mit.edu>2000-12-28 09:49:09 +0000
commitd13901155d5108fc756bf2b4a4608fa9af73a146 (patch)
treea3fc4e9de7e42980ada10de139813e9937956393 /packet-eth.c
parentf69876eece2a86501b309e9aecfdcd69b95dc500 (diff)
Tvbuffify the CDP, CGMP, ISL, and VTP dissectors.
Add a new subdissector table in the LLC dissector for protocol IDs with a Cisco OUI, and register the CDP, CGMP, and VTMP dissectors in that table, rather than calling them via a switch statement. Register the ISL dissector by name, and have the Ethernet dissector call it via a handle. Fix the handling of the checksum field in the CDP dissector. The strings in CDP are counted, not null-terminated; treat them as such. Fix the handling of the encapsulated frame CRC, and the encapsulated frame, in the ISL dissector, at least for Ethernet frames; it may not be correct for encapsulated Token Ring frames. svn path=/trunk/; revision=2792
Diffstat (limited to 'packet-eth.c')
-rw-r--r--packet-eth.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/packet-eth.c b/packet-eth.c
index 8e2b802a76..a8adf5706d 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.50 2000/11/29 05:16:15 gram Exp $
+ * $Id: packet-eth.c,v 1.51 2000/12/28 09:49:09 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -54,6 +54,8 @@ static int hf_eth_trailer = -1;
static gint ett_ieee8023 = -1;
static gint ett_ether2 = -1;
+static dissector_handle_t isl_handle;
+
#define ETH_HEADER_SIZE 14
/* These are the Netware-ish names for the different Ethernet frame types.
@@ -205,7 +207,7 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_get_guint8(tvb, 2) == 0x0C &&
tvb_get_guint8(tvb, 3) == 0x00 &&
tvb_get_guint8(tvb, 4) == 0x00 ) {
- dissect_isl(pd, eth_offset, pinfo->fd, tree);
+ call_dissector(isl_handle, tvb, pinfo, tree);
return;
}
@@ -234,7 +236,10 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
frame length, by adding in the size of any data that preceded
the Ethernet header, and adding in the Ethernet header size,
and set the payload and captured-payload lengths to the minima
- of the total length and the frame lengths. */
+ of the total length and the frame lengths.
+
+ XXX - when all dissectors are tvbuffified we shouldn't have to
+ do this any more. */
length += eth_offset + ETH_HEADER_SIZE;
if (pinfo->len > length)
pinfo->len = length;
@@ -380,5 +385,10 @@ proto_register_eth(void)
void
proto_reg_handoff_eth(void)
{
+ /*
+ * Get a handle for the ISL dissector.
+ */
+ isl_handle = find_dissector("isl");
+
dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, dissect_eth);
}