summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-03-14 04:56:40 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-03-14 04:56:40 +0000
commit877d757062a2ad61aa59d2c89adfb7598b3680a6 (patch)
treecbf0b8ea95d1505eb63363d525469f7e6caae794
parentdd99a2583740e5a5bd3bf5d4b472a1d323bf8538 (diff)
downloadwireshark-877d757062a2ad61aa59d2c89adfb7598b3680a6.tar.gz
put the opcode as a generated field inside data pdus for scsi
svn path=/trunk/; revision=17619
-rw-r--r--epan/dissectors/packet-scsi.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c
index 68205e15c3..b322dcafc7 100644
--- a/epan/dissectors/packet-scsi.c
+++ b/epan/dissectors/packet-scsi.c
@@ -5898,7 +5898,7 @@ dissect_smc2_readelementstatus (tvbuff_t *tvb, packet_info *pinfo,
}
void
-dissect_scsi_rsp (tvbuff_t *tvb, packet_info *pinfo _U_,
+dissect_scsi_rsp (tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, guint16 lun, guint8 scsi_status)
{
proto_item *ti;
@@ -7472,9 +7472,46 @@ dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
scsi_tree = proto_item_add_subtree (ti, ett_scsi);
}
- if(tree){
- ti=proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, lun);
- PROTO_ITEM_SET_GENERATED(ti);
+ ti=proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, lun);
+ PROTO_ITEM_SET_GENERATED(ti);
+
+ switch(cdata->cmd){
+ case SCSI_DEV_SBC:
+ ti=proto_tree_add_uint_format (scsi_tree, hf_scsi_sbcopcode, tvb,
+ offset, 0, opcode,
+ "Opcode: %s (0x%02x)",
+ val_to_str (opcode, cdata->cdb_vals,
+ "0x%02x"),
+ opcode);
+ PROTO_ITEM_SET_GENERATED(ti);
+ break;
+ case SCSI_DEV_CDROM:
+ ti=proto_tree_add_uint_format (scsi_tree, hf_scsi_mmcopcode, tvb,
+ offset, 0, opcode,
+ "Opcode: %s (0x%02x)",
+ val_to_str (opcode, cdata->cdb_vals,
+ "0x%02x"),
+ opcode);
+ PROTO_ITEM_SET_GENERATED(ti);
+ break;
+ case SCSI_DEV_SSC:
+ ti=proto_tree_add_uint_format (scsi_tree, hf_scsi_sscopcode, tvb,
+ offset, 0, opcode,
+ "Opcode: %s (0x%02x)",
+ val_to_str (opcode, cdata->cdb_vals,
+ "0x%02x"),
+ opcode);
+ PROTO_ITEM_SET_GENERATED(ti);
+ break;
+ case SCSI_DEV_SMC:
+ ti=proto_tree_add_uint_format (scsi_tree, hf_scsi_smcopcode, tvb,
+ offset, 0, opcode,
+ "Opcode: %s (0x%02x)",
+ val_to_str (opcode, cdata->cdb_vals,
+ "0x%02x"),
+ opcode);
+ PROTO_ITEM_SET_GENERATED(ti);
+ break;
}
if (tree == NULL) {