diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-12-29 02:27:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-12-29 02:27:21 +0000 |
commit | 00828b3f2bfe8523886257e54e37d34f18155f7d (patch) | |
tree | 394aaadfda75aa13496077a9d4b5c8dc4e4ca64c /packet-lapbether.c | |
parent | 1d3ed65598890403eda732caa15e2ceac25b7e21 (diff) | |
download | wireshark-00828b3f2bfe8523886257e54e37d34f18155f7d.tar.gz |
"dissect_lapb()" is static to "packet-lapb.c", so it can't be directly
called by "dissect_lapbether()". "packet-lapbether.c" included
"packet-lapb.h", to get "dissect_lapb()" declared, but that header file
doesn't exist.
Dissectors should call other dissectors indirectly, so have the LAPB
dissector register itself and have the LAPB-over-Ethernet dissector get
that handle and call the LAPB dissector through that handle, rather than
making the LAPB dissector non-static and adding a "packet-lapb.h" header
to declare it.
Remove some unnecessary includes from "packet-lapbether.c".
svn path=/trunk/; revision=2799
Diffstat (limited to 'packet-lapbether.c')
-rw-r--r-- | packet-lapbether.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/packet-lapbether.c b/packet-lapbether.c index a97b1904eb..36ded13088 100644 --- a/packet-lapbether.c +++ b/packet-lapbether.c @@ -1,9 +1,9 @@ -/* packet-lapb.c +/* packet-lapbether.c * Routines for lapbether frame disassembly * Richard Sharpe <rsharpe@ns.aus.com> based on the lapb module by * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-lapbether.c,v 1.1 2000/12/29 01:06:24 sharpe Exp $ + * $Id: packet-lapbether.c,v 1.2 2000/12/29 02:27:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -37,9 +37,6 @@ #include <glib.h> #include <string.h> #include "packet.h" -#include "packet-lapb.h" -#include "packet-x25.h" -#include "xdlc.h" #include "etypes.h" static int proto_lapbether = -1; @@ -48,7 +45,9 @@ static int hf_lapbether_length = -1; static gint ett_lapbether = -1; -void +static dissector_handle_t lapb_handle; + +static void dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *lapbether_tree, *ti; @@ -76,7 +75,7 @@ dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } next_tvb = tvb_new_subset(tvb, 2, len, len); - dissect_lapb(next_tvb, pinfo, tree); + call_dissector(lapb_handle, next_tvb, pinfo, tree); } @@ -103,6 +102,11 @@ void proto_reg_handoff_lapbether(void) { + /* + * Get a handle for the LAPB dissector. + */ + lapb_handle = find_dissector("lapb"); + dissector_add("ethertype", ETHERTYPE_DEC, dissect_lapbether); } |