7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 2002 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #include <epan/strutil.h>
33 #include <epan/packet.h>
34 #include <epan/prefs.h>
35 #include <epan/emem.h>
36 #include <epan/conversation.h>
38 #include "packet-scsi.h"
39 #include "packet-fc.h"
40 #include "packet-scsi-osd.h"
43 static int proto_scsi_osd = -1;
44 int hf_scsi_osd_opcode = -1;
45 static int hf_scsi_osd_add_cdblen = -1;
46 static int hf_scsi_osd_svcaction = -1;
47 static int hf_scsi_osd_option = -1;
48 static int hf_scsi_osd_option_dpo = -1;
49 static int hf_scsi_osd_option_fua = -1;
50 static int hf_scsi_osd_getsetattrib = -1;
51 static int hf_scsi_osd_timestamps_control = -1;
52 static int hf_scsi_osd_formatted_capacity = -1;
53 static int hf_scsi_osd_get_attributes_page = -1;
54 static int hf_scsi_osd_get_attributes_allocation_length = -1;
55 static int hf_scsi_osd_get_attributes_list_length= -1;
56 static int hf_scsi_osd_get_attributes_list_offset= -1;
57 static int hf_scsi_osd_retreived_attributes_offset = -1;
58 static int hf_scsi_osd_set_attributes_page = -1;
59 static int hf_scsi_osd_set_attribute_length = -1;
60 static int hf_scsi_osd_set_attribute_number = -1;
61 static int hf_scsi_osd_set_attributes_offset = -1;
62 static int hf_scsi_osd_set_attributes_list_length= -1;
63 static int hf_scsi_osd_set_attributes_list_offset= -1;
64 static int hf_scsi_osd_capability_format = -1;
65 static int hf_scsi_osd_key_version = -1;
66 static int hf_scsi_osd_icva = -1;
67 static int hf_scsi_osd_security_method = -1;
68 static int hf_scsi_osd_capability_expiration_time= -1;
69 static int hf_scsi_osd_audit= -1;
70 static int hf_scsi_osd_capability_discriminator = -1;
71 static int hf_scsi_osd_object_created_time= -1;
72 static int hf_scsi_osd_object_type = -1;
73 static int hf_scsi_osd_permissions = -1;
74 static int hf_scsi_osd_permissions_read = -1;
75 static int hf_scsi_osd_permissions_write = -1;
76 static int hf_scsi_osd_permissions_get_attr = -1;
77 static int hf_scsi_osd_permissions_set_attr = -1;
78 static int hf_scsi_osd_permissions_create = -1;
79 static int hf_scsi_osd_permissions_remove = -1;
80 static int hf_scsi_osd_permissions_obj_mgmt = -1;
81 static int hf_scsi_osd_permissions_append = -1;
82 static int hf_scsi_osd_permissions_dev_mgmt = -1;
83 static int hf_scsi_osd_permissions_global = -1;
84 static int hf_scsi_osd_permissions_pol_sec = -1;
85 static int hf_scsi_osd_object_descriptor_type = -1;
86 static int hf_scsi_osd_object_descriptor= -1;
87 static int hf_scsi_osd_ricv = -1;
88 static int hf_scsi_osd_request_nonce = -1;
89 static int hf_scsi_osd_diicvo = -1;
90 static int hf_scsi_osd_doicvo = -1;
91 static int hf_scsi_osd_requested_partition_id = -1;
92 static int hf_scsi_osd_sortorder = -1;
93 static int hf_scsi_osd_partition_id = -1;
94 static int hf_scsi_osd_list_identifier = -1;
95 static int hf_scsi_osd_allocation_length= -1;
96 static int hf_scsi_osd_length= -1;
97 static int hf_scsi_osd_starting_byte_address = -1;
98 static int hf_scsi_osd_initial_object_id= -1;
99 static int hf_scsi_osd_additional_length= -1;
100 static int hf_scsi_osd_continuation_object_id= -1;
101 static int hf_scsi_osd_list_flags_lstchg= -1;
102 static int hf_scsi_osd_list_flags_root= -1;
103 static int hf_scsi_osd_user_object_id= -1;
104 static int hf_scsi_osd_requested_user_object_id = -1;
105 static int hf_scsi_osd_number_of_user_objects = -1;
106 static int hf_scsi_osd_key_to_set = -1;
107 static int hf_scsi_osd_set_key_version = -1;
108 static int hf_scsi_osd_key_identifier = -1;
109 static int hf_scsi_osd_seed = -1;
110 static int hf_scsi_osd_collection_fcr = -1;
111 static int hf_scsi_osd_collection_object_id = -1;
112 static int hf_scsi_osd_requested_collection_object_id = -1;
113 static int hf_scsi_osd_partition_created_in = -1;
114 static int hf_scsi_osd_partition_removed_in = -1;
115 static int hf_scsi_osd_flush_scope = -1;
116 static int hf_scsi_osd_flush_collection_scope = -1;
117 static int hf_scsi_osd_flush_partition_scope = -1;
118 static int hf_scsi_osd_flush_osd_scope = -1;
120 static gint ett_osd_option = -1;
121 static gint ett_osd_partition = -1;
122 static gint ett_osd_attribute_parameters= -1;
123 static gint ett_osd_capability = -1;
124 static gint ett_osd_permission_bitmask = -1;
125 static gint ett_osd_security_parameters = -1;
129 /* There will be one such structure create for each conversation ontop of which
130 * there is an OSD session
132 typedef struct _scsi_osd_conv_info_t {
134 } scsi_osd_conv_info_t;
136 /* there will be one such structure created for each lun for each conversation
137 * that is handled by the OSD dissector
139 typedef struct _scsi_osd_lun_info_t {
140 emem_tree_t *partitions;
141 } scsi_osd_lun_info_t;
143 typedef void (*scsi_osd_dissector_t)(tvbuff_t *tvb, packet_info *pinfo,
144 proto_tree *tree, guint offset,
145 gboolean isreq, gboolean iscdb,
146 guint32 payload_len, scsi_task_data_t *cdata,
147 scsi_osd_conv_info_t *conv_info,
148 scsi_osd_lun_info_t *lun_info
151 /* One such structure is created per conversation/lun/partition to
152 * keep track of when partitions are created/used/destroyed
154 typedef struct _partition_info_t {
160 /* This is a set of extra data specific to OSD that we need to attach to every
163 typedef struct _scsi_osd_extra_data_t {
167 struct { /* gsatype: attribute list */
168 guint32 get_list_length;
169 guint32 get_list_offset;
170 guint32 get_list_allocation_length;
171 guint32 retreived_list_offset;
172 guint32 set_list_length;
173 guint32 set_list_offset;
176 } scsi_osd_extra_data_t;
178 static const true_false_string option_dpo_tfs = {
182 static const true_false_string option_fua_tfs = {
189 dissect_osd_option(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
191 proto_tree *tree=NULL;
195 option=tvb_get_guint8(tvb, offset);
198 it=proto_tree_add_item(parent_tree, hf_scsi_osd_option, tvb, offset, 1, 0);
199 tree = proto_item_add_subtree(it, ett_osd_option);
202 proto_tree_add_item(tree, hf_scsi_osd_option_dpo, tvb, offset, 1, 0);
204 proto_item_append_text(tree, " DPO");
207 proto_tree_add_item(tree, hf_scsi_osd_option_fua, tvb, offset, 1, 0);
209 proto_item_append_text(tree, " FUA");
214 static const value_string scsi_osd_getsetattrib_vals[] = {
215 {2, "Get an attributes page and set an attribute value"},
216 {3, "Get and set attributes using a list"},
221 dissect_osd_getsetattrib(tvbuff_t *tvb, int offset, proto_tree *tree, scsi_task_data_t *cdata)
223 if(cdata && cdata->itlq && cdata->itlq->extra_data){
224 scsi_osd_extra_data_t *extra_data=cdata->itlq->extra_data;
225 extra_data->gsatype=(tvb_get_guint8(tvb, offset)>>4)&0x03;
227 proto_tree_add_item(tree, hf_scsi_osd_getsetattrib, tvb, offset, 1, 0);
231 static const value_string scsi_osd_timestamps_control_vals[] = {
232 {0x00, "Timestamps shall be updated"},
233 {0x7f, "Timestamps shall not be updated"},
238 dissect_osd_timestamps_control(tvbuff_t *tvb, int offset, proto_tree *tree)
240 proto_tree_add_item(tree, hf_scsi_osd_timestamps_control, tvb, offset, 1, 0);
245 dissect_osd_formatted_capacity(tvbuff_t *tvb, int offset, proto_tree *tree)
247 proto_tree_add_item(tree, hf_scsi_osd_formatted_capacity, tvb, offset, 8, 0);
252 dissect_osd_attribute_parameters(tvbuff_t *tvb, int offset, proto_tree *parent_tree, scsi_task_data_t *cdata)
255 proto_item *item=NULL;
256 proto_tree *tree=NULL;
257 scsi_osd_extra_data_t *extra_data=NULL;
260 item = proto_tree_add_text(parent_tree, tvb, offset, 28,
261 "Attribute Parameters");
262 tree = proto_item_add_subtree(item, ett_osd_attribute_parameters);
265 if(cdata && cdata->itlq && cdata->itlq->extra_data){
266 extra_data=cdata->itlq->extra_data;
267 gsatype=extra_data->gsatype;
273 case 2: /* 5.2.2.2 attribute page */
274 proto_tree_add_item(tree, hf_scsi_osd_get_attributes_page, tvb, offset, 4, 0);
276 proto_tree_add_item(tree, hf_scsi_osd_get_attributes_allocation_length, tvb, offset, 4, 0);
278 proto_tree_add_item(tree, hf_scsi_osd_retreived_attributes_offset, tvb, offset, 4, 0);
280 proto_tree_add_item(tree, hf_scsi_osd_set_attributes_page, tvb, offset, 4, 0);
282 proto_tree_add_item(tree, hf_scsi_osd_set_attribute_number, tvb, offset, 4, 0);
284 proto_tree_add_item(tree, hf_scsi_osd_set_attribute_length, tvb, offset, 4, 0);
286 proto_tree_add_item(tree, hf_scsi_osd_set_attributes_offset, tvb, offset, 4, 0);
289 case 3: /* 5.2.2.3 attribute list */
290 proto_tree_add_item(tree, hf_scsi_osd_get_attributes_list_length, tvb, offset, 4, 0);
291 extra_data->get_list_length=tvb_get_ntohl(tvb, offset);
294 proto_tree_add_item(tree, hf_scsi_osd_get_attributes_list_offset, tvb, offset, 4, 0);
295 extra_data->get_list_offset=tvb_get_ntohl(tvb, offset);
298 proto_tree_add_item(tree, hf_scsi_osd_get_attributes_allocation_length, tvb, offset, 4, 0);
299 extra_data->get_list_allocation_length=tvb_get_ntohl(tvb, offset);
302 proto_tree_add_item(tree, hf_scsi_osd_retreived_attributes_offset, tvb, offset, 4, 0);
303 extra_data->retreived_list_offset=tvb_get_ntohl(tvb, offset);
306 proto_tree_add_item(tree, hf_scsi_osd_set_attributes_list_length, tvb, offset, 4, 0);
307 extra_data->set_list_length=tvb_get_ntohl(tvb, offset);
310 proto_tree_add_item(tree, hf_scsi_osd_set_attributes_list_offset, tvb, offset, 4, 0);
311 extra_data->set_list_offset=tvb_get_ntohl(tvb, offset);
314 /* 4 reserved bytes */
323 dissect_osd_attribute_data_out(tvbuff_t *tvb, int offset _U_, proto_tree *tree, scsi_task_data_t *cdata)
326 scsi_osd_extra_data_t *extra_data=NULL;
328 if(cdata && cdata->itlq && cdata->itlq->extra_data){
329 extra_data=cdata->itlq->extra_data;
330 gsatype=extra_data->gsatype;
336 case 2: /* 5.2.2.2 attribute page */
339 case 3: /* 5.2.2.3 attribute list */
340 if(extra_data->get_list_length){
341 proto_tree_add_text(tree, tvb, extra_data->get_list_offset, extra_data->get_list_length, "Get Attributes Data");
343 if(extra_data->set_list_length){
344 proto_tree_add_text(tree, tvb, extra_data->set_list_offset, extra_data->set_list_length, "Set Attributes Data");
352 dissect_osd_attribute_data_in(tvbuff_t *tvb, int offset _U_, proto_tree *tree, scsi_task_data_t *cdata)
355 scsi_osd_extra_data_t *extra_data=NULL;
357 if(cdata && cdata->itlq && cdata->itlq->extra_data){
358 extra_data=cdata->itlq->extra_data;
359 gsatype=extra_data->gsatype;
365 case 2: /* 5.2.2.2 attribute page */
368 case 3: /* 5.2.2.3 attribute list */
369 if(extra_data->get_list_allocation_length){
370 proto_tree_add_text(tree, tvb, extra_data->retreived_list_offset, extra_data->get_list_allocation_length, "Get Attributes Data");
377 static const value_string scsi_osd_capability_format_vals[] = {
378 {0x00, "No Capability"},
379 {0x01, "SCSI OSD Capabilities"},
382 static const value_string scsi_osd_object_type_vals[] = {
385 {0x40, "COLLECTION"},
389 static const value_string scsi_osd_object_descriptor_type_vals[] = {
390 {0, "NONE: the object descriptor field shall be ignored"},
391 {1, "U/C: a single collection or user object"},
392 {2, "PAR: a single partition, including partition zero"},
396 static const true_false_string permissions_read_tfs = {
400 static const true_false_string permissions_write_tfs = {
404 static const true_false_string permissions_get_attr_tfs = {
406 "Get_attr is NOT set"
408 static const true_false_string permissions_set_attr_tfs = {
410 "Set_attr is NOT set"
412 static const true_false_string permissions_create_tfs = {
416 static const true_false_string permissions_remove_tfs = {
420 static const true_false_string permissions_obj_mgmt_tfs = {
422 "Obj_mgmt is NOT set"
424 static const true_false_string permissions_append_tfs = {
428 static const true_false_string permissions_dev_mgmt_tfs = {
430 "Dev_mgmt is NOT set"
432 static const true_false_string permissions_global_tfs = {
436 static const true_false_string permissions_pol_sec_tfs = {
442 dissect_osd_permissions(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
444 proto_tree *tree=NULL;
448 permissions=tvb_get_ntohs(tvb, offset);
451 it=proto_tree_add_item(parent_tree, hf_scsi_osd_permissions, tvb, offset, 2, 0);
452 tree = proto_item_add_subtree(it, ett_osd_permission_bitmask);
455 proto_tree_add_item(tree, hf_scsi_osd_permissions_read, tvb, offset, 2, 0);
456 if(permissions&0x8000){
457 proto_item_append_text(tree, " READ");
459 proto_tree_add_item(tree, hf_scsi_osd_permissions_write, tvb, offset, 2, 0);
460 if(permissions&0x4000){
461 proto_item_append_text(tree, " WRITE");
463 proto_tree_add_item(tree, hf_scsi_osd_permissions_get_attr, tvb, offset, 2, 0);
464 if(permissions&0x2000){
465 proto_item_append_text(tree, " GET_ATTR");
467 proto_tree_add_item(tree, hf_scsi_osd_permissions_set_attr, tvb, offset, 2, 0);
468 if(permissions&0x1000){
469 proto_item_append_text(tree, " SET_ATTR");
471 proto_tree_add_item(tree, hf_scsi_osd_permissions_create, tvb, offset, 2, 0);
472 if(permissions&0x0800){
473 proto_item_append_text(tree, " CREATE");
475 proto_tree_add_item(tree, hf_scsi_osd_permissions_remove, tvb, offset, 2, 0);
476 if(permissions&0x0400){
477 proto_item_append_text(tree, " REMOVE");
479 proto_tree_add_item(tree, hf_scsi_osd_permissions_obj_mgmt, tvb, offset, 2, 0);
480 if(permissions&0x0200){
481 proto_item_append_text(tree, " OBJ_MGMT");
483 proto_tree_add_item(tree, hf_scsi_osd_permissions_append, tvb, offset, 2, 0);
484 if(permissions&0x0100){
485 proto_item_append_text(tree, " APPEND");
487 proto_tree_add_item(tree, hf_scsi_osd_permissions_dev_mgmt, tvb, offset, 2, 0);
488 if(permissions&0x0080){
489 proto_item_append_text(tree, " DEV_MGMT");
491 proto_tree_add_item(tree, hf_scsi_osd_permissions_global, tvb, offset, 2, 0);
492 if(permissions&0x0040){
493 proto_item_append_text(tree, " GLOBAL");
495 proto_tree_add_item(tree, hf_scsi_osd_permissions_pol_sec, tvb, offset, 2, 0);
496 if(permissions&0x0020){
497 proto_item_append_text(tree, " POL/SEC");
503 dissect_osd_capability(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
505 proto_item *item=NULL;
506 proto_tree *tree=NULL;
509 item = proto_tree_add_text(parent_tree, tvb, offset, 80,
511 tree = proto_item_add_subtree(item, ett_osd_capability);
514 /* capability format */
515 proto_tree_add_item(tree, hf_scsi_osd_capability_format, tvb, offset, 1, 0);
518 /* key version and icva */
519 proto_tree_add_item(tree, hf_scsi_osd_key_version, tvb, offset, 1, 0);
520 proto_tree_add_item(tree, hf_scsi_osd_icva, tvb, offset, 1, 0);
523 /* security method */
524 proto_tree_add_item(tree, hf_scsi_osd_security_method, tvb, offset, 1, 0);
527 /* a reserved byte */
530 /* capability expiration time */
531 proto_tree_add_item(tree, hf_scsi_osd_capability_expiration_time, tvb, offset, 6, 0);
535 proto_tree_add_item(tree, hf_scsi_osd_audit, tvb, offset, 20, 0);
538 /* capability discriminator */
539 proto_tree_add_item(tree, hf_scsi_osd_capability_discriminator, tvb, offset, 12, 0);
542 /* object created time */
543 proto_tree_add_item(tree, hf_scsi_osd_object_created_time, tvb, offset, 6, 0);
547 proto_tree_add_item(tree, hf_scsi_osd_object_type, tvb, offset, 1, 0);
550 /* permission bitmask */
551 dissect_osd_permissions(tvb, offset, tree);
554 /* a reserved byte */
557 /* object descriptor type */
558 proto_tree_add_item(tree, hf_scsi_osd_object_descriptor_type, tvb, offset, 1, 0);
561 /* object descriptor */
562 proto_tree_add_item(tree, hf_scsi_osd_object_descriptor, tvb, offset, 24, 0);
570 dissect_osd_security_parameters(tvbuff_t *tvb, int offset, proto_tree *parent_tree)
572 proto_item *item=NULL;
573 proto_tree *tree=NULL;
576 item = proto_tree_add_text(parent_tree, tvb, offset, 40,
577 "Security Parameters");
578 tree = proto_item_add_subtree(item, ett_osd_security_parameters);
581 /* request integrity check value */
582 proto_tree_add_item(tree, hf_scsi_osd_ricv, tvb, offset, 20, 0);
586 proto_tree_add_item(tree, hf_scsi_osd_request_nonce, tvb, offset, 12, 0);
589 /* data in integrity check value offset */
590 proto_tree_add_item(tree, hf_scsi_osd_diicvo, tvb, offset, 4, 0);
593 /* data out integrity check value offset */
594 proto_tree_add_item(tree, hf_scsi_osd_doicvo, tvb, offset, 4, 0);
599 dissect_osd_format_osd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
600 guint offset, gboolean isreq, gboolean iscdb,
601 guint payload_len _U_, scsi_task_data_t *cdata _U_,
602 scsi_osd_conv_info_t *conv_info _U_,
603 scsi_osd_lun_info_t *lun_info _U_)
605 /* dissecting the CDB dissection starts at byte 10 of the CDB */
608 dissect_osd_option(tvb, offset, tree);
611 /* getset attributes byte */
612 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
615 /* timestamps control */
616 dissect_osd_timestamps_control(tvb, offset, tree);
619 /* 23 reserved bytes */
622 /* formatted capacity */
623 dissect_osd_formatted_capacity(tvb, offset, tree);
626 /* 8 reserved bytes */
629 /* attribute parameters */
630 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
634 dissect_osd_capability(tvb, offset, tree);
637 /* security parameters */
638 dissect_osd_security_parameters(tvb, offset, tree);
642 /* dissecting the DATA OUT */
644 /* attribute data out */
645 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
647 /* no data out for format osd */
650 /* dissecting the DATA IN */
651 if(!isreq && !iscdb){
652 /* attribute data in */
653 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
655 /* no data in for format osd */
662 dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index, scsi_osd_lun_info_t *lun_info, gboolean is_created, gboolean is_removed)
664 proto_item *item=NULL;
665 guint64 partition_id;
668 item=proto_tree_add_item(tree, hf_index, tvb, offset, 8, 0);
669 partition_id=tvb_get_ntoh64(tvb, offset);
671 proto_item_append_text(item, " (ROOT partition)");
673 partition_info_t *part_info;
674 emem_tree_key_t pikey[2];
675 proto_tree *partition_tree=NULL;
678 pikey[0].key=(guint32 *)&partition_id;
680 part_info=se_tree_lookup32_array(lun_info->partitions, &pikey[0]);
682 part_info=se_alloc(sizeof(partition_info_t));
683 part_info->created_in=0;
684 part_info->removed_in=0;
687 pikey[0].key=(guint32 *)&partition_id;
689 se_tree_insert32_array(lun_info->partitions, &pikey[0], part_info);
692 part_info->created_in=pinfo->fd->num;
695 part_info->removed_in=pinfo->fd->num;
698 partition_tree=proto_item_add_subtree(item, ett_osd_partition);
700 if(part_info->created_in){
701 proto_item *tmp_item;
702 tmp_item=proto_tree_add_uint(partition_tree, hf_scsi_osd_partition_created_in, tvb, 0, 0, part_info->created_in);
703 PROTO_ITEM_SET_GENERATED(tmp_item);
705 if(part_info->removed_in){
706 proto_item *tmp_item;
707 tmp_item=proto_tree_add_uint(partition_tree, hf_scsi_osd_partition_removed_in, tvb, 0, 0, part_info->removed_in);
708 PROTO_ITEM_SET_GENERATED(tmp_item);
717 dissect_osd_create_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
718 guint offset, gboolean isreq, gboolean iscdb,
719 guint payload_len _U_, scsi_task_data_t *cdata _U_,
720 scsi_osd_conv_info_t *conv_info _U_,
721 scsi_osd_lun_info_t *lun_info)
723 /* dissecting the CDB dissection starts at byte 10 of the CDB */
726 dissect_osd_option(tvb, offset, tree);
729 /* getset attributes byte */
730 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
733 /* timestamps control */
734 dissect_osd_timestamps_control(tvb, offset, tree);
737 /* 3 reserved bytes */
740 /* requested partiton id */
741 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_requested_partition_id, lun_info, TRUE, FALSE);
744 /* 28 reserved bytes */
747 /* attribute parameters */
748 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
752 dissect_osd_capability(tvb, offset, tree);
755 /* security parameters */
756 dissect_osd_security_parameters(tvb, offset, tree);
760 /* dissecting the DATA OUT */
762 /* attribute data out */
763 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
765 /* no data out for create partition */
768 /* dissecting the DATA IN */
769 if(!isreq && !iscdb){
770 /* attribute data in */
771 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
773 /* no data in for create partition */
778 static const value_string scsi_osd_sort_order_vals[] = {
779 {0x00, "Ascending numeric value"},
783 dissect_osd_sortorder(tvbuff_t *tvb, int offset, proto_tree *tree)
786 proto_tree_add_item(tree, hf_scsi_osd_sortorder, tvb, offset, 1, 0);
791 dissect_osd_list_identifier(tvbuff_t *tvb, int offset, proto_tree *tree)
793 /* list identifier */
794 proto_tree_add_item(tree, hf_scsi_osd_list_identifier, tvb, offset, 4, 0);
799 dissect_osd_allocation_length(tvbuff_t *tvb, int offset, proto_tree *tree)
801 /* allocation length */
802 proto_tree_add_item(tree, hf_scsi_osd_allocation_length, tvb, offset, 8, 0);
807 dissect_osd_initial_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
809 /* initial object id */
810 proto_tree_add_item(tree, hf_scsi_osd_initial_object_id, tvb, offset, 8, 0);
815 dissect_osd_additional_length(tvbuff_t *tvb, int offset, proto_tree *tree)
817 /* additional length */
818 proto_tree_add_item(tree, hf_scsi_osd_additional_length, tvb, offset, 8, 0);
824 dissect_osd_continuation_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
826 /* continuation object id */
827 proto_tree_add_item(tree, hf_scsi_osd_continuation_object_id, tvb, offset, 8, 0);
831 static const true_false_string list_lstchg_tfs = {
832 "List has CHANGED since the first List command",
833 "List has NOT changed since first command"
835 static const true_false_string list_root_tfs = {
836 "Objects are from root and are PARTITION IDs",
837 "Objects are from a partition and are USER OBJECTs"
841 dissect_osd_user_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
844 proto_tree_add_item(tree, hf_scsi_osd_user_object_id, tvb, offset, 8, 0);
849 dissect_osd_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
850 guint offset, gboolean isreq, gboolean iscdb,
851 guint payload_len _U_, scsi_task_data_t *cdata _U_,
852 scsi_osd_conv_info_t *conv_info _U_,
853 scsi_osd_lun_info_t *lun_info)
855 /* dissecting the CDB dissection starts at byte 10 of the CDB */
858 dissect_osd_option(tvb, offset, tree);
861 /* getset attributes byte / sort order */
862 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
863 dissect_osd_sortorder(tvb, offset, tree);
866 /* timestamps control */
867 dissect_osd_timestamps_control(tvb, offset, tree);
870 /* 3 reserved bytes */
874 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
877 /* 8 reserved bytes */
880 /* list identifier */
881 dissect_osd_list_identifier(tvb, offset, tree);
884 /* allocation length */
885 dissect_osd_allocation_length(tvb, offset, tree);
888 /* initial object id */
889 dissect_osd_initial_object_id(tvb, offset, tree);
892 /* attribute parameters */
893 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
897 dissect_osd_capability(tvb, offset, tree);
900 /* security parameters */
901 dissect_osd_security_parameters(tvb, offset, tree);
905 /* dissecting the DATA OUT */
907 /* attribute data out */
908 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
910 /* no data out for LIST */
913 /* dissecting the DATA IN */
914 if(!isreq && !iscdb){
915 guint64 additional_length;
918 /* attribute data in */
919 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
921 /* dissection of the LIST DATA-IN */
922 /* additional length */
923 additional_length=tvb_get_ntoh64(tvb, offset);
924 dissect_osd_additional_length(tvb, offset, tree);
927 /* continuation object id */
928 dissect_osd_continuation_object_id(tvb, offset, tree);
931 /* list identifier */
932 dissect_osd_list_identifier(tvb, offset, tree);
935 /* 3 reserved bytes */
938 /* LSTCHG and ROOT flags */
939 proto_tree_add_item(tree, hf_scsi_osd_list_flags_lstchg, tvb, offset, 1, 0);
940 proto_tree_add_item(tree, hf_scsi_osd_list_flags_root, tvb, offset, 1, 0);
941 is_root=tvb_get_guint8(tvb, offset)&0x01;
945 /* list of user object ids or partition ids */
946 while(additional_length > (offset-8)){
948 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
950 dissect_osd_user_object_id(tvb, offset, tree);
959 dissect_osd_requested_user_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
961 /* request user object id */
962 proto_tree_add_item(tree, hf_scsi_osd_requested_user_object_id, tvb, offset, 8, 0);
967 dissect_osd_number_of_user_objects(tvbuff_t *tvb, int offset, proto_tree *tree)
969 /* number_of_user_objects */
970 proto_tree_add_item(tree, hf_scsi_osd_number_of_user_objects, tvb, offset, 2, 0);
975 dissect_osd_create(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
976 guint offset, gboolean isreq, gboolean iscdb,
977 guint payload_len _U_, scsi_task_data_t *cdata _U_,
978 scsi_osd_conv_info_t *conv_info _U_,
979 scsi_osd_lun_info_t *lun_info)
981 /* dissecting the CDB dissection starts at byte 10 of the CDB */
984 dissect_osd_option(tvb, offset, tree);
987 /* getset attributes byte */
988 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
991 /* timestamps control */
992 dissect_osd_timestamps_control(tvb, offset, tree);
995 /* 3 reserved bytes */
999 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1002 /* requested user_object id */
1003 dissect_osd_requested_user_object_id(tvb, offset, tree);
1006 /* 4 reserved bytes */
1009 /* number of user objects */
1010 dissect_osd_number_of_user_objects(tvb, offset, tree);
1013 /* 14 reserved bytes */
1016 /* attribute parameters */
1017 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1021 dissect_osd_capability(tvb, offset, tree);
1024 /* security parameters */
1025 dissect_osd_security_parameters(tvb, offset, tree);
1029 /* dissecting the DATA OUT */
1030 if(isreq && !iscdb){
1031 /* attribute data out */
1032 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1034 /* no data out for create */
1037 /* dissecting the DATA IN */
1038 if(!isreq && !iscdb){
1039 /* attribute data in */
1040 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1042 /* no data in for create */
1049 dissect_osd_remove_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1050 guint offset, gboolean isreq, gboolean iscdb,
1051 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1052 scsi_osd_conv_info_t *conv_info _U_,
1053 scsi_osd_lun_info_t *lun_info)
1055 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1058 dissect_osd_option(tvb, offset, tree);
1061 /* getset attributes byte */
1062 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1065 /* timestamps control */
1066 dissect_osd_timestamps_control(tvb, offset, tree);
1069 /* 3 reserved bytes */
1073 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, TRUE);
1076 /* 28 reserved bytes */
1079 /* attribute parameters */
1080 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1084 dissect_osd_capability(tvb, offset, tree);
1087 /* security parameters */
1088 dissect_osd_security_parameters(tvb, offset, tree);
1092 /* dissecting the DATA OUT */
1093 if(isreq && !iscdb){
1094 /* attribute data out */
1095 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1097 /* no data out for remove partition */
1100 /* dissecting the DATA IN */
1101 if(!isreq && !iscdb){
1102 /* attribute data in */
1103 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1105 /* no data in for remove partition */
1110 static const value_string key_to_set_vals[] = {
1117 dissect_osd_key_to_set(tvbuff_t *tvb, int offset, proto_tree *tree)
1119 proto_tree_add_item(tree, hf_scsi_osd_key_to_set, tvb, offset, 1, 0);
1123 dissect_osd_set_key_version(tvbuff_t *tvb, int offset, proto_tree *tree)
1125 proto_tree_add_item(tree, hf_scsi_osd_set_key_version, tvb, offset, 1, 0);
1129 dissect_osd_key_identifier(tvbuff_t *tvb, int offset, proto_tree *tree)
1131 proto_tree_add_item(tree, hf_scsi_osd_key_identifier, tvb, offset, 7, 0);
1135 dissect_osd_seed(tvbuff_t *tvb, int offset, proto_tree *tree)
1137 proto_tree_add_item(tree, hf_scsi_osd_seed, tvb, offset, 20, 0);
1141 dissect_osd_set_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1142 guint offset, gboolean isreq, gboolean iscdb,
1143 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1144 scsi_osd_conv_info_t *conv_info _U_,
1145 scsi_osd_lun_info_t *lun_info)
1147 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1149 /* a reserved byte */
1152 /* getset attributes byte and key to set*/
1153 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1154 dissect_osd_key_to_set(tvb, offset, tree);
1157 /* timestamps control */
1158 dissect_osd_timestamps_control(tvb, offset, tree);
1161 /* 3 reserved bytes */
1165 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1169 dissect_osd_set_key_version(tvb, offset, tree);
1172 /* key identifier */
1173 dissect_osd_key_identifier(tvb, offset, tree);
1177 dissect_osd_seed(tvb, offset, tree);
1180 /* attribute parameters */
1181 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1185 dissect_osd_capability(tvb, offset, tree);
1188 /* security parameters */
1189 dissect_osd_security_parameters(tvb, offset, tree);
1193 /* dissecting the DATA OUT */
1194 if(isreq && !iscdb){
1195 /* attribute data out */
1196 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1198 /* no data out for set key */
1201 /* dissecting the DATA IN */
1202 if(!isreq && !iscdb){
1203 /* attribute data in */
1204 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1206 /* no data in for set key */
1212 dissect_osd_remove(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1213 guint offset, gboolean isreq, gboolean iscdb,
1214 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1215 scsi_osd_conv_info_t *conv_info _U_,
1216 scsi_osd_lun_info_t *lun_info)
1218 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1221 dissect_osd_option(tvb, offset, tree);
1224 /* getset attributes byte */
1225 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1228 /* timestamps control */
1229 dissect_osd_timestamps_control(tvb, offset, tree);
1232 /* 3 reserved bytes */
1236 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1239 /* user object id */
1240 dissect_osd_user_object_id(tvb, offset, tree);
1243 /* 20 reserved bytes */
1246 /* attribute parameters */
1247 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1251 dissect_osd_capability(tvb, offset, tree);
1254 /* security parameters */
1255 dissect_osd_security_parameters(tvb, offset, tree);
1259 /* dissecting the DATA OUT */
1260 if(isreq && !iscdb){
1261 /* attribute data out */
1262 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1264 /* no data out for remove */
1267 /* dissecting the DATA IN */
1268 if(!isreq && !iscdb){
1269 /* attribute data in */
1270 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1272 /* no data in for remove */
1277 static const true_false_string collection_fcr_tfs = {
1282 dissect_osd_collection_fcr(tvbuff_t *tvb, int offset, proto_tree *tree)
1284 proto_tree_add_item(tree, hf_scsi_osd_collection_fcr, tvb, offset, 1, 0);
1288 dissect_osd_collection_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
1290 /* collection object id */
1291 proto_tree_add_item(tree, hf_scsi_osd_collection_object_id, tvb, offset, 8, 0);
1297 dissect_osd_remove_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1298 guint offset, gboolean isreq, gboolean iscdb,
1299 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1300 scsi_osd_conv_info_t *conv_info _U_,
1301 scsi_osd_lun_info_t *lun_info)
1303 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1306 dissect_osd_option(tvb, offset, tree);
1309 /* getset attributes byte */
1310 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1311 dissect_osd_collection_fcr(tvb, offset, tree);
1314 /* timestamps control */
1315 dissect_osd_timestamps_control(tvb, offset, tree);
1318 /* 3 reserved bytes */
1322 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1325 /* collection object id */
1326 dissect_osd_collection_object_id(tvb, offset, tree);
1329 /* 20 reserved bytes */
1332 /* attribute parameters */
1333 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1337 dissect_osd_capability(tvb, offset, tree);
1340 /* security parameters */
1341 dissect_osd_security_parameters(tvb, offset, tree);
1345 /* dissecting the DATA OUT */
1346 if(isreq && !iscdb){
1347 /* attribute data out */
1348 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1350 /* no data out for remove collection */
1353 /* dissecting the DATA IN */
1354 if(!isreq && !iscdb){
1355 /* attribute data in */
1356 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1358 /* no data in for remove collection */
1365 dissect_osd_length(tvbuff_t *tvb, int offset, proto_tree *tree)
1368 proto_tree_add_item(tree, hf_scsi_osd_length, tvb, offset, 8, 0);
1373 dissect_osd_starting_byte_address(tvbuff_t *tvb, int offset, proto_tree *tree)
1375 /* starting_byte_address */
1376 proto_tree_add_item(tree, hf_scsi_osd_starting_byte_address, tvb, offset, 8, 0);
1382 dissect_osd_write(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1383 guint offset, gboolean isreq, gboolean iscdb,
1384 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1385 scsi_osd_conv_info_t *conv_info _U_,
1386 scsi_osd_lun_info_t *lun_info)
1388 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1391 dissect_osd_option(tvb, offset, tree);
1394 /* getset attributes byte / sort order */
1395 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1398 /* timestamps control */
1399 dissect_osd_timestamps_control(tvb, offset, tree);
1402 /* 3 reserved bytes */
1406 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1409 /* user object id */
1410 dissect_osd_user_object_id(tvb, offset, tree);
1413 /* 4 reserved bytes */
1417 dissect_osd_length(tvb, offset, tree);
1420 /* starting byte address */
1421 dissect_osd_starting_byte_address(tvb, offset, tree);
1424 /* attribute parameters */
1425 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1429 dissect_osd_capability(tvb, offset, tree);
1432 /* security parameters */
1433 dissect_osd_security_parameters(tvb, offset, tree);
1437 /* dissecting the DATA OUT */
1438 if(isreq && !iscdb){
1439 /* attribute data out */
1440 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1442 /* xxx should dissect the data ? */
1445 /* dissecting the DATA IN */
1446 if(!isreq && !iscdb){
1447 /* attribute data in */
1448 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1450 /* no data in for WRITE */
1457 dissect_osd_requested_collection_object_id(tvbuff_t *tvb, int offset, proto_tree *tree)
1459 /* requested collection object id */
1460 proto_tree_add_item(tree, hf_scsi_osd_requested_collection_object_id, tvb, offset, 8, 0);
1466 dissect_osd_create_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1467 guint offset, gboolean isreq, gboolean iscdb,
1468 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1469 scsi_osd_conv_info_t *conv_info _U_,
1470 scsi_osd_lun_info_t *lun_info)
1472 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1475 dissect_osd_option(tvb, offset, tree);
1478 /* getset attributes byte */
1479 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1480 dissect_osd_collection_fcr(tvb, offset, tree);
1483 /* timestamps control */
1484 dissect_osd_timestamps_control(tvb, offset, tree);
1487 /* 3 reserved bytes */
1491 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1494 /* requested collection object id */
1495 dissect_osd_requested_collection_object_id(tvb, offset, tree);
1498 /* 20 reserved bytes */
1501 /* attribute parameters */
1502 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1506 dissect_osd_capability(tvb, offset, tree);
1509 /* security parameters */
1510 dissect_osd_security_parameters(tvb, offset, tree);
1514 /* dissecting the DATA OUT */
1515 if(isreq && !iscdb){
1516 /* attribute data out */
1517 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1519 /* no data out for create collection */
1522 /* dissecting the DATA IN */
1523 if(!isreq && !iscdb){
1524 /* attribute data in */
1525 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1527 /* no data in for create collection */
1533 static const value_string flush_scope_vals[] = {
1534 {0, "User object data and attributes"},
1535 {1, "User object attributes only"},
1540 dissect_osd_flush_scope(tvbuff_t *tvb, int offset, proto_tree *tree)
1543 proto_tree_add_item(tree, hf_scsi_osd_flush_scope, tvb, offset, 1, 0);
1548 dissect_osd_flush(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1549 guint offset, gboolean isreq, gboolean iscdb,
1550 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1551 scsi_osd_conv_info_t *conv_info _U_,
1552 scsi_osd_lun_info_t *lun_info)
1554 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1557 dissect_osd_flush_scope(tvb, offset, tree);
1560 /* getset attributes byte */
1561 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1564 /* timestamps control */
1565 dissect_osd_timestamps_control(tvb, offset, tree);
1568 /* 3 reserved bytes */
1572 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1575 /* user object id */
1576 dissect_osd_user_object_id(tvb, offset, tree);
1579 /* 20 reserved bytes */
1582 /* attribute parameters */
1583 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1587 dissect_osd_capability(tvb, offset, tree);
1590 /* security parameters */
1591 dissect_osd_security_parameters(tvb, offset, tree);
1595 /* dissecting the DATA OUT */
1596 if(isreq && !iscdb){
1597 /* attribute data out */
1598 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1600 /* no data out for flush */
1603 /* dissecting the DATA IN */
1604 if(!isreq && !iscdb){
1605 /* attribute data in */
1606 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1608 /* no data in for flush */
1614 static const value_string flush_collection_scope_vals[] = {
1615 {0, "List of user objects contained in the collection"},
1616 {1, "Collection attributes only"},
1617 {2, "List of user objects and collection attributes"},
1622 dissect_osd_flush_collection_scope(tvbuff_t *tvb, int offset, proto_tree *tree)
1624 /* flush collection scope */
1625 proto_tree_add_item(tree, hf_scsi_osd_flush_collection_scope, tvb, offset, 1, 0);
1630 dissect_osd_flush_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1631 guint offset, gboolean isreq, gboolean iscdb,
1632 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1633 scsi_osd_conv_info_t *conv_info _U_,
1634 scsi_osd_lun_info_t *lun_info)
1636 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1639 dissect_osd_flush_collection_scope(tvb, offset, tree);
1642 /* getset attributes byte */
1643 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1644 dissect_osd_collection_fcr(tvb, offset, tree);
1647 /* timestamps control */
1648 dissect_osd_timestamps_control(tvb, offset, tree);
1651 /* 3 reserved bytes */
1655 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1658 /* collection object id */
1659 dissect_osd_collection_object_id(tvb, offset, tree);
1662 /* 20 reserved bytes */
1665 /* attribute parameters */
1666 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1670 dissect_osd_capability(tvb, offset, tree);
1673 /* security parameters */
1674 dissect_osd_security_parameters(tvb, offset, tree);
1678 /* dissecting the DATA OUT */
1679 if(isreq && !iscdb){
1680 /* attribute data out */
1681 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1683 /* no data out for flush collection */
1686 /* dissecting the DATA IN */
1687 if(!isreq && !iscdb){
1688 /* attribute data in */
1689 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1691 /* no data in for flush collection */
1698 dissect_osd_append(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1699 guint offset, gboolean isreq, gboolean iscdb,
1700 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1701 scsi_osd_conv_info_t *conv_info _U_,
1702 scsi_osd_lun_info_t *lun_info)
1704 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1707 dissect_osd_option(tvb, offset, tree);
1710 /* getset attributes byte / sort order */
1711 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1712 dissect_osd_sortorder(tvb, offset, tree);
1715 /* timestamps control */
1716 dissect_osd_timestamps_control(tvb, offset, tree);
1719 /* 3 reserved bytes */
1723 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1726 /* user object id */
1727 dissect_osd_user_object_id(tvb, offset, tree);
1730 /* 4 reserved bytes */
1734 dissect_osd_length(tvb, offset, tree);
1737 /* 8 reserved bytes */
1740 /* attribute parameters */
1741 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1745 dissect_osd_capability(tvb, offset, tree);
1748 /* security parameters */
1749 dissect_osd_security_parameters(tvb, offset, tree);
1753 /* dissecting the DATA OUT */
1754 if(isreq && !iscdb){
1755 /* attribute data out */
1756 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1758 /* xxx should dissect the data ? */
1761 /* dissecting the DATA IN */
1762 if(!isreq && !iscdb){
1763 /* attribute data in */
1764 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1766 /* no data in for append */
1772 dissect_osd_create_and_write(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1773 guint offset, gboolean isreq, gboolean iscdb,
1774 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1775 scsi_osd_conv_info_t *conv_info _U_,
1776 scsi_osd_lun_info_t *lun_info)
1778 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1781 dissect_osd_option(tvb, offset, tree);
1784 /* getset attributes byte */
1785 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1788 /* timestamps control */
1789 dissect_osd_timestamps_control(tvb, offset, tree);
1792 /* 3 reserved bytes */
1796 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1799 /* requested user_object id */
1800 dissect_osd_requested_user_object_id(tvb, offset, tree);
1803 /* 4 reserved bytes */
1807 dissect_osd_length(tvb, offset, tree);
1810 /* starting byte address */
1811 dissect_osd_starting_byte_address(tvb, offset, tree);
1814 /* attribute parameters */
1815 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1819 dissect_osd_capability(tvb, offset, tree);
1822 /* security parameters */
1823 dissect_osd_security_parameters(tvb, offset, tree);
1827 /* dissecting the DATA OUT */
1828 if(isreq && !iscdb){
1829 /* attribute data out */
1830 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1832 /* should we dissect the data? */
1835 /* dissecting the DATA IN */
1836 if(!isreq && !iscdb){
1837 /* attribute data in */
1838 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1840 /* no data in for create and write*/
1846 static const value_string flush_osd_scope_vals[] = {
1847 {0, "List of partitions contained in the OSD logical unit"},
1848 {1, "Root object attributes only"},
1854 dissect_osd_flush_osd_scope(tvbuff_t *tvb, int offset, proto_tree *tree)
1856 /* flush osd scope */
1857 proto_tree_add_item(tree, hf_scsi_osd_flush_osd_scope, tvb, offset, 1, 0);
1862 dissect_osd_flush_osd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1863 guint offset, gboolean isreq, gboolean iscdb,
1864 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1865 scsi_osd_conv_info_t *conv_info _U_,
1866 scsi_osd_lun_info_t *lun_info)
1868 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1871 dissect_osd_flush_osd_scope(tvb, offset, tree);
1874 /* getset attributes byte */
1875 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1878 /* timestamps control */
1879 dissect_osd_timestamps_control(tvb, offset, tree);
1882 /* 39 reserved bytes */
1885 /* attribute parameters */
1886 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1890 dissect_osd_capability(tvb, offset, tree);
1893 /* security parameters */
1894 dissect_osd_security_parameters(tvb, offset, tree);
1898 /* dissecting the DATA OUT */
1899 if(isreq && !iscdb){
1900 /* attribute data out */
1901 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1903 /* no data out for flush osd */
1906 /* dissecting the DATA IN */
1907 if(!isreq && !iscdb){
1908 /* attribute data in */
1909 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1911 /* no data in for flush osd */
1917 static const value_string flush_partition_scope_vals[] = {
1918 {0, "List of user objects and collections in the partition"},
1919 {1, "Partition attributes only"},
1925 dissect_osd_flush_partition_scope(tvbuff_t *tvb, int offset, proto_tree *tree)
1927 /* flush partition scope */
1928 proto_tree_add_item(tree, hf_scsi_osd_flush_partition_scope, tvb, offset, 1, 0);
1934 dissect_osd_flush_partition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1935 guint offset, gboolean isreq, gboolean iscdb,
1936 guint payload_len _U_, scsi_task_data_t *cdata _U_,
1937 scsi_osd_conv_info_t *conv_info _U_,
1938 scsi_osd_lun_info_t *lun_info)
1940 /* dissecting the CDB dissection starts at byte 10 of the CDB */
1943 dissect_osd_flush_partition_scope(tvb, offset, tree);
1946 /* getset attributes byte */
1947 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
1950 /* timestamps control */
1951 dissect_osd_timestamps_control(tvb, offset, tree);
1954 /* 3 reserved bytes */
1958 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
1961 /* 28 reserved bytes */
1964 /* attribute parameters */
1965 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
1969 dissect_osd_capability(tvb, offset, tree);
1972 /* security parameters */
1973 dissect_osd_security_parameters(tvb, offset, tree);
1977 /* dissecting the DATA OUT */
1978 if(isreq && !iscdb){
1979 /* attribute data out */
1980 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
1982 /* no data out for flush partition */
1985 /* dissecting the DATA IN */
1986 if(!isreq && !iscdb){
1987 /* attribute data in */
1988 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
1990 /* no data in for flush partition */
1997 dissect_osd_get_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
1998 guint offset, gboolean isreq, gboolean iscdb,
1999 guint payload_len _U_, scsi_task_data_t *cdata _U_,
2000 scsi_osd_conv_info_t *conv_info _U_,
2001 scsi_osd_lun_info_t *lun_info)
2003 /* dissecting the CDB dissection starts at byte 10 of the CDB */
2006 dissect_osd_option(tvb, offset, tree);
2009 /* getset attributes byte */
2010 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
2013 /* timestamps control */
2014 dissect_osd_timestamps_control(tvb, offset, tree);
2017 /* 3 reserved bytes */
2021 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, TRUE);
2024 /* user_object id */
2025 dissect_osd_user_object_id(tvb, offset, tree);
2028 /* 20 reserved bytes */
2031 /* attribute parameters */
2032 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
2036 dissect_osd_capability(tvb, offset, tree);
2039 /* security parameters */
2040 dissect_osd_security_parameters(tvb, offset, tree);
2044 /* dissecting the DATA OUT */
2045 if(isreq && !iscdb){
2046 /* attribute data out */
2047 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
2049 /* no data out for get attributes */
2052 /* dissecting the DATA IN */
2053 if(!isreq && !iscdb){
2054 /* attribute data in */
2055 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
2057 /* no data in for get attributes */
2064 dissect_osd_list_collection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2065 guint offset, gboolean isreq, gboolean iscdb,
2066 guint payload_len _U_, scsi_task_data_t *cdata _U_,
2067 scsi_osd_conv_info_t *conv_info _U_,
2068 scsi_osd_lun_info_t *lun_info)
2070 /* dissecting the CDB dissection starts at byte 10 of the CDB */
2072 /* one reserved byte */
2075 /* getset attributes byte */
2076 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
2079 /* timestamps control */
2080 dissect_osd_timestamps_control(tvb, offset, tree);
2083 /* 3 reserved bytes */
2087 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
2090 /* collection object id */
2091 dissect_osd_collection_object_id(tvb, offset, tree);
2094 /* list identifier */
2095 dissect_osd_list_identifier(tvb, offset, tree);
2098 /* allocation length */
2099 dissect_osd_allocation_length(tvb, offset, tree);
2102 /* initial object id */
2103 dissect_osd_initial_object_id(tvb, offset, tree);
2106 /* attribute parameters */
2107 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
2111 dissect_osd_capability(tvb, offset, tree);
2114 /* security parameters */
2115 dissect_osd_security_parameters(tvb, offset, tree);
2119 /* dissecting the DATA OUT */
2120 if(isreq && !iscdb){
2121 /* attribute data out */
2122 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
2124 /* no data out for list collection */
2127 /* dissecting the DATA IN */
2128 if(!isreq && !iscdb){
2129 /* attribute data in */
2130 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
2132 /* XXX dissect the data */
2140 dissect_osd_read(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2141 guint offset, gboolean isreq, gboolean iscdb,
2142 guint payload_len _U_, scsi_task_data_t *cdata _U_,
2143 scsi_osd_conv_info_t *conv_info _U_,
2144 scsi_osd_lun_info_t *lun_info)
2146 /* dissecting the CDB dissection starts at byte 10 of the CDB */
2149 dissect_osd_option(tvb, offset, tree);
2152 /* getset attributes byte / sort order */
2153 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
2156 /* timestamps control */
2157 dissect_osd_timestamps_control(tvb, offset, tree);
2160 /* 3 reserved bytes */
2164 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, FALSE);
2167 /* user object id */
2168 dissect_osd_user_object_id(tvb, offset, tree);
2171 /* 4 reserved bytes */
2175 dissect_osd_length(tvb, offset, tree);
2178 /* starting byte address */
2179 dissect_osd_starting_byte_address(tvb, offset, tree);
2182 /* attribute parameters */
2183 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
2187 dissect_osd_capability(tvb, offset, tree);
2190 /* security parameters */
2191 dissect_osd_security_parameters(tvb, offset, tree);
2195 /* dissecting the DATA OUT */
2196 if(isreq && !iscdb){
2197 /* attribute data out */
2198 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
2200 /* no data out for READ */
2203 /* dissecting the DATA IN */
2204 if(!isreq && !iscdb){
2205 /* attribute data in */
2206 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
2208 /* xxx should dissect the data ? */
2215 dissect_osd_set_attributes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2216 guint offset, gboolean isreq, gboolean iscdb,
2217 guint payload_len _U_, scsi_task_data_t *cdata _U_,
2218 scsi_osd_conv_info_t *conv_info _U_,
2219 scsi_osd_lun_info_t *lun_info)
2221 /* dissecting the CDB dissection starts at byte 10 of the CDB */
2224 dissect_osd_option(tvb, offset, tree);
2227 /* getset attributes byte */
2228 dissect_osd_getsetattrib(tvb, offset, tree, cdata);
2231 /* timestamps control */
2232 dissect_osd_timestamps_control(tvb, offset, tree);
2235 /* 3 reserved bytes */
2239 dissect_osd_partition_id(pinfo, tvb, offset, tree, hf_scsi_osd_partition_id, lun_info, FALSE, TRUE);
2242 /* user_object id */
2243 dissect_osd_user_object_id(tvb, offset, tree);
2246 /* 20 reserved bytes */
2249 /* attribute parameters */
2250 dissect_osd_attribute_parameters(tvb, offset, tree, cdata);
2254 dissect_osd_capability(tvb, offset, tree);
2257 /* security parameters */
2258 dissect_osd_security_parameters(tvb, offset, tree);
2262 /* dissecting the DATA OUT */
2263 if(isreq && !iscdb){
2264 /* attribute data out */
2265 dissect_osd_attribute_data_out(tvb, offset, tree, cdata);
2267 /* no data out for set attributes */
2270 /* dissecting the DATA IN */
2271 if(!isreq && !iscdb){
2272 /* attribute data in */
2273 dissect_osd_attribute_data_in(tvb, offset, tree, cdata);
2275 /* no data in for set attributes */
2280 /* OSD Service Actions */
2281 #define OSD_FORMAT_OSD 0x8801
2282 #define OSD_CREATE 0x8802
2283 #define OSD_LIST 0x8803
2284 #define OSD_READ 0x8805
2285 #define OSD_WRITE 0x8806
2286 #define OSD_APPEND 0x8807
2287 #define OSD_FLUSH 0x8808
2288 #define OSD_REMOVE 0x880a
2289 #define OSD_CREATE_PARTITION 0x880b
2290 #define OSD_REMOVE_PARTITION 0x880c
2291 #define OSD_GET_ATTRIBUTES 0x880e
2292 #define OSD_SET_ATTRIBUTES 0x880f
2293 #define OSD_CREATE_AND_WRITE 0x8812
2294 #define OSD_CREATE_COLLECTION 0x8815
2295 #define OSD_REMOVE_COLLECTION 0x8816
2296 #define OSD_LIST_COLLECTION 0x8817
2297 #define OSD_SET_KEY 0x8818
2298 #define OSD_FLUSH_COLLECTION 0x881a
2299 #define OSD_FLUSH_PARTITION 0x881b
2300 #define OSD_FLUSH_OSD 0x881c
2301 static const value_string scsi_osd_svcaction_vals[] = {
2302 {OSD_FORMAT_OSD, "Format OSD"},
2303 {OSD_CREATE, "Create"},
2306 {OSD_WRITE, "Write"},
2307 {OSD_APPEND, "Append"},
2308 {OSD_FLUSH, "Flush"},
2309 {OSD_REMOVE, "Remove"},
2310 {OSD_CREATE_PARTITION, "Create Partition"},
2311 {OSD_REMOVE_PARTITION, "Remove Partition"},
2312 {OSD_GET_ATTRIBUTES, "Get Attributes"},
2313 {OSD_SET_ATTRIBUTES, "Set Attributes"},
2314 {OSD_CREATE_AND_WRITE, "Create And Write"},
2315 {OSD_CREATE_COLLECTION, "Create Collection"},
2316 {OSD_REMOVE_COLLECTION, "Remove Collection"},
2317 {OSD_LIST_COLLECTION, "List Collection"},
2318 {OSD_SET_KEY, "Set Key"},
2319 {OSD_FLUSH_COLLECTION, "Flush Collection"},
2320 {OSD_FLUSH_PARTITION, "Flush Partition"},
2321 {OSD_FLUSH_OSD, "Flush OSD"},
2325 /* OSD Service Action dissectors */
2326 typedef struct _scsi_osd_svcaction_t {
2328 scsi_osd_dissector_t dissector;
2329 } scsi_osd_svcaction_t;
2330 static const scsi_osd_svcaction_t scsi_osd_svcaction[] = {
2331 {OSD_FORMAT_OSD, dissect_osd_format_osd},
2332 {OSD_CREATE, dissect_osd_create},
2333 {OSD_LIST, dissect_osd_list},
2334 {OSD_READ, dissect_osd_read},
2335 {OSD_WRITE, dissect_osd_write},
2336 {OSD_APPEND, dissect_osd_append},
2337 {OSD_FLUSH, dissect_osd_flush},
2338 {OSD_REMOVE, dissect_osd_remove},
2339 {OSD_CREATE_PARTITION, dissect_osd_create_partition},
2340 {OSD_REMOVE_PARTITION, dissect_osd_remove_partition},
2341 {OSD_GET_ATTRIBUTES, dissect_osd_get_attributes},
2342 {OSD_SET_ATTRIBUTES, dissect_osd_set_attributes},
2343 {OSD_CREATE_AND_WRITE, dissect_osd_create_and_write},
2344 {OSD_CREATE_COLLECTION, dissect_osd_create_collection},
2345 {OSD_REMOVE_COLLECTION, dissect_osd_remove_collection},
2346 {OSD_LIST_COLLECTION, dissect_osd_list_collection},
2347 {OSD_SET_KEY, dissect_osd_set_key},
2348 {OSD_FLUSH_COLLECTION, dissect_osd_flush_collection},
2349 {OSD_FLUSH_PARTITION, dissect_osd_flush_partition},
2350 {OSD_FLUSH_OSD, dissect_osd_flush_osd},
2354 static scsi_osd_dissector_t
2355 find_svcaction_dissector(guint16 svcaction)
2357 const scsi_osd_svcaction_t *sa=scsi_osd_svcaction;
2359 while(sa&&sa->dissector){
2360 if(sa->svcaction==svcaction){
2361 return sa->dissector;
2371 dissect_osd_opcode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
2372 guint offset, gboolean isreq, gboolean iscdb,
2373 guint payload_len, scsi_task_data_t *cdata)
2375 guint16 svcaction=0;
2376 scsi_osd_dissector_t dissector;
2377 scsi_osd_conv_info_t *conv_info=NULL;
2378 scsi_osd_lun_info_t *lun_info=NULL;
2384 /* We must have an itl an itlq and a conversation */
2385 if(!cdata || !cdata->itl || !cdata->itl->conversation || !cdata->itlq){
2388 /* make sure we have a conversation info for this */
2389 conv_info=conversation_get_proto_data(cdata->itl->conversation, proto_scsi_osd);
2391 conv_info=se_alloc(sizeof(scsi_osd_conv_info_t));
2392 conv_info->luns=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "SCSI OSD luns tree");
2393 conversation_add_proto_data(cdata->itl->conversation, proto_scsi_osd, conv_info);
2395 /* make sure we have a lun_info structure for this */
2396 lun_info=se_tree_lookup32(conv_info->luns, cdata->itlq->lun);
2398 lun_info=se_alloc(sizeof(scsi_osd_lun_info_t));
2399 lun_info->partitions=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "SCSI OSD partitions tree");
2400 se_tree_insert32(conv_info->luns, cdata->itlq->lun, (void *)lun_info);
2403 /* dissecting the CDB */
2404 if (isreq && iscdb) {
2405 proto_tree_add_item (tree, hf_scsi_control, tvb, offset, 1, 0);
2408 /* 5 reserved bytes */
2411 proto_tree_add_item (tree, hf_scsi_osd_add_cdblen, tvb, offset, 1, 0);
2414 svcaction=tvb_get_ntohs(tvb, offset);
2415 if(cdata && cdata->itlq){
2416 /* We must store the service action for this itlq
2417 * so we can indentify what the data contains
2419 if((!pinfo->fd->flags.visited) && (!cdata->itlq->extra_data)){
2420 scsi_osd_extra_data_t *extra_data;
2422 extra_data=se_alloc(sizeof(scsi_osd_extra_data_t));
2423 extra_data->svcaction=svcaction;
2424 extra_data->gsatype=0;
2425 cdata->itlq->extra_data=extra_data;
2428 proto_tree_add_item (tree, hf_scsi_osd_svcaction, tvb, offset, 2, 0);
2432 if(check_col(pinfo->cinfo, COL_INFO)){
2433 col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
2434 val_to_str(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
2436 dissector=find_svcaction_dissector(svcaction);
2438 (*dissector)(tvb, pinfo, tree, offset, isreq, iscdb, payload_len, cdata, conv_info, lun_info);
2443 /* If it was not a CDB, try to find the service action and pass it
2444 * off to the service action dissector
2446 if(cdata && cdata->itlq && cdata->itlq->extra_data){
2447 scsi_osd_extra_data_t *extra_data=cdata->itlq->extra_data;
2448 svcaction=extra_data->svcaction;
2450 if(check_col(pinfo->cinfo, COL_INFO)){
2451 col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
2452 val_to_str(svcaction, scsi_osd_svcaction_vals, "Unknown OSD Serviceaction"));
2456 it=proto_tree_add_uint_format(tree, hf_scsi_osd_svcaction, tvb, 0, 0, svcaction, "Service Action: 0x%04x", svcaction);
2457 PROTO_ITEM_SET_GENERATED(it);
2459 dissector=find_svcaction_dissector(svcaction);
2461 (*dissector)(tvb, pinfo, tree, offset, isreq, iscdb, payload_len, cdata, conv_info, lun_info);
2468 const value_string scsi_osd_vals[] = {
2469 {SCSI_SPC2_INQUIRY , "Inquiry"},
2470 {SCSI_SPC2_LOGSELECT , "Log Select"},
2471 {SCSI_SPC2_LOGSENSE , "Log Sense"},
2472 {SCSI_SPC2_MODESELECT10 , "Mode Select(10)"},
2473 {SCSI_SPC2_MODESENSE10 , "Mode Sense(10)"},
2474 {SCSI_SPC2_PERSRESVIN , "Persistent Reserve In"},
2475 {SCSI_SPC2_PERSRESVOUT , "Persistent Reserve Out"},
2476 {SCSI_SPC2_REPORTLUNS , "Report LUNs"},
2477 {SCSI_OSD_OPCODE , "OSD Command" },
2483 scsi_cdb_table_t scsi_osd_table[256] = {
2502 /*OSD 0x12*/{dissect_spc3_inquiry},
2560 /*OSD 0x4c*/{dissect_spc3_logselect},
2561 /*OSD 0x4d*/{dissect_spc3_logsense},
2569 /*OSD 0x55*/{dissect_spc3_modeselect10},
2574 /*OSD 0x5a*/{dissect_spc3_modesense10},
2578 /*OSD 0x5e*/{dissect_spc3_persistentreservein},
2579 /*OSD 0x5f*/{dissect_spc3_persistentreserveout},
2611 /*OSD 0x7f*/{dissect_osd_opcode},
2644 /*OSD 0xa0*/{dissect_spc3_reportluns},
2746 proto_register_scsi_osd(void)
2748 static hf_register_info hf[] = {
2749 { &hf_scsi_osd_opcode,
2750 {"OSD Opcode", "scsi.osd.opcode", FT_UINT8, BASE_HEX,
2751 VALS (scsi_osd_vals), 0x0, "", HFILL}},
2752 { &hf_scsi_osd_add_cdblen,
2753 {"Additional CDB Length", "scsi.osd.addcdblen", FT_UINT8, BASE_DEC,
2754 NULL, 0x0, "", HFILL}},
2755 { &hf_scsi_osd_svcaction,
2756 {"Service Action", "scsi.osd.svcaction", FT_UINT16, BASE_HEX,
2757 VALS(scsi_osd_svcaction_vals), 0x0, "", HFILL}},
2758 { &hf_scsi_osd_option,
2759 {"Options Byte", "scsi.osd.option", FT_UINT8, BASE_HEX,
2760 NULL, 0x0, "", HFILL}},
2761 { &hf_scsi_osd_option_dpo,
2762 {"DPO", "scsi.osd.option.dpo", FT_BOOLEAN, 8,
2763 TFS(&option_dpo_tfs), 0x10, "", HFILL}},
2764 { &hf_scsi_osd_option_fua,
2765 {"FUA", "scsi.osd.option.fua", FT_BOOLEAN, 8,
2766 TFS(&option_fua_tfs), 0x08, "", HFILL}},
2767 { &hf_scsi_osd_getsetattrib,
2768 {"GET/SET CDBFMT", "scsi.osd.getset", FT_UINT8, BASE_HEX,
2769 VALS(scsi_osd_getsetattrib_vals), 0x30, "", HFILL}},
2770 { &hf_scsi_osd_timestamps_control,
2771 {"Timestamps Control", "scsi.osd.timestamps_control", FT_UINT8, BASE_HEX,
2772 VALS(scsi_osd_timestamps_control_vals), 0x0, "", HFILL}},
2773 { &hf_scsi_osd_formatted_capacity,
2774 {"Formatted Capacity", "scsi.osd.formatted_capacity", FT_UINT64, BASE_DEC,
2775 NULL, 0x0, "", HFILL}},
2776 { &hf_scsi_osd_get_attributes_page,
2777 {"Get Attributes Page", "scsi.osd.get_attributes_page", FT_UINT32, BASE_HEX,
2778 NULL, 0x0, "", HFILL}},
2779 { &hf_scsi_osd_get_attributes_list_length,
2780 {"Get Attributes List Length", "scsi.osd.get_attributes_list_length", FT_UINT32, BASE_HEX,
2781 NULL, 0x0, "", HFILL}},
2782 { &hf_scsi_osd_get_attributes_list_offset,
2783 {"Get Attributes List Offset", "scsi.osd.get_attributes_list_offset", FT_UINT32, BASE_HEX,
2784 NULL, 0x0, "", HFILL}},
2785 { &hf_scsi_osd_set_attributes_list_length,
2786 {"Set Attributes List Length", "scsi.osd.set_attributes_list_length", FT_UINT32, BASE_HEX,
2787 NULL, 0x0, "", HFILL}},
2788 { &hf_scsi_osd_set_attributes_list_offset,
2789 {"Set Attributes List Offset", "scsi.osd.set_attributes_list_offset", FT_UINT32, BASE_HEX,
2790 NULL, 0x0, "", HFILL}},
2791 { &hf_scsi_osd_get_attributes_allocation_length,
2792 {"Get Attributes Allocation Length", "scsi.osd.get_attributes_allocation_length", FT_UINT32, BASE_HEX,
2793 NULL, 0x0, "", HFILL}},
2794 { &hf_scsi_osd_retreived_attributes_offset,
2795 {"Retreived Attributes Offset", "scsi.osd.retreived_attributes_offset", FT_UINT32, BASE_HEX,
2796 NULL, 0x0, "", HFILL}},
2797 { &hf_scsi_osd_set_attributes_page,
2798 {"Set Attributes Page", "scsi.osd.set_attributes_page", FT_UINT32, BASE_HEX,
2799 NULL, 0x0, "", HFILL}},
2800 { &hf_scsi_osd_set_attribute_length,
2801 {"Set Attribute Length", "scsi.osd.set_attribute_length", FT_UINT32, BASE_HEX,
2802 NULL, 0x0, "", HFILL}},
2803 { &hf_scsi_osd_set_attribute_number,
2804 {"Set Attribute Number", "scsi.osd.set_attribute_number", FT_UINT32, BASE_HEX,
2805 NULL, 0x0, "", HFILL}},
2806 { &hf_scsi_osd_set_attributes_offset,
2807 {"Set Attributes Offset", "scsi.osd.set_attributes_offset", FT_UINT32, BASE_HEX,
2808 NULL, 0x0, "", HFILL}},
2809 { &hf_scsi_osd_capability_format,
2810 {"Capability Format", "scsi.osd.capability_format", FT_UINT8, BASE_HEX,
2811 VALS(scsi_osd_capability_format_vals), 0x0f, "", HFILL}},
2812 { &hf_scsi_osd_key_version,
2813 {"Key Version", "scsi.osd.key_version", FT_UINT8, BASE_HEX,
2814 NULL, 0xf0, "", HFILL}},
2815 { &hf_scsi_osd_icva,
2816 {"Integrity Check Value Algorithm", "scsi.osd.icva", FT_UINT8, BASE_HEX,
2817 NULL, 0x0f, "", HFILL}},
2818 { &hf_scsi_osd_security_method,
2819 {"Security Method", "scsi.osd.security_method", FT_UINT8, BASE_HEX,
2820 NULL, 0x0f, "", HFILL}},
2821 { &hf_scsi_osd_capability_expiration_time,
2822 {"Capability Expiration Time", "scsi.osd.capability_expiration_time", FT_BYTES, BASE_HEX,
2823 NULL, 0, "", HFILL}},
2824 { &hf_scsi_osd_audit,
2825 {"Audit", "scsi.osd.audit", FT_BYTES, BASE_HEX,
2826 NULL, 0, "", HFILL}},
2827 { &hf_scsi_osd_capability_discriminator,
2828 {"Capability Discriminator", "scsi.osd.capability_descriminator", FT_BYTES, BASE_HEX,
2829 NULL, 0, "", HFILL}},
2830 { &hf_scsi_osd_object_created_time,
2831 {"Object Created Time", "scsi.osd.object_created_time", FT_BYTES, BASE_HEX,
2832 NULL, 0, "", HFILL}},
2833 { &hf_scsi_osd_object_type,
2834 {"Object Type", "scsi.osd.object_type", FT_UINT8, BASE_HEX,
2835 VALS(scsi_osd_object_type_vals), 0, "", HFILL}},
2836 { &hf_scsi_osd_permissions,
2837 {"Permissions", "scsi.osd.permissions", FT_UINT16, BASE_HEX,
2838 NULL, 0, "", HFILL}},
2839 { &hf_scsi_osd_permissions_read,
2840 {"READ", "scsi.osd.permissions.read", FT_BOOLEAN, 16,
2841 TFS(&permissions_read_tfs), 0x8000, "", HFILL}},
2842 { &hf_scsi_osd_permissions_write,
2843 {"WRITE", "scsi.osd.permissions.write", FT_BOOLEAN, 16,
2844 TFS(&permissions_write_tfs), 0x4000, "", HFILL}},
2845 { &hf_scsi_osd_permissions_get_attr,
2846 {"GET_ATTR", "scsi.osd.permissions.get_attr", FT_BOOLEAN, 16,
2847 TFS(&permissions_get_attr_tfs), 0x2000, "", HFILL}},
2848 { &hf_scsi_osd_permissions_set_attr,
2849 {"SET_ATTR", "scsi.osd.permissions.set_attr", FT_BOOLEAN, 16,
2850 TFS(&permissions_set_attr_tfs), 0x1000, "", HFILL}},
2851 { &hf_scsi_osd_permissions_create,
2852 {"CREATE", "scsi.osd.permissions.create", FT_BOOLEAN, 16,
2853 TFS(&permissions_create_tfs), 0x0800, "", HFILL}},
2854 { &hf_scsi_osd_permissions_remove,
2855 {"REMOVE", "scsi.osd.permissions.remove", FT_BOOLEAN, 16,
2856 TFS(&permissions_remove_tfs), 0x0400, "", HFILL}},
2857 { &hf_scsi_osd_permissions_obj_mgmt,
2858 {"OBJ_MGMT", "scsi.osd.permissions.obj_mgmt", FT_BOOLEAN, 16,
2859 TFS(&permissions_obj_mgmt_tfs), 0x0200, "", HFILL}},
2860 { &hf_scsi_osd_permissions_append,
2861 {"APPEND", "scsi.osd.permissions.append", FT_BOOLEAN, 16,
2862 TFS(&permissions_append_tfs), 0x0100, "", HFILL}},
2863 { &hf_scsi_osd_permissions_dev_mgmt,
2864 {"DEV_MGMT", "scsi.osd.permissions.dev_mgmt", FT_BOOLEAN, 16,
2865 TFS(&permissions_dev_mgmt_tfs), 0x0080, "", HFILL}},
2866 { &hf_scsi_osd_permissions_global,
2867 {"GLOBAL", "scsi.osd.permissions.global", FT_BOOLEAN, 16,
2868 TFS(&permissions_global_tfs), 0x0040, "", HFILL}},
2869 { &hf_scsi_osd_permissions_pol_sec,
2870 {"POL/SEC", "scsi.osd.permissions.pol_sec", FT_BOOLEAN, 16,
2871 TFS(&permissions_pol_sec_tfs), 0x0020, "", HFILL}},
2873 { &hf_scsi_osd_object_descriptor_type,
2874 {"Object Descriptor Type", "scsi.osd.object_descriptor_type", FT_UINT8, BASE_HEX,
2875 VALS(scsi_osd_object_descriptor_type_vals), 0xf0, "", HFILL}},
2876 { &hf_scsi_osd_object_descriptor,
2877 {"Object Descriptor", "scsi.osd.object_descriptor", FT_BYTES, BASE_HEX,
2878 NULL, 0, "", HFILL}},
2879 { &hf_scsi_osd_ricv,
2880 {"Request Integrity Check value", "scsi.osd.ricv", FT_BYTES, BASE_HEX,
2881 NULL, 0, "", HFILL}},
2882 { &hf_scsi_osd_request_nonce,
2883 {"Request Nonce", "scsi.osd.request_nonce", FT_BYTES, BASE_HEX,
2884 NULL, 0, "", HFILL}},
2885 { &hf_scsi_osd_diicvo,
2886 {"Data-In Integrity Check Value Offset", "scsi.osd.diicvo", FT_UINT32, BASE_DEC,
2887 NULL, 0, "", HFILL}},
2888 { &hf_scsi_osd_doicvo,
2889 {"Data-Out Integrity Check Value Offset", "scsi.osd.doicvo", FT_UINT32, BASE_DEC,
2890 NULL, 0, "", HFILL}},
2891 { &hf_scsi_osd_requested_partition_id,
2892 {"Requested Partition Id", "scsi.osd.requested_partition_id", FT_UINT64, BASE_HEX,
2893 NULL, 0, "", HFILL}},
2894 { &hf_scsi_osd_sortorder,
2895 {"Sort Order", "scsi.osd.sort_order", FT_UINT8, BASE_DEC,
2896 VALS(scsi_osd_sort_order_vals), 0x0f, "", HFILL}},
2897 { &hf_scsi_osd_partition_id,
2898 {"Partition Id", "scsi.osd.partition_id", FT_UINT64, BASE_HEX,
2899 NULL, 0, "", HFILL}},
2900 { &hf_scsi_osd_list_identifier,
2901 {"List Identifier", "scsi.osd.list_identifier", FT_UINT32, BASE_DEC,
2902 NULL, 0, "", HFILL}},
2903 { &hf_scsi_osd_allocation_length,
2904 {"Allocation Length", "scsi.osd.allocation_length", FT_UINT64, BASE_DEC,
2905 NULL, 0, "", HFILL}},
2906 { &hf_scsi_osd_length,
2907 {"Length", "scsi.osd.length", FT_UINT64, BASE_DEC,
2908 NULL, 0, "", HFILL}},
2909 { &hf_scsi_osd_starting_byte_address,
2910 {"Starting Byte Address", "scsi.osd.starting_byte_address", FT_UINT64, BASE_DEC,
2911 NULL, 0, "", HFILL}},
2912 { &hf_scsi_osd_initial_object_id,
2913 {"Initial Object Id", "scsi.osd.initial_object_id", FT_BYTES, BASE_HEX,
2914 NULL, 0, "", HFILL}},
2915 { &hf_scsi_osd_additional_length,
2916 {"Additional Length", "scsi.osd.additional_length", FT_UINT64, BASE_DEC,
2917 NULL, 0, "", HFILL}},
2918 { &hf_scsi_osd_continuation_object_id,
2919 {"Continuation Object Id", "scsi.osd.continuation_object_id", FT_BYTES, BASE_HEX,
2920 NULL, 0, "", HFILL}},
2921 { &hf_scsi_osd_user_object_id,
2922 {"User Object Id", "scsi.osd.user_object_id", FT_BYTES, BASE_HEX,
2923 NULL, 0, "", HFILL}},
2924 { &hf_scsi_osd_list_flags_lstchg,
2925 {"LSTCHG", "scsi.osd.list.lstchg", FT_BOOLEAN, 8,
2926 TFS(&list_lstchg_tfs), 0x02, "", HFILL}},
2927 { &hf_scsi_osd_list_flags_root,
2928 {"ROOT", "scsi.osd.list.root", FT_BOOLEAN, 8,
2929 TFS(&list_root_tfs), 0x01, "", HFILL}},
2930 { &hf_scsi_osd_requested_user_object_id,
2931 {"Requested User Object Id", "scsi.osd.requested_user_object_id", FT_BYTES, BASE_HEX,
2932 NULL, 0, "", HFILL}},
2933 { &hf_scsi_osd_number_of_user_objects,
2934 {"Number Of User Objects", "scsi.osd.number_of_user_objects", FT_UINT16, BASE_DEC,
2935 NULL, 0, "", HFILL}},
2936 { &hf_scsi_osd_key_to_set,
2937 {"Key to Set", "scsi.osd.key_to_set", FT_UINT8, BASE_DEC,
2938 VALS(key_to_set_vals), 0x03, "", HFILL}},
2939 { &hf_scsi_osd_set_key_version,
2940 {"Key Version", "scsi.osd.set_key_version", FT_UINT8, BASE_DEC,
2941 NULL, 0x0f, "", HFILL}},
2942 { &hf_scsi_osd_key_identifier,
2943 {"Key Identifier", "scsi.osd.key_identifier", FT_BYTES, BASE_HEX,
2944 NULL, 0, "", HFILL}},
2945 { &hf_scsi_osd_seed,
2946 {"Seed", "scsi.osd.seed", FT_BYTES, BASE_HEX,
2947 NULL, 0, "", HFILL}},
2948 { &hf_scsi_osd_collection_fcr,
2949 {"FCR", "scsi.osd.collection.fcr", FT_BOOLEAN, 8,
2950 TFS(&collection_fcr_tfs), 0x01, "", HFILL}},
2951 { &hf_scsi_osd_collection_object_id,
2952 {"Collection Object Id", "scsi.osd.collection_object_id", FT_BYTES, BASE_HEX,
2953 NULL, 0, "", HFILL}},
2954 { &hf_scsi_osd_requested_collection_object_id,
2955 {"Requested Collection Object Id", "scsi.osd.requested_collection_object_id", FT_BYTES, BASE_HEX,
2956 NULL, 0, "", HFILL}},
2957 { &hf_scsi_osd_partition_created_in,
2958 { "Created In", "scsi.osd.partition.created_in", FT_FRAMENUM, BASE_NONE,
2959 NULL, 0x0, "The frame this partition was created", HFILL }},
2961 { &hf_scsi_osd_partition_removed_in,
2962 { "Removed In", "scsi.osd.partition.removed_in", FT_FRAMENUM, BASE_NONE,
2963 NULL, 0x0, "The frame this partition was removed", HFILL }},
2965 { &hf_scsi_osd_flush_scope,
2966 {"Flush Scope", "scsi.osd.flush.scope", FT_UINT8, BASE_DEC,
2967 VALS(flush_scope_vals), 0x03, "", HFILL}},
2969 { &hf_scsi_osd_flush_collection_scope,
2970 {"Flush Collection Scope", "scsi.osd.flush_collection.scope", FT_UINT8, BASE_DEC,
2971 VALS(flush_collection_scope_vals), 0x03, "", HFILL}},
2973 { &hf_scsi_osd_flush_partition_scope,
2974 {"Flush Partition Scope", "scsi.osd.flush_partition.scope", FT_UINT8, BASE_DEC,
2975 VALS(flush_partition_scope_vals), 0x03, "", HFILL}},
2977 { &hf_scsi_osd_flush_osd_scope,
2978 {"Flush OSD Scope", "scsi.osd.flush_osd.scope", FT_UINT8, BASE_DEC,
2979 VALS(flush_osd_scope_vals), 0x03, "", HFILL}},
2982 /* Setup protocol subtree array */
2983 static gint *ett[] = {
2986 &ett_osd_attribute_parameters,
2987 &ett_osd_capability,
2988 &ett_osd_permission_bitmask,
2989 &ett_osd_security_parameters,
2992 /* Register the protocol name and description */
2993 proto_scsi_osd = proto_register_protocol("SCSI_OSD", "SCSI_OSD", "scsi_osd");
2995 /* Required function calls to register the header fields and subtrees used */
2996 proto_register_field_array(proto_scsi_osd, hf, array_length(hf));
2997 proto_register_subtree_array(ett, array_length(ett));
3001 proto_reg_handoff_scsi_osd(void)