Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-scsi-smc.c
blob510976dcacd80613941996a96f35e0c736eead6c
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 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 2002 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include "config.h"
18 #include <epan/packet.h>
19 #include <epan/conversation.h>
20 #include "packet-scsi.h"
21 #include "packet-scsi-smc.h"
23 void proto_register_scsi_smc(void);
25 static int proto_scsi_smc;
26 int hf_scsi_smc_opcode;
27 static int hf_scsi_smc_mta;
28 static int hf_scsi_smc_sa;
29 static int hf_scsi_smc_da;
30 static int hf_scsi_smc_fda;
31 static int hf_scsi_smc_sda;
32 static int hf_scsi_smc_medium_flags;
33 static int hf_scsi_smc_inv1;
34 static int hf_scsi_smc_inv2;
35 static int hf_scsi_smc_range_flags;
36 static int hf_scsi_smc_fast;
37 static int hf_scsi_smc_range;
38 /* static int hf_scsi_smc_sea; */
39 static int hf_scsi_smc_num_elements;
40 static int hf_scsi_smc_invert;
41 static int hf_scsi_smc_ea;
42 static int hf_scsi_smc_action_code;
43 /* Generated from convert_proto_tree_add_text.pl */
44 static int hf_scsi_smc_allocation_length;
45 static int hf_scsi_smc_first_element_address_reported;
46 static int hf_scsi_smc_voltag;
47 static int hf_scsi_smc_element_descriptor_length;
48 static int hf_scsi_smc_byte_count_of_descriptor_data_available;
49 static int hf_scsi_smc_pvoltag;
50 static int hf_scsi_smc_code_set;
51 static int hf_scsi_smc_starting_element_address;
52 static int hf_scsi_smc_curdata;
53 static int hf_scsi_smc_element_type_code;
54 static int hf_scsi_smc_element_type_code_0F;
55 static int hf_scsi_smc_identifier;
56 static int hf_scsi_smc_vendor_specific_data;
57 static int hf_scsi_smc_source_storage_element_address;
58 static int hf_scsi_smc_number_of_elements_available;
59 static int hf_scsi_smc_identifier_type;
60 static int hf_scsi_smc_number_of_elements;
61 static int hf_scsi_smc_identifier_length;
62 static int hf_scsi_smc_scsi_bus_address;
63 static int hf_scsi_smc_byte_count_of_report_available;
64 static int hf_scsi_smc_cmc;
65 static int hf_scsi_smc_svalid;
66 static int hf_scsi_smc_avoltag;
67 static int hf_scsi_smc_access;
68 static int hf_scsi_smc_additional_sense_code_qualifier;
69 static int hf_scsi_smc_lu_valid;
70 static int hf_scsi_smc_dvcid;
71 static int hf_scsi_smc_except;
72 static int hf_scsi_smc_id_valid;
73 static int hf_scsi_smc_not_bus;
74 static int hf_scsi_smc_exenab;
75 static int hf_scsi_smc_lun;
76 static int hf_scsi_smc_inenab;
77 static int hf_scsi_smc_full;
78 static int hf_scsi_smc_impexp;
79 static int hf_scsi_smc_primary_vol_tag_id;
80 static int hf_scsi_smc_primary_vol_seq_num;
81 static int hf_scsi_smc_alternate_vol_tag_id;
82 static int hf_scsi_smc_alternate_vol_seq_num;
84 static int ett_scsi_exchange_medium;
85 static int ett_scsi_range;
86 static int ett_scsi_move;
88 static void
89 dissect_smc_exchangemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
90 unsigned offset, bool isreq, bool iscdb,
91 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
93 static int * const exchg_fields[] = {
94 &hf_scsi_smc_inv1,
95 &hf_scsi_smc_inv2,
96 NULL
99 if (!tree)
100 return;
102 if (isreq && iscdb) {
103 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
104 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN);
105 proto_tree_add_item (tree, hf_scsi_smc_fda, tvb, offset+5, 2, ENC_BIG_ENDIAN);
106 proto_tree_add_item (tree, hf_scsi_smc_sda, tvb, offset+7, 2, ENC_BIG_ENDIAN);
107 proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_medium_flags,
108 ett_scsi_exchange_medium, exchg_fields, ENC_BIG_ENDIAN);
109 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
110 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
114 static void
115 dissect_smc_position_to_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
116 unsigned offset, bool isreq, bool iscdb,
117 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
119 static int * const pte_fields[] = {
120 &hf_scsi_smc_invert,
121 NULL
124 if (!tree)
125 return;
127 if (isreq && iscdb) {
128 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
129 proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+3, 2, ENC_BIG_ENDIAN);
130 proto_tree_add_bitmask(tree, tvb, offset+7, hf_scsi_smc_medium_flags,
131 ett_scsi_exchange_medium, pte_fields, ENC_BIG_ENDIAN);
132 proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
133 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
137 static void
138 dissect_smc_initialize_element_status (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
139 unsigned offset, bool isreq, bool iscdb,
140 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
142 if (!tree)
143 return;
145 if (isreq && iscdb) {
146 proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
147 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
151 static void
152 dissect_smc_initialize_element_status_with_range (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
153 unsigned offset, bool isreq, bool iscdb,
154 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
156 static int * const range_fields[] = {
157 &hf_scsi_smc_fast,
158 &hf_scsi_smc_range,
159 NULL
162 if (!tree)
163 return;
165 if (isreq && iscdb) {
166 proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_smc_range_flags,
167 ett_scsi_range, range_fields, ENC_BIG_ENDIAN);
168 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+1, 2, ENC_BIG_ENDIAN);
169 proto_tree_add_item (tree, hf_scsi_smc_num_elements, tvb, offset+5, 2, ENC_BIG_ENDIAN);
170 proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
171 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
175 static void
176 dissect_smc_openclose_importexport_element (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
177 unsigned offset, bool isreq, bool iscdb,
178 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
180 if (!tree)
181 return;
183 if (isreq && iscdb) {
184 proto_tree_add_item (tree, hf_scsi_smc_ea, tvb, offset+1, 2, ENC_BIG_ENDIAN);
185 proto_tree_add_item (tree, hf_scsi_smc_action_code, tvb, offset+3, 1, ENC_BIG_ENDIAN);
186 proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
187 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
190 void
191 dissect_smc_movemedium (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
192 unsigned offset, bool isreq, bool iscdb,
193 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
195 static int * const move_fields[] = {
196 &hf_scsi_smc_invert,
197 NULL
200 if (!tree)
201 return;
203 if (isreq && iscdb) {
204 proto_tree_add_item (tree, hf_scsi_smc_mta, tvb, offset+1, 2, ENC_BIG_ENDIAN);
205 proto_tree_add_item (tree, hf_scsi_smc_sa, tvb, offset+3, 2, ENC_BIG_ENDIAN);
206 proto_tree_add_item (tree, hf_scsi_smc_da, tvb, offset+5, 2, ENC_BIG_ENDIAN);
207 proto_tree_add_bitmask(tree, tvb, offset+9, hf_scsi_smc_range_flags,
208 ett_scsi_move, move_fields, ENC_BIG_ENDIAN);
209 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
210 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
214 #define MT_ELEM 0x1
215 #define ST_ELEM 0x2
216 #define I_E_ELEM 0x3
217 #define DT_ELEM 0x4
219 static const value_string element_type_code_vals[] = {
220 {0x0, "All element types"},
221 {MT_ELEM, "Medium transport element"},
222 {ST_ELEM, "Storage element"},
223 {I_E_ELEM, "Import/export element"},
224 {DT_ELEM, "Data transfer element"},
225 {0, NULL}
228 static const value_string action_code_vals[] = {
229 {0, "OPEN Import/Export Element"},
230 {1, "CLOSE Import/Export Element"},
231 {0, NULL}
234 #define PVOLTAG 0x80
235 #define AVOLTAG 0x40
237 #define EXCEPT 0x04
239 #define ID_VALID 0x20
240 #define LU_VALID 0x10
242 #define SVALID 0x80
244 static void
245 dissect_scsi_smc_volume_tag (tvbuff_t *tvb, packet_info *pinfo,
246 proto_tree *tree, unsigned offset, int hf_vol_id, int hf_vol_seq_num)
248 uint8_t *volid;
249 int length;
250 for (length = 32; length > 0; length--) {
251 if (tvb_get_uint8(tvb, offset + length - 1) != ' ')
252 break;
255 volid = tvb_get_string_enc(pinfo->pool, tvb, offset, length, ENC_ASCII);
256 proto_tree_add_string(tree, hf_vol_id, tvb, offset, 32, volid);
257 proto_tree_add_item(tree, hf_vol_seq_num, tvb, offset+34, 2, ENC_BIG_ENDIAN);
261 static void
262 dissect_scsi_smc_element (tvbuff_t *tvb, packet_info *pinfo _U_,
263 proto_tree *tree, unsigned offset,
264 unsigned elem_bytecnt, uint8_t elem_type,
265 uint8_t voltag_flags)
267 uint8_t flags;
268 uint8_t ident_len;
270 proto_tree_add_item(tree, hf_scsi_smc_ea, tvb, offset, 2, ENC_BIG_ENDIAN);
271 offset += 2;
272 elem_bytecnt -= 2;
274 if (elem_bytecnt < 1)
275 return;
276 flags = tvb_get_uint8 (tvb, offset);
277 switch (elem_type) {
279 case MT_ELEM:
280 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
281 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
282 break;
284 case ST_ELEM:
285 case DT_ELEM:
286 proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA);
287 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
288 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
289 break;
291 case I_E_ELEM:
292 proto_tree_add_item(tree, hf_scsi_smc_cmc, tvb, offset, 1, ENC_NA);
293 proto_tree_add_item(tree, hf_scsi_smc_inenab, tvb, offset, 1, ENC_NA);
294 proto_tree_add_item(tree, hf_scsi_smc_exenab, tvb, offset, 1, ENC_NA);
295 proto_tree_add_item(tree, hf_scsi_smc_impexp, tvb, offset, 1, ENC_NA);
296 proto_tree_add_item(tree, hf_scsi_smc_access, tvb, offset, 1, ENC_NA);
297 proto_tree_add_item(tree, hf_scsi_smc_except, tvb, offset, 1, ENC_NA);
298 proto_tree_add_item(tree, hf_scsi_smc_full, tvb, offset, 1, ENC_NA);
299 break;
301 offset += 1;
302 elem_bytecnt -= 1;
304 if (elem_bytecnt < 1)
305 return;
306 offset += 1; /* reserved */
307 elem_bytecnt -= 1;
309 if (elem_bytecnt < 2)
310 return;
311 if (flags & EXCEPT) {
312 proto_tree_add_item(tree, hf_scsi_smc_additional_sense_code_qualifier, tvb, offset, 2, ENC_BIG_ENDIAN);
314 offset += 2;
315 elem_bytecnt -= 2;
317 if (elem_bytecnt < 3)
318 return;
319 switch (elem_type) {
321 case DT_ELEM:
322 flags = tvb_get_uint8 (tvb, offset);
323 if (flags & LU_VALID) {
324 proto_tree_add_item(tree, hf_scsi_smc_lun, tvb, offset, 1, ENC_BIG_ENDIAN);
326 proto_tree_add_item(tree, hf_scsi_smc_not_bus, tvb, offset, 1, ENC_NA);
327 proto_tree_add_item(tree, hf_scsi_smc_id_valid, tvb, offset, 1, ENC_NA);
328 proto_tree_add_item(tree, hf_scsi_smc_lu_valid, tvb, offset, 1, ENC_NA);
330 offset += 1;
331 if (flags & ID_VALID) {
332 proto_tree_add_item(tree, hf_scsi_smc_scsi_bus_address, tvb, offset, 1, ENC_BIG_ENDIAN);
334 offset += 1;
335 offset += 1; /* reserved */
336 break;
338 default:
339 offset += 3; /* reserved */
340 break;
342 elem_bytecnt -= 3;
344 if (elem_bytecnt < 3)
345 return;
346 flags = tvb_get_uint8 (tvb, offset);
347 proto_tree_add_item(tree, hf_scsi_smc_svalid, tvb, offset, 1, ENC_NA);
348 if (flags & SVALID) {
349 proto_tree_add_item(tree, hf_scsi_smc_invert, tvb, offset, 1, ENC_NA);
350 offset += 1;
351 proto_tree_add_item(tree, hf_scsi_smc_source_storage_element_address, tvb, offset, 2, ENC_BIG_ENDIAN);
352 offset += 2;
353 } else {
354 offset += 3;
356 elem_bytecnt -= 3;
358 if (voltag_flags & PVOLTAG) {
359 if (elem_bytecnt < 36)
360 return;
361 dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_primary_vol_tag_id,
362 hf_scsi_smc_primary_vol_seq_num);
363 offset += 36;
364 elem_bytecnt -= 36;
367 if (voltag_flags & AVOLTAG) {
368 if (elem_bytecnt < 36)
369 return;
370 dissect_scsi_smc_volume_tag (tvb, pinfo, tree, offset, hf_scsi_smc_alternate_vol_tag_id,
371 hf_scsi_smc_alternate_vol_seq_num);
372 offset += 36;
373 elem_bytecnt -= 36;
376 if (elem_bytecnt < 1)
377 return;
378 proto_tree_add_item(tree, hf_scsi_smc_code_set, tvb, offset, 1, ENC_BIG_ENDIAN);
379 offset += 1;
380 elem_bytecnt -= 1;
382 if (elem_bytecnt < 1)
383 return;
384 proto_tree_add_item(tree, hf_scsi_smc_identifier_type, tvb, offset, 1, ENC_BIG_ENDIAN);
385 offset += 1;
386 elem_bytecnt -= 1;
388 if (elem_bytecnt < 1)
389 return;
390 offset += 1; /* reserved */
391 elem_bytecnt -= 1;
393 if (elem_bytecnt < 1)
394 return;
395 ident_len = tvb_get_uint8 (tvb, offset);
396 proto_tree_add_item(tree, hf_scsi_smc_identifier_length, tvb, offset, 1, ENC_BIG_ENDIAN);
397 offset += 1;
398 elem_bytecnt -= 1;
400 if (ident_len != 0) {
401 if (elem_bytecnt < ident_len)
402 return;
403 proto_tree_add_item(tree, hf_scsi_smc_identifier, tvb, offset, ident_len, ENC_NA);
404 offset += ident_len;
405 elem_bytecnt -= ident_len;
407 if (elem_bytecnt != 0) {
408 proto_tree_add_item(tree, hf_scsi_smc_vendor_specific_data, tvb, offset, elem_bytecnt, ENC_NA);
413 static void
414 dissect_scsi_smc_elements (tvbuff_t *tvb, packet_info *pinfo,
415 proto_tree *tree, unsigned offset,
416 unsigned desc_bytecnt, uint8_t elem_type,
417 uint8_t voltag_flags, uint16_t elem_desc_len)
419 unsigned elem_bytecnt;
421 while (desc_bytecnt != 0) {
422 elem_bytecnt = elem_desc_len;
424 if (elem_bytecnt > desc_bytecnt)
425 elem_bytecnt = desc_bytecnt;
427 if (elem_bytecnt < 2)
428 break;
430 dissect_scsi_smc_element (tvb, pinfo, tree, offset, elem_bytecnt,
431 elem_type, voltag_flags);
432 offset += elem_bytecnt;
433 desc_bytecnt -= elem_bytecnt;
438 void
439 dissect_smc_readelementstatus (tvbuff_t *tvb, packet_info *pinfo,
440 proto_tree *tree, unsigned offset, bool isreq,
441 bool iscdb,
442 unsigned payload_len _U_, scsi_task_data_t *cdata _U_)
444 unsigned bytecnt, desc_bytecnt;
445 uint8_t elem_type;
446 uint8_t voltag_flags;
447 uint16_t elem_desc_len;
449 if (!tree)
450 return;
452 if (isreq && iscdb) {
453 proto_tree_add_item(tree, hf_scsi_smc_voltag, tvb, offset, 1, ENC_NA);
454 proto_tree_add_item(tree, hf_scsi_smc_element_type_code_0F, tvb, offset, 1, ENC_BIG_ENDIAN);
455 proto_tree_add_item(tree, hf_scsi_smc_starting_element_address, tvb, offset+1, 2, ENC_BIG_ENDIAN);
456 proto_tree_add_item(tree, hf_scsi_smc_number_of_elements, tvb, offset+3, 2, ENC_BIG_ENDIAN);
457 proto_tree_add_item(tree, hf_scsi_smc_curdata, tvb, offset+4, 1, ENC_NA);
458 proto_tree_add_item(tree, hf_scsi_smc_dvcid, tvb, offset+4, 1, ENC_NA);
459 proto_tree_add_item(tree, hf_scsi_smc_allocation_length, tvb, offset+6, 3, ENC_BIG_ENDIAN);
460 proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
461 ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
463 else if (!isreq) {
464 proto_tree_add_item(tree, hf_scsi_smc_first_element_address_reported, tvb, offset, 2, ENC_BIG_ENDIAN);
465 offset += 2;
466 proto_tree_add_item(tree, hf_scsi_smc_number_of_elements_available, tvb, offset, 2, ENC_BIG_ENDIAN);
467 offset += 2;
468 offset += 1; /* reserved */
469 bytecnt = tvb_get_ntoh24 (tvb, offset);
470 proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_report_available, tvb, offset, 3, ENC_BIG_ENDIAN);
471 offset += 3;
472 while (bytecnt != 0) {
473 elem_type = tvb_get_uint8 (tvb, offset);
474 proto_tree_add_item(tree, hf_scsi_smc_element_type_code, tvb, offset, 1, ENC_BIG_ENDIAN);
475 offset += 1;
476 bytecnt -= 1;
478 if (bytecnt < 1)
479 break;
480 voltag_flags = tvb_get_uint8 (tvb, offset);
481 proto_tree_add_item(tree, hf_scsi_smc_pvoltag, tvb, offset, 1, ENC_NA);
482 proto_tree_add_item(tree, hf_scsi_smc_avoltag, tvb, offset, 1, ENC_NA);
483 offset += 1;
484 bytecnt -= 1;
486 if (bytecnt < 2)
487 break;
488 elem_desc_len = tvb_get_ntohs (tvb, offset);
489 proto_tree_add_item(tree, hf_scsi_smc_element_descriptor_length, tvb, offset, 2, ENC_BIG_ENDIAN);
490 offset += 2;
491 bytecnt -= 2;
493 if (bytecnt < 1)
494 break;
495 offset += 1; /* reserved */
496 bytecnt -= 1;
498 if (bytecnt < 3)
499 break;
500 desc_bytecnt = tvb_get_ntoh24 (tvb, offset);
501 proto_tree_add_item(tree, hf_scsi_smc_byte_count_of_descriptor_data_available, tvb, offset, 3, ENC_BIG_ENDIAN);
502 offset += 3;
503 bytecnt -= 3;
505 if (desc_bytecnt > bytecnt)
506 desc_bytecnt = bytecnt;
507 dissect_scsi_smc_elements (tvb, pinfo, tree, offset,
508 desc_bytecnt, elem_type,
509 voltag_flags, elem_desc_len);
510 offset += desc_bytecnt;
511 bytecnt -= desc_bytecnt;
518 /* SMC Commands */
519 static const value_string scsi_smc_vals[] = {
520 /* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"},
521 /* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"},
522 /* 0x07 */ {SCSI_SMC_INITIALIZE_ELEMENT_STATUS , "Initialize Element Status"},
523 /* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"},
524 /* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"},
525 /* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"},
526 /* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"},
527 /* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"},
528 /* 0x1B */ {SCSI_SMC_OPENCLOSE_ELEMENT , "Open/Close Import/Export Element"},
529 /* 0x1C */ {SCSI_SPC_RCVDIAGRESULTS , "Receive Diagnostics Results"},
530 /* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"},
531 /* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"},
532 /* 0x2B */ {SCSI_SMC_POSITION_TO_ELEMENT , "Position To Element"},
533 /* 0x37 */ {SCSI_SMC_INITIALIZE_ELEMENT_STATUS_RANGE , "Initialize Element Status With Range"},
534 /* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"},
535 /* 0x3C */ {SCSI_SPC_READBUFFER , "Read Buffer"},
536 /* 0x40 */ {SCSI_SMC_EXCHANGE_MEDIUM , "Exchange Medium"},
537 /* 0x44 */ {SCSI_SMC_REPORT_VOLUME_TYPES_SUPPORTED , "Report Volume Types Supported"},
538 /* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"},
539 /* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"},
540 /* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"},
541 /* 0x56 */ {SCSI_SPC_RESERVE10 , "Reserve(10)"},
542 /* 0x57 */ {SCSI_SPC_RELEASE10 , "Release(10)"},
543 /* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"},
544 /* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"},
545 /* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"},
546 /* 0x86 */ {SCSI_SPC_ACCESS_CONTROL_IN , "Access Control In"},
547 /* 0x87 */ {SCSI_SPC_ACCESS_CONTROL_OUT , "Access Control Out"},
548 /* 0x8C */ {SCSI_SMC_READ_ATTRIBUTE , "Read Attribute"},
549 /* 0x8D */ {SCSI_SMC_WRITE_ATTRIBUTE , "Write Attribute"},
550 /* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"},
551 /* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"},
552 /* 0xA5 */ {SCSI_SMC_MOVE_MEDIUM , "Move Medium"},
553 /* 0xA7 */ {SCSI_SMC_MOVE_MEDIUM_ATTACHED , "Move Medium Attached"},
554 /* 0xB4 */ {SCSI_SMC_READ_ELEMENT_STATUS_ATTACHED , "Read Element Status Attached"},
555 /* 0xB5 */ {SCSI_SMC_REQUEST_VOLUME_ELEMENT_ADDRESS , "Request Volume Element Address"},
556 /* 0xB6 */ {SCSI_SMC_SEND_VOLUME_TAG , "Send Volume Tag"},
557 /* 0xB8 */ {SCSI_SMC_READ_ELEMENT_STATUS , "Read Element Status"},
558 {0, NULL},
560 value_string_ext scsi_smc_vals_ext = VALUE_STRING_EXT_INIT(scsi_smc_vals);
562 const scsi_cdb_table_t scsi_smc_table[256] = {
563 /*SPC 0x00*/{dissect_spc_testunitready},
564 /*SMC 0x01*/{NULL},
565 /*SMC 0x02*/{NULL},
566 /*SPC 0x03*/{dissect_spc_requestsense},
567 /*SMC 0x04*/{NULL},
568 /*SMC 0x05*/{NULL},
569 /*SMC 0x06*/{NULL},
570 /*SMC 0x07*/{dissect_smc_initialize_element_status},
571 /*SMC 0x08*/{NULL},
572 /*SMC 0x09*/{NULL},
573 /*SMC 0x0a*/{NULL},
574 /*SMC 0x0b*/{NULL},
575 /*SMC 0x0c*/{NULL},
576 /*SMC 0x0d*/{NULL},
577 /*SMC 0x0e*/{NULL},
578 /*SMC 0x0f*/{NULL},
579 /*SMC 0x10*/{NULL},
580 /*SMC 0x11*/{NULL},
581 /*SPC 0x12*/{dissect_spc_inquiry},
582 /*SMC 0x13*/{NULL},
583 /*SMC 0x14*/{NULL},
584 /*SPC 0x15*/{dissect_spc_modeselect6},
585 /*SPC 0x16*/{dissect_spc_reserve6},
586 /*SPC 0x17*/{dissect_spc_release6},
587 /*SMC 0x18*/{NULL},
588 /*SMC 0x19*/{NULL},
589 /*SPC 0x1a*/{dissect_spc_modesense6},
590 /*SMC 0x1b*/{dissect_smc_openclose_importexport_element},
591 /*SMC 0x1c*/{NULL},
592 /*SPC 0x1d*/{dissect_spc_senddiagnostic},
593 /*SMC 0x1e*/{dissect_spc_preventallowmediaremoval},
594 /*SMC 0x1f*/{NULL},
595 /*SMC 0x20*/{NULL},
596 /*SMC 0x21*/{NULL},
597 /*SMC 0x22*/{NULL},
598 /*SMC 0x23*/{NULL},
599 /*SMC 0x24*/{NULL},
600 /*SMC 0x25*/{NULL},
601 /*SMC 0x26*/{NULL},
602 /*SMC 0x27*/{NULL},
603 /*SMC 0x28*/{NULL},
604 /*SMC 0x29*/{NULL},
605 /*SMC 0x2a*/{NULL},
606 /*SMC 0x2b*/{dissect_smc_position_to_element},
607 /*SMC 0x2c*/{NULL},
608 /*SMC 0x2d*/{NULL},
609 /*SMC 0x2e*/{NULL},
610 /*SMC 0x2f*/{NULL},
611 /*SMC 0x30*/{NULL},
612 /*SMC 0x31*/{NULL},
613 /*SMC 0x32*/{NULL},
614 /*SMC 0x33*/{NULL},
615 /*SMC 0x34*/{NULL},
616 /*SMC 0x35*/{NULL},
617 /*SMC 0x36*/{NULL},
618 /*SMC 0x37*/{dissect_smc_initialize_element_status_with_range},
619 /*SMC 0x38*/{NULL},
620 /*SMC 0x39*/{NULL},
621 /*SMC 0x3a*/{NULL},
622 /*SPC 0x3b*/{dissect_spc_writebuffer},
623 /*SMC 0x3c*/{NULL},
624 /*SMC 0x3d*/{NULL},
625 /*SMC 0x3e*/{NULL},
626 /*SMC 0x3f*/{NULL},
627 /*SMC 0x40*/{NULL},
628 /*SMC 0x41*/{NULL},
629 /*SMC 0x42*/{NULL},
630 /*SMC 0x43*/{NULL},
631 /*SMC 0x44*/{NULL},
632 /*SMC 0x45*/{NULL},
633 /*SMC 0x46*/{NULL},
634 /*SMC 0x47*/{NULL},
635 /*SMC 0x48*/{NULL},
636 /*SMC 0x49*/{NULL},
637 /*SMC 0x4a*/{NULL},
638 /*SMC 0x4b*/{NULL},
639 /*SPC 0x4c*/{dissect_spc_logselect},
640 /*SPC 0x4d*/{dissect_spc_logsense},
641 /*SMC 0x4e*/{NULL},
642 /*SMC 0x4f*/{NULL},
643 /*SMC 0x50*/{NULL},
644 /*SMC 0x51*/{NULL},
645 /*SMC 0x52*/{NULL},
646 /*SMC 0x53*/{NULL},
647 /*SMC 0x54*/{NULL},
648 /*SPC 0x55*/{dissect_spc_modeselect10},
649 /*SPC 0x56*/{dissect_spc_reserve10},
650 /*SPC 0x57*/{dissect_spc_release10},
651 /*SMC 0x58*/{NULL},
652 /*SMC 0x59*/{NULL},
653 /*SPC 0x5a*/{dissect_spc_modesense10},
654 /*SMC 0x5b*/{NULL},
655 /*SMC 0x5c*/{NULL},
656 /*SMC 0x5d*/{NULL},
657 /*SPC 0x5e*/{dissect_spc_persistentreservein},
658 /*SPC 0x5f*/{dissect_spc_persistentreserveout},
659 /*SMC 0x60*/{NULL},
660 /*SMC 0x61*/{NULL},
661 /*SMC 0x62*/{NULL},
662 /*SMC 0x63*/{NULL},
663 /*SMC 0x64*/{NULL},
664 /*SMC 0x65*/{NULL},
665 /*SMC 0x66*/{NULL},
666 /*SMC 0x67*/{NULL},
667 /*SMC 0x68*/{NULL},
668 /*SMC 0x69*/{NULL},
669 /*SMC 0x6a*/{NULL},
670 /*SMC 0x6b*/{NULL},
671 /*SMC 0x6c*/{NULL},
672 /*SMC 0x6d*/{NULL},
673 /*SMC 0x6e*/{NULL},
674 /*SMC 0x6f*/{NULL},
675 /*SMC 0x70*/{NULL},
676 /*SMC 0x71*/{NULL},
677 /*SMC 0x72*/{NULL},
678 /*SMC 0x73*/{NULL},
679 /*SMC 0x74*/{NULL},
680 /*SMC 0x75*/{NULL},
681 /*SMC 0x76*/{NULL},
682 /*SMC 0x77*/{NULL},
683 /*SMC 0x78*/{NULL},
684 /*SMC 0x79*/{NULL},
685 /*SMC 0x7a*/{NULL},
686 /*SMC 0x7b*/{NULL},
687 /*SMC 0x7c*/{NULL},
688 /*SMC 0x7d*/{NULL},
689 /*SMC 0x7e*/{NULL},
690 /*SMC 0x7f*/{NULL},
691 /*SMC 0x80*/{NULL},
692 /*SMC 0x81*/{NULL},
693 /*SMC 0x82*/{NULL},
694 /*SMC 0x83*/{NULL},
695 /*SMC 0x84*/{NULL},
696 /*SMC 0x85*/{NULL},
697 /*SMC 0x86*/{NULL},
698 /*SMC 0x87*/{NULL},
699 /*SMC 0x88*/{NULL},
700 /*SMC 0x89*/{NULL},
701 /*SMC 0x8a*/{NULL},
702 /*SMC 0x8b*/{NULL},
703 /*SMC 0x8c*/{NULL},
704 /*SMC 0x8d*/{NULL},
705 /*SMC 0x8e*/{NULL},
706 /*SMC 0x8f*/{NULL},
707 /*SMC 0x90*/{NULL},
708 /*SMC 0x91*/{NULL},
709 /*SMC 0x92*/{NULL},
710 /*SMC 0x93*/{NULL},
711 /*SMC 0x94*/{NULL},
712 /*SMC 0x95*/{NULL},
713 /*SMC 0x96*/{NULL},
714 /*SMC 0x97*/{NULL},
715 /*SMC 0x98*/{NULL},
716 /*SMC 0x99*/{NULL},
717 /*SMC 0x9a*/{NULL},
718 /*SMC 0x9b*/{NULL},
719 /*SMC 0x9c*/{NULL},
720 /*SMC 0x9d*/{NULL},
721 /*SMC 0x9e*/{NULL},
722 /*SMC 0x9f*/{NULL},
723 /*SPC 0xa0*/{dissect_spc_reportluns},
724 /*SMC 0xa1*/{NULL},
725 /*SMC 0xa2*/{NULL},
726 /*SPC 0xa3*/{dissect_spc_mgmt_protocol_in},
727 /*SMC 0xa4*/{NULL},
728 /*SMC 0xa5*/{dissect_smc_movemedium},
729 /*SMC 0xa6*/{dissect_smc_exchangemedium},
730 /*SMC 0xa7*/{dissect_smc_movemedium},
731 /*SMC 0xa8*/{NULL},
732 /*SMC 0xa9*/{NULL},
733 /*SMC 0xaa*/{NULL},
734 /*SMC 0xab*/{NULL},
735 /*SMC 0xac*/{NULL},
736 /*SMC 0xad*/{NULL},
737 /*SMC 0xae*/{NULL},
738 /*SMC 0xaf*/{NULL},
739 /*SMC 0xb0*/{NULL},
740 /*SMC 0xb1*/{NULL},
741 /*SMC 0xb2*/{NULL},
742 /*SMC 0xb3*/{NULL},
743 /*SMC 0xb4*/{dissect_smc_readelementstatus},
744 /*SMC 0xb5*/{NULL},
745 /*SMC 0xb6*/{NULL},
746 /*SMC 0xb7*/{NULL},
747 /*SMC 0xb8*/{dissect_smc_readelementstatus},
748 /*SMC 0xb9*/{NULL},
749 /*SMC 0xba*/{NULL},
750 /*SMC 0xbb*/{NULL},
751 /*SMC 0xbc*/{NULL},
752 /*SMC 0xbd*/{NULL},
753 /*SMC 0xbe*/{NULL},
754 /*SMC 0xbf*/{NULL},
755 /*SMC 0xc0*/{NULL},
756 /*SMC 0xc1*/{NULL},
757 /*SMC 0xc2*/{NULL},
758 /*SMC 0xc3*/{NULL},
759 /*SMC 0xc4*/{NULL},
760 /*SMC 0xc5*/{NULL},
761 /*SMC 0xc6*/{NULL},
762 /*SMC 0xc7*/{NULL},
763 /*SMC 0xc8*/{NULL},
764 /*SMC 0xc9*/{NULL},
765 /*SMC 0xca*/{NULL},
766 /*SMC 0xcb*/{NULL},
767 /*SMC 0xcc*/{NULL},
768 /*SMC 0xcd*/{NULL},
769 /*SMC 0xce*/{NULL},
770 /*SMC 0xcf*/{NULL},
771 /*SMC 0xd0*/{NULL},
772 /*SMC 0xd1*/{NULL},
773 /*SMC 0xd2*/{NULL},
774 /*SMC 0xd3*/{NULL},
775 /*SMC 0xd4*/{NULL},
776 /*SMC 0xd5*/{NULL},
777 /*SMC 0xd6*/{NULL},
778 /*SMC 0xd7*/{NULL},
779 /*SMC 0xd8*/{NULL},
780 /*SMC 0xd9*/{NULL},
781 /*SMC 0xda*/{NULL},
782 /*SMC 0xdb*/{NULL},
783 /*SMC 0xdc*/{NULL},
784 /*SMC 0xdd*/{NULL},
785 /*SMC 0xde*/{NULL},
786 /*SMC 0xdf*/{NULL},
787 /*SMC 0xe0*/{NULL},
788 /*SMC 0xe1*/{NULL},
789 /*SMC 0xe2*/{NULL},
790 /*SMC 0xe3*/{NULL},
791 /*SMC 0xe4*/{NULL},
792 /*SMC 0xe5*/{NULL},
793 /*SMC 0xe6*/{NULL},
794 /*SMC 0xe7*/{NULL},
795 /*SMC 0xe8*/{NULL},
796 /*SMC 0xe9*/{NULL},
797 /*SMC 0xea*/{NULL},
798 /*SMC 0xeb*/{NULL},
799 /*SMC 0xec*/{NULL},
800 /*SMC 0xed*/{NULL},
801 /*SMC 0xee*/{NULL},
802 /*SMC 0xef*/{NULL},
803 /*SMC 0xf0*/{NULL},
804 /*SMC 0xf1*/{NULL},
805 /*SMC 0xf2*/{NULL},
806 /*SMC 0xf3*/{NULL},
807 /*SMC 0xf4*/{NULL},
808 /*SMC 0xf5*/{NULL},
809 /*SMC 0xf6*/{NULL},
810 /*SMC 0xf7*/{NULL},
811 /*SMC 0xf8*/{NULL},
812 /*SMC 0xf9*/{NULL},
813 /*SMC 0xfa*/{NULL},
814 /*SMC 0xfb*/{NULL},
815 /*SMC 0xfc*/{NULL},
816 /*SMC 0xfd*/{NULL},
817 /*SMC 0xfe*/{NULL},
818 /*SMC 0xff*/{NULL}
822 void
823 proto_register_scsi_smc(void)
825 static hf_register_info hf[] = {
826 { &hf_scsi_smc_opcode,
827 {"SMC Opcode", "scsi_smc.opcode",
828 FT_UINT8, BASE_HEX | BASE_EXT_STRING, &scsi_smc_vals_ext, 0x0,
829 NULL, HFILL}
831 { &hf_scsi_smc_mta,
832 {"Medium Transport Address", "scsi_smc.mta",
833 FT_UINT16, BASE_DEC, NULL, 0x0,
834 NULL, HFILL}
836 { &hf_scsi_smc_sa,
837 {"Source Address", "scsi_smc.sa",
838 FT_UINT16, BASE_DEC, NULL, 0x0,
839 NULL, HFILL}
841 { &hf_scsi_smc_da,
842 {"Destination Address", "scsi_smc.da",
843 FT_UINT16, BASE_DEC, NULL, 0x0,
844 NULL, HFILL}
846 { &hf_scsi_smc_fda,
847 {"First Destination Address", "scsi_smc.fda",
848 FT_UINT16, BASE_DEC, NULL, 0x0,
849 NULL, HFILL}
851 { &hf_scsi_smc_sda,
852 {"Second Destination Address", "scsi_smc.sda",
853 FT_UINT16, BASE_DEC, NULL, 0x0,
854 NULL, HFILL}
856 { &hf_scsi_smc_medium_flags,
857 {"Flags", "scsi_smc.medium_flags",
858 FT_UINT8, BASE_HEX, NULL, 0x0,
859 NULL, HFILL}
861 { &hf_scsi_smc_inv1,
862 {"INV1", "scsi_smc.inv1",
863 FT_BOOLEAN, 8, NULL, 0x02,
864 NULL, HFILL}
866 { &hf_scsi_smc_inv2,
867 {"INV2", "scsi_smc.inv2",
868 FT_BOOLEAN, 8, NULL, 0x01,
869 NULL, HFILL}
871 { &hf_scsi_smc_range_flags,
872 {"Flags", "scsi_smc.range_flags",
873 FT_UINT8, BASE_HEX, NULL, 0x0,
874 NULL, HFILL}
876 { &hf_scsi_smc_fast,
877 {"FAST", "scsi_smc.fast",
878 FT_BOOLEAN, 8, NULL, 0x02,
879 NULL, HFILL}
881 { &hf_scsi_smc_range,
882 {"RANGE", "scsi_smc.range",
883 FT_BOOLEAN, 8, NULL, 0x01,
884 NULL, HFILL}
886 #if 0
887 { &hf_scsi_smc_sea,
888 {"Starting Element Address", "scsi_smc.sea",
889 FT_UINT16, BASE_DEC, NULL, 0x0,
890 NULL, HFILL}
892 #endif
893 { &hf_scsi_smc_num_elements,
894 {"Number of Elements", "scsi_smc.num_elements",
895 FT_UINT16, BASE_DEC, NULL, 0x0,
896 NULL, HFILL}
898 { &hf_scsi_smc_invert,
899 {"INVERT", "scsi_smc.invert",
900 FT_BOOLEAN, 8, NULL, 0x01,
901 NULL, HFILL}
903 { &hf_scsi_smc_ea,
904 {"Element Address", "scsi_smc.ea",
905 FT_UINT16, BASE_DEC, NULL, 0x0,
906 NULL, HFILL}
908 { &hf_scsi_smc_action_code,
909 {"Action Code", "scsi_smc.action_code",
910 FT_UINT8, BASE_HEX, VALS(action_code_vals), 0x1f,
911 NULL, HFILL}
914 /* Generated from convert_proto_tree_add_text.pl */
915 { &hf_scsi_smc_scsi_bus_address,
916 { "SCSI Bus Address", "scsi_smc.scsi_bus_address",
917 FT_UINT8, BASE_DEC, NULL, 0x0,
918 NULL, HFILL }
920 { &hf_scsi_smc_source_storage_element_address,
921 { "Source Storage Element Address", "scsi_smc.source_storage_element_address",
922 FT_UINT16, BASE_DEC, NULL, 0x0,
923 NULL, HFILL }
925 { &hf_scsi_smc_code_set,
926 { "Code Set", "scsi_smc.code_set",
927 FT_UINT8, BASE_DEC, VALS(scsi_devid_codeset_val), 0x0F,
928 NULL, HFILL }
930 { &hf_scsi_smc_identifier_type,
931 { "Identifier Type", "scsi_smc.identifier_type",
932 FT_UINT8, BASE_DEC, VALS(scsi_devid_idtype_val), 0x0F,
933 NULL, HFILL }
935 { &hf_scsi_smc_identifier_length,
936 { "Identifier Length", "scsi_smc.identifier_length",
937 FT_UINT8, BASE_DEC, NULL, 0x0,
938 NULL, HFILL }
940 { &hf_scsi_smc_identifier,
941 { "Identifier", "scsi_smc.identifier",
942 FT_BYTES, BASE_NONE, NULL, 0x0,
943 NULL, HFILL }
945 { &hf_scsi_smc_vendor_specific_data,
946 { "Vendor-specific Data", "scsi_smc.vendor_specific_data",
947 FT_BYTES, BASE_NONE, NULL, 0x0,
948 NULL, HFILL }
950 { &hf_scsi_smc_voltag,
951 { "VOLTAG", "scsi_smc.voltag",
952 FT_BOOLEAN, 8, NULL, 0x10,
953 NULL, HFILL }
955 { &hf_scsi_smc_starting_element_address,
956 { "Starting Element Address", "scsi_smc.starting_element_address",
957 FT_UINT16, BASE_DEC, NULL, 0x0,
958 NULL, HFILL }
960 { &hf_scsi_smc_number_of_elements,
961 { "Number of Elements", "scsi_smc.number_of_elements",
962 FT_UINT16, BASE_DEC, NULL, 0x0,
963 NULL, HFILL }
965 { &hf_scsi_smc_curdata,
966 { "CURDATA", "scsi_smc.curdata",
967 FT_BOOLEAN, 8, NULL, 0x02,
968 NULL, HFILL }
970 { &hf_scsi_smc_allocation_length,
971 { "Allocation Length", "scsi_smc.allocation_length",
972 FT_UINT24, BASE_DEC, NULL, 0x0,
973 NULL, HFILL }
975 { &hf_scsi_smc_first_element_address_reported,
976 { "First Element Address Reported", "scsi_smc.first_element_address_reported",
977 FT_UINT16, BASE_DEC, NULL, 0x0,
978 NULL, HFILL }
980 { &hf_scsi_smc_number_of_elements_available,
981 { "Number of Elements Available", "scsi_smc.number_of_elements_available",
982 FT_UINT16, BASE_DEC, NULL, 0x0,
983 NULL, HFILL }
985 { &hf_scsi_smc_byte_count_of_report_available,
986 { "Byte Count of Report Available", "scsi_smc.byte_count_of_report_available",
987 FT_UINT24, BASE_DEC, NULL, 0x0,
988 NULL, HFILL }
990 { &hf_scsi_smc_element_type_code,
991 { "Element Type Code", "scsi_smc.element_type_code",
992 FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0,
993 NULL, HFILL }
995 { &hf_scsi_smc_element_type_code_0F,
996 { "Element Type Code", "scsi_smc.element_type_code",
997 FT_UINT8, BASE_DEC, VALS(element_type_code_vals), 0x0F,
998 NULL, HFILL }
1000 { &hf_scsi_smc_pvoltag,
1001 { "PVOLTAG", "scsi_smc.pvoltag",
1002 FT_BOOLEAN, 8, NULL, PVOLTAG,
1003 NULL, HFILL }
1005 { &hf_scsi_smc_element_descriptor_length,
1006 { "Element Descriptor Length", "scsi_smc.element_descriptor_length",
1007 FT_UINT16, BASE_DEC, NULL, 0x0,
1008 NULL, HFILL }
1010 { &hf_scsi_smc_byte_count_of_descriptor_data_available,
1011 { "Byte Count Of Descriptor Data Available", "scsi_smc.byte_count_of_descriptor_data_available",
1012 FT_UINT24, BASE_DEC, NULL, 0x0,
1013 NULL, HFILL }
1015 { &hf_scsi_smc_except,
1016 { "EXCEPT", "scsi_smc.except",
1017 FT_BOOLEAN, 8, NULL, EXCEPT,
1018 NULL, HFILL }
1020 { &hf_scsi_smc_access,
1021 { "ACCESS", "scsi_smc.access",
1022 FT_BOOLEAN, 8, NULL, 0x08,
1023 NULL, HFILL }
1025 { &hf_scsi_smc_cmc,
1026 { "cmc", "scsi_smc.cmc",
1027 FT_BOOLEAN, 8, NULL, 0x40,
1028 NULL, HFILL }
1030 { &hf_scsi_smc_additional_sense_code_qualifier,
1031 { "Additional Sense Code+Qualifier", "scsi_smc.additional_sense_code_qualifier",
1032 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &scsi_asc_val_ext, 0x0,
1033 NULL, HFILL }
1035 { &hf_scsi_smc_not_bus,
1036 { "NOT BUS", "scsi_smc.not_bus",
1037 FT_BOOLEAN, 8, NULL, 0x80,
1038 NULL, HFILL }
1040 { &hf_scsi_smc_id_valid,
1041 { "ID VALID", "scsi_smc.id_valid",
1042 FT_BOOLEAN, 8, NULL, ID_VALID,
1043 NULL, HFILL }
1045 { &hf_scsi_smc_lu_valid,
1046 { "LU VALID", "scsi_smc.lu_valid",
1047 FT_BOOLEAN, 8, NULL, LU_VALID,
1048 NULL, HFILL }
1050 { &hf_scsi_smc_svalid,
1051 { "SVALID", "scsi_smc.svalid",
1052 FT_BOOLEAN, 8, NULL, SVALID,
1053 NULL, HFILL }
1055 { &hf_scsi_smc_dvcid,
1056 { "DVCID", "scsi_smc.dvcid",
1057 FT_BOOLEAN, 8, NULL, 0x01,
1058 NULL, HFILL }
1060 { &hf_scsi_smc_avoltag,
1061 { "AVOLTAG", "scsi_smc.pvoltag",
1062 FT_BOOLEAN, 8, NULL, AVOLTAG,
1063 NULL, HFILL }
1065 { &hf_scsi_smc_full,
1066 { "FULL", "scsi_smc.full",
1067 FT_BOOLEAN, 8, NULL, 0x01,
1068 NULL, HFILL }
1070 { &hf_scsi_smc_exenab,
1071 { "EXENAB", "scsi_smc.exenab",
1072 FT_BOOLEAN, 8, NULL, 0x10,
1073 NULL, HFILL }
1075 { &hf_scsi_smc_inenab,
1076 { "INENAB", "scsi_smc.inenab",
1077 FT_BOOLEAN, 8, NULL, 0x20,
1078 NULL, HFILL }
1080 { &hf_scsi_smc_impexp,
1081 { "IMPEXP", "scsi_smc.impexp",
1082 FT_BOOLEAN, 8, NULL, 0x02,
1083 NULL, HFILL }
1085 { &hf_scsi_smc_lun,
1086 { "LUN", "scsi_smc.lun",
1087 FT_UINT8, BASE_DEC, NULL, 0x07,
1088 NULL, HFILL }
1090 { &hf_scsi_smc_primary_vol_tag_id,
1091 { "Primary Volume Identification", "scsi_smc.primary_vol_tag_id",
1092 FT_STRING, BASE_NONE, NULL, 0x0,
1093 NULL, HFILL }
1095 { &hf_scsi_smc_alternate_vol_tag_id,
1096 { "Alternate Volume Identification", "scsi_smc.alternate_vol_tag_id",
1097 FT_STRING, BASE_NONE, NULL, 0x0,
1098 NULL, HFILL }
1100 { &hf_scsi_smc_primary_vol_seq_num,
1101 { "Primary Volume Sequence Number", "scsi_smc.primary_vol_seq_num",
1102 FT_UINT16, BASE_DEC, NULL, 0x0,
1103 NULL, HFILL }
1105 { &hf_scsi_smc_alternate_vol_seq_num,
1106 { "Alternate Volume Sequence Number", "scsi_smc.alternate_vol_seq_num",
1107 FT_UINT16, BASE_DEC, NULL, 0x0,
1108 NULL, HFILL }
1113 /* Setup protocol subtree array */
1114 static int *ett[] = {
1115 &ett_scsi_exchange_medium,
1116 &ett_scsi_range,
1117 &ett_scsi_move
1120 /* Register the protocol name and description */
1121 proto_scsi_smc = proto_register_protocol("SCSI_SMC", "SCSI_SMC", "scsi_smc");
1123 /* Required function calls to register the header fields and subtrees used */
1124 proto_register_field_array(proto_scsi_smc, hf, array_length(hf));
1126 proto_register_subtree_array(ett, array_length(ett));
1130 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1132 * Local variables:
1133 * c-basic-offset: 4
1134 * tab-width: 8
1135 * indent-tabs-mode: nil
1136 * End:
1138 * vi: set shiftwidth=4 tabstop=8 expandtab:
1139 * :indentSize=4:tabSize=8:noTabs=true: