diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-12-28 09:49:09 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-12-28 09:49:09 +0000 |
commit | d13901155d5108fc756bf2b4a4608fa9af73a146 (patch) | |
tree | a3fc4e9de7e42980ada10de139813e9937956393 /packet-llc.c | |
parent | f69876eece2a86501b309e9aecfdcd69b95dc500 (diff) | |
download | wireshark-d13901155d5108fc756bf2b4a4608fa9af73a146.tar.gz wireshark-d13901155d5108fc756bf2b4a4608fa9af73a146.tar.bz2 wireshark-d13901155d5108fc756bf2b4a4608fa9af73a146.zip |
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-llc.c')
-rw-r--r-- | packet-llc.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/packet-llc.c b/packet-llc.c index 3a98eb0d6d..5e0ed63b04 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-llc.c,v 1.72 2000/11/29 05:16:15 gram Exp $ + * $Id: packet-llc.c,v 1.73 2000/12/28 09:49:09 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -38,14 +38,11 @@ #include "xdlc.h" #include "etypes.h" #include "llcsaps.h" -#include "packet-cdp.h" -#include "packet-cgmp.h" #include "packet-ip.h" #include "packet-ipx.h" #include "packet-netbios.h" #include "packet-osi.h" #include "packet-sna.h" -#include "packet-vtp.h" static int proto_llc = -1; static int hf_llc_dsap = -1; @@ -61,6 +58,7 @@ static gint ett_llc = -1; static gint ett_llc_ctrl = -1; static dissector_table_t subdissector_table; +static dissector_table_t cisco_subdissector_table; static dissector_handle_t bpdu_handle; @@ -372,30 +370,11 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) hf_llc_pid, tvb, 6, 2, etype); } if (XDLC_IS_INFORMATION(control)) { - switch (etype) { - -#if 0 - case 0x0102: - dissect_drip(pd, offset, pinfo->fd, tree); - break; -#endif - - case 0x2000: - dissect_cdp(pd, offset, pinfo->fd, tree); - break; - - case 0x2001: - dissect_cgmp(pd, offset, pinfo->fd, tree); - break; - - case 0x2003: - dissect_vtp(pd, offset, pinfo->fd, tree); - break; - - default: + /* do lookup with the subdissector table */ + /* for future reference, 0x0102 is Cisco DRIP */ + if (!dissector_try_port(cisco_subdissector_table, + etype, next_tvb, pinfo, tree)) dissect_data(next_tvb, 0, pinfo, tree); - break; - } } else dissect_data(next_tvb, 0, pinfo, tree); break; @@ -495,6 +474,7 @@ proto_register_llc(void) /* subdissector code */ subdissector_table = register_dissector_table("llc.dsap"); + cisco_subdissector_table = register_dissector_table("llc.cisco_pid"); } void @@ -504,5 +484,6 @@ proto_reg_handoff_llc(void) * Get a handle for the BPDU dissector. */ bpdu_handle = find_dissector("bpdu"); + dissector_add("wtap_encap", WTAP_ENCAP_ATM_RFC1483, dissect_llc); } |