In "decode_network()", get the information about the currently selected
[obnox/wireshark/wip.git] / packet-lapb.c
index 921155ba8909d73b5eaa5d5988e17a3d949f5df3..f9383b99d031444da1eb37453678517b39cd379e 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for lapb frame disassembly
  * Olivier Abad <oabad@cybercable.fr>
  *
- * $Id: packet-lapb.c,v 1.28 2001/01/22 00:20:29 guy Exp $
+ * $Id: packet-lapb.c,v 1.30 2001/06/18 02:17:48 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -36,7 +36,6 @@
 #include <glib.h>
 #include <string.h>
 #include "packet.h"
-#include "packet-x25.h"
 #include "xdlc.h"
 
 #define FROM_DCE       0x80
@@ -48,6 +47,8 @@ static int hf_lapb_control = -1;
 static gint ett_lapb = -1;
 static gint ett_lapb_control = -1;
 
+static dissector_handle_t x25_handle;
+
 static void
 dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -108,7 +109,7 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* not end of frame ==> X.25 */
     if (tvb_length(tvb) > 2) {
            next_tvb = tvb_new_subset(tvb, 2, -1, -1);
-           dissect_x25(next_tvb, pinfo, tree);
+           call_dissector(x25_handle, next_tvb, pinfo, tree);
     }
 }
 
@@ -118,11 +119,11 @@ proto_register_lapb(void)
     static hf_register_info hf[] = {
        { &hf_lapb_address,
          { "Address Field", "lapb.address", FT_UINT8, BASE_HEX, NULL, 0x0, 
-               "Address" }},
+               "Address", HFILL }},
 
        { &hf_lapb_control,
          { "Control Field", "lapb.control", FT_UINT8, BASE_HEX, NULL, 0x0,
-               "Control field" }},
+               "Control field", HFILL }},
     };
     static gint *ett[] = {
         &ett_lapb,
@@ -140,5 +141,10 @@ proto_register_lapb(void)
 void
 proto_reg_handoff_lapb(void)
 {
+    /*
+     * Get a handle for the X.25 dissector.
+     */
+    x25_handle = find_dissector("x.25");
+
     dissector_add("wtap_encap", WTAP_ENCAP_LAPB, dissect_lapb, proto_lapb);
 }