MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-ipmi-storage.c
blob0141e892180a315b4f1d024e62109f520af4e443
1 /* packet-ipmi-storage.c
2 * Sub-dissectors for IPMI messages (netFn=Storage)
3 * Copyright 2007-2008, Alexey Neyman, Pigeon Point Systems <avn@pigeonpoint.com>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include "config.h"
28 #include <epan/packet.h>
30 #include "packet-ipmi.h"
32 static gint ett_ipmi_stor_10_flags = -1;
33 static gint ett_ipmi_stor_20_ops = -1;
34 static gint ett_ipmi_stor_25_byte6 = -1;
35 static gint ett_ipmi_stor_27_status = -1;
36 static gint ett_ipmi_stor_2c_rq_byte1 = -1;
37 static gint ett_ipmi_stor_2c_rs_byte1 = -1;
38 static gint ett_ipmi_stor_40_ops = -1;
39 static gint ett_ipmi_stor_45_byte6 = -1;
40 static gint ett_ipmi_stor_47_status = -1;
41 static gint ett_ipmi_stor_5a_byte1 = -1;
42 static gint ett_ipmi_stor_5b_byte1 = -1;
44 static gint hf_ipmi_stor_10_fruid = -1;
45 static gint hf_ipmi_stor_10_size = -1;
46 static gint hf_ipmi_stor_10_access = -1;
48 static gint hf_ipmi_stor_11_fruid = -1;
49 static gint hf_ipmi_stor_11_offset = -1;
50 static gint hf_ipmi_stor_11_count = -1;
51 static gint hf_ipmi_stor_11_ret_count = -1;
52 static gint hf_ipmi_stor_11_data = -1;
54 static gint hf_ipmi_stor_12_fruid = -1;
55 static gint hf_ipmi_stor_12_offset = -1;
56 static gint hf_ipmi_stor_12_data = -1;
57 static gint hf_ipmi_stor_12_ret_count = -1;
59 static gint hf_ipmi_stor_20_sdr_version = -1;
60 static gint hf_ipmi_stor_20_rec_count = -1;
61 static gint hf_ipmi_stor_20_free_space = -1;
62 static gint hf_ipmi_stor_20_ts_add = -1;
63 static gint hf_ipmi_stor_20_ts_erase = -1;
64 static gint hf_ipmi_stor_20_op_overflow = -1;
65 static gint hf_ipmi_stor_20_op_update = -1;
66 static gint hf_ipmi_stor_20_op_delete = -1;
67 static gint hf_ipmi_stor_20_op_partial_add = -1;
68 static gint hf_ipmi_stor_20_op_reserve = -1;
69 static gint hf_ipmi_stor_20_op_allocinfo = -1;
71 static gint hf_ipmi_stor_21_units = -1;
72 static gint hf_ipmi_stor_21_size = -1;
73 static gint hf_ipmi_stor_21_free = -1;
74 static gint hf_ipmi_stor_21_largest = -1;
75 static gint hf_ipmi_stor_21_maxrec = -1;
77 static gint hf_ipmi_stor_22_rsrv_id = -1;
79 static gint hf_ipmi_stor_23_rsrv_id = -1;
80 static gint hf_ipmi_stor_23_rec_id = -1;
81 static gint hf_ipmi_stor_23_offset = -1;
82 static gint hf_ipmi_stor_23_count = -1;
83 static gint hf_ipmi_stor_23_next = -1;
84 static gint hf_ipmi_stor_23_data = -1;
86 static gint hf_ipmi_stor_24_data = -1;
87 static gint hf_ipmi_stor_24_added_rec_id = -1;
89 static gint hf_ipmi_stor_25_rsrv_id = -1;
90 static gint hf_ipmi_stor_25_rec_id = -1;
91 static gint hf_ipmi_stor_25_offset = -1;
92 static gint hf_ipmi_stor_25_inprogress = -1;
93 static gint hf_ipmi_stor_25_data = -1;
94 static gint hf_ipmi_stor_25_added_rec_id = -1;
96 #if 0
97 static gint hf_ipmi_stor_26_rsrv_id = -1;
98 static gint hf_ipmi_stor_26_rec_id = -1;
99 #endif
100 static gint hf_ipmi_stor_26_del_rec_id = -1;
102 static gint hf_ipmi_stor_27_rsrv_id = -1;
103 static gint hf_ipmi_stor_27_clr = -1;
104 static gint hf_ipmi_stor_27_action = -1;
105 static gint hf_ipmi_stor_27_status = -1;
107 static gint hf_ipmi_stor_28_time = -1;
109 static gint hf_ipmi_stor_29_time = -1;
111 static gint hf_ipmi_stor_2c_init_agent = -1;
112 static gint hf_ipmi_stor_2c_init_state = -1;
114 static gint hf_ipmi_stor_40_sel_version = -1;
115 static gint hf_ipmi_stor_40_entries = -1;
116 static gint hf_ipmi_stor_40_free_space = -1;
117 static gint hf_ipmi_stor_40_ts_add = -1;
118 static gint hf_ipmi_stor_40_ts_erase = -1;
119 static gint hf_ipmi_stor_40_op_overflow = -1;
120 static gint hf_ipmi_stor_40_op_delete = -1;
121 static gint hf_ipmi_stor_40_op_partial_add = -1;
122 static gint hf_ipmi_stor_40_op_reserve = -1;
123 static gint hf_ipmi_stor_40_op_allocinfo = -1;
125 static gint hf_ipmi_stor_41_units = -1;
126 static gint hf_ipmi_stor_41_size = -1;
127 static gint hf_ipmi_stor_41_free = -1;
128 static gint hf_ipmi_stor_41_largest = -1;
129 static gint hf_ipmi_stor_41_maxrec = -1;
131 static gint hf_ipmi_stor_42_rsrv_id = -1;
133 static gint hf_ipmi_stor_43_rsrv_id = -1;
134 static gint hf_ipmi_stor_43_rec_id = -1;
135 static gint hf_ipmi_stor_43_offset = -1;
136 static gint hf_ipmi_stor_43_count = -1;
137 static gint hf_ipmi_stor_43_next = -1;
138 static gint hf_ipmi_stor_43_data = -1;
140 static gint hf_ipmi_stor_44_data = -1;
141 static gint hf_ipmi_stor_44_added_rec_id = -1;
143 static gint hf_ipmi_stor_45_rsrv_id = -1;
144 static gint hf_ipmi_stor_45_rec_id = -1;
145 static gint hf_ipmi_stor_45_offset = -1;
146 static gint hf_ipmi_stor_45_inprogress = -1;
147 static gint hf_ipmi_stor_45_data = -1;
148 static gint hf_ipmi_stor_45_added_rec_id = -1;
150 #if 0
151 static gint hf_ipmi_stor_46_rsrv_id = -1;
152 static gint hf_ipmi_stor_46_rec_id = -1;
153 #endif
154 static gint hf_ipmi_stor_46_del_rec_id = -1;
156 static gint hf_ipmi_stor_47_rsrv_id = -1;
157 static gint hf_ipmi_stor_47_clr = -1;
158 static gint hf_ipmi_stor_47_action = -1;
159 static gint hf_ipmi_stor_47_status = -1;
161 static gint hf_ipmi_stor_48_time = -1;
163 static gint hf_ipmi_stor_49_time = -1;
165 static gint hf_ipmi_stor_5a_log_type = -1;
166 static gint hf_ipmi_stor_5a_ts_add = -1;
167 static gint hf_ipmi_stor_5a_num_entries = -1;
168 static gint hf_ipmi_stor_5a_iana = -1;
169 static gint hf_ipmi_stor_5a_bytes = -1;
170 static gint hf_ipmi_stor_5a_unknown = -1;
172 static gint hf_ipmi_stor_5b_log_type = -1;
173 static gint hf_ipmi_stor_5b_ts_add = -1;
174 static gint hf_ipmi_stor_5b_num_entries = -1;
175 static gint hf_ipmi_stor_5b_iana = -1;
176 static gint hf_ipmi_stor_5b_bytes = -1;
177 static gint hf_ipmi_stor_5b_unknown = -1;
179 static const struct true_false_string tfs_10_access = {
180 "by words", "by bytes"
183 static const value_string vals_20_update[] = {
184 { 0x00, "Unspecified" },
185 { 0x01, "Supported non-modal" },
186 { 0x02, "Supported modal" },
187 { 0x03, "Supported both modal and non-modal" },
188 { 0, NULL }
191 static const value_string vals_25_inprogress[] = {
192 { 0x00, "Partial add in progress" },
193 { 0x01, "Last record data being transferred" },
194 { 0, NULL }
197 static const value_string vals_27_action[] = {
198 { 0x00, "Get Erasure Status" },
199 { 0xaa, "Initiate Erase" },
200 { 0, NULL }
203 static const value_string vals_27_status[] = {
204 { 0x00, "Erasure in progress" },
205 { 0x01, "Erase completed" },
206 { 0, NULL }
209 static const struct true_false_string tfs_2c_init_agent = {
210 "Run", "Get status"
213 static const struct true_false_string tfs_2c_init_state = {
214 "Completed", "In progress"
217 static const value_string vals_45_inprogress[] = {
218 { 0x00, "Partial add in progress" },
219 { 0x01, "Last record data being transferred" },
220 { 0, NULL }
223 static const value_string vals_47_action[] = {
224 { 0x00, "Get Erasure Status" },
225 { 0xaa, "Initiate Erase" },
226 { 0, NULL }
229 static const value_string vals_47_status[] = {
230 { 0x00, "Erasure in progress" },
231 { 0x01, "Erase completed" },
232 { 0, NULL }
235 static const value_string log_type_vals[] = {
236 { 0x00, "MCA Log" },
237 { 0x01, "OEM 1" },
238 { 0x02, "OEM 2" },
239 { 0, NULL }
242 /* Get FRU Inventory Area Info
244 static void
245 rq10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
247 proto_tree_add_item(tree, hf_ipmi_stor_10_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
250 static void
251 rs10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
253 static const int *flags[] = { &hf_ipmi_stor_10_access, NULL };
255 proto_tree_add_item(tree, hf_ipmi_stor_10_size, tvb, 0, 2, ENC_LITTLE_ENDIAN);
256 proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_stor_10_flags, flags, ENC_LITTLE_ENDIAN, 0);
259 /* Read FRU Data
261 static void
262 rq11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
264 proto_tree_add_item(tree, hf_ipmi_stor_11_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
265 proto_tree_add_item(tree, hf_ipmi_stor_11_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN);
266 proto_tree_add_item(tree, hf_ipmi_stor_11_count, tvb, 3, 1, ENC_LITTLE_ENDIAN);
269 static void
270 rs11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
272 proto_tree_add_item(tree, hf_ipmi_stor_11_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN);
273 proto_tree_add_item(tree, hf_ipmi_stor_11_data, tvb, 1, tvb_length(tvb) - 1, ENC_NA);
276 static const value_string cc11[] = {
277 { 0x81, "FRU Device Busy" },
278 { 0, NULL }
281 /* Write FRU Data
283 static void
284 rq12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
286 proto_tree_add_item(tree, hf_ipmi_stor_12_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
287 proto_tree_add_item(tree, hf_ipmi_stor_12_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN);
288 proto_tree_add_item(tree, hf_ipmi_stor_12_data, tvb, 1, tvb_length(tvb) - 1, ENC_NA);
291 static void
292 rs12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
294 proto_tree_add_item(tree, hf_ipmi_stor_12_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN);
297 static const value_string cc12[] = {
298 { 0x80, "Write-protected offset" },
299 { 0x81, "FRU Device Busy" },
300 { 0, NULL }
303 /* Get SDR Repository Info
305 static void
306 rs20(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
308 static const int *ops[] = { &hf_ipmi_stor_20_op_overflow, &hf_ipmi_stor_20_op_update,
309 &hf_ipmi_stor_20_op_delete, &hf_ipmi_stor_20_op_partial_add, &hf_ipmi_stor_20_op_reserve,
310 &hf_ipmi_stor_20_op_allocinfo, NULL };
312 proto_tree_add_item(tree, hf_ipmi_stor_20_sdr_version, tvb, 0, 1, ENC_LITTLE_ENDIAN);
313 proto_tree_add_item(tree, hf_ipmi_stor_20_rec_count, tvb, 1, 2, ENC_LITTLE_ENDIAN);
314 proto_tree_add_item(tree, hf_ipmi_stor_20_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN);
315 ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_add, tvb, 5);
316 ipmi_add_timestamp(tree, hf_ipmi_stor_20_ts_erase, tvb, 9);
317 proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL,
318 ett_ipmi_stor_20_ops, ops, ENC_LITTLE_ENDIAN, 0);
321 /* Get SDR Repository Allocation Info
323 static void
324 rs21(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
326 proto_tree_add_item(tree, hf_ipmi_stor_21_units, tvb, 0, 2, ENC_LITTLE_ENDIAN);
327 proto_tree_add_item(tree, hf_ipmi_stor_21_size, tvb, 2, 2, ENC_LITTLE_ENDIAN);
328 proto_tree_add_item(tree, hf_ipmi_stor_21_free, tvb, 4, 2, ENC_LITTLE_ENDIAN);
329 proto_tree_add_item(tree, hf_ipmi_stor_21_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN);
330 proto_tree_add_item(tree, hf_ipmi_stor_21_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN);
333 /* Reserve SDR Repository
335 static void
336 rs22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
338 proto_tree_add_item(tree, hf_ipmi_stor_22_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
341 /* Get SDR
343 static void
344 rq23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
346 guint8 v = tvb_get_guint8(tvb, 5);
348 proto_tree_add_item(tree, hf_ipmi_stor_23_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
349 proto_tree_add_item(tree, hf_ipmi_stor_23_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
350 proto_tree_add_item(tree, hf_ipmi_stor_23_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
351 proto_tree_add_uint_format_value(tree, hf_ipmi_stor_23_count, tvb, 5, 1,
352 v, "%d%s", v, v == 0xff ? " (entire record)" : "");
355 static void
356 rs23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
358 proto_tree_add_item(tree, hf_ipmi_stor_23_next, tvb, 0, 2, ENC_LITTLE_ENDIAN);
359 proto_tree_add_item(tree, hf_ipmi_stor_23_data, tvb, 2, tvb_length(tvb) - 2, ENC_NA);
362 /* Add SDR
364 static void
365 rq24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
367 proto_tree_add_item(tree, hf_ipmi_stor_24_data, tvb, 0, tvb_length(tvb), ENC_NA);
370 static void
371 rs24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
373 proto_tree_add_item(tree, hf_ipmi_stor_24_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
376 /* Partial Add SDR
378 static void
379 rq25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
381 static const int *byte6[] = { &hf_ipmi_stor_25_inprogress, NULL };
383 proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
384 proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
385 proto_tree_add_item(tree, hf_ipmi_stor_25_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
386 proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL,
387 ett_ipmi_stor_25_byte6, byte6, ENC_LITTLE_ENDIAN, 0);
388 proto_tree_add_item(tree, hf_ipmi_stor_25_data, tvb, 6, tvb_length(tvb) - 6, ENC_NA);
391 static void
392 rs25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
394 proto_tree_add_item(tree, hf_ipmi_stor_25_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
397 static const value_string cc25[] = {
398 { 0x80, "Record rejected due to length mismatch" },
399 { 0, NULL }
402 /* Delete SDR
404 static void
405 rq26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
407 proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
408 proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
411 static void
412 rs26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
414 proto_tree_add_item(tree, hf_ipmi_stor_26_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
417 /* Clear SDR Repository
419 static void
420 rq27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
422 proto_tree_add_item(tree, hf_ipmi_stor_27_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
423 proto_tree_add_item(tree, hf_ipmi_stor_27_clr, tvb, 2, 3, ENC_ASCII|ENC_NA);
424 proto_tree_add_item(tree, hf_ipmi_stor_27_action, tvb, 5, 1, ENC_LITTLE_ENDIAN);
427 static void
428 rs27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
430 static const int *status[] = { &hf_ipmi_stor_27_status, NULL };
432 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
433 ett_ipmi_stor_27_status, status, ENC_LITTLE_ENDIAN, 0);
436 /* Get SDR Repository Time
438 static void
439 rs28(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
441 ipmi_add_timestamp(tree, hf_ipmi_stor_28_time, tvb, 0);
444 /* Set SDR Repository Time
446 static void
447 rq29(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
449 ipmi_add_timestamp(tree, hf_ipmi_stor_29_time, tvb, 0);
452 /* Run Initialization Agent
454 static void
455 rq2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
457 static const int *byte1[] = { &hf_ipmi_stor_2c_init_agent, NULL };
459 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
460 ett_ipmi_stor_2c_rq_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
463 static void
464 rs2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
466 static const int *byte1[] = { &hf_ipmi_stor_2c_init_state, NULL };
468 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
469 ett_ipmi_stor_2c_rs_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
472 /* Get SEL Info
474 static void
475 rs40(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
477 static const int *ops[] = { &hf_ipmi_stor_40_op_overflow, &hf_ipmi_stor_40_op_delete,
478 &hf_ipmi_stor_40_op_partial_add, &hf_ipmi_stor_40_op_reserve, &hf_ipmi_stor_40_op_allocinfo, NULL };
480 proto_tree_add_item(tree, hf_ipmi_stor_40_sel_version, tvb, 0, 1, ENC_LITTLE_ENDIAN);
481 proto_tree_add_item(tree, hf_ipmi_stor_40_entries, tvb, 1, 2, ENC_LITTLE_ENDIAN);
482 proto_tree_add_item(tree, hf_ipmi_stor_40_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN);
483 ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_add, tvb, 5);
484 ipmi_add_timestamp(tree, hf_ipmi_stor_40_ts_erase, tvb, 9);
485 proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL,
486 ett_ipmi_stor_40_ops, ops, ENC_LITTLE_ENDIAN, 0);
489 static const value_string cc40[] = {
490 { 0x81, "Cannot execute command, SEL erase in progress" },
491 { 0, NULL }
494 /* Get SEL Allocation Info
496 static void
497 rs41(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
499 proto_tree_add_item(tree, hf_ipmi_stor_41_units, tvb, 0, 2, ENC_LITTLE_ENDIAN);
500 proto_tree_add_item(tree, hf_ipmi_stor_41_size, tvb, 2, 2, ENC_LITTLE_ENDIAN);
501 proto_tree_add_item(tree, hf_ipmi_stor_41_free, tvb, 4, 2, ENC_LITTLE_ENDIAN);
502 proto_tree_add_item(tree, hf_ipmi_stor_41_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN);
503 proto_tree_add_item(tree, hf_ipmi_stor_41_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN);
506 /* Reserve SEL
508 static void
509 rs42(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
511 proto_tree_add_item(tree, hf_ipmi_stor_42_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
514 static const value_string cc42[] = {
515 { 0x81, "Cannot execute command, SEL erase in progress" },
516 { 0, NULL }
519 /* Get SEL Entry
521 static void
522 rq43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
524 guint8 v = tvb_get_guint8(tvb, 5);
526 proto_tree_add_item(tree, hf_ipmi_stor_43_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
527 proto_tree_add_item(tree, hf_ipmi_stor_43_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
528 proto_tree_add_item(tree, hf_ipmi_stor_43_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
529 proto_tree_add_uint_format_value(tree, hf_ipmi_stor_43_count, tvb, 5, 1,
530 v, "%d%s", v, v == 0xff ? " (entire record)" : "");
533 static void
534 rs43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
536 proto_tree_add_item(tree, hf_ipmi_stor_43_next, tvb, 0, 2, ENC_LITTLE_ENDIAN);
537 proto_tree_add_item(tree, hf_ipmi_stor_43_data, tvb, 2, tvb_length(tvb) - 2, ENC_NA);
540 static const value_string cc43[] = {
541 { 0x81, "Cannot execute command, SEL erase in progress" },
542 { 0, NULL }
545 /* Add SEL Entry
548 static void
549 rq44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
551 proto_tree_add_item(tree, hf_ipmi_stor_44_data, tvb, 0, tvb_length(tvb), ENC_NA);
554 static void
555 rs44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
557 proto_tree_add_item(tree, hf_ipmi_stor_44_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
560 static const value_string cc44[] = {
561 { 0x80, "Operation not supported for this Record Type" },
562 { 0x81, "Cannot execute command, SEL erase in progress" },
563 { 0, NULL }
566 /* Partial Add SEL Entry
568 static void
569 rq45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
571 static const int *byte6[] = { &hf_ipmi_stor_45_inprogress, NULL };
573 proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
574 proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
575 proto_tree_add_item(tree, hf_ipmi_stor_45_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
576 proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL,
577 ett_ipmi_stor_45_byte6, byte6, ENC_LITTLE_ENDIAN, 0);
578 proto_tree_add_item(tree, hf_ipmi_stor_45_data, tvb, 6, tvb_length(tvb) - 6, ENC_NA);
581 static void
582 rs45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
584 proto_tree_add_item(tree, hf_ipmi_stor_45_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
587 static const value_string cc45[] = {
588 { 0x80, "Record rejected due to length mismatch" },
589 { 0x81, "Cannot execute command, SEL erase in progress" },
590 { 0, NULL }
593 /* Delete SEL Entry
595 static void
596 rq46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
598 proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
599 proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
602 static void
603 rs46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
605 proto_tree_add_item(tree, hf_ipmi_stor_46_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
608 static const value_string cc46[] = {
609 { 0x80, "Operation not supported for this Record Type" },
610 { 0x81, "Cannot execute command, SEL erase in progress" },
611 { 0, NULL }
614 /* Clear SEL
616 static void
617 rq47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
619 proto_tree_add_item(tree, hf_ipmi_stor_47_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
620 proto_tree_add_item(tree, hf_ipmi_stor_47_clr, tvb, 2, 3, ENC_ASCII|ENC_NA);
621 proto_tree_add_item(tree, hf_ipmi_stor_47_action, tvb, 5, 1, ENC_LITTLE_ENDIAN);
624 static void
625 rs47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
627 static const int *status[] = { &hf_ipmi_stor_47_status, NULL };
629 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
630 ett_ipmi_stor_47_status, status, ENC_LITTLE_ENDIAN, 0);
633 /* Get SEL Time
635 static void
636 rs48(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
638 ipmi_add_timestamp(tree, hf_ipmi_stor_48_time, tvb, 0);
641 /* Set SEL Time
643 static void
644 rq49(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
646 ipmi_add_timestamp(tree, hf_ipmi_stor_49_time, tvb, 0);
649 /* Get Auxiliary Log Status
651 static void
652 rq5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
654 static const int *byte1[] = { &hf_ipmi_stor_5a_log_type, NULL };
656 if (!tree) {
657 ipmi_setsaveddata(0, tvb_get_guint8(tvb, 0) & 0x0f);
658 return;
661 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
662 ett_ipmi_stor_5a_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
665 static void
666 rs5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
668 guint32 v;
670 if (!ipmi_getsaveddata(0, &v) || v > 2) {
671 proto_tree_add_item(tree, hf_ipmi_stor_5a_unknown, tvb, 0, tvb_length(tvb), ENC_NA);
672 return;
675 ipmi_add_timestamp(tree, hf_ipmi_stor_5a_ts_add, tvb, 0);
676 if (v == 0) {
677 proto_tree_add_item(tree, hf_ipmi_stor_5a_num_entries, tvb, 4, 4, ENC_LITTLE_ENDIAN);
678 } else if (v == 1 || v == 2) {
679 proto_tree_add_item(tree, hf_ipmi_stor_5a_iana, tvb, 4, 3, ENC_LITTLE_ENDIAN);
680 proto_tree_add_item(tree, hf_ipmi_stor_5a_bytes, tvb, 7, 7, ENC_NA);
684 /* Set Auxiliary Log Status
686 static void
687 rq5b(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
689 static const int *byte1[] = { &hf_ipmi_stor_5b_log_type, NULL };
690 guint8 v = tvb_get_guint8(tvb, 0);
692 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
693 ett_ipmi_stor_5b_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
695 if (v > 2) {
696 proto_tree_add_item(tree, hf_ipmi_stor_5b_unknown, tvb, 1, tvb_length(tvb) - 1, ENC_NA);
697 return;
700 ipmi_add_timestamp(tree, hf_ipmi_stor_5b_ts_add, tvb, 1);
701 if (v == 0) {
702 proto_tree_add_item(tree, hf_ipmi_stor_5b_num_entries, tvb, 5, 4, ENC_LITTLE_ENDIAN);
703 } else if (v == 1 || v == 2) {
704 proto_tree_add_item(tree, hf_ipmi_stor_5b_iana, tvb, 5, 3, ENC_LITTLE_ENDIAN);
705 proto_tree_add_item(tree, hf_ipmi_stor_5b_bytes, tvb, 8, 8, ENC_NA);
709 static ipmi_cmd_t cmd_storage[] = {
710 /* FRU Device Commands */
711 { 0x10, rq10, rs10, NULL, NULL, "Get FRU Inventory Area Info", 0 },
712 { 0x11, rq11, rs11, cc11, NULL, "Read FRU Data", 0 },
713 { 0x12, rq12, rs12, cc12, NULL, "Write FRU Data", 0 },
715 /* SDR Device Commands */
716 { 0x20, NULL, rs20, NULL, NULL, "Get SDR Repository Info", 0 },
717 { 0x21, NULL, rs21, NULL, NULL, "Get SDR Repository Allocation Info", 0 },
718 { 0x22, NULL, rs22, NULL, NULL, "Reserve SDR Repository", 0 },
719 { 0x23, rq23, rs23, NULL, NULL, "Get SDR", 0 },
720 { 0x24, rq24, rs24, NULL, NULL, "Add SDR", 0 },
721 { 0x25, rq25, rs25, cc25, NULL, "Partial Add SDR", 0 },
722 { 0x26, rq26, rs26, NULL, NULL, "Delete SDR", 0 },
723 { 0x27, rq27, rs27, NULL, NULL, "Clear SDR Repository", 0 },
724 { 0x28, NULL, rs28, NULL, NULL, "Get SDR Repository Time", 0 },
725 { 0x29, rq29, NULL, NULL, NULL, "Set SDR Repository Time", 0 },
726 { 0x2a, NULL, NULL, NULL, NULL, "Enter SDR Repository Update Mode", 0 },
727 { 0x2b, NULL, NULL, NULL, NULL, "Exit SDR Repository Update Mode", 0 },
728 { 0x2c, rq2c, rs2c, NULL, NULL, "Run Initialization Agent", 0 },
730 /* SEL Device Commands */
731 { 0x40, NULL, rs40, cc40, NULL, "Get SEL Info", 0 },
732 { 0x41, NULL, rs41, NULL, NULL, "Get SEL Allocation Info", 0 },
733 { 0x42, NULL, rs42, cc42, NULL, "Reserve SEL", 0 },
734 { 0x43, rq43, rs43, cc43, NULL, "Get SEL Entry", 0 },
735 { 0x44, rq44, rs44, cc44, NULL, "Add SEL Entry", 0 },
736 { 0x45, rq45, rs45, cc45, NULL, "Partial Add SEL Entry", 0 },
737 { 0x46, rq46, rs46, cc46, NULL, "Delete SEL Entry", 0 },
738 { 0x47, rq47, rs47, NULL, NULL, "Clear SEL", 0 },
739 { 0x48, NULL, rs48, NULL, NULL, "Get SEL Time", 0 },
740 { 0x49, rq49, NULL, NULL, NULL, "Set SEL Time", 0 },
741 { 0x5a, rq5a, rs5a, NULL, NULL, "Get Auxiliary Log Status", CMD_CALLRQ },
742 { 0x5b, rq5b, NULL, NULL, NULL, "Set Auxiliary Log Status", 0 },
743 { 0x5c, IPMI_TBD, NULL, NULL, "Get SEL Time UTC Offset", 0 },
744 { 0x5d, IPMI_TBD, NULL, NULL, "Set SEL Time UTC Offset", 0 },
747 void
748 ipmi_register_storage(gint proto_ipmi)
750 static hf_register_info hf[] = {
751 { &hf_ipmi_stor_10_fruid,
752 { "FRU ID",
753 "ipmi.st10.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
754 { &hf_ipmi_stor_10_size,
755 { "FRU Inventory area size",
756 "ipmi.st10.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
757 { &hf_ipmi_stor_10_access,
758 { "Device is accessed",
759 "ipmi.st10.access", FT_BOOLEAN, 8, TFS(&tfs_10_access), 0x01, NULL, HFILL }},
761 { &hf_ipmi_stor_11_fruid,
762 { "FRU ID",
763 "ipmi.st11.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
764 { &hf_ipmi_stor_11_offset,
765 { "Offset to read",
766 "ipmi.st11.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
767 { &hf_ipmi_stor_11_count,
768 { "Count to read",
769 "ipmi.st11.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
770 { &hf_ipmi_stor_11_ret_count,
771 { "Returned count",
772 "ipmi.st11.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
773 { &hf_ipmi_stor_11_data,
774 { "Requested data",
775 "ipmi.st11.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
777 { &hf_ipmi_stor_12_fruid,
778 { "FRU ID",
779 "ipmi.st12.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
780 { &hf_ipmi_stor_12_offset,
781 { "Offset to read",
782 "ipmi.st12.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
783 { &hf_ipmi_stor_12_data,
784 { "Requested data",
785 "ipmi.st12.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
786 { &hf_ipmi_stor_12_ret_count,
787 { "Returned count",
788 "ipmi.st12.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
790 { &hf_ipmi_stor_20_sdr_version,
791 { "SDR Version",
792 "ipmi.st20.sdr_version", FT_UINT8, BASE_CUSTOM, ipmi_fmt_version, 0, NULL, HFILL }},
793 { &hf_ipmi_stor_20_rec_count,
794 { "Record Count",
795 "ipmi.st20.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
796 { &hf_ipmi_stor_20_free_space,
797 { "Free Space",
798 "ipmi.st20.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
799 { &hf_ipmi_stor_20_ts_add,
800 { "Most recent addition timestamp",
801 "ipmi.st20.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
802 { &hf_ipmi_stor_20_ts_erase,
803 { "Most recent erase timestamp",
804 "ipmi.st20.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
805 { &hf_ipmi_stor_20_op_overflow,
806 { "Overflow",
807 "ipmi.st20.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
808 { &hf_ipmi_stor_20_op_update,
809 { "SDR Repository Update",
810 "ipmi.st20.op_update", FT_UINT8, BASE_HEX, vals_20_update, 0x60, NULL, HFILL }},
811 { &hf_ipmi_stor_20_op_delete,
812 { "Delete SDR",
813 "ipmi.st20.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
814 { &hf_ipmi_stor_20_op_partial_add,
815 { "Partial Add SDR",
816 "ipmi.st20.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
817 { &hf_ipmi_stor_20_op_reserve,
818 { "Reserve SDR Repository",
819 "ipmi.st20.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
820 { &hf_ipmi_stor_20_op_allocinfo,
821 { "Get SDR Repository Allocation Info",
822 "ipmi.st20.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
824 { &hf_ipmi_stor_21_units,
825 { "Number of allocation units",
826 "ipmi.st21.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
827 { &hf_ipmi_stor_21_size,
828 { "Allocation unit size",
829 "ipmi.st21.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
830 { &hf_ipmi_stor_21_free,
831 { "Number of free units",
832 "ipmi.st21.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
833 { &hf_ipmi_stor_21_largest,
834 { "Largest free block (in units)",
835 "ipmi.st21.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
836 { &hf_ipmi_stor_21_maxrec,
837 { "Maximum record size (in units)",
838 "ipmi.st21.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
840 { &hf_ipmi_stor_22_rsrv_id,
841 { "Reservation ID",
842 "ipmi.st22.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
844 { &hf_ipmi_stor_23_rsrv_id,
845 { "Reservation ID",
846 "ipmi.st23.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
847 { &hf_ipmi_stor_23_rec_id,
848 { "Record ID",
849 "ipmi.st23.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
850 { &hf_ipmi_stor_23_offset,
851 { "Offset into record",
852 "ipmi.st23.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
853 { &hf_ipmi_stor_23_count,
854 { "Bytes to read",
855 "ipmi.st23.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
856 { &hf_ipmi_stor_23_next,
857 { "Next Record ID",
858 "ipmi.st23.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
859 { &hf_ipmi_stor_23_data,
860 { "Record Data",
861 "ipmi.st23.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
863 { &hf_ipmi_stor_24_data,
864 { "SDR Data",
865 "ipmi.st24.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
866 { &hf_ipmi_stor_24_added_rec_id,
867 { "Record ID for added record",
868 "ipmi.st23.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
870 { &hf_ipmi_stor_25_rsrv_id,
871 { "Reservation ID",
872 "ipmi.st25.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
873 { &hf_ipmi_stor_25_rec_id,
874 { "Record ID",
875 "ipmi.st25.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
876 { &hf_ipmi_stor_25_offset,
877 { "Offset into record",
878 "ipmi.st25.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
879 { &hf_ipmi_stor_25_inprogress,
880 { "In progress",
881 "ipmi.st25.inprogress", FT_UINT8, BASE_HEX, vals_25_inprogress, 0x0f, NULL, HFILL }},
882 { &hf_ipmi_stor_25_data,
883 { "SDR Data",
884 "ipmi.st25.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
885 { &hf_ipmi_stor_25_added_rec_id,
886 { "Record ID for added record",
887 "ipmi.st25.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
889 #if 0
890 { &hf_ipmi_stor_26_rsrv_id,
891 { "Reservation ID",
892 "ipmi.st26.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
894 { &hf_ipmi_stor_26_rec_id,
895 { "Record ID",
896 "ipmi.st26.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
897 #endif
898 { &hf_ipmi_stor_26_del_rec_id,
899 { "Deleted Record ID",
900 "ipmi.st26.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
902 { &hf_ipmi_stor_27_rsrv_id,
903 { "Reservation ID",
904 "ipmi.st27.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
905 { &hf_ipmi_stor_27_clr,
906 { "Confirmation (should be CLR)",
907 "ipmi.st27.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
908 { &hf_ipmi_stor_27_action,
909 { "Action",
910 "ipmi.st27.action", FT_UINT8, BASE_HEX, vals_27_action, 0, NULL, HFILL }},
911 { &hf_ipmi_stor_27_status,
912 { "Erasure Status",
913 "ipmi.st27.status", FT_UINT8, BASE_HEX, vals_27_status, 0x0f, NULL, HFILL }},
915 { &hf_ipmi_stor_28_time,
916 { "Time",
917 "ipmi.st28.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
919 { &hf_ipmi_stor_29_time,
920 { "Time",
921 "ipmi.st29.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
923 { &hf_ipmi_stor_2c_init_agent,
924 { "Initialization agent",
925 "ipmi.st2c.init_agent", FT_BOOLEAN, 8, TFS(&tfs_2c_init_agent), 0x01, NULL, HFILL }},
926 { &hf_ipmi_stor_2c_init_state,
927 { "Initialization",
928 "ipmi.st2c.init_state", FT_BOOLEAN, 8, TFS(&tfs_2c_init_state), 0x01, NULL, HFILL }},
930 { &hf_ipmi_stor_40_sel_version,
931 { "SEL Version",
932 "ipmi.st40.sel_version", FT_UINT8, BASE_CUSTOM, ipmi_fmt_version, 0, NULL, HFILL }},
933 { &hf_ipmi_stor_40_entries,
934 { "Entries",
935 "ipmi.st40.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
936 { &hf_ipmi_stor_40_free_space,
937 { "Free Space",
938 "ipmi.st40.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
939 { &hf_ipmi_stor_40_ts_add,
940 { "Most recent addition timestamp",
941 "ipmi.st40.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
942 { &hf_ipmi_stor_40_ts_erase,
943 { "Most recent erase timestamp",
944 "ipmi.st40.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
945 { &hf_ipmi_stor_40_op_overflow,
946 { "Overflow",
947 "ipmi.st40.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
948 { &hf_ipmi_stor_40_op_delete,
949 { "Delete SEL",
950 "ipmi.st40.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
951 { &hf_ipmi_stor_40_op_partial_add,
952 { "Partial Add SEL Entry",
953 "ipmi.st40.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
954 { &hf_ipmi_stor_40_op_reserve,
955 { "Reserve SEL",
956 "ipmi.st40.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
957 { &hf_ipmi_stor_40_op_allocinfo,
958 { "Get SEL Allocation Info",
959 "ipmi.st40.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
961 { &hf_ipmi_stor_41_units,
962 { "Number of allocation units",
963 "ipmi.st41.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
964 { &hf_ipmi_stor_41_size,
965 { "Allocation unit size",
966 "ipmi.st41.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
967 { &hf_ipmi_stor_41_free,
968 { "Number of free units",
969 "ipmi.st41.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
970 { &hf_ipmi_stor_41_largest,
971 { "Largest free block (in units)",
972 "ipmi.st41.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
973 { &hf_ipmi_stor_41_maxrec,
974 { "Maximum record size (in units)",
975 "ipmi.st41.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
977 { &hf_ipmi_stor_42_rsrv_id,
978 { "Reservation ID",
979 "ipmi.st42.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
981 { &hf_ipmi_stor_43_rsrv_id,
982 { "Reservation ID",
983 "ipmi.st43.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
984 { &hf_ipmi_stor_43_rec_id,
985 { "Record ID",
986 "ipmi.st43.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
987 { &hf_ipmi_stor_43_offset,
988 { "Offset into record",
989 "ipmi.st43.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
990 { &hf_ipmi_stor_43_count,
991 { "Bytes to read",
992 "ipmi.st43.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
993 { &hf_ipmi_stor_43_next,
994 { "Next Record ID",
995 "ipmi.st43.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
996 { &hf_ipmi_stor_43_data,
997 { "Record Data",
998 "ipmi.st43.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1000 { &hf_ipmi_stor_44_data,
1001 { "SDR Data",
1002 "ipmi.st44.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1003 { &hf_ipmi_stor_44_added_rec_id,
1004 { "Record ID for added record",
1005 "ipmi.st43.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1007 { &hf_ipmi_stor_45_rsrv_id,
1008 { "Reservation ID",
1009 "ipmi.st45.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1010 { &hf_ipmi_stor_45_rec_id,
1011 { "Record ID",
1012 "ipmi.st45.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1013 { &hf_ipmi_stor_45_offset,
1014 { "Offset into record",
1015 "ipmi.st45.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1016 { &hf_ipmi_stor_45_inprogress,
1017 { "In progress",
1018 "ipmi.st45.inprogress", FT_UINT8, BASE_HEX, vals_45_inprogress, 0x0f, NULL, HFILL }},
1019 { &hf_ipmi_stor_45_data,
1020 { "Record Data",
1021 "ipmi.st45.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1022 { &hf_ipmi_stor_45_added_rec_id,
1023 { "Record ID for added record",
1024 "ipmi.st45.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1026 #if 0
1027 { &hf_ipmi_stor_46_rsrv_id,
1028 { "Reservation ID",
1029 "ipmi.st46.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1031 { &hf_ipmi_stor_46_rec_id,
1032 { "Record ID",
1033 "ipmi.st46.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1034 #endif
1035 { &hf_ipmi_stor_46_del_rec_id,
1036 { "Deleted Record ID",
1037 "ipmi.st46.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1039 { &hf_ipmi_stor_47_rsrv_id,
1040 { "Reservation ID",
1041 "ipmi.st47.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1042 { &hf_ipmi_stor_47_clr,
1043 { "Confirmation (should be CLR)",
1044 "ipmi.st47.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1045 { &hf_ipmi_stor_47_action,
1046 { "Action",
1047 "ipmi.st47.action", FT_UINT8, BASE_HEX, vals_47_action, 0, NULL, HFILL }},
1048 { &hf_ipmi_stor_47_status,
1049 { "Erasure Status",
1050 "ipmi.st47.status", FT_UINT8, BASE_HEX, vals_47_status, 0x0f, NULL, HFILL }},
1052 { &hf_ipmi_stor_48_time,
1053 { "Time",
1054 "ipmi.st48.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1056 { &hf_ipmi_stor_49_time,
1057 { "Time",
1058 "ipmi.st49.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1060 { &hf_ipmi_stor_5a_log_type,
1061 { "Log type",
1062 "ipmi.st5a.log_type", FT_UINT8, BASE_HEX, log_type_vals, 0x0f, NULL, HFILL }},
1063 { &hf_ipmi_stor_5a_ts_add,
1064 { "Last addition timestamp",
1065 "ipmi.st5a.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1066 { &hf_ipmi_stor_5a_num_entries,
1067 { "Number of entries in MCA Log",
1068 "ipmi.st5a.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1069 { &hf_ipmi_stor_5a_iana,
1070 { "OEM IANA",
1071 "ipmi.st5a.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
1072 { &hf_ipmi_stor_5a_bytes,
1073 { "Log status bytes",
1074 "ipmi.st5a.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1075 { &hf_ipmi_stor_5a_unknown,
1076 { "Unknown log format (cannot parse data)",
1077 "ipmi.st5a.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1079 { &hf_ipmi_stor_5b_log_type,
1080 { "Log type",
1081 "ipmi.st5b.log_type", FT_UINT8, BASE_HEX, log_type_vals, 0x0f, NULL, HFILL }},
1082 { &hf_ipmi_stor_5b_ts_add,
1083 { "Last addition timestamp",
1084 "ipmi.st5b.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1085 { &hf_ipmi_stor_5b_num_entries,
1086 { "Number of entries in MCA Log",
1087 "ipmi.st5b.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1088 { &hf_ipmi_stor_5b_iana,
1089 { "OEM IANA",
1090 "ipmi.st5b.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
1091 { &hf_ipmi_stor_5b_bytes,
1092 { "Log status bytes",
1093 "ipmi.st5b.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1094 { &hf_ipmi_stor_5b_unknown,
1095 { "Unknown log format (cannot parse data)",
1096 "ipmi.st5b.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1099 static gint *ett[] = {
1100 &ett_ipmi_stor_10_flags,
1101 &ett_ipmi_stor_20_ops,
1102 &ett_ipmi_stor_25_byte6,
1103 &ett_ipmi_stor_27_status,
1104 &ett_ipmi_stor_2c_rq_byte1,
1105 &ett_ipmi_stor_2c_rs_byte1,
1106 &ett_ipmi_stor_40_ops,
1107 &ett_ipmi_stor_45_byte6,
1108 &ett_ipmi_stor_47_status,
1109 &ett_ipmi_stor_5a_byte1,
1110 &ett_ipmi_stor_5b_byte1,
1113 proto_register_field_array(proto_ipmi, hf, array_length(hf));
1114 proto_register_subtree_array(ett, array_length(ett));
1115 ipmi_register_netfn_cmdtab(IPMI_STORAGE_REQ, IPMI_OEM_NONE, NULL, 0, NULL,
1116 cmd_storage, array_length(cmd_storage));