Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ipmi-storage.c
blob542fc59ca7105f315c9a628dc4cf88f0a834f1d8
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 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <epan/packet.h>
15 #include <epan/tfs.h>
16 #include <wsutil/array.h>
17 #include "packet-ipmi.h"
19 void proto_register_ipmi_storage(void);
21 static int ett_ipmi_stor_10_flags;
22 static int ett_ipmi_stor_20_ops;
23 static int ett_ipmi_stor_25_byte6;
24 static int ett_ipmi_stor_27_status;
25 static int ett_ipmi_stor_2c_rq_byte1;
26 static int ett_ipmi_stor_2c_rs_byte1;
27 static int ett_ipmi_stor_40_ops;
28 static int ett_ipmi_stor_45_byte6;
29 static int ett_ipmi_stor_47_status;
30 static int ett_ipmi_stor_5a_byte1;
31 static int ett_ipmi_stor_5b_byte1;
33 static int hf_ipmi_stor_10_fruid;
34 static int hf_ipmi_stor_10_size;
35 static int hf_ipmi_stor_10_access;
37 static int hf_ipmi_stor_11_fruid;
38 static int hf_ipmi_stor_11_offset;
39 static int hf_ipmi_stor_11_count;
40 static int hf_ipmi_stor_11_ret_count;
41 static int hf_ipmi_stor_11_data;
43 static int hf_ipmi_stor_12_fruid;
44 static int hf_ipmi_stor_12_offset;
45 static int hf_ipmi_stor_12_data;
46 static int hf_ipmi_stor_12_ret_count;
48 static int hf_ipmi_stor_20_sdr_version;
49 static int hf_ipmi_stor_20_rec_count;
50 static int hf_ipmi_stor_20_free_space;
51 static int hf_ipmi_stor_20_ts_add;
52 static int hf_ipmi_stor_20_ts_erase;
53 static int hf_ipmi_stor_20_op_overflow;
54 static int hf_ipmi_stor_20_op_update;
55 static int hf_ipmi_stor_20_op_delete;
56 static int hf_ipmi_stor_20_op_partial_add;
57 static int hf_ipmi_stor_20_op_reserve;
58 static int hf_ipmi_stor_20_op_allocinfo;
60 static int hf_ipmi_stor_21_units;
61 static int hf_ipmi_stor_21_size;
62 static int hf_ipmi_stor_21_free;
63 static int hf_ipmi_stor_21_largest;
64 static int hf_ipmi_stor_21_maxrec;
66 static int hf_ipmi_stor_22_rsrv_id;
68 static int hf_ipmi_stor_23_rsrv_id;
69 static int hf_ipmi_stor_23_rec_id;
70 static int hf_ipmi_stor_23_offset;
71 static int hf_ipmi_stor_23_count;
72 static int hf_ipmi_stor_23_next;
73 static int hf_ipmi_stor_23_data;
75 static int hf_ipmi_stor_24_data;
76 static int hf_ipmi_stor_24_added_rec_id;
78 static int hf_ipmi_stor_25_rsrv_id;
79 static int hf_ipmi_stor_25_rec_id;
80 static int hf_ipmi_stor_25_offset;
81 static int hf_ipmi_stor_25_inprogress;
82 static int hf_ipmi_stor_25_data;
83 static int hf_ipmi_stor_25_added_rec_id;
85 #if 0
86 static int hf_ipmi_stor_26_rsrv_id;
87 static int hf_ipmi_stor_26_rec_id;
88 #endif
89 static int hf_ipmi_stor_26_del_rec_id;
91 static int hf_ipmi_stor_27_rsrv_id;
92 static int hf_ipmi_stor_27_clr;
93 static int hf_ipmi_stor_27_action;
94 static int hf_ipmi_stor_27_status;
96 static int hf_ipmi_stor_28_time;
98 static int hf_ipmi_stor_29_time;
100 static int hf_ipmi_stor_2c_init_agent;
101 static int hf_ipmi_stor_2c_init_state;
103 static int hf_ipmi_stor_40_sel_version;
104 static int hf_ipmi_stor_40_entries;
105 static int hf_ipmi_stor_40_free_space;
106 static int hf_ipmi_stor_40_ts_add;
107 static int hf_ipmi_stor_40_ts_erase;
108 static int hf_ipmi_stor_40_op_overflow;
109 static int hf_ipmi_stor_40_op_delete;
110 static int hf_ipmi_stor_40_op_partial_add;
111 static int hf_ipmi_stor_40_op_reserve;
112 static int hf_ipmi_stor_40_op_allocinfo;
114 static int hf_ipmi_stor_41_units;
115 static int hf_ipmi_stor_41_size;
116 static int hf_ipmi_stor_41_free;
117 static int hf_ipmi_stor_41_largest;
118 static int hf_ipmi_stor_41_maxrec;
120 static int hf_ipmi_stor_42_rsrv_id;
122 static int hf_ipmi_stor_43_rsrv_id;
123 static int hf_ipmi_stor_43_rec_id;
124 static int hf_ipmi_stor_43_offset;
125 static int hf_ipmi_stor_43_count;
126 static int hf_ipmi_stor_43_next;
127 static int hf_ipmi_stor_43_data;
129 static int hf_ipmi_stor_44_data;
130 static int hf_ipmi_stor_44_added_rec_id;
132 static int hf_ipmi_stor_45_rsrv_id;
133 static int hf_ipmi_stor_45_rec_id;
134 static int hf_ipmi_stor_45_offset;
135 static int hf_ipmi_stor_45_inprogress;
136 static int hf_ipmi_stor_45_data;
137 static int hf_ipmi_stor_45_added_rec_id;
139 #if 0
140 static int hf_ipmi_stor_46_rsrv_id;
141 static int hf_ipmi_stor_46_rec_id;
142 #endif
143 static int hf_ipmi_stor_46_del_rec_id;
145 static int hf_ipmi_stor_47_rsrv_id;
146 static int hf_ipmi_stor_47_clr;
147 static int hf_ipmi_stor_47_action;
148 static int hf_ipmi_stor_47_status;
150 static int hf_ipmi_stor_48_time;
152 static int hf_ipmi_stor_49_time;
154 static int hf_ipmi_stor_5a_log_type;
155 static int hf_ipmi_stor_5a_ts_add;
156 static int hf_ipmi_stor_5a_num_entries;
157 static int hf_ipmi_stor_5a_iana;
158 static int hf_ipmi_stor_5a_bytes;
159 static int hf_ipmi_stor_5a_unknown;
161 static int hf_ipmi_stor_5b_log_type;
162 static int hf_ipmi_stor_5b_ts_add;
163 static int hf_ipmi_stor_5b_num_entries;
164 static int hf_ipmi_stor_5b_iana;
165 static int hf_ipmi_stor_5b_bytes;
166 static int hf_ipmi_stor_5b_unknown;
168 static const struct true_false_string tfs_10_access = {
169 "by words", "by bytes"
172 static const value_string vals_20_update[] = {
173 { 0x00, "Unspecified" },
174 { 0x01, "Supported non-modal" },
175 { 0x02, "Supported modal" },
176 { 0x03, "Supported both modal and non-modal" },
177 { 0, NULL }
180 static const value_string vals_25_inprogress[] = {
181 { 0x00, "Partial add in progress" },
182 { 0x01, "Last record data being transferred" },
183 { 0, NULL }
186 static const value_string vals_27_action[] = {
187 { 0x00, "Get Erasure Status" },
188 { 0xaa, "Initiate Erase" },
189 { 0, NULL }
192 static const value_string vals_27_status[] = {
193 { 0x00, "Erasure in progress" },
194 { 0x01, "Erase completed" },
195 { 0, NULL }
198 static const struct true_false_string tfs_2c_init_agent = {
199 "Run", "Get status"
202 static const struct true_false_string tfs_2c_init_state = {
203 "Completed", "In progress"
206 static const value_string vals_45_inprogress[] = {
207 { 0x00, "Partial add in progress" },
208 { 0x01, "Last record data being transferred" },
209 { 0, NULL }
212 static const value_string vals_47_action[] = {
213 { 0x00, "Get Erasure Status" },
214 { 0xaa, "Initiate Erase" },
215 { 0, NULL }
218 static const value_string vals_47_status[] = {
219 { 0x00, "Erasure in progress" },
220 { 0x01, "Erase completed" },
221 { 0, NULL }
224 static const value_string log_type_vals[] = {
225 { 0x00, "MCA Log" },
226 { 0x01, "OEM 1" },
227 { 0x02, "OEM 2" },
228 { 0, NULL }
231 /* Get FRU Inventory Area Info
233 static void
234 rq10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
236 proto_tree_add_item(tree, hf_ipmi_stor_10_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
239 static void
240 rs10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
242 static int * const flags[] = { &hf_ipmi_stor_10_access, NULL };
244 proto_tree_add_item(tree, hf_ipmi_stor_10_size, tvb, 0, 2, ENC_LITTLE_ENDIAN);
245 proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_stor_10_flags, flags, ENC_LITTLE_ENDIAN, 0);
248 /* Read FRU Data
250 static void
251 rq11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
253 proto_tree_add_item(tree, hf_ipmi_stor_11_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
254 proto_tree_add_item(tree, hf_ipmi_stor_11_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN);
255 proto_tree_add_item(tree, hf_ipmi_stor_11_count, tvb, 3, 1, ENC_LITTLE_ENDIAN);
258 static void
259 rs11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
261 proto_tree_add_item(tree, hf_ipmi_stor_11_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN);
262 proto_tree_add_item(tree, hf_ipmi_stor_11_data, tvb, 1, -1, ENC_NA);
265 static const value_string cc11[] = {
266 { 0x81, "FRU Device Busy" },
267 { 0, NULL }
270 /* Write FRU Data
272 static void
273 rq12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
275 proto_tree_add_item(tree, hf_ipmi_stor_12_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN);
276 proto_tree_add_item(tree, hf_ipmi_stor_12_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN);
277 proto_tree_add_item(tree, hf_ipmi_stor_12_data, tvb, 3, -1, ENC_NA);
280 static void
281 rs12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
283 proto_tree_add_item(tree, hf_ipmi_stor_12_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN);
286 static const value_string cc12[] = {
287 { 0x80, "Write-protected offset" },
288 { 0x81, "FRU Device Busy" },
289 { 0, NULL }
292 /* Get SDR Repository Info
294 static void
295 rs20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
297 static int * const ops[] = { &hf_ipmi_stor_20_op_overflow, &hf_ipmi_stor_20_op_update,
298 &hf_ipmi_stor_20_op_delete, &hf_ipmi_stor_20_op_partial_add, &hf_ipmi_stor_20_op_reserve,
299 &hf_ipmi_stor_20_op_allocinfo, NULL };
301 proto_tree_add_item(tree, hf_ipmi_stor_20_sdr_version, tvb, 0, 1, ENC_LITTLE_ENDIAN);
302 proto_tree_add_item(tree, hf_ipmi_stor_20_rec_count, tvb, 1, 2, ENC_LITTLE_ENDIAN);
303 proto_tree_add_item(tree, hf_ipmi_stor_20_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN);
304 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_add, tvb, 5);
305 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_erase, tvb, 9);
306 proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL,
307 ett_ipmi_stor_20_ops, ops, ENC_LITTLE_ENDIAN, 0);
310 /* Get SDR Repository Allocation Info
312 static void
313 rs21(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
315 proto_tree_add_item(tree, hf_ipmi_stor_21_units, tvb, 0, 2, ENC_LITTLE_ENDIAN);
316 proto_tree_add_item(tree, hf_ipmi_stor_21_size, tvb, 2, 2, ENC_LITTLE_ENDIAN);
317 proto_tree_add_item(tree, hf_ipmi_stor_21_free, tvb, 4, 2, ENC_LITTLE_ENDIAN);
318 proto_tree_add_item(tree, hf_ipmi_stor_21_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN);
319 proto_tree_add_item(tree, hf_ipmi_stor_21_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN);
322 /* Reserve SDR Repository
324 static void
325 rs22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
327 proto_tree_add_item(tree, hf_ipmi_stor_22_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
330 /* Get SDR
332 static void
333 rq23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
335 uint8_t v = tvb_get_uint8(tvb, 5);
337 proto_tree_add_item(tree, hf_ipmi_stor_23_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
338 proto_tree_add_item(tree, hf_ipmi_stor_23_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
339 proto_tree_add_item(tree, hf_ipmi_stor_23_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
340 proto_tree_add_uint_format_value(tree, hf_ipmi_stor_23_count, tvb, 5, 1,
341 v, "%d%s", v, v == 0xff ? " (entire record)" : "");
344 static void
345 rs23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
347 proto_tree_add_item(tree, hf_ipmi_stor_23_next, tvb, 0, 2, ENC_LITTLE_ENDIAN);
348 proto_tree_add_item(tree, hf_ipmi_stor_23_data, tvb, 2, -1, ENC_NA);
351 /* Add SDR
353 static void
354 rq24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
356 proto_tree_add_item(tree, hf_ipmi_stor_24_data, tvb, 0, -1, ENC_NA);
359 static void
360 rs24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
362 proto_tree_add_item(tree, hf_ipmi_stor_24_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
365 /* Partial Add SDR
367 static void
368 rq25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
370 static int * const byte6[] = { &hf_ipmi_stor_25_inprogress, NULL };
372 proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
373 proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
374 proto_tree_add_item(tree, hf_ipmi_stor_25_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
375 proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL,
376 ett_ipmi_stor_25_byte6, byte6, ENC_LITTLE_ENDIAN, 0);
377 proto_tree_add_item(tree, hf_ipmi_stor_25_data, tvb, 6, -1, ENC_NA);
380 static void
381 rs25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
383 proto_tree_add_item(tree, hf_ipmi_stor_25_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
386 static const value_string cc25[] = {
387 { 0x80, "Record rejected due to length mismatch" },
388 { 0, NULL }
391 /* Delete SDR
393 static void
394 rq26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
396 proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
397 proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
400 static void
401 rs26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
403 proto_tree_add_item(tree, hf_ipmi_stor_26_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
406 /* Clear SDR Repository
408 static void
409 rq27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
411 proto_tree_add_item(tree, hf_ipmi_stor_27_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
412 proto_tree_add_item(tree, hf_ipmi_stor_27_clr, tvb, 2, 3, ENC_ASCII);
413 proto_tree_add_item(tree, hf_ipmi_stor_27_action, tvb, 5, 1, ENC_LITTLE_ENDIAN);
416 static void
417 rs27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
419 static int * const status[] = { &hf_ipmi_stor_27_status, NULL };
421 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
422 ett_ipmi_stor_27_status, status, ENC_LITTLE_ENDIAN, 0);
425 /* Get SDR Repository Time
427 static void
428 rs28(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
430 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_28_time, tvb, 0);
433 /* Set SDR Repository Time
435 static void
436 rq29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
438 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_29_time, tvb, 0);
441 /* Run Initialization Agent
443 static void
444 rq2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
446 static int * const byte1[] = { &hf_ipmi_stor_2c_init_agent, NULL };
448 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
449 ett_ipmi_stor_2c_rq_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
452 static void
453 rs2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
455 static int * const byte1[] = { &hf_ipmi_stor_2c_init_state, NULL };
457 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
458 ett_ipmi_stor_2c_rs_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
461 /* Get SEL Info
463 static void
464 rs40(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
466 static int * const ops[] = { &hf_ipmi_stor_40_op_overflow, &hf_ipmi_stor_40_op_delete,
467 &hf_ipmi_stor_40_op_partial_add, &hf_ipmi_stor_40_op_reserve, &hf_ipmi_stor_40_op_allocinfo, NULL };
469 proto_tree_add_item(tree, hf_ipmi_stor_40_sel_version, tvb, 0, 1, ENC_LITTLE_ENDIAN);
470 proto_tree_add_item(tree, hf_ipmi_stor_40_entries, tvb, 1, 2, ENC_LITTLE_ENDIAN);
471 proto_tree_add_item(tree, hf_ipmi_stor_40_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN);
472 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_add, tvb, 5);
473 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_erase, tvb, 9);
474 proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL,
475 ett_ipmi_stor_40_ops, ops, ENC_LITTLE_ENDIAN, 0);
478 static const value_string cc40[] = {
479 { 0x81, "Cannot execute command, SEL erase in progress" },
480 { 0, NULL }
483 /* Get SEL Allocation Info
485 static void
486 rs41(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
488 proto_tree_add_item(tree, hf_ipmi_stor_41_units, tvb, 0, 2, ENC_LITTLE_ENDIAN);
489 proto_tree_add_item(tree, hf_ipmi_stor_41_size, tvb, 2, 2, ENC_LITTLE_ENDIAN);
490 proto_tree_add_item(tree, hf_ipmi_stor_41_free, tvb, 4, 2, ENC_LITTLE_ENDIAN);
491 proto_tree_add_item(tree, hf_ipmi_stor_41_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN);
492 proto_tree_add_item(tree, hf_ipmi_stor_41_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN);
495 /* Reserve SEL
497 static void
498 rs42(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
500 proto_tree_add_item(tree, hf_ipmi_stor_42_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
503 static const value_string cc42[] = {
504 { 0x81, "Cannot execute command, SEL erase in progress" },
505 { 0, NULL }
508 /* Get SEL Entry
510 static void
511 rq43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
513 uint8_t v = tvb_get_uint8(tvb, 5);
515 proto_tree_add_item(tree, hf_ipmi_stor_43_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
516 proto_tree_add_item(tree, hf_ipmi_stor_43_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
517 proto_tree_add_item(tree, hf_ipmi_stor_43_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
518 proto_tree_add_uint_format_value(tree, hf_ipmi_stor_43_count, tvb, 5, 1,
519 v, "%d%s", v, v == 0xff ? " (entire record)" : "");
522 static void
523 rs43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
525 proto_tree_add_item(tree, hf_ipmi_stor_43_next, tvb, 0, 2, ENC_LITTLE_ENDIAN);
526 proto_tree_add_item(tree, hf_ipmi_stor_43_data, tvb, 2, -1, ENC_NA);
529 static const value_string cc43[] = {
530 { 0x81, "Cannot execute command, SEL erase in progress" },
531 { 0, NULL }
534 /* Add SEL Entry
537 static void
538 rq44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
540 proto_tree_add_item(tree, hf_ipmi_stor_44_data, tvb, 0, -1, ENC_NA);
543 static void
544 rs44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
546 proto_tree_add_item(tree, hf_ipmi_stor_44_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
549 static const value_string cc44[] = {
550 { 0x80, "Operation not supported for this Record Type" },
551 { 0x81, "Cannot execute command, SEL erase in progress" },
552 { 0, NULL }
555 /* Partial Add SEL Entry
557 static void
558 rq45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
560 static int * const byte6[] = { &hf_ipmi_stor_45_inprogress, NULL };
562 proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
563 proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
564 proto_tree_add_item(tree, hf_ipmi_stor_45_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN);
565 proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL,
566 ett_ipmi_stor_45_byte6, byte6, ENC_LITTLE_ENDIAN, 0);
567 proto_tree_add_item(tree, hf_ipmi_stor_45_data, tvb, 6, -1, ENC_NA);
570 static void
571 rs45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
573 proto_tree_add_item(tree, hf_ipmi_stor_45_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
576 static const value_string cc45[] = {
577 { 0x80, "Record rejected due to length mismatch" },
578 { 0x81, "Cannot execute command, SEL erase in progress" },
579 { 0, NULL }
582 /* Delete SEL Entry
584 static void
585 rq46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
587 proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
588 proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN);
591 static void
592 rs46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
594 proto_tree_add_item(tree, hf_ipmi_stor_46_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
597 static const value_string cc46[] = {
598 { 0x80, "Operation not supported for this Record Type" },
599 { 0x81, "Cannot execute command, SEL erase in progress" },
600 { 0, NULL }
603 /* Clear SEL
605 static void
606 rq47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
608 proto_tree_add_item(tree, hf_ipmi_stor_47_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN);
609 proto_tree_add_item(tree, hf_ipmi_stor_47_clr, tvb, 2, 3, ENC_ASCII);
610 proto_tree_add_item(tree, hf_ipmi_stor_47_action, tvb, 5, 1, ENC_LITTLE_ENDIAN);
613 static void
614 rs47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
616 static int * const status[] = { &hf_ipmi_stor_47_status, NULL };
618 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
619 ett_ipmi_stor_47_status, status, ENC_LITTLE_ENDIAN, 0);
622 /* Get SEL Time
624 static void
625 rs48(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
627 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_48_time, tvb, 0);
630 /* Set SEL Time
632 static void
633 rq49(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
635 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_49_time, tvb, 0);
638 /* Get Auxiliary Log Status
640 static void
641 rq5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
643 static int * const byte1[] = { &hf_ipmi_stor_5a_log_type, NULL };
645 ipmi_set_data(pinfo, 0, tvb_get_uint8(tvb, 0) & 0x0f);
646 if (!tree) {
647 return;
650 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
651 ett_ipmi_stor_5a_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
654 static void
655 rs5a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
657 uint32_t v;
659 if (!ipmi_get_data(pinfo, 0, &v) || v > 2) {
660 proto_tree_add_item(tree, hf_ipmi_stor_5a_unknown, tvb, 0, -1, ENC_NA);
661 return;
664 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5a_ts_add, tvb, 0);
665 if (v == 0) {
666 proto_tree_add_item(tree, hf_ipmi_stor_5a_num_entries, tvb, 4, 4, ENC_LITTLE_ENDIAN);
667 } else if (v == 1 || v == 2) {
668 proto_tree_add_item(tree, hf_ipmi_stor_5a_iana, tvb, 4, 3, ENC_LITTLE_ENDIAN);
669 proto_tree_add_item(tree, hf_ipmi_stor_5a_bytes, tvb, 7, 7, ENC_NA);
673 /* Set Auxiliary Log Status
675 static void
676 rq5b(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
678 static int * const byte1[] = { &hf_ipmi_stor_5b_log_type, NULL };
679 uint8_t v = tvb_get_uint8(tvb, 0);
681 proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
682 ett_ipmi_stor_5b_byte1, byte1, ENC_LITTLE_ENDIAN, 0);
684 if (v > 2) {
685 proto_tree_add_item(tree, hf_ipmi_stor_5b_unknown, tvb, 1, -1, ENC_NA);
686 return;
689 ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5b_ts_add, tvb, 1);
690 if (v == 0) {
691 proto_tree_add_item(tree, hf_ipmi_stor_5b_num_entries, tvb, 5, 4, ENC_LITTLE_ENDIAN);
692 } else if (v == 1 || v == 2) {
693 proto_tree_add_item(tree, hf_ipmi_stor_5b_iana, tvb, 5, 3, ENC_LITTLE_ENDIAN);
694 proto_tree_add_item(tree, hf_ipmi_stor_5b_bytes, tvb, 8, 8, ENC_NA);
698 static const ipmi_cmd_t cmd_storage[] = {
699 /* FRU Device Commands */
700 { 0x10, rq10, rs10, NULL, NULL, "Get FRU Inventory Area Info", 0 },
701 { 0x11, rq11, rs11, cc11, NULL, "Read FRU Data", 0 },
702 { 0x12, rq12, rs12, cc12, NULL, "Write FRU Data", 0 },
704 /* SDR Device Commands */
705 { 0x20, NULL, rs20, NULL, NULL, "Get SDR Repository Info", 0 },
706 { 0x21, NULL, rs21, NULL, NULL, "Get SDR Repository Allocation Info", 0 },
707 { 0x22, NULL, rs22, NULL, NULL, "Reserve SDR Repository", 0 },
708 { 0x23, rq23, rs23, NULL, NULL, "Get SDR", 0 },
709 { 0x24, rq24, rs24, NULL, NULL, "Add SDR", 0 },
710 { 0x25, rq25, rs25, cc25, NULL, "Partial Add SDR", 0 },
711 { 0x26, rq26, rs26, NULL, NULL, "Delete SDR", 0 },
712 { 0x27, rq27, rs27, NULL, NULL, "Clear SDR Repository", 0 },
713 { 0x28, NULL, rs28, NULL, NULL, "Get SDR Repository Time", 0 },
714 { 0x29, rq29, NULL, NULL, NULL, "Set SDR Repository Time", 0 },
715 { 0x2a, NULL, NULL, NULL, NULL, "Enter SDR Repository Update Mode", 0 },
716 { 0x2b, NULL, NULL, NULL, NULL, "Exit SDR Repository Update Mode", 0 },
717 { 0x2c, rq2c, rs2c, NULL, NULL, "Run Initialization Agent", 0 },
719 /* SEL Device Commands */
720 { 0x40, NULL, rs40, cc40, NULL, "Get SEL Info", 0 },
721 { 0x41, NULL, rs41, NULL, NULL, "Get SEL Allocation Info", 0 },
722 { 0x42, NULL, rs42, cc42, NULL, "Reserve SEL", 0 },
723 { 0x43, rq43, rs43, cc43, NULL, "Get SEL Entry", 0 },
724 { 0x44, rq44, rs44, cc44, NULL, "Add SEL Entry", 0 },
725 { 0x45, rq45, rs45, cc45, NULL, "Partial Add SEL Entry", 0 },
726 { 0x46, rq46, rs46, cc46, NULL, "Delete SEL Entry", 0 },
727 { 0x47, rq47, rs47, NULL, NULL, "Clear SEL", 0 },
728 { 0x48, NULL, rs48, NULL, NULL, "Get SEL Time", 0 },
729 { 0x49, rq49, NULL, NULL, NULL, "Set SEL Time", 0 },
730 { 0x5a, rq5a, rs5a, NULL, NULL, "Get Auxiliary Log Status", CMD_CALLRQ },
731 { 0x5b, rq5b, NULL, NULL, NULL, "Set Auxiliary Log Status", 0 },
732 { 0x5c, IPMI_TBD, NULL, NULL, "Get SEL Time UTC Offset", 0 },
733 { 0x5d, IPMI_TBD, NULL, NULL, "Set SEL Time UTC Offset", 0 },
736 void
737 proto_register_ipmi_storage(void)
739 static hf_register_info hf[] = {
740 { &hf_ipmi_stor_10_fruid,
741 { "FRU ID",
742 "ipmi.st10.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
743 { &hf_ipmi_stor_10_size,
744 { "FRU Inventory area size",
745 "ipmi.st10.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
746 { &hf_ipmi_stor_10_access,
747 { "Device is accessed",
748 "ipmi.st10.access", FT_BOOLEAN, 8, TFS(&tfs_10_access), 0x01, NULL, HFILL }},
750 { &hf_ipmi_stor_11_fruid,
751 { "FRU ID",
752 "ipmi.st11.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
753 { &hf_ipmi_stor_11_offset,
754 { "Offset to read",
755 "ipmi.st11.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
756 { &hf_ipmi_stor_11_count,
757 { "Count to read",
758 "ipmi.st11.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
759 { &hf_ipmi_stor_11_ret_count,
760 { "Returned count",
761 "ipmi.st11.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
762 { &hf_ipmi_stor_11_data,
763 { "Requested data",
764 "ipmi.st11.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
766 { &hf_ipmi_stor_12_fruid,
767 { "FRU ID",
768 "ipmi.st12.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
769 { &hf_ipmi_stor_12_offset,
770 { "Offset to read",
771 "ipmi.st12.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
772 { &hf_ipmi_stor_12_data,
773 { "Requested data",
774 "ipmi.st12.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
775 { &hf_ipmi_stor_12_ret_count,
776 { "Returned count",
777 "ipmi.st12.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
779 { &hf_ipmi_stor_20_sdr_version,
780 { "SDR Version",
781 "ipmi.st20.sdr_version", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_version), 0, NULL, HFILL }},
782 { &hf_ipmi_stor_20_rec_count,
783 { "Record Count",
784 "ipmi.st20.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
785 { &hf_ipmi_stor_20_free_space,
786 { "Free Space",
787 "ipmi.st20.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
788 { &hf_ipmi_stor_20_ts_add,
789 { "Most recent addition timestamp",
790 "ipmi.st20.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
791 { &hf_ipmi_stor_20_ts_erase,
792 { "Most recent erase timestamp",
793 "ipmi.st20.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
794 { &hf_ipmi_stor_20_op_overflow,
795 { "Overflow",
796 "ipmi.st20.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
797 { &hf_ipmi_stor_20_op_update,
798 { "SDR Repository Update",
799 "ipmi.st20.op_update", FT_UINT8, BASE_HEX, VALS(vals_20_update), 0x60, NULL, HFILL }},
800 { &hf_ipmi_stor_20_op_delete,
801 { "Delete SDR",
802 "ipmi.st20.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
803 { &hf_ipmi_stor_20_op_partial_add,
804 { "Partial Add SDR",
805 "ipmi.st20.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
806 { &hf_ipmi_stor_20_op_reserve,
807 { "Reserve SDR Repository",
808 "ipmi.st20.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
809 { &hf_ipmi_stor_20_op_allocinfo,
810 { "Get SDR Repository Allocation Info",
811 "ipmi.st20.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
813 { &hf_ipmi_stor_21_units,
814 { "Number of allocation units",
815 "ipmi.st21.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
816 { &hf_ipmi_stor_21_size,
817 { "Allocation unit size",
818 "ipmi.st21.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
819 { &hf_ipmi_stor_21_free,
820 { "Number of free units",
821 "ipmi.st21.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
822 { &hf_ipmi_stor_21_largest,
823 { "Largest free block (in units)",
824 "ipmi.st21.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
825 { &hf_ipmi_stor_21_maxrec,
826 { "Maximum record size (in units)",
827 "ipmi.st21.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
829 { &hf_ipmi_stor_22_rsrv_id,
830 { "Reservation ID",
831 "ipmi.st22.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
833 { &hf_ipmi_stor_23_rsrv_id,
834 { "Reservation ID",
835 "ipmi.st23.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
836 { &hf_ipmi_stor_23_rec_id,
837 { "Record ID",
838 "ipmi.st23.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
839 { &hf_ipmi_stor_23_offset,
840 { "Offset into record",
841 "ipmi.st23.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
842 { &hf_ipmi_stor_23_count,
843 { "Bytes to read",
844 "ipmi.st23.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
845 { &hf_ipmi_stor_23_next,
846 { "Next Record ID",
847 "ipmi.st23.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
848 { &hf_ipmi_stor_23_data,
849 { "Record Data",
850 "ipmi.st23.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
852 { &hf_ipmi_stor_24_data,
853 { "SDR Data",
854 "ipmi.st24.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
855 { &hf_ipmi_stor_24_added_rec_id,
856 { "Record ID for added record",
857 "ipmi.st23.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
859 { &hf_ipmi_stor_25_rsrv_id,
860 { "Reservation ID",
861 "ipmi.st25.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
862 { &hf_ipmi_stor_25_rec_id,
863 { "Record ID",
864 "ipmi.st25.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
865 { &hf_ipmi_stor_25_offset,
866 { "Offset into record",
867 "ipmi.st25.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
868 { &hf_ipmi_stor_25_inprogress,
869 { "In progress",
870 "ipmi.st25.inprogress", FT_UINT8, BASE_HEX, VALS(vals_25_inprogress), 0x0f, NULL, HFILL }},
871 { &hf_ipmi_stor_25_data,
872 { "SDR Data",
873 "ipmi.st25.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
874 { &hf_ipmi_stor_25_added_rec_id,
875 { "Record ID for added record",
876 "ipmi.st25.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
878 #if 0
879 { &hf_ipmi_stor_26_rsrv_id,
880 { "Reservation ID",
881 "ipmi.st26.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
883 { &hf_ipmi_stor_26_rec_id,
884 { "Record ID",
885 "ipmi.st26.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
886 #endif
887 { &hf_ipmi_stor_26_del_rec_id,
888 { "Deleted Record ID",
889 "ipmi.st26.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
891 { &hf_ipmi_stor_27_rsrv_id,
892 { "Reservation ID",
893 "ipmi.st27.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
894 { &hf_ipmi_stor_27_clr,
895 { "Confirmation (should be CLR)",
896 "ipmi.st27.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
897 { &hf_ipmi_stor_27_action,
898 { "Action",
899 "ipmi.st27.action", FT_UINT8, BASE_HEX, VALS(vals_27_action), 0, NULL, HFILL }},
900 { &hf_ipmi_stor_27_status,
901 { "Erasure Status",
902 "ipmi.st27.status", FT_UINT8, BASE_HEX, VALS(vals_27_status), 0x0f, NULL, HFILL }},
904 { &hf_ipmi_stor_28_time,
905 { "Time",
906 "ipmi.st28.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
908 { &hf_ipmi_stor_29_time,
909 { "Time",
910 "ipmi.st29.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
912 { &hf_ipmi_stor_2c_init_agent,
913 { "Initialization agent",
914 "ipmi.st2c.init_agent", FT_BOOLEAN, 8, TFS(&tfs_2c_init_agent), 0x01, NULL, HFILL }},
915 { &hf_ipmi_stor_2c_init_state,
916 { "Initialization",
917 "ipmi.st2c.init_state", FT_BOOLEAN, 8, TFS(&tfs_2c_init_state), 0x01, NULL, HFILL }},
919 { &hf_ipmi_stor_40_sel_version,
920 { "SEL Version",
921 "ipmi.st40.sel_version", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_version), 0, NULL, HFILL }},
922 { &hf_ipmi_stor_40_entries,
923 { "Entries",
924 "ipmi.st40.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
925 { &hf_ipmi_stor_40_free_space,
926 { "Free Space",
927 "ipmi.st40.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
928 { &hf_ipmi_stor_40_ts_add,
929 { "Most recent addition timestamp",
930 "ipmi.st40.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
931 { &hf_ipmi_stor_40_ts_erase,
932 { "Most recent erase timestamp",
933 "ipmi.st40.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
934 { &hf_ipmi_stor_40_op_overflow,
935 { "Overflow",
936 "ipmi.st40.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
937 { &hf_ipmi_stor_40_op_delete,
938 { "Delete SEL",
939 "ipmi.st40.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
940 { &hf_ipmi_stor_40_op_partial_add,
941 { "Partial Add SEL Entry",
942 "ipmi.st40.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
943 { &hf_ipmi_stor_40_op_reserve,
944 { "Reserve SEL",
945 "ipmi.st40.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
946 { &hf_ipmi_stor_40_op_allocinfo,
947 { "Get SEL Allocation Info",
948 "ipmi.st40.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
950 { &hf_ipmi_stor_41_units,
951 { "Number of allocation units",
952 "ipmi.st41.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
953 { &hf_ipmi_stor_41_size,
954 { "Allocation unit size",
955 "ipmi.st41.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
956 { &hf_ipmi_stor_41_free,
957 { "Number of free units",
958 "ipmi.st41.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
959 { &hf_ipmi_stor_41_largest,
960 { "Largest free block (in units)",
961 "ipmi.st41.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
962 { &hf_ipmi_stor_41_maxrec,
963 { "Maximum record size (in units)",
964 "ipmi.st41.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
966 { &hf_ipmi_stor_42_rsrv_id,
967 { "Reservation ID",
968 "ipmi.st42.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
970 { &hf_ipmi_stor_43_rsrv_id,
971 { "Reservation ID",
972 "ipmi.st43.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
973 { &hf_ipmi_stor_43_rec_id,
974 { "Record ID",
975 "ipmi.st43.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
976 { &hf_ipmi_stor_43_offset,
977 { "Offset into record",
978 "ipmi.st43.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
979 { &hf_ipmi_stor_43_count,
980 { "Bytes to read",
981 "ipmi.st43.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
982 { &hf_ipmi_stor_43_next,
983 { "Next Record ID",
984 "ipmi.st43.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
985 { &hf_ipmi_stor_43_data,
986 { "Record Data",
987 "ipmi.st43.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
989 { &hf_ipmi_stor_44_data,
990 { "SDR Data",
991 "ipmi.st44.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
992 { &hf_ipmi_stor_44_added_rec_id,
993 { "Record ID for added record",
994 "ipmi.st43.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
996 { &hf_ipmi_stor_45_rsrv_id,
997 { "Reservation ID",
998 "ipmi.st45.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
999 { &hf_ipmi_stor_45_rec_id,
1000 { "Record ID",
1001 "ipmi.st45.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1002 { &hf_ipmi_stor_45_offset,
1003 { "Offset into record",
1004 "ipmi.st45.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1005 { &hf_ipmi_stor_45_inprogress,
1006 { "In progress",
1007 "ipmi.st45.inprogress", FT_UINT8, BASE_HEX, VALS(vals_45_inprogress), 0x0f, NULL, HFILL }},
1008 { &hf_ipmi_stor_45_data,
1009 { "Record Data",
1010 "ipmi.st45.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1011 { &hf_ipmi_stor_45_added_rec_id,
1012 { "Record ID for added record",
1013 "ipmi.st45.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1015 #if 0
1016 { &hf_ipmi_stor_46_rsrv_id,
1017 { "Reservation ID",
1018 "ipmi.st46.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1020 { &hf_ipmi_stor_46_rec_id,
1021 { "Record ID",
1022 "ipmi.st46.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1023 #endif
1024 { &hf_ipmi_stor_46_del_rec_id,
1025 { "Deleted Record ID",
1026 "ipmi.st46.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1028 { &hf_ipmi_stor_47_rsrv_id,
1029 { "Reservation ID",
1030 "ipmi.st47.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
1031 { &hf_ipmi_stor_47_clr,
1032 { "Confirmation (should be CLR)",
1033 "ipmi.st47.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
1034 { &hf_ipmi_stor_47_action,
1035 { "Action",
1036 "ipmi.st47.action", FT_UINT8, BASE_HEX, VALS(vals_47_action), 0, NULL, HFILL }},
1037 { &hf_ipmi_stor_47_status,
1038 { "Erasure Status",
1039 "ipmi.st47.status", FT_UINT8, BASE_HEX, VALS(vals_47_status), 0x0f, NULL, HFILL }},
1041 { &hf_ipmi_stor_48_time,
1042 { "Time",
1043 "ipmi.st48.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1045 { &hf_ipmi_stor_49_time,
1046 { "Time",
1047 "ipmi.st49.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1049 { &hf_ipmi_stor_5a_log_type,
1050 { "Log type",
1051 "ipmi.st5a.log_type", FT_UINT8, BASE_HEX, VALS(log_type_vals), 0x0f, NULL, HFILL }},
1052 { &hf_ipmi_stor_5a_ts_add,
1053 { "Last addition timestamp",
1054 "ipmi.st5a.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1055 { &hf_ipmi_stor_5a_num_entries,
1056 { "Number of entries in MCA Log",
1057 "ipmi.st5a.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1058 { &hf_ipmi_stor_5a_iana,
1059 { "OEM IANA",
1060 "ipmi.st5a.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
1061 { &hf_ipmi_stor_5a_bytes,
1062 { "Log status bytes",
1063 "ipmi.st5a.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1064 { &hf_ipmi_stor_5a_unknown,
1065 { "Unknown log format (cannot parse data)",
1066 "ipmi.st5a.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1068 { &hf_ipmi_stor_5b_log_type,
1069 { "Log type",
1070 "ipmi.st5b.log_type", FT_UINT8, BASE_HEX, VALS(log_type_vals), 0x0f, NULL, HFILL }},
1071 { &hf_ipmi_stor_5b_ts_add,
1072 { "Last addition timestamp",
1073 "ipmi.st5b.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1074 { &hf_ipmi_stor_5b_num_entries,
1075 { "Number of entries in MCA Log",
1076 "ipmi.st5b.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1077 { &hf_ipmi_stor_5b_iana,
1078 { "OEM IANA",
1079 "ipmi.st5b.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
1080 { &hf_ipmi_stor_5b_bytes,
1081 { "Log status bytes",
1082 "ipmi.st5b.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1083 { &hf_ipmi_stor_5b_unknown,
1084 { "Unknown log format (cannot parse data)",
1085 "ipmi.st5b.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
1088 static int *ett[] = {
1089 &ett_ipmi_stor_10_flags,
1090 &ett_ipmi_stor_20_ops,
1091 &ett_ipmi_stor_25_byte6,
1092 &ett_ipmi_stor_27_status,
1093 &ett_ipmi_stor_2c_rq_byte1,
1094 &ett_ipmi_stor_2c_rs_byte1,
1095 &ett_ipmi_stor_40_ops,
1096 &ett_ipmi_stor_45_byte6,
1097 &ett_ipmi_stor_47_status,
1098 &ett_ipmi_stor_5a_byte1,
1099 &ett_ipmi_stor_5b_byte1,
1102 proto_register_field_array(proto_ipmi, hf, array_length(hf));
1103 proto_register_subtree_array(ett, array_length(ett));
1104 ipmi_register_netfn_cmdtab(IPMI_STORAGE_REQ, IPMI_OEM_NONE, NULL, 0, NULL,
1105 cmd_storage, array_length(cmd_storage));
1109 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1111 * Local variables:
1112 * c-basic-offset: 8
1113 * tab-width: 8
1114 * indent-tabs-mode: t
1115 * End:
1117 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1118 * :indentSize=8:tabSize=8:noTabs=false: