Remove "text2pcap-scanner.obj" and "tools\lemon\lemon.obj" when a "nmake
[obnox/wireshark/wip.git] / packet-lapbether.c
index a97b1904eb4fcf25e1ce5677af077c6951d1f7ed..ad1616a1b01655e83466e7aaf0061345b049f6b2 100644 (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.6 2001/06/18 02:17:48 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,19 +45,19 @@ 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;
     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;
 
@@ -76,7 +73,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);
 
 }
 
@@ -86,14 +83,15 @@ proto_register_lapbether(void)
     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));
 }
@@ -103,6 +101,11 @@ void
 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);
 
 }