aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-scsi-ssc.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-02-10 21:48:12 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2007-02-10 21:48:12 +0000
commit7fa46e0aaf2ef3532722d680f887bcab4e411bf7 (patch)
tree440617bec6c619f20941c2fea4680fb2af170149 /epan/dissectors/packet-scsi-ssc.c
parent991ec50ba5e18376d3bba80d5c87812a92374644 (diff)
add dissection of REPORTDENSITYSUPPORT cdb
svn path=/trunk/; revision=20774
Diffstat (limited to 'epan/dissectors/packet-scsi-ssc.c')
-rw-r--r--epan/dissectors/packet-scsi-ssc.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/epan/dissectors/packet-scsi-ssc.c b/epan/dissectors/packet-scsi-ssc.c
index 09dfbff822..7a41b660c0 100644
--- a/epan/dissectors/packet-scsi-ssc.c
+++ b/epan/dissectors/packet-scsi-ssc.c
@@ -1,4 +1,8 @@
/* based on SSC3 spec */
+/* TODO:
+ * dissect READPOSITION data
+ * dissect REPORTDENSITYSUPPORT data
+ */
/* packet-scsi-ssc.c
* Dissector for the SCSI SSC commandset
* Extracted from packet-scsi.c
@@ -84,6 +88,8 @@ static int hf_scsi_ssc_fixed = -1;
static int hf_scsi_ssc_bytord = -1;
static int hf_scsi_ssc_bytcmp = -1;
static int hf_scsi_ssc_verify16_immed = -1;
+static int hf_scsi_ssc_medium_type = -1;
+static int hf_scsi_ssc_media = -1;
static gint ett_scsi_erase = -1;
static gint ett_scsi_formatmedium = -1;
@@ -155,6 +161,41 @@ dissect_ssc_recoverbuffereddata (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
}
static void
+dissect_ssc_reportdensitysupport (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
+ guint offset, gboolean isreq, gboolean iscdb,
+ guint payload_len _U_, scsi_task_data_t *cdata _U_)
+{
+ guint8 flags;
+ static const int *rd_fields[] = {
+ &hf_scsi_ssc_medium_type,
+ &hf_scsi_ssc_media,
+ NULL
+ };
+
+ if (isreq) {
+ if (check_col (pinfo->cinfo, COL_INFO))
+ col_append_fstr (pinfo->cinfo, COL_INFO, "(Len: %u)",
+ tvb_get_ntoh24 (tvb, offset+1));
+ }
+
+ if(!tree)
+ return;
+
+ if (isreq && iscdb) {
+ proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_ssc_read6_flags, ett_scsi_read6, rd_fields, FALSE);
+
+ proto_tree_add_item (tree, hf_scsi_ssc_rdwr6_xferlen, tvb, offset+6, 2, 0);
+ flags = tvb_get_guint8 (tvb, offset+8);
+ proto_tree_add_uint_format (tree, hf_scsi_control, tvb, offset+8, 1,
+ flags,
+ "Vendor Unique = %u, NACA = %u, Link = %u",
+ flags & 0xC0, flags & 0x4, flags & 0x1);
+ } else {
+ /* XXX decode the data */
+ }
+}
+
+static void
dissect_ssc_readreverse6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
@@ -1091,7 +1132,7 @@ scsi_cdb_table_t scsi_ssc_table[256] = {
/*SSC 0x41*/{NULL},
/*SSC 0x42*/{NULL},
/*SSC 0x43*/{NULL},
-/*SSC 0x44*/{NULL},
+/*SSC 0x44*/{dissect_ssc_reportdensitysupport},
/*SSC 0x45*/{NULL},
/*SSC 0x46*/{NULL},
/*SSC 0x47*/{NULL},
@@ -1402,6 +1443,12 @@ proto_register_scsi_ssc(void)
{ &hf_scsi_ssc_verify16_immed,
{"IMMED", "scsi.ssc.verify16_immed", FT_BOOLEAN, 8,
NULL, 0x04, "", HFILL}},
+ { &hf_scsi_ssc_medium_type,
+ {"Medium Type", "scsi.ssc.medium_type", FT_BOOLEAN, 8,
+ NULL, 0x02, "", HFILL}},
+ { &hf_scsi_ssc_media,
+ {"Media", "scsi.ssc.media", FT_BOOLEAN, 8,
+ NULL, 0x01, "", HFILL}},
};