2 * Routines for ethertype 0x88A1 tunneling dissection
4 * Copyright 2006 Joerg Mayer (see AUTHORS file)
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
14 * - find out more about the real meaning of the 8 bytes
15 * and possible other packet types
16 * - Telkonet (www.telkonet.com) has registered other ethertypes
17 * as well: find out what they do
22 #include <epan/packet.h>
23 #include <epan/etypes.h>
25 void proto_reg_handoff_telkonet(void);
26 void proto_register_telkonet(void);
28 static int proto_telkonet
;
29 static int hf_telkonet_type
;
31 static int ett_telkonet
;
33 static dissector_handle_t telkonet_handle
;
34 static dissector_handle_t eth_withoutfcs_handle
;
37 TELKONET_TYPE_TUNNEL
= 0x78
40 static const value_string telkonet_type_vals
[] = {
41 { TELKONET_TYPE_TUNNEL
, "tunnel" },
47 dissect_telkonet(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
49 proto_tree
*ti
, *telkonet_tree
;
53 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "TELKONET");
54 col_clear(pinfo
->cinfo
, COL_INFO
);
56 type
= (telkonet_type_t
)tvb_get_uint8(tvb
, offset
);
57 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Telkonet type: %s",
58 val_to_str(type
, telkonet_type_vals
, "Unknown (0x%02x)"));
60 ti
= proto_tree_add_item(tree
, proto_telkonet
, tvb
, 0, 8, ENC_NA
);
61 telkonet_tree
= proto_item_add_subtree(ti
, ett_telkonet
);
63 proto_tree_add_item(telkonet_tree
, hf_telkonet_type
, tvb
, 0, 8, ENC_NA
);
66 if (type
== TELKONET_TYPE_TUNNEL
)
67 call_dissector(eth_withoutfcs_handle
, tvb_new_subset_remaining(tvb
, offset
),
70 return tvb_captured_length(tvb
);
74 proto_register_telkonet(void)
76 static hf_register_info hf
[] = {
78 { "Type", "telkonet.type", FT_BYTES
, BASE_NONE
, NULL
,
79 0x0, "TELKONET type", HFILL
}},
85 proto_telkonet
= proto_register_protocol("Telkonet powerline", "TELKONET", "telkonet");
86 proto_register_field_array(proto_telkonet
, hf
, array_length(hf
));
87 proto_register_subtree_array(ett
, array_length(ett
));
88 telkonet_handle
= register_dissector("telkonet", dissect_telkonet
, proto_telkonet
);
92 proto_reg_handoff_telkonet(void)
94 eth_withoutfcs_handle
= find_dissector_add_dependency("eth_withoutfcs", proto_telkonet
);
96 dissector_add_uint("ethertype", ETHERTYPE_TELKONET
, telkonet_handle
);
100 * Editor modelines - https://www.wireshark.org/tools/modelines.html
105 * indent-tabs-mode: t
108 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
109 * :indentSize=8:tabSize=8:noTabs=false: