2 * Routines for Wellfleet BOFL dissection
3 * Author: Endoh Akira (endoh@netmarks.co.jp)
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@unicom.net>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * The following information was copied from
26 * http://www.protocols.com/pbook/bridge.htm#WellfleetBOFL
28 * The Wellfleet Breath of Life (BOFL) protocol is used as a line sensing
31 * - Ethernet LANs to detect transmitter jams.
32 * - Synchronous lines running WFLT STD protocols to determine if the line
34 * - Dial backup PPP lines.
36 * The frame format of Wellfleet BOFL is shown following the Ethernet header
37 * in the following illustration:
39 * Destination Source 8102 PDU Sequence Padding
49 #include <epan/packet.h>
51 #define ETHER_TYPE_BOFL 0x8102
52 #define BOFL_MIN_LEN 8
54 /* Initialize the protocol and registered fields */
55 static int proto_bofl = -1;
56 static int hf_bofl_pdu = -1;
57 static int hf_bofl_sequence = -1;
59 /* Initialize the subtree pointers */
60 static gint ett_bofl = -1;
62 /* Code to actually dissect the packets */
64 dissect_bofl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
67 proto_tree *bofl_tree = NULL;
69 guint32 pdu, sequence;
71 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BOFL");
73 col_clear(pinfo->cinfo, COL_INFO);
76 ti = proto_tree_add_item(tree, proto_bofl, tvb, 0, -1, ENC_BIG_ENDIAN);
77 bofl_tree = proto_item_add_subtree(ti, ett_bofl);
80 pdu = tvb_get_ntohl(tvb, 0);
81 col_add_fstr(pinfo->cinfo, COL_INFO,
84 proto_tree_add_uint(bofl_tree, hf_bofl_pdu, tvb, 0, 4, pdu);
86 sequence = tvb_get_ntohl(tvb, 4);
88 col_append_fstr(pinfo->cinfo, COL_INFO,
89 " Sequence: %u", sequence);
91 proto_tree_add_uint(bofl_tree, hf_bofl_sequence, tvb, 4, 4, sequence);
93 len = tvb_length_remaining(tvb, 8);
95 proto_tree_add_text(bofl_tree, tvb, 8, len,
96 "Padding (%d byte)", len);
102 proto_register_bofl(void)
104 static hf_register_info hf[] = {
107 FT_UINT32, BASE_HEX, NULL, 0,
108 "PDU; normally equals 0x01010000 or 0x01011111", HFILL }
111 { "Sequence", "bofl.sequence",
112 FT_UINT32, BASE_DEC, NULL, 0,
113 "incremental counter", HFILL }
117 static gint *ett[] = {
121 proto_bofl = proto_register_protocol("Wellfleet Breath of Life",
123 proto_register_field_array(proto_bofl, hf, array_length(hf));
124 proto_register_subtree_array(ett, array_length(ett));
129 proto_reg_handoff_bofl(void)
131 dissector_handle_t bofl_handle;
133 bofl_handle = create_dissector_handle(dissect_bofl, proto_bofl);
134 dissector_add_uint("ethertype", ETHER_TYPE_BOFL, bofl_handle);