1 /* This dissector is based on the SBC2 specification.
9 * Some DATA IN/OUT PDUs are missing as well.
12 * Dissector for the SCSI SBC commandset
13 * Extracted from packet-scsi.c
15 * Dinesh G Dutt (ddutt@cisco.com)
16 * Ronnie sahlberg 2006
20 * Wireshark - Network traffic analyzer
21 * By Gerald Combs <gerald@wireshark.org>
22 * Copyright 2002 Gerald Combs
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation; either version 2
27 * of the License, or (at your option) any later version.
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with this program; if not, write to the Free Software
36 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
42 #include <epan/packet.h>
43 #include <epan/conversation.h>
45 #include "packet-scsi.h"
46 #include "packet-fc.h"
47 #include "packet-scsi-sbc.h"
50 static int proto_scsi_sbc
= -1;
52 int hf_scsi_sbc_opcode
= -1;
53 static int hf_scsi_sbc_formatunit_flags
= -1;
54 static int hf_scsi_sbc_defect_list_format
= -1;
55 static int hf_scsi_sbc_formatunit_vendor
= -1;
56 static int hf_scsi_sbc_formatunit_interleave
= -1;
57 static int hf_scsi_sbc_rdwr6_lba
= -1;
58 static int hf_scsi_sbc_rdwr6_xferlen
= -1;
59 static int hf_scsi_sbc_rdwr10_lba
= -1;
60 static int hf_scsi_sbc_rdwr10_xferlen
= -1;
61 static int hf_scsi_sbc_rdwr12_xferlen
= -1;
62 static int hf_scsi_sbc_rdwr16_lba
= -1;
63 static int hf_scsi_sbc_ssu_immed_flags
= -1;
64 static int hf_scsi_sbc_ssu_immed
= -1;
65 static int hf_scsi_sbc_ssu_pwr_flags
= -1;
66 static int hf_scsi_sbc_ssu_pwr_cond
= -1;
67 static int hf_scsi_sbc_ssu_loej
= -1;
68 static int hf_scsi_sbc_ssu_start
= -1;
69 static int hf_scsi_sbc_bytchk
= -1;
70 /* static int hf_scsi_sbc_verify_reladdr= -1; */
71 static int hf_scsi_sbc_verify_lba
= -1;
72 static int hf_scsi_sbc_verify_lba64
= -1;
73 static int hf_scsi_sbc_verify_vlen
= -1;
74 static int hf_scsi_sbc_verify_vlen32
= -1;
75 static int hf_scsi_sbc_wrverify_lba
= -1;
76 static int hf_scsi_sbc_wrverify_xferlen
= -1;
77 static int hf_scsi_sbc_wrverify_lba64
= -1;
78 static int hf_scsi_sbc_wrverify_xferlen32
= -1;
79 /* static int hf_scsi_sbc_readcapacity_flags= -1; */
80 static int hf_scsi_sbc_readdefdata_flags
= -1;
81 static int hf_scsi_sbc_reassignblks_flags
= -1;
82 static int hf_scsi_sbc_read_flags
= -1;
83 static int hf_scsi_sbc_alloclen32
= -1;
84 static int hf_scsi_sbc_alloclen16
= -1;
85 static int hf_scsi_sbc_fuflags_fmtpinfo
= -1;
86 static int hf_scsi_sbc_fuflags_rto_req
= -1;
87 static int hf_scsi_sbc_fuflags_longlist
= -1;
88 static int hf_scsi_sbc_fuflags_fmtdata
= -1;
89 static int hf_scsi_sbc_fuflags_cmplist
= -1;
90 static int hf_scsi_sbc_prefetch_flags
= -1;
91 static int hf_scsi_sbc_prefetch_immed
= -1;
92 static int hf_scsi_sbc_group
= -1;
93 static int hf_scsi_sbc_rdprotect
= -1;
94 static int hf_scsi_sbc_dpo
= -1;
95 static int hf_scsi_sbc_fua
= -1;
96 static int hf_scsi_sbc_fua_nv
= -1;
97 static int hf_scsi_sbc_blocksize
= -1;
98 static int hf_scsi_sbc_returned_lba
= -1;
99 static int hf_scsi_sbc_req_plist
= -1;
100 static int hf_scsi_sbc_req_glist
= -1;
101 static int hf_scsi_sbc_corrct_flags
= -1;
102 static int hf_scsi_sbc_corrct
= -1;
103 static int hf_scsi_sbc_reassignblocks_longlba
= -1;
104 static int hf_scsi_sbc_reassignblocks_longlist
= -1;
105 static int hf_scsi_sbc_synccache_flags
= -1;
106 static int hf_scsi_sbc_synccache_immed
= -1;
107 static int hf_scsi_sbc_synccache_sync_nv
= -1;
108 static int hf_scsi_sbc_vrprotect
= -1;
109 static int hf_scsi_sbc_verify_flags
= -1;
110 static int hf_scsi_sbc_wrprotect
= -1;
111 static int hf_scsi_sbc_wrverify_flags
= -1;
112 static int hf_scsi_sbc_writesame_flags
= -1;
113 static int hf_scsi_sbc_anchor
= -1;
114 static int hf_scsi_sbc_unmap
= -1;
115 static int hf_scsi_sbc_pbdata
= -1;
116 static int hf_scsi_sbc_lbdata
= -1;
117 static int hf_scsi_sbc_xdread_flags
= -1;
118 static int hf_scsi_sbc_xorpinfo
= -1;
119 static int hf_scsi_sbc_disable_write
= -1;
120 static int hf_scsi_sbc_xdwrite_flags
= -1;
121 static int hf_scsi_sbc_xdwriteread_flags
= -1;
122 static int hf_scsi_sbc_xpwrite_flags
= -1;
123 static int hf_scsi_sbc_unmap_flags
= -1;
124 static int hf_scsi_sbc_unmap_anchor
= -1;
125 static int hf_scsi_sbc_unmap_data_length
= -1;
126 static int hf_scsi_sbc_unmap_block_descriptor_data_length
= -1;
127 static int hf_scsi_sbc_unmap_lba
= -1;
128 static int hf_scsi_sbc_unmap_num_blocks
= -1;
129 static int hf_scsi_sbc_ptype
= -1;
130 static int hf_scsi_sbc_prot_en
= -1;
131 static int hf_scsi_sbc_p_i_exponent
= -1;
132 static int hf_scsi_sbc_lbppbe
= -1;
133 static int hf_scsi_sbc_lbpme
= -1;
134 static int hf_scsi_sbc_lbprz
= -1;
135 static int hf_scsi_sbc_lalba
= -1;
136 static int hf_scsi_sbc_get_lba_status_lba
= -1;
137 static int hf_scsi_sbc_get_lba_status_data_length
= -1;
138 static int hf_scsi_sbc_get_lba_status_num_blocks
= -1;
139 static int hf_scsi_sbc_get_lba_status_provisioning_status
= -1;
140 static int hf_scsi_sbc_sanitize_flags
= -1;
141 static int hf_scsi_sbc_sanitize_immed
= -1;
142 static int hf_scsi_sbc_sanitize_ause
= -1;
143 static int hf_scsi_sbc_sanitize_sa
= -1;
144 static int hf_scsi_sbc_sanitize_overwrite_flags
= -1;
145 static int hf_scsi_sbc_sanitize_invert
= -1;
146 static int hf_scsi_sbc_sanitize_test
= -1;
147 static int hf_scsi_sbc_sanitize_owcount
= -1;
148 static int hf_scsi_sbc_sanitize_pattern_length
= -1;
149 static int hf_scsi_sbc_sanitize_pattern
= -1;
151 static gint ett_scsi_format_unit
= -1;
152 static gint ett_scsi_prefetch
= -1;
153 static gint ett_scsi_rdwr
= -1;
154 static gint ett_scsi_xdread
= -1;
155 static gint ett_scsi_xdwrite
= -1;
156 static gint ett_scsi_xdwriteread
= -1;
157 static gint ett_scsi_xpwrite
= -1;
158 static gint ett_scsi_defectdata
= -1;
159 static gint ett_scsi_corrct
= -1;
160 static gint ett_scsi_reassign_blocks
= -1;
161 static gint ett_scsi_ssu_immed
= -1;
162 static gint ett_scsi_ssu_pwr
= -1;
163 static gint ett_scsi_synccache
= -1;
164 static gint ett_scsi_verify
= -1;
165 static gint ett_scsi_wrverify
= -1;
166 static gint ett_scsi_writesame
= -1;
167 static gint ett_scsi_unmap
= -1;
168 static gint ett_scsi_unmap_block_descriptor
= -1;
169 static gint ett_scsi_lba_status_descriptor
= -1;
170 static gint ett_scsi_sanitize
= -1;
171 static gint ett_scsi_sanitize_overwrite
= -1;
174 static const true_false_string dpo_tfs
= {
175 "Disable Page Out (don't cache this data)",
176 "Disable page out is DISABLED (cache this data)"
178 static const true_false_string fua_tfs
= {
179 "Read from the medium, not cache",
180 "Read from cache if possible"
182 static const true_false_string fua_nv_tfs
= {
183 "Read from volatile cache is NOT permitted",
184 "Read from volatile or non-volatile cache permitted"
187 static const true_false_string pmi_tfs
= {
194 dissect_sbc_formatunit (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
195 guint offset
, gboolean isreq
, gboolean iscdb
,
196 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
198 static const int *fuflags_fields
[] = {
199 &hf_scsi_sbc_fuflags_fmtpinfo
,
200 &hf_scsi_sbc_fuflags_rto_req
,
201 &hf_scsi_sbc_fuflags_longlist
,
202 &hf_scsi_sbc_fuflags_fmtdata
,
203 &hf_scsi_sbc_fuflags_cmplist
,
204 &hf_scsi_sbc_defect_list_format
,
211 if (isreq
&& iscdb
) {
212 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_formatunit_flags
,
213 ett_scsi_format_unit
, fuflags_fields
, ENC_BIG_ENDIAN
);
214 proto_tree_add_item (tree
, hf_scsi_sbc_formatunit_vendor
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
215 proto_tree_add_item (tree
, hf_scsi_sbc_formatunit_interleave
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
216 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
217 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
219 /* TODO : add dissection of DATA */
223 dissect_sbc_read6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
224 guint offset
, gboolean isreq
, gboolean iscdb
,
225 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
227 if (isreq
&& iscdb
) {
228 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%06x, Len: %u)",
229 tvb_get_ntoh24 (tvb
, offset
),
230 tvb_get_guint8 (tvb
, offset
+3));
233 if (tree
&& isreq
&& iscdb
) {
234 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr6_lba
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
235 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr6_xferlen
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
236 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
237 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
242 dissect_sbc_write6 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
243 guint offset
, gboolean isreq
, gboolean iscdb
,
244 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
246 if (isreq
&& iscdb
) {
247 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%06x, Len: %u)",
248 tvb_get_ntoh24 (tvb
, offset
),
249 tvb_get_guint8 (tvb
, offset
+3));
252 if (tree
&& isreq
&& iscdb
) {
253 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr6_lba
, tvb
, offset
, 3, ENC_BIG_ENDIAN
);
254 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr6_xferlen
, tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
255 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
256 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
261 dissect_sbc_prefetch10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
262 guint offset
, gboolean isreq
, gboolean iscdb
,
263 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
266 static const int *prefetch_fields
[] = {
267 &hf_scsi_sbc_prefetch_immed
,
271 if (isreq
&& iscdb
) {
272 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
273 tvb_get_ntohl (tvb
, offset
+1),
274 tvb_get_ntohs (tvb
, offset
+6));
277 if (tree
&& isreq
&& iscdb
) {
278 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_prefetch_flags
,
279 ett_scsi_prefetch
, prefetch_fields
, ENC_BIG_ENDIAN
);
280 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
281 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
282 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
283 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
284 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
289 dissect_sbc_synchronizecache10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
290 guint offset
, gboolean isreq
, gboolean iscdb
,
291 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
294 static const int *sync_fields
[] = {
295 &hf_scsi_sbc_synccache_sync_nv
,
296 &hf_scsi_sbc_synccache_immed
,
300 if (isreq
&& iscdb
) {
301 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
302 tvb_get_ntohl (tvb
, offset
+1),
303 tvb_get_ntohs (tvb
, offset
+6));
306 if (tree
&& isreq
&& iscdb
) {
307 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_synccache_flags
,
308 ett_scsi_synccache
, sync_fields
, ENC_BIG_ENDIAN
);
309 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
310 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
311 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
312 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
313 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
318 dissect_sbc_synchronizecache16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
319 guint offset
, gboolean isreq
, gboolean iscdb
,
320 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
323 static const int *sync_fields
[] = {
324 &hf_scsi_sbc_synccache_sync_nv
,
325 &hf_scsi_sbc_synccache_immed
,
329 if (isreq
&& iscdb
) {
330 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
331 tvb_get_ntoh64 (tvb
, offset
+1),
332 tvb_get_ntohl (tvb
, offset
+9));
335 if (tree
&& isreq
&& iscdb
) {
336 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_synccache_flags
,
337 ett_scsi_synccache
, sync_fields
, ENC_BIG_ENDIAN
);
338 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
339 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
340 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
341 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
342 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
347 dissect_sbc_prefetch16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
348 guint offset
, gboolean isreq
, gboolean iscdb
,
349 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
352 static const int *prefetch_fields
[] = {
353 &hf_scsi_sbc_prefetch_immed
,
357 if (isreq
&& iscdb
) {
358 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
359 tvb_get_ntoh64 (tvb
, offset
+1),
360 tvb_get_ntohl (tvb
, offset
+9));
363 if (tree
&& isreq
&& iscdb
) {
364 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_prefetch_flags
,
365 ett_scsi_prefetch
, prefetch_fields
, ENC_BIG_ENDIAN
);
366 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
367 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
368 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
369 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
370 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
375 dissect_sbc_read10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
376 guint offset
, gboolean isreq
, gboolean iscdb
,
377 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
380 static const int *rdwr10_fields
[] = {
381 &hf_scsi_sbc_rdprotect
,
388 if (isreq
&& iscdb
) {
389 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
390 tvb_get_ntohl (tvb
, offset
+1),
391 tvb_get_ntohs (tvb
, offset
+6));
394 if (tree
&& isreq
&& iscdb
) {
395 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
396 ett_scsi_rdwr
, rdwr10_fields
, ENC_BIG_ENDIAN
);
397 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
398 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
399 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
400 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
401 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
406 dissect_sbc_xdread10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
407 guint offset
, gboolean isreq
, gboolean iscdb
,
408 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
411 static const int *xdread10_fields
[] = {
412 &hf_scsi_sbc_xorpinfo
,
416 if (isreq
&& iscdb
) {
417 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
418 tvb_get_ntohl (tvb
, offset
+1),
419 tvb_get_ntohs (tvb
, offset
+6));
422 if (tree
&& isreq
&& iscdb
) {
423 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_xdread_flags
,
424 ett_scsi_xdread
, xdread10_fields
, ENC_BIG_ENDIAN
);
425 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
426 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
427 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
428 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
429 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
434 dissect_sbc_xdwrite10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
435 guint offset
, gboolean isreq
, gboolean iscdb
,
436 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
439 static const int *xdwrite10_fields
[] = {
440 &hf_scsi_sbc_wrprotect
,
443 &hf_scsi_sbc_disable_write
,
448 if (isreq
&& iscdb
) {
449 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
450 tvb_get_ntohl (tvb
, offset
+1),
451 tvb_get_ntohs (tvb
, offset
+6));
454 if (tree
&& isreq
&& iscdb
) {
455 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_xdwrite_flags
,
456 ett_scsi_xdwrite
, xdwrite10_fields
, ENC_BIG_ENDIAN
);
457 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
458 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
459 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
460 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
461 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
466 dissect_sbc_xdwriteread10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
467 guint offset
, gboolean isreq
, gboolean iscdb
,
468 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
471 static const int *xdwriteread10_fields
[] = {
472 &hf_scsi_sbc_wrprotect
,
475 &hf_scsi_sbc_disable_write
,
477 &hf_scsi_sbc_xorpinfo
,
481 if (isreq
&& iscdb
) {
482 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
483 tvb_get_ntohl (tvb
, offset
+1),
484 tvb_get_ntohs (tvb
, offset
+6));
487 if (tree
&& isreq
&& iscdb
) {
488 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_xdwriteread_flags
,
489 ett_scsi_xdwriteread
, xdwriteread10_fields
, ENC_BIG_ENDIAN
);
490 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
491 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
492 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
493 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
494 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
499 dissect_sbc_xpwrite10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
500 guint offset
, gboolean isreq
, gboolean iscdb
,
501 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
504 static const int *xpwrite10_fields
[] = {
508 &hf_scsi_sbc_xorpinfo
,
512 if (isreq
&& iscdb
) {
513 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
514 tvb_get_ntohl (tvb
, offset
+1),
515 tvb_get_ntohs (tvb
, offset
+6));
518 if (tree
&& isreq
&& iscdb
) {
519 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_xpwrite_flags
,
520 ett_scsi_xpwrite
, xpwrite10_fields
, ENC_BIG_ENDIAN
);
521 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
522 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
523 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
524 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
525 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
530 dissect_sbc_write10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
531 guint offset
, gboolean isreq
, gboolean iscdb
,
532 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
535 static const int *rdwr10_fields
[] = {
536 &hf_scsi_sbc_wrprotect
,
543 if (isreq
&& iscdb
) {
544 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
545 tvb_get_ntohl (tvb
, offset
+1),
546 tvb_get_ntohs (tvb
, offset
+6));
549 if (tree
&& isreq
&& iscdb
) {
550 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
551 ett_scsi_rdwr
, rdwr10_fields
, ENC_BIG_ENDIAN
);
552 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
553 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
554 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
555 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
556 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
561 dissect_sbc_read12 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
562 guint offset
, gboolean isreq
, gboolean iscdb
,
563 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
565 static const int *rdwr12_fields
[] = {
566 &hf_scsi_sbc_rdprotect
,
573 if (isreq
&& iscdb
) {
574 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
575 tvb_get_ntohl (tvb
, offset
+1),
576 tvb_get_ntohl (tvb
, offset
+5));
579 if (tree
&& isreq
&& iscdb
) {
580 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
581 ett_scsi_rdwr
, rdwr12_fields
, ENC_BIG_ENDIAN
);
582 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
583 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
584 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
585 proto_tree_add_bitmask(tree
, tvb
, offset
+10, hf_scsi_control
,
586 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
591 dissect_sbc_write12 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
592 guint offset
, gboolean isreq
, gboolean iscdb
,
593 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
595 static const int *rdwr12_fields
[] = {
596 &hf_scsi_sbc_wrprotect
,
603 if (isreq
&& iscdb
) {
604 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
605 tvb_get_ntohl (tvb
, offset
+1),
606 tvb_get_ntohl (tvb
, offset
+5));
609 if (tree
&& isreq
&& iscdb
) {
610 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
611 ett_scsi_rdwr
, rdwr12_fields
, ENC_BIG_ENDIAN
);
612 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
613 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
614 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
615 proto_tree_add_bitmask(tree
, tvb
, offset
+10, hf_scsi_control
,
616 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
621 dissect_sbc_read16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
622 guint offset
, gboolean isreq
, gboolean iscdb
,
623 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
625 static const int *rdwr16_fields
[] = {
626 &hf_scsi_sbc_rdprotect
,
633 if (isreq
&& iscdb
) {
634 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
635 tvb_get_ntoh64 (tvb
, offset
+1),
636 tvb_get_ntohl (tvb
, offset
+9));
639 if (tree
&& isreq
&& iscdb
) {
640 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
641 ett_scsi_rdwr
, rdwr16_fields
, ENC_BIG_ENDIAN
);
642 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
643 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
644 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
645 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
646 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
650 dissect_sbc_write16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
651 guint offset
, gboolean isreq
, gboolean iscdb
,
652 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
654 static const int *rdwr16_fields
[] = {
655 &hf_scsi_sbc_wrprotect
,
662 if (isreq
&& iscdb
) {
663 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
664 tvb_get_ntoh64 (tvb
, offset
+1),
665 tvb_get_ntohl (tvb
, offset
+9));
668 if (tree
&& isreq
&& iscdb
) {
669 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
670 ett_scsi_rdwr
, rdwr16_fields
, ENC_BIG_ENDIAN
);
671 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
672 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
673 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
674 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
675 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
680 dissect_sbc_orwrite (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
681 guint offset
, gboolean isreq
, gboolean iscdb
,
682 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
684 static const int *rdwr16_fields
[] = {
685 &hf_scsi_sbc_wrprotect
,
692 if (isreq
&& iscdb
) {
693 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
694 tvb_get_ntoh64 (tvb
, offset
+1),
695 tvb_get_ntohl (tvb
, offset
+9));
698 if (tree
&& isreq
&& iscdb
) {
699 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
700 ett_scsi_rdwr
, rdwr16_fields
, ENC_BIG_ENDIAN
);
701 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
702 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
703 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
704 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
705 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
710 dissect_sbc_comparenwrite (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
711 guint offset
, gboolean isreq
, gboolean iscdb
,
712 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
714 static const int *rdwr16_fields
[] = {
715 &hf_scsi_sbc_wrprotect
,
722 if (isreq
&& iscdb
) {
723 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
724 tvb_get_ntoh64 (tvb
, offset
+1),
725 tvb_get_ntohl (tvb
, offset
+9));
728 if (tree
&& isreq
&& iscdb
) {
729 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_read_flags
,
730 ett_scsi_rdwr
, rdwr16_fields
, ENC_BIG_ENDIAN
);
731 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
732 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+12, 1, ENC_BIG_ENDIAN
);
733 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
734 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
735 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
739 static const value_string scsi_ssu_pwrcnd_val
[] = {
741 {0x1, "Place Device In Active Condition"},
742 {0x2, "Place device into Idle condition"},
743 {0x3, "Place device into Standby condition"},
745 {0x5, "Place device into Sleep condition"},
747 {0x7, "Transfer control of power conditions to block device"},
750 {0xA, "Force Idle Condition Timer to zero"},
751 {0xB, "Force Standby Condition Timer to zero"},
755 static const value_string scsi_ptype_val
[] = {
756 {0x0, "Type 1 protection" },
757 {0x1, "Type 2 protection" },
758 {0x2, "Type 3 protection" },
762 static const value_string scsi_provisioning_type_val
[] = {
763 {0x0, "The LBA is MAPPED" },
764 {0x1, "The LBA is DEALLOCATED" },
765 {0x2, "The LBA is ANCHORED" },
770 dissect_sbc_startstopunit (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
771 guint offset
, gboolean isreq _U_
, gboolean iscdb
,
772 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
774 static const int *ssu_fields
[] = {
775 &hf_scsi_sbc_ssu_immed
,
778 static const int *pwr_fields
[] = {
779 &hf_scsi_sbc_ssu_pwr_cond
,
780 &hf_scsi_sbc_ssu_loej
,
781 &hf_scsi_sbc_ssu_start
,
788 if (isreq
&& iscdb
) {
789 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_ssu_immed_flags
,
790 ett_scsi_ssu_immed
, ssu_fields
, ENC_BIG_ENDIAN
);
791 proto_tree_add_bitmask(tree
, tvb
, offset
+3, hf_scsi_sbc_ssu_pwr_flags
,
792 ett_scsi_ssu_pwr
, pwr_fields
, ENC_BIG_ENDIAN
);
793 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
794 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
799 dissect_sbc_verify10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
800 guint offset
, gboolean isreq
, gboolean iscdb
,
801 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
804 static const int *verify10_fields
[] = {
805 &hf_scsi_sbc_vrprotect
,
811 if (isreq
&& iscdb
) {
812 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
813 tvb_get_ntohl (tvb
, offset
+1),
814 tvb_get_ntohs (tvb
, offset
+6));
817 if (tree
&& isreq
&& iscdb
) {
818 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_verify_flags
,
819 ett_scsi_verify
, verify10_fields
, ENC_BIG_ENDIAN
);
820 proto_tree_add_item (tree
, hf_scsi_sbc_verify_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
821 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
822 proto_tree_add_item (tree
, hf_scsi_sbc_verify_vlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
823 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
824 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
829 dissect_sbc_verify12 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
830 guint offset
, gboolean isreq
, gboolean iscdb
,
831 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
834 static const int *verify12_fields
[] = {
835 &hf_scsi_sbc_vrprotect
,
841 if (isreq
&& iscdb
) {
842 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
843 tvb_get_ntohl (tvb
, offset
+1),
844 tvb_get_ntohl (tvb
, offset
+5));
847 if (isreq
&& iscdb
) {
848 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_verify_flags
,
849 ett_scsi_verify
, verify12_fields
, ENC_BIG_ENDIAN
);
850 proto_tree_add_item (tree
, hf_scsi_sbc_verify_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
851 proto_tree_add_item (tree
, hf_scsi_sbc_verify_vlen32
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
852 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
853 proto_tree_add_bitmask(tree
, tvb
, offset
+10, hf_scsi_control
,
854 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
859 dissect_sbc_verify16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
860 guint offset
, gboolean isreq
, gboolean iscdb
,
861 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
864 static const int *verify16_fields
[] = {
865 &hf_scsi_sbc_vrprotect
,
871 if (isreq
&& iscdb
) {
872 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
873 tvb_get_ntoh64 (tvb
, offset
+1),
874 tvb_get_ntohl (tvb
, offset
+9));
877 if (isreq
&& iscdb
) {
878 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_verify_flags
,
879 ett_scsi_verify
, verify16_fields
, ENC_BIG_ENDIAN
);
880 proto_tree_add_item (tree
, hf_scsi_sbc_verify_lba64
, tvb
, offset
+1, 8, ENC_BIG_ENDIAN
);
881 proto_tree_add_item (tree
, hf_scsi_sbc_verify_vlen32
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
882 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
883 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
884 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
890 dissect_sbc_wrverify10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
891 proto_tree
*tree
, guint offset
, gboolean isreq
,
892 gboolean iscdb
, guint payload_len _U_
,
893 scsi_task_data_t
*cdata _U_
)
896 static const int *wrverify10_fields
[] = {
897 &hf_scsi_sbc_wrprotect
,
903 if (isreq
&& iscdb
) {
904 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
905 tvb_get_ntohl (tvb
, offset
+1),
906 tvb_get_ntohs (tvb
, offset
+6));
909 if (tree
&& isreq
&& iscdb
) {
910 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_wrverify_flags
,
911 ett_scsi_wrverify
, wrverify10_fields
, ENC_BIG_ENDIAN
);
912 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
913 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
914 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_xferlen
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
915 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
916 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
921 dissect_sbc_wrverify12 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
922 proto_tree
*tree
, guint offset
, gboolean isreq
,
923 gboolean iscdb
, guint payload_len _U_
,
924 scsi_task_data_t
*cdata _U_
)
926 static const int *wrverify12_fields
[] = {
927 &hf_scsi_sbc_wrprotect
,
933 if (isreq
&& iscdb
) {
934 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: 0x%08x, Len: %u)",
935 tvb_get_ntohl (tvb
, offset
+1),
936 tvb_get_ntohl (tvb
, offset
+5));
939 if (tree
&& isreq
&& iscdb
) {
940 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_wrverify_flags
,
941 ett_scsi_wrverify
, wrverify12_fields
, ENC_BIG_ENDIAN
);
942 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
943 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_xferlen32
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
944 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+9, 1, ENC_BIG_ENDIAN
);
945 proto_tree_add_bitmask(tree
, tvb
, offset
+10, hf_scsi_control
,
946 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
951 dissect_sbc_wrverify16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
952 proto_tree
*tree
, guint offset
, gboolean isreq
,
953 gboolean iscdb
, guint payload_len _U_
,
954 scsi_task_data_t
*cdata _U_
)
956 static const int *wrverify16_fields
[] = {
957 &hf_scsi_sbc_wrprotect
,
963 if (isreq
&& iscdb
) {
964 col_append_fstr (pinfo
->cinfo
, COL_INFO
, "(LBA: %" G_GINT64_MODIFIER
"u, Len: %u)",
965 tvb_get_ntoh64 (tvb
, offset
+1),
966 tvb_get_ntohl (tvb
, offset
+9));
969 if (tree
&& isreq
&& iscdb
) {
970 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_wrverify_flags
,
971 ett_scsi_wrverify
, wrverify16_fields
, ENC_BIG_ENDIAN
);
972 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_lba64
, tvb
, offset
+1, 8, ENC_BIG_ENDIAN
);
973 proto_tree_add_item (tree
, hf_scsi_sbc_wrverify_xferlen32
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
974 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
975 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
976 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
981 dissect_sbc_readcapacity10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
,
982 guint offset
, gboolean isreq
, gboolean iscdb
,
983 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
985 guint32 len
, block_len
, tot_len
;
991 if (isreq
&& iscdb
) {
992 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
993 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
996 len
= tvb_get_ntohl (tvb
, offset
);
997 block_len
= tvb_get_ntohl (tvb
, offset
+4);
998 tot_len
=((len
/1024)*block_len
)/1024; /*MB*/
1004 proto_tree_add_uint_format (tree
, hf_scsi_sbc_returned_lba
, tvb
, offset
, 4, len
, "LBA: %u (%u %s)", len
, tot_len
, un
);
1005 proto_tree_add_item (tree
, hf_scsi_sbc_blocksize
, tvb
, offset
+4, 4, ENC_BIG_ENDIAN
);
1010 dissect_sbc_readdefectdata10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1011 proto_tree
*tree
, guint offset
, gboolean isreq
,
1013 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1015 static const int *defect_fields
[] = {
1016 &hf_scsi_sbc_defect_list_format
,
1017 &hf_scsi_sbc_req_plist
,
1018 &hf_scsi_sbc_req_glist
,
1025 if (isreq
&& iscdb
) {
1026 proto_tree_add_bitmask(tree
, tvb
, offset
+1, hf_scsi_sbc_readdefdata_flags
,
1027 ett_scsi_defectdata
, defect_fields
, ENC_BIG_ENDIAN
);
1028 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1029 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1030 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1032 /* TODO : add dissection of DATA */
1037 dissect_sbc_readlong10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1038 proto_tree
*tree
, guint offset
, gboolean isreq
,
1040 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1042 static const int *corrct_fields
[] = {
1043 &hf_scsi_sbc_corrct
,
1050 if (isreq
&& iscdb
) {
1051 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_corrct_flags
,
1052 ett_scsi_corrct
, corrct_fields
, ENC_BIG_ENDIAN
);
1053 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
1054 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1055 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1056 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1061 dissect_sbc_writelong10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1062 proto_tree
*tree
, guint offset
, gboolean isreq
,
1064 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1069 if (isreq
&& iscdb
) {
1070 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
1071 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1072 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1073 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1078 dissect_sbc_writesame10 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1079 proto_tree
*tree
, guint offset
, gboolean isreq
,
1081 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1083 static const int *writesame10_fields
[] = {
1084 &hf_scsi_sbc_wrprotect
,
1085 &hf_scsi_sbc_anchor
,
1087 &hf_scsi_sbc_pbdata
,
1088 &hf_scsi_sbc_lbdata
,
1095 if (isreq
&& iscdb
) {
1096 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_writesame_flags
,
1097 ett_scsi_writesame
, writesame10_fields
, ENC_BIG_ENDIAN
);
1098 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr10_lba
, tvb
, offset
+1, 4, ENC_BIG_ENDIAN
);
1099 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1100 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1101 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1102 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1107 dissect_sbc_writesame16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1108 proto_tree
*tree
, guint offset
, gboolean isreq
,
1110 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1112 static const int *writesame16_fields
[] = {
1113 &hf_scsi_sbc_wrprotect
,
1114 &hf_scsi_sbc_anchor
,
1116 &hf_scsi_sbc_pbdata
,
1117 &hf_scsi_sbc_lbdata
,
1124 if (isreq
&& iscdb
) {
1125 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_writesame_flags
,
1126 ett_scsi_writesame
, writesame16_fields
, ENC_BIG_ENDIAN
);
1127 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr16_lba
, tvb
, offset
+1, 8, ENC_NA
);
1128 proto_tree_add_item (tree
, hf_scsi_sbc_rdwr12_xferlen
, tvb
, offset
+9, 4, ENC_BIG_ENDIAN
);
1129 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
1130 proto_tree_add_bitmask(tree
, tvb
, offset
+14, hf_scsi_control
,
1131 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1136 dissect_sbc_unmap (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1137 proto_tree
*tree
, guint offset
, gboolean isreq
,
1139 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1141 static const int *unmap_fields
[] = {
1142 &hf_scsi_sbc_unmap_anchor
,
1149 if (isreq
&& iscdb
) {
1150 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_unmap_flags
,
1151 ett_scsi_unmap
, unmap_fields
, ENC_BIG_ENDIAN
);
1152 proto_tree_add_item (tree
, hf_scsi_sbc_group
, tvb
, offset
+5, 1, ENC_BIG_ENDIAN
);
1154 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
1156 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1157 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1159 proto_tree_add_item (tree
, hf_scsi_sbc_unmap_data_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1160 proto_tree_add_item (tree
, hf_scsi_sbc_unmap_block_descriptor_data_length
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
1162 while (tvb_reported_length_remaining(tvb
, offset
) >=16) {
1168 it
= proto_tree_add_text(tree
, tvb
, offset
, 16, "UNMAP Block Descriptor: LBA ");
1169 tr
= proto_item_add_subtree(it
, ett_scsi_unmap_block_descriptor
);
1171 proto_tree_add_item (tr
, hf_scsi_sbc_unmap_lba
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1172 lba
= tvb_get_ntoh64 (tvb
, offset
);
1174 proto_tree_add_item (tr
, hf_scsi_sbc_unmap_num_blocks
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
1175 num_blocks
= tvb_get_ntohl(tvb
, offset
+8);
1177 if (num_blocks
> 1) {
1178 proto_item_append_text (it
, "%" G_GINT64_MODIFIER
"u-%" G_GINT64_MODIFIER
"u ", lba
, lba
+num_blocks
-1);
1180 proto_item_append_text (it
, "%" G_GINT64_MODIFIER
"u ", lba
);
1188 static const value_string sanitize_val
[] = {
1189 {0x01, "OVERWRITE"},
1190 {0x02, "BLOCK ERASE"},
1191 {0x03, "CRYPTO ERASE"},
1192 {0x1f, "EXIT FAILURE MODE"},
1197 dissect_sbc_sanitize (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1198 proto_tree
*tree
, guint offset
, gboolean isreq
,
1200 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1202 static const int *sanitize_fields
[] = {
1203 &hf_scsi_sbc_sanitize_immed
,
1204 &hf_scsi_sbc_sanitize_ause
,
1205 &hf_scsi_sbc_sanitize_sa
,
1208 static const int *sanitize_overwrite_fields
[] = {
1209 &hf_scsi_sbc_sanitize_invert
,
1210 &hf_scsi_sbc_sanitize_test
,
1211 &hf_scsi_sbc_sanitize_owcount
,
1218 if (isreq
&& iscdb
) {
1219 guint8 service_action
;
1221 service_action
= tvb_get_guint8 (tvb
, offset
) & 0x1F;
1222 col_append_str(pinfo
->cinfo
, COL_INFO
, val_to_str(service_action
,
1224 "Unknown (0x%02x)"));
1226 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_sanitize_flags
,
1227 ett_scsi_sanitize
, sanitize_fields
, ENC_BIG_ENDIAN
);
1229 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
+6, 2,
1232 proto_tree_add_bitmask(tree
, tvb
, offset
+8, hf_scsi_control
,
1233 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1235 proto_tree_add_bitmask(tree
, tvb
, offset
,
1236 hf_scsi_sbc_sanitize_overwrite_flags
,
1237 ett_scsi_sanitize_overwrite
,
1238 sanitize_overwrite_fields
,
1241 proto_tree_add_item (tree
, hf_scsi_sbc_sanitize_pattern_length
,
1245 proto_tree_add_item (tree
, hf_scsi_sbc_sanitize_pattern
,
1252 dissect_sbc_readdefectdata12 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1253 proto_tree
*tree
, guint offset
, gboolean isreq
,
1255 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1257 static const int *defect_fields
[] = {
1258 &hf_scsi_sbc_defect_list_format
,
1259 &hf_scsi_sbc_req_plist
,
1260 &hf_scsi_sbc_req_glist
,
1267 if (isreq
&& iscdb
) {
1268 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_readdefdata_flags
,
1269 ett_scsi_defectdata
, defect_fields
, ENC_BIG_ENDIAN
);
1270 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen32
, tvb
, offset
+5, 4, ENC_BIG_ENDIAN
);
1271 proto_tree_add_bitmask(tree
, tvb
, offset
+10, hf_scsi_control
,
1272 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1274 /* TODO : add dissection of DATA */
1279 dissect_sbc_reassignblocks (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1280 proto_tree
*tree
, guint offset
, gboolean isreq
,
1282 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1284 static const int *reassign_fields
[] = {
1285 &hf_scsi_sbc_reassignblocks_longlba
,
1286 &hf_scsi_sbc_reassignblocks_longlist
,
1293 if (isreq
&& iscdb
) {
1294 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_sbc_reassignblks_flags
,
1295 ett_scsi_reassign_blocks
, reassign_fields
, ENC_BIG_ENDIAN
);
1296 proto_tree_add_bitmask(tree
, tvb
, offset
+4, hf_scsi_control
,
1297 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1299 /* TODO : add dissection of DATA */
1303 const value_string service_action_vals
[] = {
1304 {SHORT_FORM_BLOCK_ID
, "Short Form - Block ID"},
1305 {SHORT_FORM_VENDOR_SPECIFIC
, "Short Form - Vendor-Specific"},
1306 {LONG_FORM
, "Long Form"},
1307 {EXTENDED_FORM
, "Extended Form"},
1308 {SERVICE_READ_CAPACITY16
, "Read Capacity(16)"},
1309 {SERVICE_READ_LONG16
, "Read Long(16)"},
1310 {SERVICE_GET_LBA_STATUS
, "Get LBA Status"},
1314 /* this is either readcapacity16 or readlong16 depending of what service
1318 dissect_sbc_serviceactionin16 (tvbuff_t
*tvb
, packet_info
*pinfo _U_
,
1319 proto_tree
*tree
, guint offset
, gboolean isreq
,
1321 guint payload_len _U_
, scsi_task_data_t
*cdata _U_
)
1323 guint8 service_action
;
1325 guint64 len
, tot_len
;
1331 if (isreq
&& iscdb
) {
1332 service_action
= tvb_get_guint8 (tvb
, offset
) & 0x1F;
1333 if(cdata
&& cdata
->itlq
){
1334 cdata
->itlq
->flags
=service_action
;
1337 switch(service_action
){
1338 case SERVICE_READ_CAPACITY16
:
1339 col_append_str(pinfo
->cinfo
, COL_INFO
, " READCAPACITY16");
1341 proto_tree_add_text (tree
, tvb
, offset
, 1,
1342 "Service Action: %s",
1343 val_to_str (service_action
,
1344 service_action_vals
,
1345 "Unknown (0x%02x)"));
1348 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1351 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_control
,
1352 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1356 case SERVICE_READ_LONG16
:
1357 col_append_str(pinfo
->cinfo
, COL_INFO
, " READ_LONG16");
1358 proto_tree_add_text (tree
, tvb
, offset
, 1,
1359 "Service Action: %s",
1360 val_to_str (service_action
,
1361 service_action_vals
,
1362 "Unknown (0x%02x)"));
1365 proto_tree_add_text (tree
, tvb
, offset
, 8,
1366 "Logical Block Address: %" G_GINT64_MODIFIER
"u",
1367 tvb_get_ntoh64 (tvb
, offset
));
1370 /* two reserved bytes */
1373 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen16
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1379 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_control
,
1380 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1384 case SERVICE_GET_LBA_STATUS
:
1385 col_append_str(pinfo
->cinfo
, COL_INFO
, " GET_LBA_STATUS");
1387 proto_tree_add_text (tree
, tvb
, offset
, 1,
1388 "Service Action: %s",
1389 val_to_str (service_action
,
1390 service_action_vals
,
1391 "Unknown (0x%02x)"));
1394 proto_tree_add_item (tree
, hf_scsi_sbc_get_lba_status_lba
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1397 proto_tree_add_item (tree
, hf_scsi_sbc_alloclen32
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1403 proto_tree_add_bitmask(tree
, tvb
, offset
, hf_scsi_control
,
1404 ett_scsi_control
, cdb_control_fields
, ENC_BIG_ENDIAN
);
1409 } else if (!iscdb
) {
1410 if(cdata
&& cdata
->itlq
){
1411 switch(cdata
->itlq
->flags
){
1412 case SERVICE_READ_CAPACITY16
:
1413 len
= tvb_get_ntoh64 (tvb
, offset
);
1414 block_len
= tvb_get_ntohl (tvb
, offset
+8);
1415 tot_len
=((len
/1024)*block_len
)/1024; /*MB*/
1421 proto_tree_add_text (tree
, tvb
, offset
, 8, "LBA: %" G_GINT64_MODIFIER
"u (%" G_GINT64_MODIFIER
"u %s)",
1423 proto_tree_add_item (tree
, hf_scsi_sbc_blocksize
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
1426 proto_tree_add_item (tree
, hf_scsi_sbc_prot_en
, tvb
, offset
+12, 1, ENC_BIG_ENDIAN
);
1427 if (tvb_get_guint8(tvb
, offset
+12) & 0x01) {
1428 /* only decode the protection type if protection is enabled */
1429 proto_tree_add_item (tree
, hf_scsi_sbc_ptype
, tvb
, offset
+12, 1, ENC_BIG_ENDIAN
);
1432 proto_tree_add_item (tree
, hf_scsi_sbc_p_i_exponent
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
1433 proto_tree_add_item (tree
, hf_scsi_sbc_lbppbe
, tvb
, offset
+13, 1, ENC_BIG_ENDIAN
);
1435 proto_tree_add_item (tree
, hf_scsi_sbc_lbpme
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
1436 proto_tree_add_item (tree
, hf_scsi_sbc_lbprz
, tvb
, offset
+14, 1, ENC_BIG_ENDIAN
);
1437 proto_tree_add_item (tree
, hf_scsi_sbc_lalba
, tvb
, offset
+14, 2, ENC_BIG_ENDIAN
);
1440 case SERVICE_GET_LBA_STATUS
:
1441 proto_tree_add_item (tree
, hf_scsi_sbc_get_lba_status_data_length
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1447 while (tvb_length_remaining(tvb
, offset
) >= 16) {
1454 it
= proto_tree_add_text(tree
, tvb
, offset
, 16, "LBA Status Descriptor: ");
1455 tr
= proto_item_add_subtree(it
, ett_scsi_lba_status_descriptor
);
1457 proto_tree_add_item (tr
, hf_scsi_sbc_get_lba_status_lba
, tvb
, offset
, 8, ENC_BIG_ENDIAN
);
1458 lba
= tvb_get_ntoh64(tvb
, offset
);
1461 proto_tree_add_item (tr
, hf_scsi_sbc_get_lba_status_num_blocks
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1462 num_blocks
= tvb_get_ntohl(tvb
, offset
);
1465 proto_tree_add_item (tr
, hf_scsi_sbc_get_lba_status_provisioning_status
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1466 type
= tvb_get_guint8(tvb
, offset
) & 0x07;
1472 proto_item_append_text (it
, "%" G_GINT64_MODIFIER
"u-%" G_GINT64_MODIFIER
"u %s",
1474 lba
+ num_blocks
- 1,
1475 val_to_str(type
, scsi_provisioning_type_val
, "Unknown (0x%02x)")
1486 const value_string scsi_sbc_vals
[] = {
1487 {SCSI_SPC_EXTCOPY
, "Extended Copy"},
1488 {SCSI_SPC_INQUIRY
, "Inquiry"},
1489 {SCSI_SBC_FORMATUNIT
, "Format Unit"},
1490 {SCSI_SBC_LOCKUNLKCACHE10
, "Lock Unlock Cache(10)"},
1491 {SCSI_SBC_LOCKUNLKCACHE16
, "Lock Unlock Cache(16)"},
1492 {SCSI_SPC_LOGSELECT
, "Log Select"},
1493 {SCSI_SPC_LOGSENSE
, "Log Sense"},
1494 {SCSI_SPC_MGMT_PROTOCOL_IN
, "Mgmt Protocol In"},
1495 {SCSI_SPC_MODESELECT6
, "Mode Select(6)"},
1496 {SCSI_SPC_MODESELECT10
, "Mode Select(10)"},
1497 {SCSI_SPC_MODESENSE6
, "Mode Sense(6)"},
1498 {SCSI_SPC_MODESENSE10
, "Mode Sense(10)"},
1499 {SCSI_SPC_PERSRESVIN
, "Persistent Reserve In"},
1500 {SCSI_SPC_PERSRESVOUT
, "Persistent Reserve Out"},
1501 {SCSI_SBC_PREFETCH10
, "Pre-Fetch(10)"},
1502 {SCSI_SBC_PREFETCH16
, "Pre-Fetch(16)"},
1503 {SCSI_SPC_PREVMEDREMOVAL
, "Prevent/Allow Medium Removal"},
1504 {SCSI_SBC_READ6
, "Read(6)"},
1505 {SCSI_SBC_READ10
, "Read(10)"},
1506 {SCSI_SBC_READ12
, "Read(12)"},
1507 {SCSI_SBC_READ16
, "Read(16)"},
1508 {SCSI_SBC_READCAPACITY10
, "Read Capacity(10)"},
1509 {SCSI_SPC_REPORTLUNS
, "Report LUNs"},
1510 {SCSI_SPC_REQSENSE
, "Request Sense"},
1511 {SCSI_SBC_SERVICEACTIONIN16
, "Service Action In(16)"},
1512 {SCSI_SBC_READDEFDATA10
, "Read Defect Data(10)"},
1513 {SCSI_SBC_READDEFDATA12
, "Read Defect Data(12)"},
1514 {SCSI_SBC_READLONG
, "Read Long(10)"},
1515 {SCSI_SBC_REASSIGNBLKS
, "Reassign Blocks"},
1516 {SCSI_SBC_REBUILD16
, "Rebuild(16)"},
1517 {SCSI_SBC_REBUILD32
, "Rebuild(32)"},
1518 {SCSI_SBC_REGENERATE16
, "Regenerate(16)"},
1519 {SCSI_SBC_REGENERATE32
, "Regenerate(32)"},
1520 {SCSI_SPC_RELEASE6
, "Release(6)"}, /* obsolete in SBC2 and later */
1521 {SCSI_SPC_RELEASE10
, "Release(10)"},/* obsolete in SBC2 and later */
1522 {SCSI_SPC_RESERVE6
, "Reserve(6)"}, /* obsolete in SBC2 and later */
1523 {SCSI_SPC_RESERVE10
, "Reserve(10)"},/* obsolete in SBC2 and later */
1524 {SCSI_SBC_SANITIZE
, "Sanitize"},
1525 {SCSI_SBC_SEEK10
, "Seek(10)"},
1526 {SCSI_SPC_SENDDIAG
, "Send Diagnostic"},
1527 {SCSI_SBC_SETLIMITS10
, "Set Limits(10)"},
1528 {SCSI_SBC_SETLIMITS12
, "Set Limits(12)"},
1529 {SCSI_SBC_STARTSTOPUNIT
, "Start Stop Unit"},
1530 {SCSI_SBC_SYNCCACHE10
, "Synchronize Cache(10)"},
1531 {SCSI_SBC_SYNCCACHE16
, "Synchronize Cache(16)"},
1532 {SCSI_SPC_TESTUNITRDY
, "Test Unit Ready"},
1533 {SCSI_SBC_UNMAP
, "Unmap"},
1534 {SCSI_SBC_VERIFY10
, "Verify(10)"},
1535 {SCSI_SBC_VERIFY12
, "Verify(12)"},
1536 {SCSI_SBC_VERIFY16
, "Verify(16)"},
1537 {SCSI_SBC_WRITE6
, "Write(6)"},
1538 {SCSI_SBC_WRITE10
, "Write(10)"},
1539 {SCSI_SBC_WRITE12
, "Write(12)"},
1540 {SCSI_SBC_WRITE16
, "Write(16)"},
1541 {SCSI_SBC_ORWRITE
, "OrWrite(16)"},
1542 {SCSI_SPC_WRITEBUFFER
, "Write Buffer"},
1543 {SCSI_SBC_COMPARENWRITE
, "Compare & Write(16)"},
1544 {SCSI_SBC_WRITENVERIFY10
, "Write & Verify(10)"},
1545 {SCSI_SBC_WRITENVERIFY12
, "Write & Verify(12)"},
1546 {SCSI_SBC_WRITENVERIFY16
, "Write & Verify(16)"},
1547 {SCSI_SBC_WRITELONG
, "Write Long"},
1548 {SCSI_SBC_WRITESAME10
, "Write Same(10)"},
1549 {SCSI_SBC_WRITESAME16
, "Write Same(16)"},
1550 {SCSI_SBC_XDREAD10
, "XdRead(10)"},
1551 {SCSI_SBC_XDREAD32
, "XdRead(32)"},
1552 {SCSI_SBC_XDWRITE10
, "XdWrite(10)"},
1553 {SCSI_SBC_XDWRITE32
, "XdWrite(32)"},
1554 {SCSI_SBC_XDWRITEREAD10
, "XdWriteRead(10)"},
1555 {SCSI_SBC_XDWRITEREAD32
, "XdWriteRead(32)"},
1556 {SCSI_SBC_XDWRITEEXTD16
, "XdWrite Extended(16)"},
1557 {SCSI_SBC_XDWRITEEXTD32
, "XdWrite Extended(32)"},
1558 {SCSI_SBC_XPWRITE10
, "XpWrite(10)"},
1559 {SCSI_SBC_XPWRITE32
, "XpWrite(32)"},
1563 scsi_cdb_table_t scsi_sbc_table
[256] = {
1564 /*SPC 0x00*/{dissect_spc_testunitready
},
1567 /*SPC 0x03*/{dissect_spc_requestsense
},
1568 /*SBC 0x04*/{dissect_sbc_formatunit
},
1571 /*SBC 0x07*/{dissect_sbc_reassignblocks
},
1572 /*SBC 0x08*/{dissect_sbc_read6
},
1574 /*SBC 0x0a*/{dissect_sbc_write6
},
1582 /*SPC 0x12*/{dissect_spc_inquiry
},
1585 /*SPC 0x15*/{dissect_spc_modeselect6
},
1586 /*SBC 0x16*/{dissect_spc_reserve6
}, /* obsolete in SBC2 and later */
1587 /*SBC 0x17*/{dissect_spc_release6
}, /* obsolete in SBC2 and later */
1590 /*SPC 0x1a*/{dissect_spc_modesense6
},
1591 /*SBC 0x1b*/{dissect_sbc_startstopunit
},
1593 /*SPC 0x1d*/{dissect_spc_senddiagnostic
},
1594 /*SBC 0x1e*/{dissect_spc_preventallowmediaremoval
},
1601 /*SBC 0x25*/{dissect_sbc_readcapacity10
},
1604 /*SBC 0x28*/{dissect_sbc_read10
},
1606 /*SBC 0x2a*/{dissect_sbc_write10
},
1610 /*SBC 0x2e*/{dissect_sbc_wrverify10
},
1611 /*SBC 0x2f*/{dissect_sbc_verify10
},
1616 /*SBC 0x34*/{dissect_sbc_prefetch10
},
1617 /*SBC 0x35*/{dissect_sbc_synchronizecache10
},
1619 /*SBC 0x37*/{dissect_sbc_readdefectdata10
},
1623 /*SPC 0x3b*/{dissect_spc_writebuffer
},
1626 /*SBC 0x3e*/{dissect_sbc_readlong10
},
1627 /*SBC 0x3f*/{dissect_sbc_writelong10
},
1629 /*SBC 0x41*/{dissect_sbc_writesame10
},
1630 /*SBC 0x42*/{dissect_sbc_unmap
},
1636 /*SBC 0x48*/{dissect_sbc_sanitize
},
1640 /*SPC 0x4c*/{dissect_spc_logselect
},
1641 /*SPC 0x4d*/{dissect_spc_logsense
},
1644 /*SBC 0x50*/{dissect_sbc_xdwrite10
},
1645 /*SBC 0x51*/{dissect_sbc_xpwrite10
},
1646 /*SBC 0x52*/{dissect_sbc_xdread10
},
1647 /*SBC 0x53*/{dissect_sbc_xdwriteread10
},
1649 /*SPC 0x55*/{dissect_spc_modeselect10
},
1650 /*SPC 0x56*/{dissect_spc_reserve10
},/* obsolete in SBC2 and later */
1651 /*SPC 0x57*/{dissect_spc_release10
},/* obsolete in SBC2 and later */
1654 /*SPC 0x5a*/{dissect_spc_modesense10
},
1658 /*SPC 0x5e*/{dissect_spc_persistentreservein
},
1659 /*SPC 0x5f*/{dissect_spc_persistentreserveout
},
1695 /*SPC 0x83*/{dissect_spc_extcopy
},
1700 /*SBC 0x88*/{dissect_sbc_read16
},
1701 /*SBC 0x89*/{dissect_sbc_comparenwrite
},
1702 /*SBC 0x8a*/{dissect_sbc_write16
},
1703 /*SBC 0x8b*/{dissect_sbc_orwrite
},
1706 /*SBC 0x8e*/{dissect_sbc_wrverify16
},
1707 /*SBC 0x8f*/{dissect_sbc_verify16
},
1708 /*SBC 0x90*/{dissect_sbc_prefetch16
},
1709 /*SBC 0x91*/{dissect_sbc_synchronizecache16
},
1711 /*SBC 0x93*/{dissect_sbc_writesame16
},
1722 /*SBC 0x9e*/{dissect_sbc_serviceactionin16
},
1724 /*SPC 0xa0*/{dissect_spc_reportluns
},
1727 /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in
},
1732 /*SBC 0xa8*/{dissect_sbc_read12
},
1734 /*SBC 0xaa*/{dissect_sbc_write12
},
1738 /*SBC 0xae*/{dissect_sbc_wrverify12
},
1739 /*SBC 0xaf*/{dissect_sbc_verify12
},
1747 /*SBC 0xb7*/{dissect_sbc_readdefectdata12
},
1824 proto_register_scsi_sbc(void)
1826 static hf_register_info hf
[] = {
1827 { &hf_scsi_sbc_opcode
,
1828 {"SBC Opcode", "scsi_sbc.opcode", FT_UINT8
, BASE_HEX
,
1829 VALS (scsi_sbc_vals
), 0x0, NULL
, HFILL
}},
1830 { &hf_scsi_sbc_formatunit_flags
,
1831 {"Flags", "scsi_sbc.formatunit.flags", FT_UINT8
, BASE_HEX
, NULL
, 0xF8,
1833 { &hf_scsi_sbc_defect_list_format
,
1834 {"Defect List Format", "scsi_sbc.defect_list_format", FT_UINT8
, BASE_DEC
,
1835 NULL
, 0x7, NULL
, HFILL
}},
1836 { &hf_scsi_sbc_formatunit_vendor
,
1837 {"Vendor Unique", "scsi_sbc.formatunit.vendor", FT_UINT8
, BASE_HEX
, NULL
,
1839 { &hf_scsi_sbc_formatunit_interleave
,
1840 {"Interleave", "scsi_sbc.formatunit.interleave", FT_UINT16
, BASE_HEX
,
1841 NULL
, 0x0, NULL
, HFILL
}},
1842 { &hf_scsi_sbc_rdwr6_lba
,
1843 {"Logical Block Address (LBA)", "scsi_sbc.rdwr6.lba", FT_UINT24
, BASE_DEC
,
1844 NULL
, 0x0FFFFF, NULL
, HFILL
}},
1845 { &hf_scsi_sbc_rdwr6_xferlen
,
1846 {"Transfer Length", "scsi_sbc.rdwr6.xferlen", FT_UINT24
, BASE_DEC
, NULL
, 0x0,
1848 { &hf_scsi_sbc_rdwr10_lba
,
1849 {"Logical Block Address (LBA)", "scsi_sbc.rdwr10.lba", FT_UINT32
, BASE_DEC
,
1850 NULL
, 0x0, NULL
, HFILL
}},
1851 { &hf_scsi_sbc_rdwr10_xferlen
,
1852 {"Transfer Length", "scsi_sbc.rdwr10.xferlen", FT_UINT16
, BASE_DEC
, NULL
,
1854 { &hf_scsi_sbc_rdwr12_xferlen
,
1855 {"Transfer Length", "scsi_sbc.rdwr12.xferlen", FT_UINT32
, BASE_DEC
, NULL
,
1857 { &hf_scsi_sbc_rdwr16_lba
,
1858 {"Logical Block Address (LBA)", "scsi_sbc.rdwr16.lba", FT_BYTES
, BASE_NONE
,
1859 NULL
, 0x0, NULL
, HFILL
}},
1860 { &hf_scsi_sbc_ssu_immed
,
1861 {"Immediate", "scsi_sbc.ssu.immediate", FT_BOOLEAN
, 8, NULL
,
1862 0x01, NULL
, HFILL
}},
1863 { &hf_scsi_sbc_ssu_pwr_cond
,
1864 {"Power Conditions", "scsi_sbc.ssu.pwr", FT_UINT8
, BASE_HEX
,
1865 VALS (scsi_ssu_pwrcnd_val
), 0xF0, NULL
, HFILL
}},
1866 { &hf_scsi_sbc_ssu_loej
,
1867 {"LOEJ", "scsi_sbc.ssu.loej", FT_BOOLEAN
, 8, NULL
, 0x2, NULL
,
1869 { &hf_scsi_sbc_ssu_start
,
1870 {"Start", "scsi_sbc.ssu.start", FT_BOOLEAN
, 8, NULL
, 0x1,
1872 { &hf_scsi_sbc_bytchk
,
1873 {"BYTCHK", "scsi_sbc.bytchk", FT_BOOLEAN
, 8,
1874 NULL
, 0x02, NULL
, HFILL
}},
1876 { &hf_scsi_sbc_verify_reladdr
,
1877 {"RELADDR", "scsi_sbc.verify.reladdr", FT_BOOLEAN
, 8, NULL
,
1880 { &hf_scsi_sbc_verify_lba
,
1881 {"LBA", "scsi_sbc.verify.lba", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
,
1883 { &hf_scsi_sbc_verify_lba64
,
1884 {"LBA", "scsi_sbc.verify.lba64", FT_UINT64
, BASE_DEC
, NULL
, 0x0, NULL
,
1886 { &hf_scsi_sbc_verify_vlen
,
1887 {"Verification Length", "scsi_sbc.verify.vlen", FT_UINT16
,
1888 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1889 { &hf_scsi_sbc_verify_vlen32
,
1890 {"Verification Length", "scsi_sbc.verify.vlen32", FT_UINT32
,
1891 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1892 { &hf_scsi_sbc_wrverify_lba
,
1893 {"LBA", "scsi_sbc.wrverify.lba", FT_UINT32
, BASE_DEC
, NULL
, 0x0, NULL
,
1895 { &hf_scsi_sbc_wrverify_xferlen
,
1896 {"Transfer Length", "scsi_sbc.wrverify.xferlen", FT_UINT16
, BASE_DEC
,
1897 NULL
, 0x0, NULL
, HFILL
}},
1898 { &hf_scsi_sbc_wrverify_lba64
,
1899 {"LBA", "scsi_sbc.wrverify.lba64", FT_UINT64
, BASE_DEC
, NULL
, 0x0,
1901 { &hf_scsi_sbc_wrverify_xferlen32
,
1902 {"Transfer Length", "scsi_sbc.wrverify.xferlen32", FT_UINT32
,
1903 BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
1905 { &hf_scsi_sbc_readcapacity_flags
,
1906 {"Flags", "scsi_sbc.readcapacity.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
1909 { &hf_scsi_sbc_readdefdata_flags
,
1910 {"Flags", "scsi_sbc.readdefdata.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
1912 { &hf_scsi_sbc_reassignblks_flags
,
1913 {"Flags", "scsi_sbc.reassignblks.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
1915 { &hf_scsi_sbc_read_flags
,
1916 {"Flags", "scsi_sbc.read.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
1918 { &hf_scsi_sbc_alloclen32
,
1919 {"Allocation Length", "scsi_sbc.alloclen32", FT_UINT32
, BASE_DEC
,
1920 NULL
, 0x0, NULL
, HFILL
}},
1921 { &hf_scsi_sbc_alloclen16
,
1922 {"Allocation Length", "scsi_sbc.alloclen16", FT_UINT16
, BASE_DEC
,
1923 NULL
, 0x0, NULL
, HFILL
}},
1924 { &hf_scsi_sbc_fuflags_fmtpinfo
,
1925 {"FMTPINFO", "scsi_sbc.format_unit.fmtpinfo", FT_BOOLEAN
, 8,
1926 NULL
, 0x80, NULL
, HFILL
}},
1927 { &hf_scsi_sbc_fuflags_rto_req
,
1928 {"RTO_REQ", "scsi_sbc.format_unit.rto_req", FT_BOOLEAN
, 8,
1929 NULL
, 0x40, NULL
, HFILL
}},
1930 { &hf_scsi_sbc_fuflags_longlist
,
1931 {"LONGLIST", "scsi_sbc.format_unit.longlist", FT_BOOLEAN
, 8,
1932 NULL
, 0x20, NULL
, HFILL
}},
1933 { &hf_scsi_sbc_fuflags_fmtdata
,
1934 {"FMTDATA", "scsi_sbc.format_unit.fmtdata", FT_BOOLEAN
, 8,
1935 NULL
, 0x10, NULL
, HFILL
}},
1936 { &hf_scsi_sbc_fuflags_cmplist
,
1937 {"CMPLIST", "scsi_sbc.format_unit.cmplist", FT_BOOLEAN
, 8,
1938 NULL
, 0x08, NULL
, HFILL
}},
1939 { &hf_scsi_sbc_prefetch_flags
,
1940 {"Flags", "scsi_sbc.prefetch.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
1942 { &hf_scsi_sbc_prefetch_immed
,
1943 {"Immediate", "scsi_sbc.prefetch.immediate", FT_BOOLEAN
, 8, NULL
,
1945 { &hf_scsi_sbc_group
,
1946 {"Group", "scsi_sbc.group", FT_UINT8
, BASE_HEX
, NULL
,
1947 0x1f, NULL
, HFILL
}},
1948 { &hf_scsi_sbc_rdprotect
,
1949 {"RDPROTECT", "scsi_sbc.rdprotect", FT_UINT8
, BASE_HEX
,
1950 NULL
, 0xe0, NULL
, HFILL
}},
1952 {"DPO", "scsi_sbc.dpo", FT_BOOLEAN
, 8,
1953 TFS(&dpo_tfs
), 0x10, "DisablePageOut: Whether the device should cache the data or not", HFILL
}},
1955 {"FUA", "scsi_sbc.fua", FT_BOOLEAN
, 8,
1956 TFS(&fua_tfs
), 0x08, "ForceUnitAccess: Whether to allow reading from the cache or not", HFILL
}},
1957 { &hf_scsi_sbc_fua_nv
,
1958 {"FUA_NV", "scsi_sbc.fua_nv", FT_BOOLEAN
, 8,
1959 TFS(&fua_nv_tfs
), 0x02, "ForceUnitAccess_NonVolatile: Whether to allow reading from non-volatile cache or not", HFILL
}},
1960 { &hf_scsi_sbc_blocksize
,
1961 {"Block size in bytes", "scsi_sbc.blocksize", FT_UINT32
, BASE_DEC
,
1962 NULL
, 0, NULL
, HFILL
}},
1963 { &hf_scsi_sbc_returned_lba
,
1964 {"Returned LBA", "scsi_sbc.returned_lba", FT_UINT32
, BASE_DEC
,
1965 NULL
, 0, NULL
, HFILL
}},
1966 { &hf_scsi_sbc_req_plist
,
1967 {"REQ_PLIST", "scsi_sbc.req_plist", FT_BOOLEAN
, 8,
1968 NULL
, 0x10, NULL
, HFILL
}},
1969 { &hf_scsi_sbc_req_glist
,
1970 {"REQ_GLIST", "scsi_sbc.req_glist", FT_BOOLEAN
, 8,
1971 NULL
, 0x08, NULL
, HFILL
}},
1972 { &hf_scsi_sbc_corrct
,
1973 {"CORRCT", "scsi_sbc.corrct", FT_BOOLEAN
, 8,
1974 NULL
, 0x02, NULL
, HFILL
}},
1975 { &hf_scsi_sbc_corrct_flags
,
1976 {"Flags", "scsi_sbc.corrct_flags", FT_UINT8
, BASE_HEX
,
1977 NULL
, 0, NULL
, HFILL
}},
1978 { &hf_scsi_sbc_reassignblocks_longlba
,
1979 {"LongLBA", "scsi_sbc.reassignblocks.longlba", FT_BOOLEAN
, 8,
1980 NULL
, 0x02, NULL
, HFILL
}},
1981 { &hf_scsi_sbc_reassignblocks_longlist
,
1982 {"LongList", "scsi_sbc.reassignblocks.longlist", FT_BOOLEAN
, 8,
1983 NULL
, 0x01, NULL
, HFILL
}},
1984 { &hf_scsi_sbc_ssu_immed_flags
,
1985 {"Immed flags", "scsi_sbc.ssu.immed_flags", FT_UINT8
, BASE_HEX
,
1986 NULL
, 0, NULL
, HFILL
}},
1987 { &hf_scsi_sbc_ssu_pwr_flags
,
1988 {"Pwr flags", "scsi_sbc.ssu.pwr_flags", FT_UINT8
, BASE_HEX
,
1989 NULL
, 0, NULL
, HFILL
}},
1990 { &hf_scsi_sbc_synccache_flags
,
1991 {"Flags", "scsi_sbc.synccache.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
1993 { &hf_scsi_sbc_synccache_immed
,
1994 {"Immediate", "scsi_sbc.synccache.immediate", FT_BOOLEAN
, 8, NULL
,
1995 0x02, NULL
, HFILL
}},
1996 { &hf_scsi_sbc_synccache_sync_nv
,
1997 {"SYNC_NV", "scsi_sbc.synccache.sync_nv", FT_BOOLEAN
, 8, NULL
,
1998 0x04, NULL
, HFILL
}},
1999 { &hf_scsi_sbc_vrprotect
,
2000 {"VRPROTECT", "scsi_sbc.vrprotect", FT_UINT8
, BASE_HEX
,
2001 NULL
, 0xe0, NULL
, HFILL
}},
2002 { &hf_scsi_sbc_verify_flags
,
2003 {"Flags", "scsi_sbc.verify_flags", FT_UINT8
, BASE_HEX
,
2004 NULL
, 0, NULL
, HFILL
}},
2005 { &hf_scsi_sbc_wrprotect
,
2006 {"WRPROTECT", "scsi_sbc.wrprotect", FT_UINT8
, BASE_HEX
,
2007 NULL
, 0xe0, NULL
, HFILL
}},
2008 { &hf_scsi_sbc_wrverify_flags
,
2009 {"Flags", "scsi_sbc.wrverify_flags", FT_UINT8
, BASE_HEX
,
2010 NULL
, 0, NULL
, HFILL
}},
2011 { &hf_scsi_sbc_writesame_flags
,
2012 {"Flags", "scsi_sbc.writesame_flags", FT_UINT8
, BASE_HEX
,
2013 NULL
, 0, NULL
, HFILL
}},
2014 { &hf_scsi_sbc_anchor
,
2015 {"ANCHOR", "scsi_sbc.anchor", FT_BOOLEAN
, 8, NULL
,
2016 0x10, NULL
, HFILL
}},
2017 { &hf_scsi_sbc_unmap
,
2018 {"UNMAP", "scsi_sbc.unmap", FT_BOOLEAN
, 8, NULL
,
2019 0x08, NULL
, HFILL
}},
2020 { &hf_scsi_sbc_pbdata
,
2021 {"PBDATA", "scsi_sbc.pbdata", FT_BOOLEAN
, 8, NULL
,
2022 0x04, NULL
, HFILL
}},
2023 { &hf_scsi_sbc_lbdata
,
2024 {"LBDATA", "scsi_sbc.lbdata", FT_BOOLEAN
, 8, NULL
,
2025 0x02, NULL
, HFILL
}},
2026 { &hf_scsi_sbc_xdread_flags
,
2027 {"Flags", "scsi_sbc.xdread.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
2029 { &hf_scsi_sbc_xorpinfo
,
2030 {"XORPINFO", "scsi_sbc.xorpinfo", FT_BOOLEAN
, 8, NULL
,
2031 0x01, NULL
, HFILL
}},
2032 { &hf_scsi_sbc_disable_write
,
2033 {"DISABLE_WRITE", "scsi_sbc.disable_write", FT_BOOLEAN
, 8, NULL
,
2034 0x04, NULL
, HFILL
}},
2035 { &hf_scsi_sbc_xdwrite_flags
,
2036 {"Flags", "scsi_sbc.xdwrite.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
2038 { &hf_scsi_sbc_xdwriteread_flags
,
2039 {"Flags", "scsi_sbc.xdwriteread.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
2041 { &hf_scsi_sbc_xpwrite_flags
,
2042 {"Flags", "scsi_sbc.xpwrite.flags", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
,
2044 { &hf_scsi_sbc_unmap_anchor
,
2045 {"ANCHOR", "scsi_sbc.unmap.anchor", FT_BOOLEAN
, 8, NULL
,
2046 0x01, NULL
, HFILL
}},
2047 { &hf_scsi_sbc_unmap_flags
,
2048 {"Flags", "scsi_sbc.unmap_flags", FT_UINT8
, BASE_HEX
,
2049 NULL
, 0, NULL
, HFILL
}},
2050 { &hf_scsi_sbc_unmap_data_length
,
2051 {"Data Length", "scsi_sbc.unmap.data_length", FT_UINT16
, BASE_DEC
,
2052 NULL
, 0, NULL
, HFILL
}},
2053 { &hf_scsi_sbc_unmap_block_descriptor_data_length
,
2054 {"Block Descriptor Data Length", "scsi_sbc.unmap.block_descriptor_data_length", FT_UINT16
, BASE_DEC
,
2055 NULL
, 0, NULL
, HFILL
}},
2056 { &hf_scsi_sbc_unmap_lba
,
2057 {"LBA", "scsi_sbc.unmap.lba", FT_UINT64
, BASE_DEC
,
2058 NULL
, 0, NULL
, HFILL
}},
2059 { &hf_scsi_sbc_unmap_num_blocks
,
2060 {"Num Blocks", "scsi_sbc.unmap.num_blocks", FT_UINT32
, BASE_DEC
,
2061 NULL
, 0, NULL
, HFILL
}},
2062 { &hf_scsi_sbc_ptype
,
2063 {"PTYPE", "scsi_sbc.ptype", FT_UINT8
, BASE_DEC
,
2064 VALS(scsi_ptype_val
), 0x0e, NULL
, HFILL
}},
2065 { &hf_scsi_sbc_prot_en
,
2066 {"PROT_EN", "scsi_sbc.prot_en", FT_BOOLEAN
, 8,
2067 NULL
, 0x01, NULL
, HFILL
}},
2068 { &hf_scsi_sbc_p_i_exponent
,
2069 {"P_I_EXPONENT", "scsi_sbc.p_i_exponent", FT_UINT8
, BASE_DEC
,
2070 NULL
, 0xf0, NULL
, HFILL
}},
2071 { &hf_scsi_sbc_lbppbe
,
2072 {"LOGICAL_BLOCKS_PER_PHYSICAL_BLOCK_EXPONENT", "scsi_sbc.lbppbe", FT_UINT8
, BASE_DEC
,
2073 NULL
, 0x0f, NULL
, HFILL
}},
2074 { &hf_scsi_sbc_lbpme
,
2075 {"LBPME", "scsi_sbc.lbpme", FT_BOOLEAN
, 8,
2076 NULL
, 0x80, NULL
, HFILL
}},
2077 { &hf_scsi_sbc_lbprz
,
2078 {"LBPRZ", "scsi_sbc.lbprz", FT_BOOLEAN
, 8,
2079 NULL
, 0x40, NULL
, HFILL
}},
2080 { &hf_scsi_sbc_lalba
,
2081 {"LOWEST_ALIGNED_LBA", "scsi_sbc.lalba", FT_UINT16
, BASE_DEC
,
2082 NULL
, 0x3fff, NULL
, HFILL
}},
2083 { &hf_scsi_sbc_get_lba_status_lba
,
2084 {"LBA", "scsi_sbc.get_lba_status.start_lba", FT_UINT64
, BASE_DEC
,
2085 NULL
, 0, NULL
, HFILL
}},
2086 { &hf_scsi_sbc_get_lba_status_data_length
,
2087 {"Data Length", "scsi_sbc.get_lba_status.data_length", FT_UINT32
, BASE_DEC
,
2088 NULL
, 0, NULL
, HFILL
}},
2089 { &hf_scsi_sbc_get_lba_status_num_blocks
,
2090 {"Num Blocks", "scsi_sbc.get_lba_status.num_blocks", FT_UINT32
, BASE_DEC
,
2091 NULL
, 0, NULL
, HFILL
}},
2092 { &hf_scsi_sbc_get_lba_status_provisioning_status
,
2093 {"Provisioning Type", "scsi_sbc.get_lba_status.provisioning_type", FT_UINT8
, BASE_DEC
,
2094 VALS(scsi_provisioning_type_val
), 0x07, NULL
, HFILL
}},
2095 { &hf_scsi_sbc_sanitize_sa
,
2096 {"Service Action", "scsi_sbc.sanitize.sa", FT_UINT8
, BASE_HEX
, VALS(sanitize_val
),
2097 0x1f, NULL
, HFILL
}},
2098 { &hf_scsi_sbc_sanitize_ause
,
2099 {"AUSE", "scsi_sbc.sanitize.ause", FT_BOOLEAN
, 8, NULL
,
2100 0x20, NULL
, HFILL
}},
2101 { &hf_scsi_sbc_sanitize_immed
,
2102 {"IMMED", "scsi_sbc.sanitize.immed", FT_BOOLEAN
, 8, NULL
,
2103 0x80, NULL
, HFILL
}},
2104 { &hf_scsi_sbc_sanitize_flags
,
2105 {"Flags", "scsi_sbc.sanitize_flags", FT_UINT8
, BASE_HEX
,
2106 NULL
, 0, NULL
, HFILL
}},
2107 { &hf_scsi_sbc_sanitize_overwrite_flags
,
2108 {"Flags", "scsi_sbc.sanitize_overwrite_flags", FT_UINT8
, BASE_HEX
,
2109 NULL
, 0, NULL
, HFILL
}},
2110 { &hf_scsi_sbc_sanitize_invert
,
2111 {"INVERT", "scsi_sbc.sanitize.invert", FT_BOOLEAN
, 8, NULL
,
2112 0x80, NULL
, HFILL
}},
2113 { &hf_scsi_sbc_sanitize_test
,
2114 {"TEST", "scsi_sbc.sanitize.test", FT_UINT8
, BASE_HEX
, NULL
,
2115 0x60, NULL
, HFILL
}},
2116 { &hf_scsi_sbc_sanitize_owcount
,
2117 {"Overwrite Count", "scsi_sbc.sanitize.overwrite_count", FT_UINT8
, BASE_HEX
, NULL
,
2118 0x1f, NULL
, HFILL
}},
2119 { &hf_scsi_sbc_sanitize_pattern_length
,
2120 {"Initialization Pattern Length", "scsi_sbc.sanitize.pattern_length", FT_UINT16
, BASE_DEC
, NULL
,
2122 { &hf_scsi_sbc_sanitize_pattern
,
2123 {"Initialization Pattern", "scsi_sbc.sanitize.pattern", FT_BYTES
, BASE_NONE
, NULL
,
2128 /* Setup protocol subtree array */
2129 static gint
*ett
[] = {
2130 &ett_scsi_format_unit
,
2135 &ett_scsi_xdwriteread
,
2137 &ett_scsi_defectdata
,
2139 &ett_scsi_reassign_blocks
,
2140 &ett_scsi_ssu_immed
,
2142 &ett_scsi_synccache
,
2145 &ett_scsi_writesame
,
2147 &ett_scsi_unmap_block_descriptor
,
2148 &ett_scsi_lba_status_descriptor
,
2150 &ett_scsi_sanitize_overwrite
2153 /* Register the protocol name and description */
2154 proto_scsi_sbc
= proto_register_protocol("SCSI_SBC", "SCSI_SBC", "scsi_sbc");
2156 /* Required function calls to register the header fields and subtrees used */
2157 proto_register_field_array(proto_scsi_sbc
, hf
, array_length(hf
));
2158 proto_register_subtree_array(ett
, array_length(ett
));
2162 proto_reg_handoff_scsi_sbc(void)
2168 * Editor modelines - http://www.wireshark.org/tools/modelines.html
2173 * indent-tabs-mode: nil
2176 * vi: set shiftwidth=4 tabstop=4 expandtab:
2177 * :indentSize=4:tabSize=4:noTabs=true: