2 * Routines for ASF packet dissection
4 * Duncan Laurie <duncan@sun.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * Copied from packet-rmcp.c
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
35 #include <epan/packet.h>
39 * http://www.dmtf.org/standards/standard_alert.php
40 * http://www.dmtf.org/standards/documents/ASF/DSP0136.pdf
43 #define RMCP_CLASS_ASF 0x06
45 static int proto_asf = -1;
46 static int hf_asf_iana = -1;
47 static int hf_asf_type = -1;
48 static int hf_asf_tag = -1;
49 static int hf_asf_len = -1;
51 static dissector_handle_t data_handle;
52 static gint ett_asf = -1;
54 static const value_string asf_type_vals[] = {
57 { 0x12, "Unconditional Power-down" },
58 { 0x13, "Power Cycle" },
59 { 0x40, "Presence Pong" },
60 { 0x41, "Capabilities Response" },
61 { 0x42, "System State Response" },
62 { 0x43, "Open Session Response" },
63 { 0x44, "Close Session Response" },
64 { 0x80, "Presence Ping" },
65 { 0x81, "Capabilities Request" },
66 { 0x82, "System State Request" },
67 { 0x83, "Open Session Request" },
68 { 0x84, "Close Session Request" },
69 { 0xC0, "RAKP Message 1" },
70 { 0xC1, "RAKP Message 2" },
71 { 0xC2, "RAKP Message 3" },
76 dissect_asf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
78 proto_tree *asf_tree = NULL;
84 col_set_str(pinfo->cinfo, COL_PROTOCOL, "ASF");
86 col_clear(pinfo->cinfo, COL_INFO);
88 type = tvb_get_guint8(tvb, 4);
89 len = tvb_get_guint8(tvb, 7);
91 if (check_col(pinfo->cinfo, COL_INFO))
92 col_add_str(pinfo->cinfo, COL_INFO,
93 val_to_str(type, asf_type_vals, "Unknown (0x%02x)"));
96 ti = proto_tree_add_item(tree, proto_asf, tvb, 0, 8, FALSE);
97 asf_tree = proto_item_add_subtree(ti, ett_asf);
98 /* FIXME: resolve enterprise ID */
99 proto_tree_add_item(asf_tree, hf_asf_iana, tvb, 0, 4, FALSE);
100 proto_tree_add_item(asf_tree, hf_asf_type, tvb, 4, 1, FALSE);
101 proto_tree_add_item(asf_tree, hf_asf_tag, tvb, 5, 1, FALSE);
102 proto_tree_add_item(asf_tree, hf_asf_len, tvb, 7, 1, FALSE);
106 next_tvb = tvb_new_subset(tvb, 8, -1, len);
107 call_dissector(data_handle, next_tvb, pinfo, tree);
112 proto_register_asf(void)
114 static hf_register_info hf[] = {
116 "IANA Enterprise Number", "asf.iana",
117 FT_UINT32, BASE_HEX, NULL, 0,
118 "ASF IANA Enterprise Number", HFILL }},
120 "Message Type", "asf.type",
121 FT_UINT8, BASE_HEX, VALS(asf_type_vals), 0,
122 "ASF Message Type", HFILL }},
124 "Message Tag", "asf.tag",
125 FT_UINT8, BASE_HEX, NULL, 0,
126 "ASF Message Tag", HFILL }},
128 "Data Length", "asf.len",
129 FT_UINT8, BASE_DEC, NULL, 0,
130 "ASF Data Length", HFILL }},
132 static gint *ett[] = {
136 proto_asf = proto_register_protocol(
137 "Alert Standard Forum", "ASF", "asf");
139 proto_register_field_array(proto_asf, hf, array_length(hf));
140 proto_register_subtree_array(ett, array_length(ett));
144 proto_reg_handoff_asf(void)
146 dissector_handle_t asf_handle;
148 data_handle = find_dissector("data");
150 asf_handle = create_dissector_handle(dissect_asf, proto_asf);
151 dissector_add("rmcp.class", RMCP_CLASS_ASF, asf_handle);