"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
This commit is contained in:
Guy Harris 2000-12-29 02:27:21 +00:00
parent 1d3ed65598
commit 00828b3f2b
2 changed files with 15 additions and 9 deletions

View File

@ -2,7 +2,7 @@
* Routines for lapb frame disassembly
* Olivier Abad <oabad@cybercable.fr>
*
* $Id: packet-lapb.c,v 1.24 2000/11/29 05:16:15 gram Exp $
* $Id: packet-lapb.c,v 1.25 2000/12/29 02:27:21 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -134,10 +134,12 @@ proto_register_lapb(void)
proto_lapb = proto_register_protocol ("Link Access Procedure Balanced (LAPB)", "lapb");
proto_register_field_array (proto_lapb, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_dissector("lapb", dissect_lapb);
}
void
proto_reg_handoff_lapb(void)
{
dissector_add("wtap_encap", WTAP_ENCAP_LAPB, dissect_lapb);
dissector_add("wtap_encap", WTAP_ENCAP_LAPB, dissect_lapb);
}

View File

@ -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);
}