2 * Routines for lapbether frame disassembly
3 * Richard Sharpe <rsharpe@ns.aus.com> based on the lapb module by
4 * Olivier Abad <oabad@noos.fr>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <epan/packet.h>
29 #include <epan/etypes.h>
31 void proto_register_lapbether(void);
32 void proto_reg_handoff_lapbether(void);
34 static int proto_lapbether = -1;
36 static int hf_lapbether_length = -1;
38 static gint ett_lapbether = -1;
40 static dissector_handle_t lapb_handle;
43 dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
45 proto_tree *lapbether_tree, *ti;
49 col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPBETHER");
50 col_clear(pinfo->cinfo, COL_INFO);
52 len = tvb_get_guint8(tvb, 0) + tvb_get_guint8(tvb, 1) * 256;
56 ti = proto_tree_add_protocol_format(tree, proto_lapbether, tvb, 0, 2,
59 lapbether_tree = proto_item_add_subtree(ti, ett_lapbether);
60 proto_tree_add_uint_format(lapbether_tree, hf_lapbether_length, tvb, 0, 2,
61 len, "Length: %u", len);
65 next_tvb = tvb_new_subset_length(tvb, 2, len);
66 call_dissector(lapb_handle, next_tvb, pinfo, tree);
71 proto_register_lapbether(void)
73 static hf_register_info hf[] = {
74 { &hf_lapbether_length,
75 { "Length Field", "lapbether.length", FT_UINT16, BASE_DEC, NULL, 0x0,
76 "LAPBEther Length Field", HFILL }},
79 static gint *ett[] = {
83 proto_lapbether = proto_register_protocol ("Link Access Procedure Balanced Ethernet (LAPBETHER)",
84 "LAPBETHER", "lapbether");
85 proto_register_field_array (proto_lapbether, hf, array_length(hf));
86 proto_register_subtree_array(ett, array_length(ett));
89 /* The registration hand-off routine */
91 proto_reg_handoff_lapbether(void)
93 dissector_handle_t lapbether_handle;
96 * Get a handle for the LAPB dissector.
98 lapb_handle = find_dissector("lapb");
100 lapbether_handle = create_dissector_handle(dissect_lapbether,
102 dissector_add_uint("ethertype", ETHERTYPE_DEC, lapbether_handle);
107 * Editor modelines - http://www.wireshark.org/tools/modelines.html
112 * indent-tabs-mode: nil
115 * ex: set shiftwidth=2 tabstop=8 expandtab:
116 * :indentSize=2:tabSize=8:noTabs=true: