1 /* based on SSC3 spec */
3 * dissect READPOSITION data
4 * dissect REPORTDENSITYSUPPORT data
7 * Dissector for the SCSI SSC commandset
8 * Extracted from packet-scsi.c
10 * Dinesh G Dutt (ddutt@cisco.com)
11 * Ronnie sahlberg 2006
13 * Wireshark - Network traffic analyzer
14 * By Gerald Combs <gerald@wireshark.org>
15 * Copyright 2002 Gerald Combs
17 * SPDX-License-Identifier: GPL-2.0-or-later
22 #include <epan/packet.h>
23 #include <epan/unit_strings.h>
25 #include <wsutil/array.h>
26 #include "packet-scsi.h"
27 #include "packet-scsi-ssc.h"
28 #include "packet-scsi-smc.h"
30 void proto_register_scsi_ssc(void);
32 static int proto_scsi_ssc
;
33 int hf_scsi_ssc_opcode
;
34 static int hf_scsi_ssc_rdwr6_xferlen
;
35 static int hf_scsi_ssc_ver16_verlen
;
36 static int hf_scsi_ssc_locate10_loid
;
37 static int hf_scsi_ssc_locate16_loid
;
38 static int hf_scsi_ssc_space6_code
;
39 static int hf_scsi_ssc_space6_count
;
40 static int hf_scsi_ssc_space16_count
;
41 static int hf_scsi_ssc_erase_flags
;
42 static int hf_scsi_ssc_fcs
;
43 static int hf_scsi_ssc_lcs
;
44 static int hf_scsi_ssc_erase_immed
;
45 static int hf_scsi_ssc_long
;
46 static int hf_scsi_ssc_partition
;
47 static int hf_scsi_ssc_lbi
;
48 static int hf_scsi_ssc_verify
;
49 static int hf_scsi_ssc_immed
;
50 static int hf_scsi_ssc_formatmedium_flags
;
51 static int hf_scsi_ssc_format
;
52 static int hf_scsi_ssc_rdwr10_xferlen
;
53 static int hf_scsi_ssc_loadunload_immed_flags
;
54 static int hf_scsi_ssc_loadunload_flags
;
55 static int hf_scsi_ssc_hold
;
56 static int hf_scsi_ssc_eot
;
57 static int hf_scsi_ssc_reten
;
58 static int hf_scsi_ssc_load
;
59 static int hf_scsi_ssc_locate_flags
;
60 static int hf_scsi_ssc_bt
;
61 static int hf_scsi_ssc_cp
;
62 static int hf_scsi_ssc_dest_type
;
63 static int hf_scsi_ssc_bam_flags
;
64 static int hf_scsi_ssc_bam
;
65 static int hf_scsi_ssc_read6_flags
;
66 static int hf_scsi_ssc_sili
;
67 static int hf_scsi_ssc_fixed
;
68 static int hf_scsi_ssc_bytord
;
69 static int hf_scsi_ssc_bytcmp
;
70 static int hf_scsi_ssc_verify16_immed
;
71 static int hf_scsi_ssc_medium_type
;
72 static int hf_scsi_ssc_media
;
73 static int hf_scsi_ssc_capacity_prop_value
;
74 /* Generated from convert_proto_tree_add_text.pl */
75 static int hf_scsi_ssc_readposition_block_number
;
76 static int hf_scsi_ssc_readposition_file_number
;
77 static int hf_scsi_ssc_readposition_parameter_len
;
78 static int hf_scsi_ssc_readblocklimits_max_block_length_limit
;
79 static int hf_scsi_ssc_readposition_set_number
;
80 static int hf_scsi_ssc_readblocklimits_granularity
;
81 static int hf_scsi_ssc_readposition_flags
;
82 static int hf_scsi_ssc_readposition_bop
;
83 static int hf_scsi_ssc_readposition_eop
;
84 static int hf_scsi_ssc_readposition_mpu
;
85 static int hf_scsi_ssc_readposition_bcu
;
86 static int hf_scsi_ssc_readposition_bycu
;
87 static int hf_scsi_ssc_readposition_bpu
;
88 static int hf_scsi_ssc_readposition_perr
;
91 static int hf_scsi_ssc_readposition_additional_length
;
92 static int hf_scsi_ssc_readposition_num_blocks_buffer
;
93 static int hf_scsi_ssc_readposition_last_block_location
;
94 static int hf_scsi_ssc_erase6_immed
;
95 static int hf_scsi_ssc_erase6_long
;
96 static int hf_scsi_ssc_readblocklimits_min_block_length_limit
;
97 static int hf_scsi_ssc_readposition_service_action
;
98 static int hf_scsi_ssc_readposition_num_bytes_buffer
;
99 static int hf_scsi_ssc_readposition_first_block_location
;
100 static int hf_scsi_ssc_space16_parameter_len
;
101 static int hf_scsi_ssc_readposition_partition_number
;
103 static int ett_scsi_erase
;
104 static int ett_scsi_formatmedium
;
105 static int ett_scsi_loadunload_immed
;
106 static int ett_scsi_loadunload
;
107 static int ett_scsi_locate
;
108 static int ett_scsi_bam
;
109 static int ett_scsi_read6
;
110 static int ett_scsi_ssc_readposition_flags
;
114 dissect_ssc_read6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
115 unsigned offset
, bool isreq
, bool iscdb
,
116 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
118 static int * const read6_fields
[] = {
125 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
126 tvb_get_ntoh24 (tvb
, offset
+1));
129 if (tree
&& isreq
&& iscdb
) {
130 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
131 ett_scsi_read6
, read6_fields
, ENC_BIG_ENDIAN
);
132 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
133 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
134 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
139 dissect_ssc_recoverbuffereddata (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
140 unsigned offset
, bool isreq
, bool iscdb
,
141 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
143 static int * const recover_fields
[] = {
150 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
151 tvb_get_ntoh24 (tvb
, offset
+1));
154 if (tree
&& isreq
&& iscdb
) {
155 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
156 ett_scsi_read6
, recover_fields
, ENC_BIG_ENDIAN
);
157 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
158 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
159 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
164 dissect_ssc_reportdensitysupport (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
165 unsigned offset
, bool isreq
, bool iscdb
,
166 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
168 static int * const rd_fields
[] = {
169 &hf_scsi_ssc_medium_type
,
175 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
176 tvb_get_ntoh24 (tvb
, offset
+1));
182 if (isreq
&& iscdb
) {
183 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
184 ett_scsi_read6
, rd_fields
, ENC_BIG_ENDIAN
);
185 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
186 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
187 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
189 /* XXX decode the data */
194 dissect_ssc_readreverse6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
195 unsigned offset
, bool isreq
, bool iscdb
,
196 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
198 static int * const rr6_fields
[] = {
206 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
207 tvb_get_ntoh24 (tvb
, offset
+1));
210 if (tree
&& isreq
&& iscdb
) {
211 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
212 ett_scsi_read6
, rr6_fields
, ENC_BIG_ENDIAN
);
213 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
214 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
215 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
220 dissect_ssc_read16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
221 unsigned offset
, bool isreq
, bool iscdb
,
222 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
224 static int * const read6_fields
[] = {
231 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
232 tvb_get_ntoh24 (tvb
, offset
+1));
235 if (tree
&& isreq
&& iscdb
) {
236 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
237 ett_scsi_read6
, read6_fields
, ENC_BIG_ENDIAN
);
238 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
239 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
240 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+11, 3, ENC_BIG_ENDIAN
);
241 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
242 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
247 dissect_ssc_write16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
248 unsigned offset
, bool isreq
, bool iscdb
,
249 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
251 static int * const write16_fields
[] = {
259 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
260 tvb_get_ntoh24 (tvb
, offset
+1));
263 if (tree
&& isreq
&& iscdb
) {
264 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
265 ett_scsi_read6
, write16_fields
, ENC_BIG_ENDIAN
);
266 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
267 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
268 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+11, 3, ENC_BIG_ENDIAN
);
269 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
270 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
275 dissect_ssc_writefilemarks16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
276 unsigned offset
, bool isreq
, bool iscdb
,
277 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
279 static int * const wf16_fields
[] = {
287 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
288 tvb_get_ntoh24 (tvb
, offset
+1));
291 if (tree
&& isreq
&& iscdb
) {
292 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
293 ett_scsi_read6
, wf16_fields
, ENC_BIG_ENDIAN
);
294 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
295 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
296 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+11, 3, ENC_BIG_ENDIAN
);
297 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
298 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
303 dissect_ssc_verify16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
304 unsigned offset
, bool isreq
, bool iscdb
,
305 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
307 static int * const verify16_fields
[] = {
308 &hf_scsi_ssc_verify16_immed
,
315 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
316 tvb_get_ntoh24 (tvb
, offset
+1));
319 if (tree
&& isreq
&& iscdb
) {
320 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
321 ett_scsi_read6
, verify16_fields
, ENC_BIG_ENDIAN
);
322 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
323 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
324 proto_tree_add_item (tree
, hf_scsi_ssc_ver16_verlen
, tvb
, offset
+11, 3, ENC_BIG_ENDIAN
);
325 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
326 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
331 dissect_ssc_verify6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
332 unsigned offset
, bool isreq
, bool iscdb
,
333 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
335 static int * const verify6_fields
[] = {
336 &hf_scsi_ssc_verify16_immed
,
343 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
344 tvb_get_ntoh24 (tvb
, offset
+1));
347 if (tree
&& isreq
&& iscdb
) {
348 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
349 ett_scsi_read6
, verify6_fields
, ENC_BIG_ENDIAN
);
350 proto_tree_add_item (tree
, hf_scsi_ssc_ver16_verlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
351 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
352 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
357 dissect_ssc_readreverse16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
358 unsigned offset
, bool isreq
, bool iscdb
,
359 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
361 static int * const rr16_fields
[] = {
369 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
370 tvb_get_ntoh24 (tvb
, offset
+1));
373 if (tree
&& isreq
&& iscdb
) {
374 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
375 ett_scsi_read6
, rr16_fields
, ENC_BIG_ENDIAN
);
376 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
377 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
378 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+11, 3, ENC_BIG_ENDIAN
);
379 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
380 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
385 dissect_ssc_write6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
386 unsigned offset
, bool isreq
, bool iscdb
,
387 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
389 static int * const write6_fields
[] = {
394 if (isreq
&& iscdb
) {
395 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
396 tvb_get_ntoh24 (tvb
, offset
+1));
399 if (tree
&& isreq
&& iscdb
) {
400 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
401 ett_scsi_read6
, write6_fields
, ENC_BIG_ENDIAN
);
402 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
403 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
404 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
409 dissect_ssc_writefilemarks6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
410 unsigned offset
, bool isreq
, bool iscdb
,
411 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
413 static int * const wf6_fields
[] = {
419 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Len: %u)",
420 tvb_get_ntoh24 (tvb
, offset
+1));
423 if (tree
&& isreq
&& iscdb
) {
424 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
425 ett_scsi_read6
, wf6_fields
, ENC_BIG_ENDIAN
);
426 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr6_xferlen
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
427 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
428 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
433 dissect_ssc_loadunload (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
434 unsigned offset
, bool isreq
, bool iscdb
,
435 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
437 static int * const loadunload_immed_fields
[] = {
441 static int * const loadunload_fields
[] = {
449 if (isreq
&& iscdb
) {
450 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Immed: %u)",
451 tvb_get_uint8 (tvb
, offset
) & 0x01);
458 if (isreq
&& iscdb
) {
459 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_loadunload_immed_flags
,
460 ett_scsi_loadunload_immed
, loadunload_immed_fields
, ENC_BIG_ENDIAN
);
461 proto_tree_add_bitmask(tree
, tvb
, offset
+3, hf_scsi_ssc_loadunload_flags
,
462 ett_scsi_loadunload
, loadunload_fields
, ENC_BIG_ENDIAN
);
463 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
464 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
470 dissect_ssc_readblocklimits (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
471 unsigned offset
, bool isreq
, bool iscdb
,
472 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
479 if (isreq
&& iscdb
) {
480 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
481 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
484 granularity
= tvb_get_uint8 (tvb
, offset
);
485 proto_tree_add_uint(tree
, hf_scsi_ssc_readblocklimits_granularity
, tvb
, offset
, 1, 1 << granularity
);
486 proto_tree_add_item(tree
, hf_scsi_ssc_readblocklimits_max_block_length_limit
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
487 proto_tree_add_item(tree
, hf_scsi_ssc_readblocklimits_min_block_length_limit
, tvb
, offset
+4, 2, ENC_BIG_ENDIAN
);
492 dissect_ssc_rewind (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
493 unsigned offset
, bool isreq
, bool iscdb
,
494 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
496 static int * const rewind_fields
[] = {
504 if (isreq
&& iscdb
) {
505 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(Immed: %u)",
506 tvb_get_uint8 (tvb
, offset
) & 0x01);
508 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
, ett_scsi_read6
, rewind_fields
, ENC_BIG_ENDIAN
);
509 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
510 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
515 dissect_ssc_setcapacity (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
516 unsigned offset
, bool isreq
, bool iscdb
,
517 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
519 static int * const sc_fields
[] = {
527 if (isreq
&& iscdb
) {
528 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_read6_flags
,
529 ett_scsi_read6
, sc_fields
, ENC_BIG_ENDIAN
);
530 proto_tree_add_item (tree
, hf_scsi_ssc_capacity_prop_value
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
531 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
532 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
538 dissect_ssc_locate10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
539 unsigned offset
, bool isreq
, bool iscdb
,
540 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
542 static int * const locate_fields
[] = {
552 if (isreq
&& iscdb
) {
553 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_locate_flags
,
554 ett_scsi_locate
, locate_fields
, ENC_BIG_ENDIAN
);
555 proto_tree_add_item (tree
, hf_scsi_ssc_locate10_loid
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
556 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
557 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
558 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
564 dissect_ssc_locate16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
565 unsigned offset
, bool isreq
, bool iscdb
,
566 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
568 static int * const locate_fields
[] = {
569 &hf_scsi_ssc_dest_type
,
574 static int * const bam_fields
[] = {
582 if (isreq
&& iscdb
) {
583 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_locate_flags
,
584 ett_scsi_locate
, locate_fields
, ENC_BIG_ENDIAN
);
585 proto_tree_add_bitmask(tree
, tvb
, offset
+1, hf_scsi_ssc_bam_flags
,
586 ett_scsi_bam
, bam_fields
, ENC_BIG_ENDIAN
);
587 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
588 proto_tree_add_item (tree
, hf_scsi_ssc_locate16_loid
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
589 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
590 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
596 dissect_ssc_erase6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
597 unsigned offset
, bool isreq
, bool iscdb
,
598 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
600 if (isreq
&& iscdb
) {
604 proto_tree_add_item(tree
, hf_scsi_ssc_erase6_immed
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
605 proto_tree_add_item(tree
, hf_scsi_ssc_erase6_long
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
607 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
608 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
614 dissect_ssc_erase16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
615 unsigned offset
, bool isreq
, bool iscdb
,
616 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
618 static int * const erase16_fields
[] = {
621 &hf_scsi_ssc_erase_immed
,
629 if (isreq
&& iscdb
) {
630 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_erase_flags
,
631 ett_scsi_erase
, erase16_fields
, ENC_BIG_ENDIAN
);
632 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
633 proto_tree_add_item (tree
, hf_scsi_ssc_lbi
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
634 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
635 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
640 dissect_ssc_space6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
641 unsigned offset
, bool isreq
, bool iscdb
,
642 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
647 if (isreq
&& iscdb
) {
648 proto_tree_add_item (tree
, hf_scsi_ssc_space6_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
649 proto_tree_add_item (tree
, hf_scsi_ssc_space6_count
, tvb
, offset
+1, 3, ENC_BIG_ENDIAN
);
650 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
651 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
656 dissect_ssc_space16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
657 unsigned offset
, bool isreq
, bool iscdb
,
658 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
663 if (isreq
&& iscdb
) {
664 proto_tree_add_item (tree
, hf_scsi_ssc_space6_code
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
665 proto_tree_add_item (tree
, hf_scsi_ssc_space16_count
, tvb
, offset
+3, 8, ENC_BIG_ENDIAN
);
666 proto_tree_add_item(tree
, hf_scsi_ssc_space16_parameter_len
, tvb
, offset
+11, 2, ENC_BIG_ENDIAN
);
667 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
668 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
672 static const value_string space6_code_vals
[] = {
673 {0, "Logical Blocks"},
675 {2, "Sequential Filemarks"},
680 static const value_string format_vals
[] = {
681 {0x0, "Use default format"},
682 {0x1, "Partition medium"},
683 {0x2, "Default format then partition"},
687 static const value_string dest_type_vals
[] = {
688 {0, "Logical Object Identifier"},
689 {1, "Logical File Identifier"},
694 dissect_ssc_formatmedium (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
695 unsigned offset
, bool isreq
, bool iscdb
,
696 unsigned payload_len _U_
, scsi_task_data_t
*cdata _U_
)
698 static int * const formatmedium_fields
[] = {
707 if (isreq
&& iscdb
) {
708 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_formatmedium_flags
,
709 ett_scsi_formatmedium
, formatmedium_fields
, ENC_BIG_ENDIAN
);
710 proto_tree_add_item (tree
, hf_scsi_ssc_format
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
711 proto_tree_add_item (tree
, hf_scsi_ssc_rdwr10_xferlen
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
712 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
713 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
724 dissect_ssc_readposition (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
725 unsigned offset
, bool isreq
, bool iscdb
,
726 unsigned payload_len _U_
, scsi_task_data_t
*cdata
)
734 if (isreq
&& iscdb
) {
735 service_action
= tvb_get_uint8 (tvb
, offset
) & 0x1F;
736 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_service_action
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
737 /* Remember the service action so we can decode the reply */
739 cdata
->itlq
->flags
= service_action
;
741 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_parameter_len
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
742 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
743 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
747 service_action
= cdata
->itlq
->flags
;
749 service_action
= -1; /* unknown */
750 switch (service_action
) {
751 case SHORT_FORM_BLOCK_ID
:
752 case SHORT_FORM_VENDOR_SPECIFIC
:
754 static int * const block_id_flags
[] = {
755 &hf_scsi_ssc_readposition_bop
,
756 &hf_scsi_ssc_readposition_eop
,
757 &hf_scsi_ssc_readposition_bcu
,
758 &hf_scsi_ssc_readposition_bycu
,
759 &hf_scsi_ssc_readposition_bpu
,
760 &hf_scsi_ssc_readposition_perr
,
764 flags
= tvb_get_uint8 (tvb
, offset
);
765 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_readposition_flags
,
766 ett_scsi_ssc_readposition_flags
, block_id_flags
, ENC_NA
);
769 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
772 offset
+= 2; /* reserved */
774 if (!(flags
& BPU
)) {
775 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_first_block_location
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
778 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_last_block_location
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
783 offset
+= 1; /* reserved */
785 if (!(flags
& BCU
)) {
786 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_num_blocks_buffer
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
790 if (!(flags
& BYCU
)) {
791 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_num_bytes_buffer
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
799 static int * const long_form_flags
[] = {
800 &hf_scsi_ssc_readposition_bop
,
801 &hf_scsi_ssc_readposition_eop
,
802 &hf_scsi_ssc_readposition_mpu
,
803 &hf_scsi_ssc_readposition_bcu
,
807 flags
= tvb_get_uint8 (tvb
, offset
);
808 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_readposition_flags
,
809 ett_scsi_ssc_readposition_flags
, long_form_flags
, ENC_NA
);
812 offset
+= 3; /* reserved */
814 if (!(flags
& BPU
)) {
815 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_partition_number
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
818 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_block_number
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
823 if (!(flags
& MPU
)) {
824 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_file_number
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
827 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_set_number
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
837 static int * const extended_form_flags
[] = {
838 &hf_scsi_ssc_readposition_bop
,
839 &hf_scsi_ssc_readposition_eop
,
840 &hf_scsi_ssc_readposition_bcu
,
841 &hf_scsi_ssc_readposition_bycu
,
842 &hf_scsi_ssc_readposition_mpu
,
843 &hf_scsi_ssc_readposition_bpu
,
844 &hf_scsi_ssc_readposition_perr
,
848 flags
= tvb_get_uint8 (tvb
, offset
);
849 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_ssc_readposition_flags
,
850 ett_scsi_ssc_readposition_flags
, extended_form_flags
, ENC_NA
);
853 proto_tree_add_item (tree
, hf_scsi_ssc_partition
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
856 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_additional_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
859 offset
+= 1; /* reserved */
861 if (!(flags
& BCU
)) {
862 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_num_blocks_buffer
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
866 if (!(flags
& BPU
)) {
867 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_first_block_location
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
870 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_last_block_location
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
875 offset
+= 1; /* reserved */
877 if (!(flags
& BYCU
)) {
878 proto_tree_add_item(tree
, hf_scsi_ssc_readposition_num_bytes_buffer
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
892 static const value_string scsi_ssc_vals
[] = {
893 /* 0x00 */ {SCSI_SPC_TESTUNITRDY
, "Test Unit Ready"},
894 /* 0x01 */ {SCSI_SSC_REWIND
, "Rewind"},
895 /* 0x03 */ {SCSI_SPC_REQSENSE
, "Request Sense"},
896 /* 0x04 */ {SCSI_SSC_FORMAT_MEDIUM
, "Format Medium"},
897 /* 0x05 */ {SCSI_SSC_READ_BLOCK_LIMITS
, "Read Block Limits"},
898 /* 0x08 */ {SCSI_SSC_READ6
, "Read(6)"},
899 /* 0x0A */ {SCSI_SSC_WRITE6
, "Write(6)"},
900 /* 0x0B */ {SCSI_SSC_SET_CAPACITY
, "Set Capacity"},
901 /* 0x0F */ {SCSI_SSC_READ_REVERSE_6
, "Read Reverse(6)"},
902 /* 0x10 */ {SCSI_SSC_WRITE_FILEMARKS_6
, "Write Filemarks(6)"},
903 /* 0x11 */ {SCSI_SSC_SPACE_6
, "Space(6)"},
904 /* 0x12 */ {SCSI_SPC_INQUIRY
, "Inquiry"},
905 /* 0x13 */ {SCSI_SSC_VERIFY_6
, "Verify(6)"},
906 /* 0x14 */ {SCSI_SSC_RECOVER_BUFFERED_DATA
, "Recover Buffered Data"},
907 /* 0x15 */ {SCSI_SPC_MODESELECT6
, "Mode Select(6)"},
908 /* 0x16 */ {SCSI_SPC_RESERVE6
, "Reserve(6)"},
909 /* 0x17 */ {SCSI_SPC_RELEASE6
, "Release(6)"},
910 /* 0x19 */ {SCSI_SSC_ERASE_6
, "Erase(6)"},
911 /* 0x1A */ {SCSI_SPC_MODESENSE6
, "Mode Sense(6)"},
912 /* 0x1B */ {SCSI_SSC_LOAD_UNLOAD
, "Load Unload"},
913 /* 0x1D */ {SCSI_SPC_SENDDIAG
, "Send Diagnostic"},
914 /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL
, "Prevent/Allow Medium Removal"},
915 /* 0x2B */ {SCSI_SSC_LOCATE_10
, "Locate(10)"},
916 /* 0x34 */ {SCSI_SSC_READ_POSITION
, "Read Position"},
917 /* 0x3B */ {SCSI_SPC_WRITEBUFFER
, "Write Buffer"},
918 /* 0x44 */ {SCSI_SSC_REPORT_DENSITY_SUPPORT
, "Report Density Support"},
919 /* 0x4C */ {SCSI_SPC_LOGSELECT
, "Log Select"},
920 /* 0x4D */ {SCSI_SPC_LOGSENSE
, "Log Sense"},
921 /* 0x55 */ {SCSI_SPC_MODESELECT10
, "Mode Select(10)"},
922 /* 0x5A */ {SCSI_SPC_MODESENSE10
, "Mode Sense(10)"},
923 /* 0x5E */ {SCSI_SPC_PERSRESVIN
, "Persistent Reserve In"},
924 /* 0x5F */ {SCSI_SPC_PERSRESVOUT
, "Persistent Reserve Out"},
925 /* 0x80 */ {SCSI_SSC_WRITE_FILEMARKS_16
, "Write Filemarks(16)"},
926 /* 0x81 */ {SCSI_SSC_READ_REVERSE_16
, "Read Reverse(16)"},
927 /* 0x83 */ {SCSI_SPC_EXTCOPY
, "Extended Copy"},
928 /* 0x88 */ {SCSI_SSC_READ_16
, "Read(16)"},
929 /* 0x8A */ {SCSI_SSC_WRITE_16
, "Write(16)"},
930 /* 0x8F */ {SCSI_SSC_VERIFY_16
, "Verify(16)"},
931 /* 0x91 */ {SCSI_SSC_SPACE_16
, "Space(16)"},
932 /* 0x92 */ {SCSI_SSC_LOCATE_16
, "Locate(16)"},
933 /* 0x93 */ {SCSI_SSC_ERASE_16
, "Erase(16)"},
934 /* 0xA0 */ {SCSI_SPC_REPORTLUNS
, "Report LUNs"},
935 /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN
, "Mgmt Protocol In"},
936 /* 0xA5 */ {SCSI_SMC_MOVE_MEDIUM
, "Move Medium"},
937 /* 0xA7 */ {SCSI_SMC_MOVE_MEDIUM_ATTACHED
, "Move Medium Attached"},
938 /* 0xB4 */ {SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED
, "Read Element Status Attached"},
939 /* 0xB8 */ {SCSI_SMC_READ_ELEMENT_STATUS
, "Read Element Status"},
942 value_string_ext scsi_ssc_vals_ext
= VALUE_STRING_EXT_INIT(scsi_ssc_vals
);
945 const scsi_cdb_table_t scsi_ssc_table
[256] = {
946 /*SPC 0x00*/{dissect_spc_testunitready
},
947 /*SSC 0x01*/{dissect_ssc_rewind
},
949 /*SPC 0x03*/{dissect_spc_requestsense
},
950 /*SSC 0x04*/{dissect_ssc_formatmedium
},
951 /*SSC 0x05*/{dissect_ssc_readblocklimits
},
954 /*SSC 0x08*/{dissect_ssc_read6
},
956 /*SSC 0x0a*/{dissect_ssc_write6
},
957 /*SSC 0x0b*/{dissect_ssc_setcapacity
},
961 /*SSC 0x0f*/{dissect_ssc_readreverse6
},
962 /*SSC 0x10*/{dissect_ssc_writefilemarks6
},
963 /*SSC 0x11*/{dissect_ssc_space6
},
964 /*SPC 0x12*/{dissect_spc_inquiry
},
965 /*SSC 0x13*/{dissect_ssc_verify6
},
966 /*SSC 0x14*/{dissect_ssc_recoverbuffereddata
},
967 /*SPC 0x15*/{dissect_spc_modeselect6
},
968 /*SSC 0x16*/{dissect_spc_reserve6
},
969 /*SSC 0x17*/{dissect_spc_release6
},
971 /*SSC 0x19*/{dissect_ssc_erase6
},
972 /*SPC 0x1a*/{dissect_spc_modesense6
},
973 /*SSC 0x1b*/{dissect_ssc_loadunload
},
975 /*SPC 0x1d*/{dissect_spc_senddiagnostic
},
976 /*SSC 0x1e*/{dissect_spc_preventallowmediaremoval
},
989 /*SSC 0x2b*/{dissect_ssc_locate10
},
998 /*SSC 0x34*/{dissect_ssc_readposition
},
1005 /*SPC 0x3b*/{dissect_spc_writebuffer
},
1014 /*SSC 0x44*/{dissect_ssc_reportdensitysupport
},
1022 /*SPC 0x4c*/{dissect_spc_logselect
},
1023 /*SPC 0x4d*/{dissect_spc_logsense
},
1031 /*SPC 0x55*/{dissect_spc_modeselect10
},
1036 /*SPC 0x5a*/{dissect_spc_modesense10
},
1040 /*SPC 0x5e*/{dissect_spc_persistentreservein
},
1041 /*SPC 0x5f*/{dissect_spc_persistentreserveout
},
1074 /*SSC 0x80*/{dissect_ssc_writefilemarks16
},
1075 /*SSC 0x81*/{dissect_ssc_readreverse16
},
1077 /*SPC 0x83*/{dissect_spc_extcopy
},
1082 /*SSC 0x88*/{dissect_ssc_read16
},
1084 /*SSC 0x8a*/{dissect_ssc_write16
},
1089 /*SSC 0x8f*/{dissect_ssc_verify16
},
1091 /*SSC 0x91*/{dissect_ssc_space16
},
1092 /*SSC 0x92*/{dissect_ssc_locate16
},
1093 /*SSC 0x93*/{dissect_ssc_erase16
},
1106 /*SPC 0xa0*/{dissect_spc_reportluns
},
1109 /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in
},
1111 /*SSC 0xa5*/{dissect_smc_movemedium
},
1113 /*SSC 0xa7*/{dissect_smc_movemedium
},
1126 /*SSC 0xb4*/{dissect_smc_readelementstatus
},
1130 /*SSC 0xb8*/{dissect_smc_readelementstatus
},
1207 proto_register_scsi_ssc(void)
1209 static hf_register_info hf
[] = {
1210 { &hf_scsi_ssc_opcode
,
1211 {"SSC Opcode", "scsi_ssc.opcode", FT_UINT8
, BASE_HEX
| BASE_EXT_STRING
,
1212 &scsi_ssc_vals_ext
, 0x0, NULL
, HFILL
}},
1213 { &hf_scsi_ssc_rdwr6_xferlen
,
1214 {"Transfer Length", "scsi_ssc.rdwr6.xferlen", FT_UINT24
, BASE_DEC
, NULL
, 0x0,
1216 { &hf_scsi_ssc_ver16_verlen
,
1217 {"Verification Length", "scsi_ssc.verify16.verify_len", FT_UINT24
, BASE_DEC
, NULL
, 0x0,
1219 { &hf_scsi_ssc_locate10_loid
,
1220 {"Logical Object Identifier", "scsi_ssc.locate10.loid", FT_UINT32
, BASE_DEC
, NULL
, 0x0,
1222 { &hf_scsi_ssc_locate16_loid
,
1223 {"Logical Identifier", "scsi_ssc.locate16.loid", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
1225 { &hf_scsi_ssc_space6_count
,
1226 {"Count", "scsi_ssc.space6.count", FT_INT24
, BASE_DEC
, NULL
, 0x0,
1228 { &hf_scsi_ssc_space6_code
,
1229 {"Code", "scsi_ssc.space6.code", FT_UINT8
, BASE_HEX
,
1230 VALS(space6_code_vals
), 0x0f,
1232 { &hf_scsi_ssc_space16_count
,
1233 {"Count", "scsi_ssc.space16.count", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
1235 { &hf_scsi_ssc_rdwr10_xferlen
,
1236 {"Transfer Length", "scsi_ssc.rdwr10.xferlen", FT_UINT16
, BASE_DEC
, NULL
,
1238 { &hf_scsi_ssc_erase_flags
,
1239 {"Flags", "scsi_ssc.erase_flags", FT_UINT8
, BASE_HEX
,
1240 NULL
, 0x0, NULL
, HFILL
}},
1242 {"FCS", "scsi_ssc.fcs", FT_BOOLEAN
, 8,
1243 NULL
, 0x08, NULL
, HFILL
}},
1245 {"LCS", "scsi_ssc.lcs", FT_BOOLEAN
, 8,
1246 NULL
, 0x04, NULL
, HFILL
}},
1247 { &hf_scsi_ssc_erase_immed
,
1248 {"IMMED", "scsi_ssc.erase_immed", FT_BOOLEAN
, 8,
1249 NULL
, 0x02, NULL
, HFILL
}},
1250 { &hf_scsi_ssc_long
,
1251 {"LONG", "scsi_ssc.long", FT_BOOLEAN
, 8,
1252 NULL
, 0x01, NULL
, HFILL
}},
1253 { &hf_scsi_ssc_partition
,
1254 {"Partition", "scsi_ssc.partition", FT_UINT8
, BASE_HEX
,
1255 NULL
, 0x0, NULL
, HFILL
}},
1257 {"Logical Block Identifier", "scsi_ssc.lbi", FT_UINT64
, BASE_HEX
,
1258 NULL
, 0x0, NULL
, HFILL
}},
1259 { &hf_scsi_ssc_verify
,
1260 {"VERIFY", "scsi_ssc.verify", FT_BOOLEAN
, 8,
1261 NULL
, 0x02, NULL
, HFILL
}},
1262 { &hf_scsi_ssc_immed
,
1263 {"IMMED", "scsi_ssc.immed", FT_BOOLEAN
, 8,
1264 NULL
, 0x01, NULL
, HFILL
}},
1265 { &hf_scsi_ssc_formatmedium_flags
,
1266 {"Flags", "scsi_ssc.formatmedium_flags", FT_UINT8
, BASE_HEX
,
1267 NULL
, 0x0, NULL
, HFILL
}},
1268 { &hf_scsi_ssc_format
,
1269 {"Format", "scsi_ssc.format", FT_UINT8
, BASE_HEX
,
1270 VALS(format_vals
), 0x0f, NULL
, HFILL
}},
1271 { &hf_scsi_ssc_loadunload_immed_flags
,
1272 {"Immed", "scsi_ssc.loadunload_immed_flags", FT_UINT8
, BASE_HEX
,
1273 NULL
, 0x0, NULL
, HFILL
}},
1274 { &hf_scsi_ssc_loadunload_flags
,
1275 {"Flags", "scsi_ssc.loadunload_flags", FT_UINT8
, BASE_HEX
,
1276 NULL
, 0x0, NULL
, HFILL
}},
1277 { &hf_scsi_ssc_hold
,
1278 {"HOLD", "scsi_ssc.hold", FT_BOOLEAN
, 8,
1279 NULL
, 0x08, NULL
, HFILL
}},
1281 {"EOT", "scsi_ssc.eot", FT_BOOLEAN
, 8,
1282 NULL
, 0x04, NULL
, HFILL
}},
1283 { &hf_scsi_ssc_reten
,
1284 {"RETEN", "scsi_ssc.reten", FT_BOOLEAN
, 8,
1285 NULL
, 0x02, NULL
, HFILL
}},
1286 { &hf_scsi_ssc_load
,
1287 {"LOAD", "scsi_ssc.load", FT_BOOLEAN
, 8,
1288 NULL
, 0x01, NULL
, HFILL
}},
1289 { &hf_scsi_ssc_locate_flags
,
1290 {"Flags", "scsi_ssc.locate_flags", FT_UINT8
, BASE_HEX
,
1291 NULL
, 0x0, NULL
, HFILL
}},
1293 {"BT", "scsi_ssc.bt", FT_BOOLEAN
, 8,
1294 NULL
, 0x04, NULL
, HFILL
}},
1296 {"CP", "scsi_ssc.cp", FT_BOOLEAN
, 8,
1297 NULL
, 0x02, NULL
, HFILL
}},
1298 { &hf_scsi_ssc_dest_type
,
1299 {"Dest Type", "scsi_ssc.dest_type", FT_UINT8
, BASE_HEX
,
1300 VALS(dest_type_vals
), 0x18, NULL
, HFILL
}},
1301 { &hf_scsi_ssc_bam_flags
,
1302 {"Flags", "scsi_ssc.bam_flags", FT_UINT8
, BASE_HEX
,
1303 NULL
, 0x0, NULL
, HFILL
}},
1305 {"BAM", "scsi_ssc.bam", FT_BOOLEAN
, 8,
1306 NULL
, 0x01, NULL
, HFILL
}},
1307 { &hf_scsi_ssc_read6_flags
,
1308 {"Flags", "scsi_ssc.read6_flags", FT_UINT8
, BASE_HEX
,
1309 NULL
, 0x0, NULL
, HFILL
}},
1310 { &hf_scsi_ssc_sili
,
1311 {"SILI", "scsi_ssc.sili", FT_BOOLEAN
, 8,
1312 NULL
, 0x02, NULL
, HFILL
}},
1313 { &hf_scsi_ssc_fixed
,
1314 {"FIXED", "scsi_ssc.fixed", FT_BOOLEAN
, 8,
1315 NULL
, 0x01, NULL
, HFILL
}},
1316 { &hf_scsi_ssc_bytord
,
1317 {"BYTORD", "scsi_ssc.bytord", FT_BOOLEAN
, 8,
1318 NULL
, 0x04, NULL
, HFILL
}},
1319 { &hf_scsi_ssc_bytcmp
,
1320 {"BYTCMP", "scsi_ssc.bytcmp", FT_BOOLEAN
, 8,
1321 NULL
, 0x02, NULL
, HFILL
}},
1322 { &hf_scsi_ssc_verify16_immed
,
1323 {"IMMED", "scsi_ssc.verify16_immed", FT_BOOLEAN
, 8,
1324 NULL
, 0x04, NULL
, HFILL
}},
1325 { &hf_scsi_ssc_medium_type
,
1326 {"Medium Type", "scsi_ssc.medium_type", FT_BOOLEAN
, 8,
1327 NULL
, 0x02, NULL
, HFILL
}},
1328 { &hf_scsi_ssc_media
,
1329 {"Media", "scsi_ssc.media", FT_BOOLEAN
, 8,
1330 NULL
, 0x01, NULL
, HFILL
}},
1331 { &hf_scsi_ssc_capacity_prop_value
,
1332 {"Capacity Proportion Value", "scsi_ssc.cpv", FT_UINT16
, BASE_DEC
,
1333 NULL
, 0, NULL
, HFILL
}},
1334 /* Generated from convert_proto_tree_add_text.pl */
1335 { &hf_scsi_ssc_readblocklimits_granularity
, { "Granularity", "scsi_ssc.readblocklimits.granularity", FT_UINT8
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_byte_bytes
), 0x0, NULL
, HFILL
}},
1336 { &hf_scsi_ssc_readblocklimits_max_block_length_limit
, { "Maximum Block Length Limit", "scsi_ssc.readblocklimits.max_block_length_limit", FT_UINT24
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_byte_bytes
), 0x0, NULL
, HFILL
}},
1337 { &hf_scsi_ssc_readblocklimits_min_block_length_limit
, { "Minimum Block Length Limit", "scsi_ssc.readblocklimits.min_block_length_limit", FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_byte_bytes
), 0x0, NULL
, HFILL
}},
1338 { &hf_scsi_ssc_erase6_immed
, { "IMMED", "scsi_ssc.erase6.immed", FT_UINT8
, BASE_DEC
, NULL
, 0x02, NULL
, HFILL
}},
1339 { &hf_scsi_ssc_erase6_long
, { "LONG", "scsi_ssc.erase6.long", FT_UINT8
, BASE_DEC
, NULL
, 0x01, NULL
, HFILL
}},
1340 { &hf_scsi_ssc_space16_parameter_len
, { "Parameter Len", "scsi_ssc.space16.parameter_len", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1341 { &hf_scsi_ssc_readposition_service_action
, { "Service Action", "scsi_ssc.readposition.service_action", FT_UINT8
, BASE_DEC
, VALS(service_action_vals
), 0x1F, NULL
, HFILL
}},
1342 { &hf_scsi_ssc_readposition_parameter_len
, { "Parameter Len", "scsi_ssc.readposition.parameter_len", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1343 { &hf_scsi_ssc_readposition_flags
, { "Flags", "scsi_ssc.readposition.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
1344 { &hf_scsi_ssc_readposition_bop
, { "BOP", "scsi_ssc.readposition.bop", FT_UINT8
, BASE_DEC
, NULL
, 0x80, NULL
, HFILL
}},
1345 { &hf_scsi_ssc_readposition_eop
, { "EOP", "scsi_ssc.readposition.eop", FT_UINT8
, BASE_DEC
, NULL
, 0x40, NULL
, HFILL
}},
1346 { &hf_scsi_ssc_readposition_mpu
, { "EOP", "scsi_ssc.readposition.mpu", FT_UINT8
, BASE_DEC
, NULL
, MPU
, NULL
, HFILL
}},
1347 { &hf_scsi_ssc_readposition_bcu
, { "BCU", "scsi_ssc.readposition.bcu", FT_UINT8
, BASE_DEC
, NULL
, BCU
, NULL
, HFILL
}},
1348 { &hf_scsi_ssc_readposition_bycu
, { "BYCU", "scsi_ssc.readposition.bycu", FT_UINT8
, BASE_DEC
, NULL
, BYCU
, NULL
, HFILL
}},
1349 { &hf_scsi_ssc_readposition_bpu
, { "BPU", "scsi_ssc.readposition.bpu", FT_UINT8
, BASE_DEC
, NULL
, BPU
, NULL
, HFILL
}},
1350 { &hf_scsi_ssc_readposition_perr
, { "PERR", "scsi_ssc.readposition.perr", FT_UINT8
, BASE_DEC
, NULL
, 0x02, NULL
, HFILL
}},
1351 { &hf_scsi_ssc_readposition_first_block_location
, { "First Block Location", "scsi_ssc.readposition.first_block_location", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1352 { &hf_scsi_ssc_readposition_last_block_location
, { "Last Block Location", "scsi_ssc.readposition.last_block_location", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1353 { &hf_scsi_ssc_readposition_num_blocks_buffer
, { "Number of Blocks in Buffer", "scsi_ssc.readposition.num_blocks_buffer", FT_UINT24
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1354 { &hf_scsi_ssc_readposition_num_bytes_buffer
, { "Number of Bytes in Buffer", "scsi_ssc.readposition.num_bytes_buffer", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1355 { &hf_scsi_ssc_readposition_partition_number
, { "Partition Number", "scsi_ssc.readposition.partition_number", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1356 { &hf_scsi_ssc_readposition_block_number
, { "Block Number", "scsi_ssc.readposition.block_number", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1357 { &hf_scsi_ssc_readposition_file_number
, { "File Number", "scsi_ssc.readposition.file_number", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1358 { &hf_scsi_ssc_readposition_set_number
, { "Set Number", "scsi_ssc.readposition.set_number", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1359 { &hf_scsi_ssc_readposition_additional_length
, { "Additional Length", "scsi_ssc.readposition.additional_length", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1363 /* Setup protocol subtree array */
1364 static int *ett
[] = {
1366 &ett_scsi_formatmedium
,
1367 &ett_scsi_loadunload_immed
,
1368 &ett_scsi_loadunload
,
1372 &ett_scsi_ssc_readposition_flags
1376 /* Register the protocol name and description */
1377 proto_scsi_ssc
= proto_register_protocol("SCSI_SSC", "SCSI_SSC", "scsi_ssc");
1379 /* Required function calls to register the header fields and subtrees used */
1380 proto_register_field_array(proto_scsi_ssc
, hf
, array_length(hf
));
1382 proto_register_subtree_array(ett
, array_length(ett
));
1387 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1392 * indent-tabs-mode: nil
1395 * vi: set shiftwidth=4 tabstop=8 expandtab:
1396 * :indentSize=4:tabSize=8:noTabs=true: