-/* 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.6 2001/06/18 02:17:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#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;
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;
int len;
tvbuff_t *next_tvb;
- CHECK_DISPLAY_AS_DATA(proto_lapbether, tvb, pinfo, tree);
-
- pinfo->current_proto = "LAPBETHER";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "LAPBETHER");
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
len = tvb_get_guint8(tvb, 0) + tvb_get_guint8(tvb, 1) * 256;
}
next_tvb = tvb_new_subset(tvb, 2, len, len);
- dissect_lapb(next_tvb, pinfo, tree);
+ call_dissector(lapb_handle, next_tvb, pinfo, tree);
}
static hf_register_info hf[] = {
{ &hf_lapbether_length,
{ "Length Field", "lapbether.length", FT_UINT16, BASE_DEC, NULL, 0x0,
- "LAPBEther Length Field"}},
+ "LAPBEther Length Field", HFILL }},
};
static gint *ett[] = {
&ett_lapbether,
};
- proto_lapbether = proto_register_protocol ("Link Access Procedure Balanced Ethernet (LAPBETHER)", "lapbether");
+ proto_lapbether = proto_register_protocol ("Link Access Procedure Balanced Ethernet (LAPBETHER)",
+ "LAPBETHER", "lapbether");
proto_register_field_array (proto_lapbether, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
proto_reg_handoff_lapbether(void)
{
- dissector_add("ethertype", ETHERTYPE_DEC, dissect_lapbether);
+ /*
+ * Get a handle for the LAPB dissector.
+ */
+ lapb_handle = find_dissector("lapb");
+
+ dissector_add("ethertype", ETHERTYPE_DEC, dissect_lapbether, proto_lapbether);
}