HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-scsi-smc.c
blobf070f461d6d26bf7d2bd8af349daa5755038ca7d
1 /* based on the SMC 3 standard */
2 /* packet-scsi-smc.c
3 * Dissector for the SCSI SMC commandset
4 * Extracted from packet-scsi.c
6 * Dinesh G Dutt (ddutt@cisco.com)
7 * Ronnie sahlberg 2006
9 * $Id$
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 2002 Gerald Combs
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include "config.h"
32 #include <glib.h>
33 #include <epan/packet.h>
34 #include <epan/conversation.h>
35 #include <epan/tap.h>
36 #include "packet-scsi.h"
37 #include "packet-fc.h"
38 #include "packet-scsi-smc.h"
41 static int proto_scsi_smc = -1;
42 int hf_scsi_smc_opcode = -1;
43 static int hf_scsi_smc_mta = -1;
44 static int hf_scsi_smc_sa = -1;
45 static int hf_scsi_smc_da = -1;
46 static int hf_scsi_smc_fda = -1;
47 static int hf_scsi_smc_sda = -1;
48 static int hf_scsi_smc_medium_flags = -1;
49 static int hf_scsi_smc_inv1 = -1;
50 static int hf_scsi_smc_inv2 = -1;
51 static int hf_scsi_smc_range_flags = -1;
52 static int hf_scsi_smc_fast = -1;
53 static int hf_scsi_smc_range = -1;
54 /* static int hf_scsi_smc_sea = -1; */
55 static int hf_scsi_smc_num_elements = -1;
56 static int hf_scsi_smc_invert = -1;
57 static int hf_scsi_smc_ea = -1;
58 static int hf_scsi_smc_action_code = -1;
59 /* Generated from convert_proto_tree_add_text.pl */
60 static int hf_scsi_smc_allocation_length = -1;
61 static int hf_scsi_smc_first_element_address_reported = -1;
62 static int hf_scsi_smc_voltag = -1;
63 static int hf_scsi_smc_element_descriptor_length = -1;
64 static int hf_scsi_smc_byte_count_of_descriptor_data_available = -1;
65 static int hf_scsi_smc_pvoltag = -1;
66 static int hf_scsi_smc_code_set = -1;
67 static int hf_scsi_smc_starting_element_address = -1;
68 static int hf_scsi_smc_curdata = -1;
69 static int hf_scsi_smc_element_type_code = -1;
70 static int hf_scsi_smc_element_type_code_0F = -1;
71 static int hf_scsi_smc_identifier = -1;
72 static int hf_scsi_smc_vendor_specific_data = -1;
73 static int hf_scsi_smc_source_storage_element_address = -1;
74 static int hf_scsi_smc_number_of_elements_available = -1;
75 static int hf_scsi_smc_identifier_type = -1;
76 static int hf_scsi_smc_number_of_elements = -1;
77 static int hf_scsi_smc_identifier_length = -1;
78 static int hf_scsi_smc_scsi_bus_address = -1;
79 static int hf_scsi_smc_byte_count_of_report_available = -1;
80 static int hf_scsi_smc_cmc = -1;
81 static int hf_scsi_smc_svalid = -1;
82 static int hf_scsi_smc_avoltag = -1;
83 static int hf_scsi_smc_access = -1;
84 static int hf_scsi_smc_additional_sense_code_qualifier = -1;
85 static int hf_scsi_smc_lu_valid = -1;
86 static int hf_scsi_smc_dvcid = -1;
87 static int hf_scsi_smc_except = -1;
88 static int hf_scsi_smc_id_valid = -1;
89 static int hf_scsi_smc_not_bus = -1;
90 static int hf_scsi_smc_exenab = -1;
91 static int hf_scsi_smc_lun = -1;
92 static int hf_scsi_smc_inenab = -1;
93 static int hf_scsi_smc_full = -1;
94 static int hf_scsi_smc_impexp = -1;
95 static int hf_scsi_smc_primary_vol_tag_id = -1;
96 static int hf_scsi_smc_primary_vol_seq_num = -1;
97 static int hf_scsi_smc_alternate_vol_tag_id = -1;
98 static int hf_scsi_smc_alternate_vol_seq_num = -1;
100 static gint ett_scsi_exchange_medium = -1;
101 static gint ett_scsi_range = -1;
102 static gint ett_scsi_move = -1;
104 void
105 dissect_smc_exchangemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
106 guint offset, gboolean isreq, gboolean iscdb,
107 guint payload_len _U_, scsi_task_data_t *cdata _U_)
109 static const int *exchg_fields[] = {
110 &hf_scsi_smc_inv1,
111 &hf_scsi_smc_inv2,
112 NULL
115 if (!tree)
116 return;
118 if (isreq && iscdb) {
119 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
120 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN);
121 proto_tree_add_item (tree, hf_scsi_smc_fda, tvb, offset+5, 2, ENC_BIG_ENDIAN);
122 proto_tree_add_item (tree, hf_scsi_smc_sda, tvb, offset+7, 2, ENC_BIG_ENDIAN);
123 proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_medium_flags,
124 ett_scsi_exchange_medium, exchg_fields, ENC_BIG_ENDIAN);
125 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
126 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
130 void
131 dissect_smc_position_to_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
132 guint offset, gboolean isreq, gboolean iscdb,
133 guint payload_len _U_, scsi_task_data_t *cdata _U_)
135 static const int *pte_fields[] = {
136 &hf_scsi_smc_invert,
137 NULL
140 if (!tree)
141 return;
143 if (isreq && iscdb) {
144 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
145 proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+3, 2, ENC_BIG_ENDIAN);
146 proto_tree_add_bitmask(tree, tvb, offset+7, hf_scsi_smc_medium_flags,
147 ett_scsi_exchange_medium, pte_fields, ENC_BIG_ENDIAN);
148 proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
149 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
153 void
154 dissect_smc_initialize_element_status (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
155 guint offset, gboolean isreq, gboolean iscdb,
156 guint payload_len _U_, scsi_task_data_t *cdata _U_)
158 if (!tree)
159 return;
161 if (isreq && iscdb) {
162 proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
163 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
167 void
168 dissect_smc_initialize_element_status_with_range (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
169 guint offset, gboolean isreq, gboolean iscdb,
170 guint payload_len _U_, scsi_task_data_t *cdata _U_)
172 static const int *range_fields[] = {
173 &hf_scsi_smc_fast,
174 &hf_scsi_smc_range,
175 NULL
178 if (!tree)
179 return;
181 if (isreq && iscdb) {
182 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_smc_range_flags,
183 ett_scsi_range, range_fields, ENC_BIG_ENDIAN);
184 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+1, 2, ENC_BIG_ENDIAN);
185 proto_tree_add_item (tree, hf_scsi_smc_num_elements, tvb, offset+5, 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);
191 void
192 dissect_smc_openclose_importexport_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
193 guint offset, gboolean isreq, gboolean iscdb,
194 guint payload_len _U_, scsi_task_data_t *cdata _U_)
196 if (!tree)
197 return;
199 if (isreq && iscdb) {
200 proto_tree_add_item (tree, hf_scsi_smc_ea, tvb, offset+1, 2, ENC_BIG_ENDIAN);
201 proto_tree_add_item (tree, hf_scsi_smc_action_code, tvb, offset+3, 1, ENC_BIG_ENDIAN);
202 proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
203 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
206 void
207 dissect_smc_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
208 guint offset, gboolean isreq, gboolean iscdb,
209 guint payload_len _U_, scsi_task_data_t *cdata _U_)
211 static const int *move_fields[] = {
212 &hf_scsi_smc_invert,
213 NULL
216 if (!tree)
217 return;
219 if (isreq && iscdb) {
220 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
221 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN);
222 proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+5, 2, ENC_BIG_ENDIAN);
223 proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_range_flags,
224 ett_scsi_move, move_fields, ENC_BIG_ENDIAN);
225 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
226 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
230 #define MT_ELEM 0x1
231 #define ST_ELEM 0x2
232 #define I_E_ELEM 0x3
233 #define DT_ELEM 0x4
235 static const value_string element_type_code_vals[] = {
236 {0x0, "All element types"},
237 {MT_ELEM, "Medium transport element"},
238 {ST_ELEM, "Storage element"},
239 {I_E_ELEM, "Import/export element"},
240 {DT_ELEM, "Data transfer element"},
241 {0, NULL}
244 static const value_string action_code_vals[] = {
245 {0, "OPEN Import/Export Element"},
246 {1, "CLOSE Import/Export Element"},
247 {0, NULL}
250 #define PVOLTAG 0x80
251 #define AVOLTAG 0x40
253 #define EXCEPT 0x04
255 #define ID_VALID 0x20
256 #define LU_VALID 0x10
258 #define SVALID 0x80
260 static void
261 dissect_scsi_smc_volume_tag (tvbuff_t *tvb, packet_info *pinfo _U_,
262 proto_tree *tree, guint offset, int hf_vol_id, int hf_vol_seq_num)
264 char volid[32+1];
265 char *p;
267 tvb_memcpy (tvb, (guint8 *)volid, offset, 32);
268 p = &volid[32];
269 for (;;) {
270 *p = '\0';
271 if (p == volid)
272 break;
273 if (*(p - 1) != ' ')
274 break;
275 p--;
278 proto_tree_add_string(tree, hf_vol_id, tvb, offset, 32, volid);
279 proto_tree_add_item(tree, hf_vol_seq_num, tvb, offset+34, 2, ENC_BIG_ENDIAN);
283 static void
284 dissect_scsi_smc_element (tvbuff_t *tvb, packet_info *pinfo _U_,
285 proto_tree *tree, guint offset,
286 guint elem_bytecnt, guint8 elem_type,
287 guint8 voltag_flags)
289 guint8 flags;
290 guint8 ident_len;
292 proto_tree_add_item(tree, hf_scsi_smc_ea, tvb, offset, 2, ENC_BIG_ENDIAN);
293 offset += 2;
294 elem_bytecnt -= 2;
296 if (elem_bytecnt < 1)
297 return;
298 flags = tvb_get_guint8 (tvb, offset);
299 switch (elem_type) {
301 case MT_ELEM:
302 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
303 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
304 break;
306 case ST_ELEM:
307 case DT_ELEM:
308 proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA);
309 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
310 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
311 break;
313 case I_E_ELEM:
314 proto_tree_add_item(tree, hf_scsi_smc_cmc, tvb, offset, 1, ENC_NA);
315 proto_tree_add_item(tree, hf_scsi_smc_inenab, tvb, offset, 1, ENC_NA);
316 proto_tree_add_item(tree, hf_scsi_smc_exenab, tvb, offset, 1, ENC_NA);
317 proto_tree_add_item(tree, hf_scsi_smc_impexp, tvb, offset, 1, ENC_NA);
318 proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA);
319 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
320 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
321 break;
323 offset += 1;
324 elem_bytecnt -= 1;
326 if (elem_bytecnt < 1)
327 return;
328 offset += 1; /* reserved */
329 elem_bytecnt -= 1;
331 if (elem_bytecnt < 2)
332 return;
333 if (flags & EXCEPT) {
334 proto_tree_add_item(tree, hf_scsi_smc_additional_sense_code_qualifier, tvb, offset, 2, ENC_BIG_ENDIAN);
336 offset += 2;
337 elem_bytecnt -= 2;
339 if (elem_bytecnt < 3)
340 return;
341 switch (elem_type) {
343 case DT_ELEM:
344 flags = tvb_get_guint8 (tvb, offset);
345 if (flags & LU_VALID) {
346 proto_tree_add_item(tree, hf_scsi_smc_lun, tvb, offset, 1, ENC_NA);
348 proto_tree_add_item(tree, hf_scsi_smc_not_bus, tvb, offset, 1, ENC_NA);
349 proto_tree_add_item(tree, hf_scsi_smc_id_valid, tvb, offset, 1, ENC_NA);
350 proto_tree_add_item(tree, hf_scsi_smc_lu_valid, tvb, offset, 1, ENC_NA);
352 offset += 1;
353 if (flags & ID_VALID) {
354 proto_tree_add_item(tree, hf_scsi_smc_scsi_bus_address, tvb, offset, 1, ENC_NA);
356 offset += 1;
357 offset += 1; /* reserved */
358 break;
360 default:
361 offset += 3; /* reserved */
362 break;
364 elem_bytecnt -= 3;
366 if (elem_bytecnt < 3)
367 return;
368 flags = tvb_get_guint8 (tvb, offset);
369 proto_tree_add_item(tree, hf_scsi_smc_svalid, tvb, offset, 1, ENC_NA);
370 if (flags & SVALID) {
371 proto_tree_add_item(tree, hf_scsi_smc_invert, tvb, offset, 1, ENC_NA);
372 offset += 1;
373 proto_tree_add_item(tree, hf_scsi_smc_source_storage_element_address, tvb, offset, 2, ENC_BIG_ENDIAN);
374 offset += 2;
375 } else {
376 offset += 3;
378 elem_bytecnt -= 3;
380 if (voltag_flags & PVOLTAG) {
381 if (elem_bytecnt < 36)
382 return;
383 dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_primary_vol_tag_id,
384 hf_scsi_smc_primary_vol_seq_num);
385 offset += 36;
386 elem_bytecnt -= 36;
389 if (voltag_flags & AVOLTAG) {
390 if (elem_bytecnt < 36)
391 return;
392 dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_alternate_vol_tag_id,
393 hf_scsi_smc_alternate_vol_seq_num);
394 offset += 36;
395 elem_bytecnt -= 36;
398 if (elem_bytecnt < 1)
399 return;
400 proto_tree_add_item(tree, hf_scsi_smc_code_set, tvb, offset, 1, ENC_NA);
401 offset += 1;
402 elem_bytecnt -= 1;
404 if (elem_bytecnt < 1)
405 return;
406 proto_tree_add_item(tree, hf_scsi_smc_identifier_type, tvb, offset, 1, ENC_NA);
407 offset += 1;
408 elem_bytecnt -= 1;
410 if (elem_bytecnt < 1)
411 return;
412 offset += 1; /* reserved */
413 elem_bytecnt -= 1;
415 if (elem_bytecnt < 1)
416 return;
417 ident_len = tvb_get_guint8 (tvb, offset);
418 proto_tree_add_item(tree, hf_scsi_smc_identifier_length, tvb, offset, 1, ENC_NA);
419 offset += 1;
420 elem_bytecnt -= 1;
422 if (ident_len != 0) {
423 if (elem_bytecnt < ident_len)
424 return;
425 proto_tree_add_item(tree, hf_scsi_smc_identifier, tvb, offset, ident_len, ENC_NA);
426 offset += ident_len;
427 elem_bytecnt -= ident_len;
429 if (elem_bytecnt != 0) {
430 proto_tree_add_item(tree, hf_scsi_smc_vendor_specific_data, tvb, offset, elem_bytecnt, ENC_NA);
435 static void
436 dissect_scsi_smc_elements (tvbuff_t *tvb, packet_info *pinfo,
437 proto_tree *tree, guint offset,
438 guint desc_bytecnt, guint8 elem_type,
439 guint8 voltag_flags, guint16 elem_desc_len)
441 guint elem_bytecnt;
443 while (desc_bytecnt != 0) {
444 elem_bytecnt = elem_desc_len;
446 if (elem_bytecnt > desc_bytecnt)
447 elem_bytecnt = desc_bytecnt;
449 if (elem_bytecnt < 2)
450 break;
452 dissect_scsi_smc_element (tvb, pinfo, tree, offset, elem_bytecnt,
453 elem_type, voltag_flags);
454 offset += elem_bytecnt;
455 desc_bytecnt -= elem_bytecnt;
460 void
461 dissect_smc_readelementstatus (tvbuff_t *tvb, packet_info *pinfo,
462 proto_tree *tree, guint offset, gboolean isreq,
463 gboolean iscdb,
464 guint payload_len _U_, scsi_task_data_t *cdata _U_)
466 guint bytecnt, desc_bytecnt;
467 guint8 elem_type;
468 guint8 voltag_flags;
469 guint16 elem_desc_len;
471 if (!tree)
472 return;
474 if (isreq && iscdb) {
475 proto_tree_add_item(tree, hf_scsi_smc_voltag, tvb, offset, 1, ENC_NA);
476 proto_tree_add_item(tree, hf_scsi_smc_element_type_code_0F, tvb, offset, 1, ENC_NA);
477 proto_tree_add_item(tree, hf_scsi_smc_starting_element_address, tvb, offset+1, 2, ENC_BIG_ENDIAN);
478 proto_tree_add_item(tree, hf_scsi_smc_number_of_elements, tvb, offset+3, 2, ENC_BIG_ENDIAN);
479 proto_tree_add_item(tree, hf_scsi_smc_curdata, tvb, offset+4, 1, ENC_NA);
480 proto_tree_add_item(tree, hf_scsi_smc_dvcid, tvb, offset+4, 1, ENC_NA);
481 proto_tree_add_item(tree, hf_scsi_smc_allocation_length, tvb, offset+6, 3, ENC_BIG_ENDIAN);
482 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
483 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
485 else if (!isreq) {
486 proto_tree_add_item(tree, hf_scsi_smc_first_element_address_reported, tvb, offset, 2, ENC_BIG_ENDIAN);
487 offset += 2;
488 proto_tree_add_item(tree, hf_scsi_smc_number_of_elements_available, tvb, offset, 2, ENC_BIG_ENDIAN);
489 offset += 2;
490 offset += 1; /* reserved */
491 bytecnt = tvb_get_ntoh24 (tvb, offset);
492 proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_report_available, tvb, offset, 3, ENC_BIG_ENDIAN);
493 offset += 3;
494 while (bytecnt != 0) {
495 if (bytecnt < 1)
496 break;
497 elem_type = tvb_get_guint8 (tvb, offset);
498 proto_tree_add_item(tree, hf_scsi_smc_element_type_code, tvb, offset, 1, ENC_NA);
499 offset += 1;
500 bytecnt -= 1;
502 if (bytecnt < 1)
503 break;
504 voltag_flags = tvb_get_guint8 (tvb, offset);
505 proto_tree_add_item(tree, hf_scsi_smc_pvoltag, tvb, offset, 1, ENC_NA);
506 proto_tree_add_item(tree, hf_scsi_smc_avoltag, tvb, offset, 1, ENC_NA);
507 offset += 1;
508 bytecnt -= 1;
510 if (bytecnt < 2)
511 break;
512 elem_desc_len = tvb_get_ntohs (tvb, offset);
513 proto_tree_add_item(tree, hf_scsi_smc_element_descriptor_length, tvb, offset, 2, ENC_BIG_ENDIAN);
514 offset += 2;
515 bytecnt -= 2;
517 if (bytecnt < 1)
518 break;
519 offset += 1; /* reserved */
520 bytecnt -= 1;
522 if (bytecnt < 3)
523 break;
524 desc_bytecnt = tvb_get_ntoh24 (tvb, offset);
525 proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_descriptor_data_available, tvb, offset, 3, ENC_BIG_ENDIAN);
526 offset += 3;
527 bytecnt -= 3;
529 if (desc_bytecnt > bytecnt)
530 desc_bytecnt = bytecnt;
531 dissect_scsi_smc_elements (tvb, pinfo, tree, offset,
532 desc_bytecnt, elem_type,
533 voltag_flags, elem_desc_len);
534 offset += desc_bytecnt;
535 bytecnt -= desc_bytecnt;
542 /* SMC Commands */
543 const value_string scsi_smc_vals[] = {
544 {SCSI_SPC_ACCESS_CONTROL_IN , "Access Control In"},
545 {SCSI_SPC_ACCESS_CONTROL_OUT , "Access Control Out"},
546 {SCSI_SMC_EXCHANGE_MEDIUM , "Exchange Medium"},
547 {SCSI_SMC_INITIALIZE_ELEMENT_STATUS , "Initialize Element Status"},
548 {SCSI_SMC_INITIALIZE_ELEMENT_STATUS_RANGE , "Initialize Element Status With Range"},
549 {SCSI_SPC_INQUIRY , "Inquiry"},
550 {SCSI_SPC_LOGSELECT , "Log Select"},
551 {SCSI_SPC_LOGSENSE , "Log Sense"},
552 {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"},
553 {SCSI_SPC_MODESELECT6 , "Mode Select(6)"},
554 {SCSI_SPC_MODESELECT10 , "Mode Select(10)"},
555 {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"},
556 {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"},
557 {SCSI_SMC_MOVE_MEDIUM , "Move Medium"},
558 {SCSI_SMC_MOVE_MEDIUM_ATTACHED , "Move Medium Attached"},
559 {SCSI_SMC_OPENCLOSE_ELEMENT , "Open/Close Import/Export Element"},
560 {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"},
561 {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"},
562 {SCSI_SMC_POSITION_TO_ELEMENT , "Position To Element"},
563 {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"},
564 {SCSI_SMC_READ_ATTRIBUTE , "Read Attribute"},
565 {SCSI_SPC_READBUFFER , "Read Buffer"},
566 {SCSI_SMC_READ_ELEMENT_STATUS , "Read Element Status"},
567 {SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED , "Read Element Status Attached"},
568 {SCSI_SPC_RCVDIAGRESULTS , "Receive Diagnostics Results"},
569 {SCSI_SPC_RELEASE6 , "Release(6)"},
570 {SCSI_SPC_RELEASE10 , "Release(10)"},
571 {SCSI_SPC_REPORTLUNS , "Report LUNs"},
572 {SCSI_SMC_REPORT_VOLUME_TYPES_SUPPORTED , "Report Volume Types Supported"},
573 {SCSI_SPC_REQSENSE , "Request Sense"},
574 {SCSI_SMC_REQUEST_VOLUME_ELEMENT_ADDRESS , "Request Volume Element Address"},
575 {SCSI_SPC_RESERVE6 , "Reserve(6)"},
576 {SCSI_SPC_RESERVE10 , "Reserve(10)"},
577 {SCSI_SMC_SEND_VOLUME_TAG , "Send Volume Tag"},
578 {SCSI_SPC_SENDDIAG , "Send Diagnostic"},
579 {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"},
580 {SCSI_SMC_WRITE_ATTRIBUTE , "Write Attribute"},
581 {SCSI_SPC_WRITEBUFFER , "Write Buffer"},
582 {0, NULL},
585 scsi_cdb_table_t scsi_smc_table[256] = {
586 /*SPC 0x00*/{dissect_spc_testunitready},
587 /*SMC 0x01*/{NULL},
588 /*SMC 0x02*/{NULL},
589 /*SPC 0x03*/{dissect_spc_requestsense},
590 /*SMC 0x04*/{NULL},
591 /*SMC 0x05*/{NULL},
592 /*SMC 0x06*/{NULL},
593 /*SMC 0x07*/{dissect_smc_initialize_element_status},
594 /*SMC 0x08*/{NULL},
595 /*SMC 0x09*/{NULL},
596 /*SMC 0x0a*/{NULL},
597 /*SMC 0x0b*/{NULL},
598 /*SMC 0x0c*/{NULL},
599 /*SMC 0x0d*/{NULL},
600 /*SMC 0x0e*/{NULL},
601 /*SMC 0x0f*/{NULL},
602 /*SMC 0x10*/{NULL},
603 /*SMC 0x11*/{NULL},
604 /*SPC 0x12*/{dissect_spc_inquiry},
605 /*SMC 0x13*/{NULL},
606 /*SMC 0x14*/{NULL},
607 /*SPC 0x15*/{dissect_spc_modeselect6},
608 /*SPC 0x16*/{dissect_spc_reserve6},
609 /*SPC 0x17*/{dissect_spc_release6},
610 /*SMC 0x18*/{NULL},
611 /*SMC 0x19*/{NULL},
612 /*SPC 0x1a*/{dissect_spc_modesense6},
613 /*SMC 0x1b*/{dissect_smc_openclose_importexport_element},
614 /*SMC 0x1c*/{NULL},
615 /*SPC 0x1d*/{dissect_spc_senddiagnostic},
616 /*SMC 0x1e*/{dissect_spc_preventallowmediaremoval},
617 /*SMC 0x1f*/{NULL},
618 /*SMC 0x20*/{NULL},
619 /*SMC 0x21*/{NULL},
620 /*SMC 0x22*/{NULL},
621 /*SMC 0x23*/{NULL},
622 /*SMC 0x24*/{NULL},
623 /*SMC 0x25*/{NULL},
624 /*SMC 0x26*/{NULL},
625 /*SMC 0x27*/{NULL},
626 /*SMC 0x28*/{NULL},
627 /*SMC 0x29*/{NULL},
628 /*SMC 0x2a*/{NULL},
629 /*SMC 0x2b*/{dissect_smc_position_to_element},
630 /*SMC 0x2c*/{NULL},
631 /*SMC 0x2d*/{NULL},
632 /*SMC 0x2e*/{NULL},
633 /*SMC 0x2f*/{NULL},
634 /*SMC 0x30*/{NULL},
635 /*SMC 0x31*/{NULL},
636 /*SMC 0x32*/{NULL},
637 /*SMC 0x33*/{NULL},
638 /*SMC 0x34*/{NULL},
639 /*SMC 0x35*/{NULL},
640 /*SMC 0x36*/{NULL},
641 /*SMC 0x37*/{dissect_smc_initialize_element_status_with_range},
642 /*SMC 0x38*/{NULL},
643 /*SMC 0x39*/{NULL},
644 /*SMC 0x3a*/{NULL},
645 /*SPC 0x3b*/{dissect_spc_writebuffer},
646 /*SMC 0x3c*/{NULL},
647 /*SMC 0x3d*/{NULL},
648 /*SMC 0x3e*/{NULL},
649 /*SMC 0x3f*/{NULL},
650 /*SMC 0x40*/{NULL},
651 /*SMC 0x41*/{NULL},
652 /*SMC 0x42*/{NULL},
653 /*SMC 0x43*/{NULL},
654 /*SMC 0x44*/{NULL},
655 /*SMC 0x45*/{NULL},
656 /*SMC 0x46*/{NULL},
657 /*SMC 0x47*/{NULL},
658 /*SMC 0x48*/{NULL},
659 /*SMC 0x49*/{NULL},
660 /*SMC 0x4a*/{NULL},
661 /*SMC 0x4b*/{NULL},
662 /*SPC 0x4c*/{dissect_spc_logselect},
663 /*SPC 0x4d*/{dissect_spc_logsense},
664 /*SMC 0x4e*/{NULL},
665 /*SMC 0x4f*/{NULL},
666 /*SMC 0x50*/{NULL},
667 /*SMC 0x51*/{NULL},
668 /*SMC 0x52*/{NULL},
669 /*SMC 0x53*/{NULL},
670 /*SMC 0x54*/{NULL},
671 /*SPC 0x55*/{dissect_spc_modeselect10},
672 /*SPC 0x56*/{dissect_spc_reserve10},
673 /*SPC 0x57*/{dissect_spc_release10},
674 /*SMC 0x58*/{NULL},
675 /*SMC 0x59*/{NULL},
676 /*SPC 0x5a*/{dissect_spc_modesense10},
677 /*SMC 0x5b*/{NULL},
678 /*SMC 0x5c*/{NULL},
679 /*SMC 0x5d*/{NULL},
680 /*SPC 0x5e*/{dissect_spc_persistentreservein},
681 /*SPC 0x5f*/{dissect_spc_persistentreserveout},
682 /*SMC 0x60*/{NULL},
683 /*SMC 0x61*/{NULL},
684 /*SMC 0x62*/{NULL},
685 /*SMC 0x63*/{NULL},
686 /*SMC 0x64*/{NULL},
687 /*SMC 0x65*/{NULL},
688 /*SMC 0x66*/{NULL},
689 /*SMC 0x67*/{NULL},
690 /*SMC 0x68*/{NULL},
691 /*SMC 0x69*/{NULL},
692 /*SMC 0x6a*/{NULL},
693 /*SMC 0x6b*/{NULL},
694 /*SMC 0x6c*/{NULL},
695 /*SMC 0x6d*/{NULL},
696 /*SMC 0x6e*/{NULL},
697 /*SMC 0x6f*/{NULL},
698 /*SMC 0x70*/{NULL},
699 /*SMC 0x71*/{NULL},
700 /*SMC 0x72*/{NULL},
701 /*SMC 0x73*/{NULL},
702 /*SMC 0x74*/{NULL},
703 /*SMC 0x75*/{NULL},
704 /*SMC 0x76*/{NULL},
705 /*SMC 0x77*/{NULL},
706 /*SMC 0x78*/{NULL},
707 /*SMC 0x79*/{NULL},
708 /*SMC 0x7a*/{NULL},
709 /*SMC 0x7b*/{NULL},
710 /*SMC 0x7c*/{NULL},
711 /*SMC 0x7d*/{NULL},
712 /*SMC 0x7e*/{NULL},
713 /*SMC 0x7f*/{NULL},
714 /*SMC 0x80*/{NULL},
715 /*SMC 0x81*/{NULL},
716 /*SMC 0x82*/{NULL},
717 /*SMC 0x83*/{NULL},
718 /*SMC 0x84*/{NULL},
719 /*SMC 0x85*/{NULL},
720 /*SMC 0x86*/{NULL},
721 /*SMC 0x87*/{NULL},
722 /*SMC 0x88*/{NULL},
723 /*SMC 0x89*/{NULL},
724 /*SMC 0x8a*/{NULL},
725 /*SMC 0x8b*/{NULL},
726 /*SMC 0x8c*/{NULL},
727 /*SMC 0x8d*/{NULL},
728 /*SMC 0x8e*/{NULL},
729 /*SMC 0x8f*/{NULL},
730 /*SMC 0x90*/{NULL},
731 /*SMC 0x91*/{NULL},
732 /*SMC 0x92*/{NULL},
733 /*SMC 0x93*/{NULL},
734 /*SMC 0x94*/{NULL},
735 /*SMC 0x95*/{NULL},
736 /*SMC 0x96*/{NULL},
737 /*SMC 0x97*/{NULL},
738 /*SMC 0x98*/{NULL},
739 /*SMC 0x99*/{NULL},
740 /*SMC 0x9a*/{NULL},
741 /*SMC 0x9b*/{NULL},
742 /*SMC 0x9c*/{NULL},
743 /*SMC 0x9d*/{NULL},
744 /*SMC 0x9e*/{NULL},
745 /*SMC 0x9f*/{NULL},
746 /*SPC 0xa0*/{dissect_spc_reportluns},
747 /*SMC 0xa1*/{NULL},
748 /*SMC 0xa2*/{NULL},
749 /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in},
750 /*SMC 0xa4*/{NULL},
751 /*SMC 0xa5*/{dissect_smc_movemedium},
752 /*SMC 0xa6*/{dissect_smc_exchangemedium},
753 /*SMC 0xa7*/{dissect_smc_movemedium},
754 /*SMC 0xa8*/{NULL},
755 /*SMC 0xa9*/{NULL},
756 /*SMC 0xaa*/{NULL},
757 /*SMC 0xab*/{NULL},
758 /*SMC 0xac*/{NULL},
759 /*SMC 0xad*/{NULL},
760 /*SMC 0xae*/{NULL},
761 /*SMC 0xaf*/{NULL},
762 /*SMC 0xb0*/{NULL},
763 /*SMC 0xb1*/{NULL},
764 /*SMC 0xb2*/{NULL},
765 /*SMC 0xb3*/{NULL},
766 /*SMC 0xb4*/{dissect_smc_readelementstatus},
767 /*SMC 0xb5*/{NULL},
768 /*SMC 0xb6*/{NULL},
769 /*SMC 0xb7*/{NULL},
770 /*SMC 0xb8*/{dissect_smc_readelementstatus},
771 /*SMC 0xb9*/{NULL},
772 /*SMC 0xba*/{NULL},
773 /*SMC 0xbb*/{NULL},
774 /*SMC 0xbc*/{NULL},
775 /*SMC 0xbd*/{NULL},
776 /*SMC 0xbe*/{NULL},
777 /*SMC 0xbf*/{NULL},
778 /*SMC 0xc0*/{NULL},
779 /*SMC 0xc1*/{NULL},
780 /*SMC 0xc2*/{NULL},
781 /*SMC 0xc3*/{NULL},
782 /*SMC 0xc4*/{NULL},
783 /*SMC 0xc5*/{NULL},
784 /*SMC 0xc6*/{NULL},
785 /*SMC 0xc7*/{NULL},
786 /*SMC 0xc8*/{NULL},
787 /*SMC 0xc9*/{NULL},
788 /*SMC 0xca*/{NULL},
789 /*SMC 0xcb*/{NULL},
790 /*SMC 0xcc*/{NULL},
791 /*SMC 0xcd*/{NULL},
792 /*SMC 0xce*/{NULL},
793 /*SMC 0xcf*/{NULL},
794 /*SMC 0xd0*/{NULL},
795 /*SMC 0xd1*/{NULL},
796 /*SMC 0xd2*/{NULL},
797 /*SMC 0xd3*/{NULL},
798 /*SMC 0xd4*/{NULL},
799 /*SMC 0xd5*/{NULL},
800 /*SMC 0xd6*/{NULL},
801 /*SMC 0xd7*/{NULL},
802 /*SMC 0xd8*/{NULL},
803 /*SMC 0xd9*/{NULL},
804 /*SMC 0xda*/{NULL},
805 /*SMC 0xdb*/{NULL},
806 /*SMC 0xdc*/{NULL},
807 /*SMC 0xdd*/{NULL},
808 /*SMC 0xde*/{NULL},
809 /*SMC 0xdf*/{NULL},
810 /*SMC 0xe0*/{NULL},
811 /*SMC 0xe1*/{NULL},
812 /*SMC 0xe2*/{NULL},
813 /*SMC 0xe3*/{NULL},
814 /*SMC 0xe4*/{NULL},
815 /*SMC 0xe5*/{NULL},
816 /*SMC 0xe6*/{NULL},
817 /*SMC 0xe7*/{NULL},
818 /*SMC 0xe8*/{NULL},
819 /*SMC 0xe9*/{NULL},
820 /*SMC 0xea*/{NULL},
821 /*SMC 0xeb*/{NULL},
822 /*SMC 0xec*/{NULL},
823 /*SMC 0xed*/{NULL},
824 /*SMC 0xee*/{NULL},
825 /*SMC 0xef*/{NULL},
826 /*SMC 0xf0*/{NULL},
827 /*SMC 0xf1*/{NULL},
828 /*SMC 0xf2*/{NULL},
829 /*SMC 0xf3*/{NULL},
830 /*SMC 0xf4*/{NULL},
831 /*SMC 0xf5*/{NULL},
832 /*SMC 0xf6*/{NULL},
833 /*SMC 0xf7*/{NULL},
834 /*SMC 0xf8*/{NULL},
835 /*SMC 0xf9*/{NULL},
836 /*SMC 0xfa*/{NULL},
837 /*SMC 0xfb*/{NULL},
838 /*SMC 0xfc*/{NULL},
839 /*SMC 0xfd*/{NULL},
840 /*SMC 0xfe*/{NULL},
841 /*SMC 0xff*/{NULL}
845 void
846 proto_register_scsi_smc(void)
848 static hf_register_info hf[] = {
849 { &hf_scsi_smc_opcode,
850 {"SMC Opcode", "scsi_smc.opcode", FT_UINT8, BASE_HEX,
851 VALS (scsi_smc_vals), 0x0, NULL, HFILL}},
852 { &hf_scsi_smc_mta,
853 {"Medium Transport Address", "scsi_smc.mta", FT_UINT16, BASE_DEC,
854 NULL, 0x0, NULL, HFILL}},
855 { &hf_scsi_smc_sa,
856 {"Source Address", "scsi_smc.sa", FT_UINT16, BASE_DEC,
857 NULL, 0x0, NULL, HFILL}},
858 { &hf_scsi_smc_da,
859 {"Destination Address", "scsi_smc.da", FT_UINT16, BASE_DEC,
860 NULL, 0x0, NULL, HFILL}},
861 { &hf_scsi_smc_fda,
862 {"First Destination Address", "scsi_smc.fda", FT_UINT16, BASE_DEC,
863 NULL, 0x0, NULL, HFILL}},
864 { &hf_scsi_smc_sda,
865 {"Second Destination Address", "scsi_smc.sda", FT_UINT16, BASE_DEC,
866 NULL, 0x0, NULL, HFILL}},
867 { &hf_scsi_smc_medium_flags,
868 {"Flags", "scsi_smc.medium_flags", FT_UINT8, BASE_HEX,
869 NULL, 0x0, NULL, HFILL}},
870 { &hf_scsi_smc_inv1,
871 {"INV1", "scsi_smc.inv1", FT_BOOLEAN, 8,
872 NULL, 0x02, NULL, HFILL}},
873 { &hf_scsi_smc_inv2,
874 {"INV2", "scsi_smc.inv2", FT_BOOLEAN, 8,
875 NULL, 0x01, NULL, HFILL}},
876 { &hf_scsi_smc_range_flags,
877 {"Flags", "scsi_smc.range_flags", FT_UINT8, BASE_HEX,
878 NULL, 0x0, NULL, HFILL}},
879 { &hf_scsi_smc_fast,
880 {"FAST", "scsi_smc.fast", FT_BOOLEAN, 8,
881 NULL, 0x02, NULL, HFILL}},
882 { &hf_scsi_smc_range,
883 {"RANGE", "scsi_smc.range", FT_BOOLEAN, 8,
884 NULL, 0x01, NULL, HFILL}},
885 #if 0
886 { &hf_scsi_smc_sea,
887 {"Starting Element Address", "scsi_smc.sea", FT_UINT16, BASE_DEC,
888 NULL, 0x0, NULL, HFILL}},
889 #endif
890 { &hf_scsi_smc_num_elements,
891 {"Number of Elements", "scsi_smc.num_elements", FT_UINT16, BASE_DEC,
892 NULL, 0x0, NULL, HFILL}},
893 { &hf_scsi_smc_invert,
894 {"INVERT", "scsi_smc.invert", FT_BOOLEAN, 8,
895 NULL, 0x01, NULL, HFILL}},
896 { &hf_scsi_smc_ea,
897 {"Element Address", "scsi_smc.ea", FT_UINT16, BASE_DEC,
898 NULL, 0x0, NULL, HFILL}},
899 { &hf_scsi_smc_action_code,
900 {"Action Code", "scsi_smc.action_code", FT_UINT8, BASE_HEX,
901 VALS(action_code_vals), 0x1f, NULL, HFILL}},
903 /* Generated from convert_proto_tree_add_text.pl */
904 { &hf_scsi_smc_scsi_bus_address, { "SCSI Bus Address", "scsi_smc.scsi_bus_address", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
905 { &hf_scsi_smc_source_storage_element_address, { "Source Storage Element Address", "scsi_smc.source_storage_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
906 { &hf_scsi_smc_code_set, { "Code Set", "scsi_smc.code_set", FT_UINT8, BASE_DEC, VALS(scsi_devid_codeset_val), 0x0F, NULL, HFILL }},
907 { &hf_scsi_smc_identifier_type, { "Identifier Type", "scsi_smc.identifier_type", FT_UINT8, BASE_DEC, VALS(scsi_devid_idtype_val), 0x0F, NULL, HFILL }},
908 { &hf_scsi_smc_identifier_length, { "Identifier Length", "scsi_smc.identifier_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
909 { &hf_scsi_smc_identifier, { "Identifier", "scsi_smc.identifier", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
910 { &hf_scsi_smc_vendor_specific_data, { "Vendor-specific Data", "scsi_smc.vendor_specific_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
911 { &hf_scsi_smc_voltag, { "VOLTAG", "scsi_smc.voltag", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
912 { &hf_scsi_smc_starting_element_address, { "Starting Element Address", "scsi_smc.starting_element_address", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
913 { &hf_scsi_smc_number_of_elements, { "Number of Elements", "scsi_smc.number_of_elements", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
914 { &hf_scsi_smc_curdata, { "CURDATA", "scsi_smc.curdata", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
915 { &hf_scsi_smc_allocation_length, { "Allocation Length", "scsi_smc.allocation_length", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
916 { &hf_scsi_smc_first_element_address_reported, { "First Element Address Reported", "scsi_smc.first_element_address_reported", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
917 { &hf_scsi_smc_number_of_elements_available, { "Number of Elements Available", "scsi_smc.number_of_elements_available", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
918 { &hf_scsi_smc_byte_count_of_report_available, { "Byte Count of Report Available", "scsi_smc.byte_count_of_report_available", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
919 { &hf_scsi_smc_element_type_code, { "Element Type Code", "scsi_smc.element_type_code", FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0, NULL, HFILL }},
920 { &hf_scsi_smc_element_type_code_0F, { "Element Type Code", "scsi_smc.element_type_code", FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0F, NULL, HFILL }},
921 { &hf_scsi_smc_pvoltag, { "PVOLTAG", "scsi_smc.pvoltag", FT_BOOLEAN, 8, NULL, PVOLTAG, NULL, HFILL }},
922 { &hf_scsi_smc_element_descriptor_length, { "Element Descriptor Length", "scsi_smc.element_descriptor_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
923 { &hf_scsi_smc_byte_count_of_descriptor_data_available, { "Byte Count Of Descriptor Data Available", "scsi_smc.byte_count_of_descriptor_data_available", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
924 { &hf_scsi_smc_except, { "EXCEPT", "scsi_smc.except", FT_BOOLEAN, 8, NULL, EXCEPT, NULL, HFILL }},
925 { &hf_scsi_smc_access, { "ACCESS", "scsi_smc.access", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
926 { &hf_scsi_smc_cmc, { "cmc", "scsi_smc.cmc", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
927 { &hf_scsi_smc_additional_sense_code_qualifier, { "Additional Sense Code+Qualifier", "scsi_smc.additional_sense_code_qualifier", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &scsi_asc_val_ext, 0x0, NULL, HFILL }},
928 { &hf_scsi_smc_not_bus, { "NOT BUS", "scsi_smc.not_bus", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
929 { &hf_scsi_smc_id_valid, { "ID VALID", "scsi_smc.id_valid", FT_BOOLEAN, 8, NULL, ID_VALID, NULL, HFILL }},
930 { &hf_scsi_smc_lu_valid, { "LU VALID", "scsi_smc.lu_valid", FT_BOOLEAN, 8, NULL, LU_VALID, NULL, HFILL }},
931 { &hf_scsi_smc_svalid, { "SVALID", "scsi_smc.svalid", FT_BOOLEAN, 8, NULL, SVALID, NULL, HFILL }},
932 { &hf_scsi_smc_dvcid, { "DVCID", "scsi_smc.dvcid", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
933 { &hf_scsi_smc_avoltag, { "AVOLTAG", "scsi_smc.pvoltag", FT_BOOLEAN, 8, NULL, AVOLTAG, NULL, HFILL }},
934 { &hf_scsi_smc_full, { "FULL", "scsi_smc.full", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
935 { &hf_scsi_smc_exenab, { "EXENAB", "scsi_smc.exenab", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
936 { &hf_scsi_smc_inenab, { "INENAB", "scsi_smc.inenab", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
937 { &hf_scsi_smc_impexp, { "IMPEXP", "scsi_smc.impexp", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
938 { &hf_scsi_smc_lun, { "LUN", "scsi_smc.lun", FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
939 { &hf_scsi_smc_primary_vol_tag_id, { "Primary Volume Identification", "scsi_smc.primary_vol_tag_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
940 { &hf_scsi_smc_alternate_vol_tag_id, { "Alternate Volume Identification", "scsi_smc.alternate_vol_tag_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
941 { &hf_scsi_smc_primary_vol_seq_num, { "Primary Volume Sequence Number", "scsi_smc.primary_vol_seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
942 { &hf_scsi_smc_alternate_vol_seq_num, { "Alternate Volume Sequence Number", "scsi_smc.alternate_vol_seq_num", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
946 /* Setup protocol subtree array */
947 static gint *ett[] = {
948 &ett_scsi_exchange_medium,
949 &ett_scsi_range,
950 &ett_scsi_move
953 /* Register the protocol name and description */
954 proto_scsi_smc = proto_register_protocol("SCSI_SMC", "SCSI_SMC", "scsi_smc");
956 /* Required function calls to register the header fields and subtrees used */
957 proto_register_field_array(proto_scsi_smc, hf, array_length(hf));
959 proto_register_subtree_array(ett, array_length(ett));
962 void
963 proto_reg_handoff_scsi_smc(void)