/src/wireshark/epan/dissectors/packet-ipmi-storage.c
Line | Count | Source (jump to first uncovered line) |
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> |
4 | | * |
5 | | * Wireshark - Network traffic analyzer |
6 | | * By Gerald Combs <gerald@wireshark.org> |
7 | | * Copyright 1998 Gerald Combs |
8 | | * |
9 | | * SPDX-License-Identifier: GPL-2.0-or-later |
10 | | */ |
11 | | |
12 | | #include "config.h" |
13 | | |
14 | | #include <epan/packet.h> |
15 | | #include <epan/tfs.h> |
16 | | #include <wsutil/array.h> |
17 | | #include "packet-ipmi.h" |
18 | | |
19 | | void proto_register_ipmi_storage(void); |
20 | | |
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; |
32 | | |
33 | | static int hf_ipmi_stor_10_fruid; |
34 | | static int hf_ipmi_stor_10_size; |
35 | | static int hf_ipmi_stor_10_access; |
36 | | |
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; |
42 | | |
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; |
47 | | |
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; |
59 | | |
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; |
65 | | |
66 | | static int hf_ipmi_stor_22_rsrv_id; |
67 | | |
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; |
74 | | |
75 | | static int hf_ipmi_stor_24_data; |
76 | | static int hf_ipmi_stor_24_added_rec_id; |
77 | | |
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; |
84 | | |
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; |
90 | | |
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; |
95 | | |
96 | | static int hf_ipmi_stor_28_time; |
97 | | |
98 | | static int hf_ipmi_stor_29_time; |
99 | | |
100 | | static int hf_ipmi_stor_2c_init_agent; |
101 | | static int hf_ipmi_stor_2c_init_state; |
102 | | |
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; |
113 | | |
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; |
119 | | |
120 | | static int hf_ipmi_stor_42_rsrv_id; |
121 | | |
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; |
128 | | |
129 | | static int hf_ipmi_stor_44_data; |
130 | | static int hf_ipmi_stor_44_added_rec_id; |
131 | | |
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; |
138 | | |
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; |
144 | | |
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; |
149 | | |
150 | | static int hf_ipmi_stor_48_time; |
151 | | |
152 | | static int hf_ipmi_stor_49_time; |
153 | | |
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; |
160 | | |
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; |
167 | | |
168 | | static const struct true_false_string tfs_10_access = { |
169 | | "by words", "by bytes" |
170 | | }; |
171 | | |
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 } |
178 | | }; |
179 | | |
180 | | static const value_string vals_25_inprogress[] = { |
181 | | { 0x00, "Partial add in progress" }, |
182 | | { 0x01, "Last record data being transferred" }, |
183 | | { 0, NULL } |
184 | | }; |
185 | | |
186 | | static const value_string vals_27_action[] = { |
187 | | { 0x00, "Get Erasure Status" }, |
188 | | { 0xaa, "Initiate Erase" }, |
189 | | { 0, NULL } |
190 | | }; |
191 | | |
192 | | static const value_string vals_27_status[] = { |
193 | | { 0x00, "Erasure in progress" }, |
194 | | { 0x01, "Erase completed" }, |
195 | | { 0, NULL } |
196 | | }; |
197 | | |
198 | | static const struct true_false_string tfs_2c_init_agent = { |
199 | | "Run", "Get status" |
200 | | }; |
201 | | |
202 | | static const struct true_false_string tfs_2c_init_state = { |
203 | | "Completed", "In progress" |
204 | | }; |
205 | | |
206 | | static const value_string vals_45_inprogress[] = { |
207 | | { 0x00, "Partial add in progress" }, |
208 | | { 0x01, "Last record data being transferred" }, |
209 | | { 0, NULL } |
210 | | }; |
211 | | |
212 | | static const value_string vals_47_action[] = { |
213 | | { 0x00, "Get Erasure Status" }, |
214 | | { 0xaa, "Initiate Erase" }, |
215 | | { 0, NULL } |
216 | | }; |
217 | | |
218 | | static const value_string vals_47_status[] = { |
219 | | { 0x00, "Erasure in progress" }, |
220 | | { 0x01, "Erase completed" }, |
221 | | { 0, NULL } |
222 | | }; |
223 | | |
224 | | static const value_string log_type_vals[] = { |
225 | | { 0x00, "MCA Log" }, |
226 | | { 0x01, "OEM 1" }, |
227 | | { 0x02, "OEM 2" }, |
228 | | { 0, NULL } |
229 | | }; |
230 | | |
231 | | /* Get FRU Inventory Area Info |
232 | | */ |
233 | | static void |
234 | | rq10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
235 | 0 | { |
236 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_10_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
237 | 0 | } |
238 | | |
239 | | static void |
240 | | rs10(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
241 | 0 | { |
242 | 0 | static int * const flags[] = { &hf_ipmi_stor_10_access, NULL }; |
243 | |
|
244 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_10_size, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
245 | 0 | proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL, ett_ipmi_stor_10_flags, flags, ENC_LITTLE_ENDIAN, 0); |
246 | 0 | } |
247 | | |
248 | | /* Read FRU Data |
249 | | */ |
250 | | static void |
251 | | rq11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
252 | 0 | { |
253 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_11_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
254 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_11_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN); |
255 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_11_count, tvb, 3, 1, ENC_LITTLE_ENDIAN); |
256 | 0 | } |
257 | | |
258 | | static void |
259 | | rs11(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
260 | 0 | { |
261 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_11_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
262 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_11_data, tvb, 1, -1, ENC_NA); |
263 | 0 | } |
264 | | |
265 | | static const value_string cc11[] = { |
266 | | { 0x81, "FRU Device Busy" }, |
267 | | { 0, NULL } |
268 | | }; |
269 | | |
270 | | /* Write FRU Data |
271 | | */ |
272 | | static void |
273 | | rq12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
274 | 0 | { |
275 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_12_fruid, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
276 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_12_offset, tvb, 1, 2, ENC_LITTLE_ENDIAN); |
277 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_12_data, tvb, 3, -1, ENC_NA); |
278 | 0 | } |
279 | | |
280 | | static void |
281 | | rs12(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
282 | 0 | { |
283 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_12_ret_count, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
284 | 0 | } |
285 | | |
286 | | static const value_string cc12[] = { |
287 | | { 0x80, "Write-protected offset" }, |
288 | | { 0x81, "FRU Device Busy" }, |
289 | | { 0, NULL } |
290 | | }; |
291 | | |
292 | | /* Get SDR Repository Info |
293 | | */ |
294 | | static void |
295 | | rs20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
296 | 0 | { |
297 | 0 | static int * const ops[] = { &hf_ipmi_stor_20_op_overflow, &hf_ipmi_stor_20_op_update, |
298 | 0 | &hf_ipmi_stor_20_op_delete, &hf_ipmi_stor_20_op_partial_add, &hf_ipmi_stor_20_op_reserve, |
299 | 0 | &hf_ipmi_stor_20_op_allocinfo, NULL }; |
300 | |
|
301 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_20_sdr_version, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
302 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_20_rec_count, tvb, 1, 2, ENC_LITTLE_ENDIAN); |
303 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_20_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN); |
304 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_add, tvb, 5); |
305 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_20_ts_erase, tvb, 9); |
306 | 0 | proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, |
307 | 0 | ett_ipmi_stor_20_ops, ops, ENC_LITTLE_ENDIAN, 0); |
308 | 0 | } |
309 | | |
310 | | /* Get SDR Repository Allocation Info |
311 | | */ |
312 | | static void |
313 | | rs21(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
314 | 0 | { |
315 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_21_units, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
316 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_21_size, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
317 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_21_free, tvb, 4, 2, ENC_LITTLE_ENDIAN); |
318 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_21_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN); |
319 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_21_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN); |
320 | 0 | } |
321 | | |
322 | | /* Reserve SDR Repository |
323 | | */ |
324 | | static void |
325 | | rs22(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
326 | 0 | { |
327 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_22_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
328 | 0 | } |
329 | | |
330 | | /* Get SDR |
331 | | */ |
332 | | static void |
333 | | rq23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
334 | 0 | { |
335 | 0 | uint8_t v = tvb_get_uint8(tvb, 5); |
336 | |
|
337 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_23_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
338 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_23_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
339 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_23_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN); |
340 | 0 | proto_tree_add_uint_format_value(tree, hf_ipmi_stor_23_count, tvb, 5, 1, |
341 | 0 | v, "%d%s", v, v == 0xff ? " (entire record)" : ""); |
342 | 0 | } |
343 | | |
344 | | static void |
345 | | rs23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
346 | 0 | { |
347 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_23_next, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
348 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_23_data, tvb, 2, -1, ENC_NA); |
349 | 0 | } |
350 | | |
351 | | /* Add SDR |
352 | | */ |
353 | | static void |
354 | | rq24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
355 | 0 | { |
356 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_24_data, tvb, 0, -1, ENC_NA); |
357 | 0 | } |
358 | | |
359 | | static void |
360 | | rs24(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
361 | 0 | { |
362 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_24_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
363 | 0 | } |
364 | | |
365 | | /* Partial Add SDR |
366 | | */ |
367 | | static void |
368 | | rq25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
369 | 0 | { |
370 | 0 | static int * const byte6[] = { &hf_ipmi_stor_25_inprogress, NULL }; |
371 | |
|
372 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
373 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
374 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN); |
375 | 0 | proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL, |
376 | 0 | ett_ipmi_stor_25_byte6, byte6, ENC_LITTLE_ENDIAN, 0); |
377 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_data, tvb, 6, -1, ENC_NA); |
378 | 0 | } |
379 | | |
380 | | static void |
381 | | rs25(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
382 | 0 | { |
383 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
384 | 0 | } |
385 | | |
386 | | static const value_string cc25[] = { |
387 | | { 0x80, "Record rejected due to length mismatch" }, |
388 | | { 0, NULL } |
389 | | }; |
390 | | |
391 | | /* Delete SDR |
392 | | */ |
393 | | static void |
394 | | rq26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
395 | 0 | { |
396 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
397 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_25_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
398 | 0 | } |
399 | | |
400 | | static void |
401 | | rs26(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
402 | 0 | { |
403 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_26_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
404 | 0 | } |
405 | | |
406 | | /* Clear SDR Repository |
407 | | */ |
408 | | static void |
409 | | rq27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
410 | 0 | { |
411 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_27_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
412 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_27_clr, tvb, 2, 3, ENC_ASCII); |
413 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_27_action, tvb, 5, 1, ENC_LITTLE_ENDIAN); |
414 | 0 | } |
415 | | |
416 | | static void |
417 | | rs27(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
418 | 0 | { |
419 | 0 | static int * const status[] = { &hf_ipmi_stor_27_status, NULL }; |
420 | |
|
421 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
422 | 0 | ett_ipmi_stor_27_status, status, ENC_LITTLE_ENDIAN, 0); |
423 | 0 | } |
424 | | |
425 | | /* Get SDR Repository Time |
426 | | */ |
427 | | static void |
428 | | rs28(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
429 | 0 | { |
430 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_28_time, tvb, 0); |
431 | 0 | } |
432 | | |
433 | | /* Set SDR Repository Time |
434 | | */ |
435 | | static void |
436 | | rq29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
437 | 0 | { |
438 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_29_time, tvb, 0); |
439 | 0 | } |
440 | | |
441 | | /* Run Initialization Agent |
442 | | */ |
443 | | static void |
444 | | rq2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
445 | 0 | { |
446 | 0 | static int * const byte1[] = { &hf_ipmi_stor_2c_init_agent, NULL }; |
447 | |
|
448 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
449 | 0 | ett_ipmi_stor_2c_rq_byte1, byte1, ENC_LITTLE_ENDIAN, 0); |
450 | 0 | } |
451 | | |
452 | | static void |
453 | | rs2c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
454 | 0 | { |
455 | 0 | static int * const byte1[] = { &hf_ipmi_stor_2c_init_state, NULL }; |
456 | |
|
457 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
458 | 0 | ett_ipmi_stor_2c_rs_byte1, byte1, ENC_LITTLE_ENDIAN, 0); |
459 | 0 | } |
460 | | |
461 | | /* Get SEL Info |
462 | | */ |
463 | | static void |
464 | | rs40(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
465 | 0 | { |
466 | 0 | static int * const ops[] = { &hf_ipmi_stor_40_op_overflow, &hf_ipmi_stor_40_op_delete, |
467 | 0 | &hf_ipmi_stor_40_op_partial_add, &hf_ipmi_stor_40_op_reserve, &hf_ipmi_stor_40_op_allocinfo, NULL }; |
468 | |
|
469 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_40_sel_version, tvb, 0, 1, ENC_LITTLE_ENDIAN); |
470 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_40_entries, tvb, 1, 2, ENC_LITTLE_ENDIAN); |
471 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_40_free_space, tvb, 3, 2, ENC_LITTLE_ENDIAN); |
472 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_add, tvb, 5); |
473 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_40_ts_erase, tvb, 9); |
474 | 0 | proto_tree_add_bitmask_text(tree, tvb, 13, 1, "Operation Support: ", NULL, |
475 | 0 | ett_ipmi_stor_40_ops, ops, ENC_LITTLE_ENDIAN, 0); |
476 | 0 | } |
477 | | |
478 | | static const value_string cc40[] = { |
479 | | { 0x81, "Cannot execute command, SEL erase in progress" }, |
480 | | { 0, NULL } |
481 | | }; |
482 | | |
483 | | /* Get SEL Allocation Info |
484 | | */ |
485 | | static void |
486 | | rs41(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
487 | 0 | { |
488 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_41_units, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
489 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_41_size, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
490 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_41_free, tvb, 4, 2, ENC_LITTLE_ENDIAN); |
491 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_41_largest, tvb, 6, 2, ENC_LITTLE_ENDIAN); |
492 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_41_maxrec, tvb, 8, 1, ENC_LITTLE_ENDIAN); |
493 | 0 | } |
494 | | |
495 | | /* Reserve SEL |
496 | | */ |
497 | | static void |
498 | | rs42(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
499 | 0 | { |
500 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_42_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
501 | 0 | } |
502 | | |
503 | | static const value_string cc42[] = { |
504 | | { 0x81, "Cannot execute command, SEL erase in progress" }, |
505 | | { 0, NULL } |
506 | | }; |
507 | | |
508 | | /* Get SEL Entry |
509 | | */ |
510 | | static void |
511 | | rq43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
512 | 0 | { |
513 | 0 | uint8_t v = tvb_get_uint8(tvb, 5); |
514 | |
|
515 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_43_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
516 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_43_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
517 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_43_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN); |
518 | 0 | proto_tree_add_uint_format_value(tree, hf_ipmi_stor_43_count, tvb, 5, 1, |
519 | 0 | v, "%d%s", v, v == 0xff ? " (entire record)" : ""); |
520 | 0 | } |
521 | | |
522 | | static void |
523 | | rs43(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
524 | 0 | { |
525 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_43_next, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
526 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_43_data, tvb, 2, -1, ENC_NA); |
527 | 0 | } |
528 | | |
529 | | static const value_string cc43[] = { |
530 | | { 0x81, "Cannot execute command, SEL erase in progress" }, |
531 | | { 0, NULL } |
532 | | }; |
533 | | |
534 | | /* Add SEL Entry |
535 | | */ |
536 | | |
537 | | static void |
538 | | rq44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
539 | 0 | { |
540 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_44_data, tvb, 0, -1, ENC_NA); |
541 | 0 | } |
542 | | |
543 | | static void |
544 | | rs44(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
545 | 0 | { |
546 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_44_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
547 | 0 | } |
548 | | |
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 } |
553 | | }; |
554 | | |
555 | | /* Partial Add SEL Entry |
556 | | */ |
557 | | static void |
558 | | rq45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
559 | 0 | { |
560 | 0 | static int * const byte6[] = { &hf_ipmi_stor_45_inprogress, NULL }; |
561 | |
|
562 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
563 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
564 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_offset, tvb, 4, 1, ENC_LITTLE_ENDIAN); |
565 | 0 | proto_tree_add_bitmask_text(tree, tvb, 5, 1, NULL, NULL, |
566 | 0 | ett_ipmi_stor_45_byte6, byte6, ENC_LITTLE_ENDIAN, 0); |
567 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_data, tvb, 6, -1, ENC_NA); |
568 | 0 | } |
569 | | |
570 | | static void |
571 | | rs45(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
572 | 0 | { |
573 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_added_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
574 | 0 | } |
575 | | |
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 } |
580 | | }; |
581 | | |
582 | | /* Delete SEL Entry |
583 | | */ |
584 | | static void |
585 | | rq46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
586 | 0 | { |
587 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
588 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_45_rec_id, tvb, 2, 2, ENC_LITTLE_ENDIAN); |
589 | 0 | } |
590 | | |
591 | | static void |
592 | | rs46(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
593 | 0 | { |
594 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_46_del_rec_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
595 | 0 | } |
596 | | |
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 } |
601 | | }; |
602 | | |
603 | | /* Clear SEL |
604 | | */ |
605 | | static void |
606 | | rq47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
607 | 0 | { |
608 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_47_rsrv_id, tvb, 0, 2, ENC_LITTLE_ENDIAN); |
609 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_47_clr, tvb, 2, 3, ENC_ASCII); |
610 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_47_action, tvb, 5, 1, ENC_LITTLE_ENDIAN); |
611 | 0 | } |
612 | | |
613 | | static void |
614 | | rs47(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
615 | 0 | { |
616 | 0 | static int * const status[] = { &hf_ipmi_stor_47_status, NULL }; |
617 | |
|
618 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
619 | 0 | ett_ipmi_stor_47_status, status, ENC_LITTLE_ENDIAN, 0); |
620 | 0 | } |
621 | | |
622 | | /* Get SEL Time |
623 | | */ |
624 | | static void |
625 | | rs48(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
626 | 0 | { |
627 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_48_time, tvb, 0); |
628 | 0 | } |
629 | | |
630 | | /* Set SEL Time |
631 | | */ |
632 | | static void |
633 | | rq49(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
634 | 0 | { |
635 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_49_time, tvb, 0); |
636 | 0 | } |
637 | | |
638 | | /* Get Auxiliary Log Status |
639 | | */ |
640 | | static void |
641 | | rq5a(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) |
642 | 0 | { |
643 | 0 | static int * const byte1[] = { &hf_ipmi_stor_5a_log_type, NULL }; |
644 | |
|
645 | 0 | ipmi_set_data(pinfo, 0, tvb_get_uint8(tvb, 0) & 0x0f); |
646 | 0 | if (!tree) { |
647 | 0 | return; |
648 | 0 | } |
649 | | |
650 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
651 | 0 | ett_ipmi_stor_5a_byte1, byte1, ENC_LITTLE_ENDIAN, 0); |
652 | 0 | } |
653 | | |
654 | | static void |
655 | | rs5a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
656 | 0 | { |
657 | 0 | uint32_t v; |
658 | |
|
659 | 0 | if (!ipmi_get_data(pinfo, 0, &v) || v > 2) { |
660 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5a_unknown, tvb, 0, -1, ENC_NA); |
661 | 0 | return; |
662 | 0 | } |
663 | | |
664 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5a_ts_add, tvb, 0); |
665 | 0 | if (v == 0) { |
666 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5a_num_entries, tvb, 4, 4, ENC_LITTLE_ENDIAN); |
667 | 0 | } else if (v == 1 || v == 2) { |
668 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5a_iana, tvb, 4, 3, ENC_LITTLE_ENDIAN); |
669 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5a_bytes, tvb, 7, 7, ENC_NA); |
670 | 0 | } |
671 | 0 | } |
672 | | |
673 | | /* Set Auxiliary Log Status |
674 | | */ |
675 | | static void |
676 | | rq5b(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
677 | 0 | { |
678 | 0 | static int * const byte1[] = { &hf_ipmi_stor_5b_log_type, NULL }; |
679 | 0 | uint8_t v = tvb_get_uint8(tvb, 0); |
680 | |
|
681 | 0 | proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, |
682 | 0 | ett_ipmi_stor_5b_byte1, byte1, ENC_LITTLE_ENDIAN, 0); |
683 | |
|
684 | 0 | if (v > 2) { |
685 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5b_unknown, tvb, 1, -1, ENC_NA); |
686 | 0 | return; |
687 | 0 | } |
688 | | |
689 | 0 | ipmi_add_timestamp(pinfo, tree, hf_ipmi_stor_5b_ts_add, tvb, 1); |
690 | 0 | if (v == 0) { |
691 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5b_num_entries, tvb, 5, 4, ENC_LITTLE_ENDIAN); |
692 | 0 | } else if (v == 1 || v == 2) { |
693 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5b_iana, tvb, 5, 3, ENC_LITTLE_ENDIAN); |
694 | 0 | proto_tree_add_item(tree, hf_ipmi_stor_5b_bytes, tvb, 8, 8, ENC_NA); |
695 | 0 | } |
696 | 0 | } |
697 | | |
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 }, |
703 | | |
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 }, |
718 | | |
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 }, |
734 | | }; |
735 | | |
736 | | void |
737 | | proto_register_ipmi_storage(void) |
738 | 14 | { |
739 | 14 | static hf_register_info hf[] = { |
740 | 14 | { &hf_ipmi_stor_10_fruid, |
741 | 14 | { "FRU ID", |
742 | 14 | "ipmi.st10.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
743 | 14 | { &hf_ipmi_stor_10_size, |
744 | 14 | { "FRU Inventory area size", |
745 | 14 | "ipmi.st10.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
746 | 14 | { &hf_ipmi_stor_10_access, |
747 | 14 | { "Device is accessed", |
748 | 14 | "ipmi.st10.access", FT_BOOLEAN, 8, TFS(&tfs_10_access), 0x01, NULL, HFILL }}, |
749 | | |
750 | 14 | { &hf_ipmi_stor_11_fruid, |
751 | 14 | { "FRU ID", |
752 | 14 | "ipmi.st11.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
753 | 14 | { &hf_ipmi_stor_11_offset, |
754 | 14 | { "Offset to read", |
755 | 14 | "ipmi.st11.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
756 | 14 | { &hf_ipmi_stor_11_count, |
757 | 14 | { "Count to read", |
758 | 14 | "ipmi.st11.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
759 | 14 | { &hf_ipmi_stor_11_ret_count, |
760 | 14 | { "Returned count", |
761 | 14 | "ipmi.st11.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
762 | 14 | { &hf_ipmi_stor_11_data, |
763 | 14 | { "Requested data", |
764 | 14 | "ipmi.st11.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
765 | | |
766 | 14 | { &hf_ipmi_stor_12_fruid, |
767 | 14 | { "FRU ID", |
768 | 14 | "ipmi.st12.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
769 | 14 | { &hf_ipmi_stor_12_offset, |
770 | 14 | { "Offset to read", |
771 | 14 | "ipmi.st12.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
772 | 14 | { &hf_ipmi_stor_12_data, |
773 | 14 | { "Requested data", |
774 | 14 | "ipmi.st12.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
775 | 14 | { &hf_ipmi_stor_12_ret_count, |
776 | 14 | { "Returned count", |
777 | 14 | "ipmi.st12.ret_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
778 | | |
779 | 14 | { &hf_ipmi_stor_20_sdr_version, |
780 | 14 | { "SDR Version", |
781 | 14 | "ipmi.st20.sdr_version", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_version), 0, NULL, HFILL }}, |
782 | 14 | { &hf_ipmi_stor_20_rec_count, |
783 | 14 | { "Record Count", |
784 | 14 | "ipmi.st20.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
785 | 14 | { &hf_ipmi_stor_20_free_space, |
786 | 14 | { "Free Space", |
787 | 14 | "ipmi.st20.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
788 | 14 | { &hf_ipmi_stor_20_ts_add, |
789 | 14 | { "Most recent addition timestamp", |
790 | 14 | "ipmi.st20.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
791 | 14 | { &hf_ipmi_stor_20_ts_erase, |
792 | 14 | { "Most recent erase timestamp", |
793 | 14 | "ipmi.st20.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
794 | 14 | { &hf_ipmi_stor_20_op_overflow, |
795 | 14 | { "Overflow", |
796 | 14 | "ipmi.st20.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, |
797 | 14 | { &hf_ipmi_stor_20_op_update, |
798 | 14 | { "SDR Repository Update", |
799 | 14 | "ipmi.st20.op_update", FT_UINT8, BASE_HEX, VALS(vals_20_update), 0x60, NULL, HFILL }}, |
800 | 14 | { &hf_ipmi_stor_20_op_delete, |
801 | 14 | { "Delete SDR", |
802 | 14 | "ipmi.st20.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, |
803 | 14 | { &hf_ipmi_stor_20_op_partial_add, |
804 | 14 | { "Partial Add SDR", |
805 | 14 | "ipmi.st20.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, |
806 | 14 | { &hf_ipmi_stor_20_op_reserve, |
807 | 14 | { "Reserve SDR Repository", |
808 | 14 | "ipmi.st20.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, |
809 | 14 | { &hf_ipmi_stor_20_op_allocinfo, |
810 | 14 | { "Get SDR Repository Allocation Info", |
811 | 14 | "ipmi.st20.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, |
812 | | |
813 | 14 | { &hf_ipmi_stor_21_units, |
814 | 14 | { "Number of allocation units", |
815 | 14 | "ipmi.st21.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
816 | 14 | { &hf_ipmi_stor_21_size, |
817 | 14 | { "Allocation unit size", |
818 | 14 | "ipmi.st21.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
819 | 14 | { &hf_ipmi_stor_21_free, |
820 | 14 | { "Number of free units", |
821 | 14 | "ipmi.st21.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
822 | 14 | { &hf_ipmi_stor_21_largest, |
823 | 14 | { "Largest free block (in units)", |
824 | 14 | "ipmi.st21.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
825 | 14 | { &hf_ipmi_stor_21_maxrec, |
826 | 14 | { "Maximum record size (in units)", |
827 | 14 | "ipmi.st21.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
828 | | |
829 | 14 | { &hf_ipmi_stor_22_rsrv_id, |
830 | 14 | { "Reservation ID", |
831 | 14 | "ipmi.st22.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
832 | | |
833 | 14 | { &hf_ipmi_stor_23_rsrv_id, |
834 | 14 | { "Reservation ID", |
835 | 14 | "ipmi.st23.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
836 | 14 | { &hf_ipmi_stor_23_rec_id, |
837 | 14 | { "Record ID", |
838 | 14 | "ipmi.st23.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
839 | 14 | { &hf_ipmi_stor_23_offset, |
840 | 14 | { "Offset into record", |
841 | 14 | "ipmi.st23.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
842 | 14 | { &hf_ipmi_stor_23_count, |
843 | 14 | { "Bytes to read", |
844 | 14 | "ipmi.st23.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
845 | 14 | { &hf_ipmi_stor_23_next, |
846 | 14 | { "Next Record ID", |
847 | 14 | "ipmi.st23.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
848 | 14 | { &hf_ipmi_stor_23_data, |
849 | 14 | { "Record Data", |
850 | 14 | "ipmi.st23.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
851 | | |
852 | 14 | { &hf_ipmi_stor_24_data, |
853 | 14 | { "SDR Data", |
854 | 14 | "ipmi.st24.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
855 | 14 | { &hf_ipmi_stor_24_added_rec_id, |
856 | 14 | { "Record ID for added record", |
857 | 14 | "ipmi.st23.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
858 | | |
859 | 14 | { &hf_ipmi_stor_25_rsrv_id, |
860 | 14 | { "Reservation ID", |
861 | 14 | "ipmi.st25.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
862 | 14 | { &hf_ipmi_stor_25_rec_id, |
863 | 14 | { "Record ID", |
864 | 14 | "ipmi.st25.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
865 | 14 | { &hf_ipmi_stor_25_offset, |
866 | 14 | { "Offset into record", |
867 | 14 | "ipmi.st25.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
868 | 14 | { &hf_ipmi_stor_25_inprogress, |
869 | 14 | { "In progress", |
870 | 14 | "ipmi.st25.inprogress", FT_UINT8, BASE_HEX, VALS(vals_25_inprogress), 0x0f, NULL, HFILL }}, |
871 | 14 | { &hf_ipmi_stor_25_data, |
872 | 14 | { "SDR Data", |
873 | 14 | "ipmi.st25.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
874 | 14 | { &hf_ipmi_stor_25_added_rec_id, |
875 | 14 | { "Record ID for added record", |
876 | 14 | "ipmi.st25.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
877 | | |
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 }}, |
882 | | |
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 | 14 | { &hf_ipmi_stor_26_del_rec_id, |
888 | 14 | { "Deleted Record ID", |
889 | 14 | "ipmi.st26.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
890 | | |
891 | 14 | { &hf_ipmi_stor_27_rsrv_id, |
892 | 14 | { "Reservation ID", |
893 | 14 | "ipmi.st27.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
894 | 14 | { &hf_ipmi_stor_27_clr, |
895 | 14 | { "Confirmation (should be CLR)", |
896 | 14 | "ipmi.st27.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, |
897 | 14 | { &hf_ipmi_stor_27_action, |
898 | 14 | { "Action", |
899 | 14 | "ipmi.st27.action", FT_UINT8, BASE_HEX, VALS(vals_27_action), 0, NULL, HFILL }}, |
900 | 14 | { &hf_ipmi_stor_27_status, |
901 | 14 | { "Erasure Status", |
902 | 14 | "ipmi.st27.status", FT_UINT8, BASE_HEX, VALS(vals_27_status), 0x0f, NULL, HFILL }}, |
903 | | |
904 | 14 | { &hf_ipmi_stor_28_time, |
905 | 14 | { "Time", |
906 | 14 | "ipmi.st28.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
907 | | |
908 | 14 | { &hf_ipmi_stor_29_time, |
909 | 14 | { "Time", |
910 | 14 | "ipmi.st29.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
911 | | |
912 | 14 | { &hf_ipmi_stor_2c_init_agent, |
913 | 14 | { "Initialization agent", |
914 | 14 | "ipmi.st2c.init_agent", FT_BOOLEAN, 8, TFS(&tfs_2c_init_agent), 0x01, NULL, HFILL }}, |
915 | 14 | { &hf_ipmi_stor_2c_init_state, |
916 | 14 | { "Initialization", |
917 | 14 | "ipmi.st2c.init_state", FT_BOOLEAN, 8, TFS(&tfs_2c_init_state), 0x01, NULL, HFILL }}, |
918 | | |
919 | 14 | { &hf_ipmi_stor_40_sel_version, |
920 | 14 | { "SEL Version", |
921 | 14 | "ipmi.st40.sel_version", FT_UINT8, BASE_CUSTOM, CF_FUNC(ipmi_fmt_version), 0, NULL, HFILL }}, |
922 | 14 | { &hf_ipmi_stor_40_entries, |
923 | 14 | { "Entries", |
924 | 14 | "ipmi.st40.rec_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
925 | 14 | { &hf_ipmi_stor_40_free_space, |
926 | 14 | { "Free Space", |
927 | 14 | "ipmi.st40.free_space", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
928 | 14 | { &hf_ipmi_stor_40_ts_add, |
929 | 14 | { "Most recent addition timestamp", |
930 | 14 | "ipmi.st40.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
931 | 14 | { &hf_ipmi_stor_40_ts_erase, |
932 | 14 | { "Most recent erase timestamp", |
933 | 14 | "ipmi.st40.ts_erase", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
934 | 14 | { &hf_ipmi_stor_40_op_overflow, |
935 | 14 | { "Overflow", |
936 | 14 | "ipmi.st40.op_overflow", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }}, |
937 | 14 | { &hf_ipmi_stor_40_op_delete, |
938 | 14 | { "Delete SEL", |
939 | 14 | "ipmi.st40.op_delete", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }}, |
940 | 14 | { &hf_ipmi_stor_40_op_partial_add, |
941 | 14 | { "Partial Add SEL Entry", |
942 | 14 | "ipmi.st40.op_partial_add", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }}, |
943 | 14 | { &hf_ipmi_stor_40_op_reserve, |
944 | 14 | { "Reserve SEL", |
945 | 14 | "ipmi.st40.op_reserve", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }}, |
946 | 14 | { &hf_ipmi_stor_40_op_allocinfo, |
947 | 14 | { "Get SEL Allocation Info", |
948 | 14 | "ipmi.st40.op_allocinfo", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }}, |
949 | | |
950 | 14 | { &hf_ipmi_stor_41_units, |
951 | 14 | { "Number of allocation units", |
952 | 14 | "ipmi.st41.units", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
953 | 14 | { &hf_ipmi_stor_41_size, |
954 | 14 | { "Allocation unit size", |
955 | 14 | "ipmi.st41.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
956 | 14 | { &hf_ipmi_stor_41_free, |
957 | 14 | { "Number of free units", |
958 | 14 | "ipmi.st41.free", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
959 | 14 | { &hf_ipmi_stor_41_largest, |
960 | 14 | { "Largest free block (in units)", |
961 | 14 | "ipmi.st41.largest", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }}, |
962 | 14 | { &hf_ipmi_stor_41_maxrec, |
963 | 14 | { "Maximum record size (in units)", |
964 | 14 | "ipmi.st41.maxrec", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
965 | | |
966 | 14 | { &hf_ipmi_stor_42_rsrv_id, |
967 | 14 | { "Reservation ID", |
968 | 14 | "ipmi.st42.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
969 | | |
970 | 14 | { &hf_ipmi_stor_43_rsrv_id, |
971 | 14 | { "Reservation ID", |
972 | 14 | "ipmi.st43.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
973 | 14 | { &hf_ipmi_stor_43_rec_id, |
974 | 14 | { "Record ID", |
975 | 14 | "ipmi.st43.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
976 | 14 | { &hf_ipmi_stor_43_offset, |
977 | 14 | { "Offset into record", |
978 | 14 | "ipmi.st43.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
979 | 14 | { &hf_ipmi_stor_43_count, |
980 | 14 | { "Bytes to read", |
981 | 14 | "ipmi.st43.count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
982 | 14 | { &hf_ipmi_stor_43_next, |
983 | 14 | { "Next Record ID", |
984 | 14 | "ipmi.st43.next", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
985 | 14 | { &hf_ipmi_stor_43_data, |
986 | 14 | { "Record Data", |
987 | 14 | "ipmi.st43.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
988 | | |
989 | 14 | { &hf_ipmi_stor_44_data, |
990 | 14 | { "SDR Data", |
991 | 14 | "ipmi.st44.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
992 | 14 | { &hf_ipmi_stor_44_added_rec_id, |
993 | 14 | { "Record ID for added record", |
994 | 14 | "ipmi.st43.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
995 | | |
996 | 14 | { &hf_ipmi_stor_45_rsrv_id, |
997 | 14 | { "Reservation ID", |
998 | 14 | "ipmi.st45.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
999 | 14 | { &hf_ipmi_stor_45_rec_id, |
1000 | 14 | { "Record ID", |
1001 | 14 | "ipmi.st45.rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1002 | 14 | { &hf_ipmi_stor_45_offset, |
1003 | 14 | { "Offset into record", |
1004 | 14 | "ipmi.st45.offset", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1005 | 14 | { &hf_ipmi_stor_45_inprogress, |
1006 | 14 | { "In progress", |
1007 | 14 | "ipmi.st45.inprogress", FT_UINT8, BASE_HEX, VALS(vals_45_inprogress), 0x0f, NULL, HFILL }}, |
1008 | 14 | { &hf_ipmi_stor_45_data, |
1009 | 14 | { "Record Data", |
1010 | 14 | "ipmi.st45.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1011 | 14 | { &hf_ipmi_stor_45_added_rec_id, |
1012 | 14 | { "Record ID for added record", |
1013 | 14 | "ipmi.st45.added_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1014 | | |
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 }}, |
1019 | | |
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 | 14 | { &hf_ipmi_stor_46_del_rec_id, |
1025 | 14 | { "Deleted Record ID", |
1026 | 14 | "ipmi.st46.del_rec_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1027 | | |
1028 | 14 | { &hf_ipmi_stor_47_rsrv_id, |
1029 | 14 | { "Reservation ID", |
1030 | 14 | "ipmi.st47.rsrv_id", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1031 | 14 | { &hf_ipmi_stor_47_clr, |
1032 | 14 | { "Confirmation (should be CLR)", |
1033 | 14 | "ipmi.st47.clr", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1034 | 14 | { &hf_ipmi_stor_47_action, |
1035 | 14 | { "Action", |
1036 | 14 | "ipmi.st47.action", FT_UINT8, BASE_HEX, VALS(vals_47_action), 0, NULL, HFILL }}, |
1037 | 14 | { &hf_ipmi_stor_47_status, |
1038 | 14 | { "Erasure Status", |
1039 | 14 | "ipmi.st47.status", FT_UINT8, BASE_HEX, VALS(vals_47_status), 0x0f, NULL, HFILL }}, |
1040 | | |
1041 | 14 | { &hf_ipmi_stor_48_time, |
1042 | 14 | { "Time", |
1043 | 14 | "ipmi.st48.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1044 | | |
1045 | 14 | { &hf_ipmi_stor_49_time, |
1046 | 14 | { "Time", |
1047 | 14 | "ipmi.st49.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1048 | | |
1049 | 14 | { &hf_ipmi_stor_5a_log_type, |
1050 | 14 | { "Log type", |
1051 | 14 | "ipmi.st5a.log_type", FT_UINT8, BASE_HEX, VALS(log_type_vals), 0x0f, NULL, HFILL }}, |
1052 | 14 | { &hf_ipmi_stor_5a_ts_add, |
1053 | 14 | { "Last addition timestamp", |
1054 | 14 | "ipmi.st5a.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1055 | 14 | { &hf_ipmi_stor_5a_num_entries, |
1056 | 14 | { "Number of entries in MCA Log", |
1057 | 14 | "ipmi.st5a.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1058 | 14 | { &hf_ipmi_stor_5a_iana, |
1059 | 14 | { "OEM IANA", |
1060 | 14 | "ipmi.st5a.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1061 | 14 | { &hf_ipmi_stor_5a_bytes, |
1062 | 14 | { "Log status bytes", |
1063 | 14 | "ipmi.st5a.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1064 | 14 | { &hf_ipmi_stor_5a_unknown, |
1065 | 14 | { "Unknown log format (cannot parse data)", |
1066 | 14 | "ipmi.st5a.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1067 | | |
1068 | 14 | { &hf_ipmi_stor_5b_log_type, |
1069 | 14 | { "Log type", |
1070 | 14 | "ipmi.st5b.log_type", FT_UINT8, BASE_HEX, VALS(log_type_vals), 0x0f, NULL, HFILL }}, |
1071 | 14 | { &hf_ipmi_stor_5b_ts_add, |
1072 | 14 | { "Last addition timestamp", |
1073 | 14 | "ipmi.st5b.ts_add", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1074 | 14 | { &hf_ipmi_stor_5b_num_entries, |
1075 | 14 | { "Number of entries in MCA Log", |
1076 | 14 | "ipmi.st5b.num_entries", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, |
1077 | 14 | { &hf_ipmi_stor_5b_iana, |
1078 | 14 | { "OEM IANA", |
1079 | 14 | "ipmi.st5b.iana", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }}, |
1080 | 14 | { &hf_ipmi_stor_5b_bytes, |
1081 | 14 | { "Log status bytes", |
1082 | 14 | "ipmi.st5b.bytes", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1083 | 14 | { &hf_ipmi_stor_5b_unknown, |
1084 | 14 | { "Unknown log format (cannot parse data)", |
1085 | 14 | "ipmi.st5b.unknown", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, |
1086 | | |
1087 | 14 | }; |
1088 | 14 | static int *ett[] = { |
1089 | 14 | &ett_ipmi_stor_10_flags, |
1090 | 14 | &ett_ipmi_stor_20_ops, |
1091 | 14 | &ett_ipmi_stor_25_byte6, |
1092 | 14 | &ett_ipmi_stor_27_status, |
1093 | 14 | &ett_ipmi_stor_2c_rq_byte1, |
1094 | 14 | &ett_ipmi_stor_2c_rs_byte1, |
1095 | 14 | &ett_ipmi_stor_40_ops, |
1096 | 14 | &ett_ipmi_stor_45_byte6, |
1097 | 14 | &ett_ipmi_stor_47_status, |
1098 | 14 | &ett_ipmi_stor_5a_byte1, |
1099 | 14 | &ett_ipmi_stor_5b_byte1, |
1100 | 14 | }; |
1101 | | |
1102 | 14 | proto_register_field_array(proto_ipmi, hf, array_length(hf)); |
1103 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
1104 | 14 | ipmi_register_netfn_cmdtab(IPMI_STORAGE_REQ, IPMI_OEM_NONE, NULL, 0, NULL, |
1105 | 14 | cmd_storage, array_length(cmd_storage)); |
1106 | 14 | } |
1107 | | |
1108 | | /* |
1109 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1110 | | * |
1111 | | * Local variables: |
1112 | | * c-basic-offset: 8 |
1113 | | * tab-width: 8 |
1114 | | * indent-tabs-mode: t |
1115 | | * End: |
1116 | | * |
1117 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
1118 | | * :indentSize=8:tabSize=8:noTabs=false: |
1119 | | */ |