diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-03-12 11:30:45 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-03-12 11:30:45 +0000 |
commit | 1206c771dceeaff1288f1972095383210e24a1ef (patch) | |
tree | 5e856f6fdb973d0fe80f20945c954ab3d9e56e09 /packet-scsi.c | |
parent | 89337f9f35e54289866e664206dfac4618940497 (diff) |
From Dinesh Dutt: initial dissection of a variable-length CDB.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4932 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-scsi.c')
-rw-r--r-- | packet-scsi.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/packet-scsi.c b/packet-scsi.c index 152668d131..ff4b6d5094 100644 --- a/packet-scsi.c +++ b/packet-scsi.c @@ -2,7 +2,7 @@ * Routines for decoding SCSI CDBs and responses * Author: Dinesh G Dutt (ddutt@cisco.com) * - * $Id: packet-scsi.c,v 1.5 2002/02/13 01:17:58 guy Exp $ + * $Id: packet-scsi.c,v 1.6 2002/03/12 11:30:45 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -156,6 +156,8 @@ static int hf_scsi_inq_normaca = -1; static int hf_scsi_persresv_key = -1; static int hf_scsi_persresv_scopeaddr = -1; static int hf_scsi_sscopcode = -1; +static int hf_scsi_add_cdblen = -1; +static int hf_scsi_svcaction = -1; static gint ett_scsi = -1; @@ -196,6 +198,7 @@ typedef guint32 scsi_device_type; #define SCSI_SPC2_SETDEVICEID 0xA4 #define SCSI_SPC2_TESTUNITRDY 0x00 #define SCSI_SPC2_WRITEBUFFER 0x3B +#define SCSI_SPC2_VARLENCDB 0x7F static const value_string scsi_spc2_val[] = { {SCSI_SPC2_EXTCOPY , "Extended Copy"}, @@ -221,6 +224,7 @@ static const value_string scsi_spc2_val[] = { {SCSI_SPC2_RESERVE10 , "Reserve (10)"}, {SCSI_SPC2_TESTUNITRDY , "Test Unit Ready"}, {SCSI_SPC2_WRITEBUFFER , "Write Buffer"}, + {SCSI_SPC2_VARLENCDB , "Variable Length CDB"}, {0, NULL}, }; @@ -2620,6 +2624,22 @@ dissect_scsi_reassignblks (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } +static void +dissect_scsi_varlencdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, + guint offset, gboolean isreq, gboolean iscdb) +{ + guint8 flags; + + if (!tree) + return; + + if (isreq && iscdb) { + proto_tree_add_item (tree, hf_scsi_control, tvb, offset, 1, 0); + proto_tree_add_item (tree, hf_scsi_add_cdblen, tvb, offset+6, 1, 0); + proto_tree_add_item (tree, hf_scsi_svcaction, tvb, offset+7, 2, 0); + } +} + void dissect_scsi_rsp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -2866,6 +2886,11 @@ dissect_scsi_cdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, TRUE, TRUE); break; + case SCSI_SPC2_VARLENCDB: + dissect_scsi_varlencdb (tvb, pinfo, scsi_tree, offset+1, + TRUE, TRUE); + break; + default: call_dissector (data_handle, tvb, pinfo, scsi_tree); break; @@ -3385,6 +3410,12 @@ proto_register_scsi (void) { &hf_scsi_persresv_scopeaddr, {"Scope Address", "scsi.spc2.resv.scopeaddr", FT_BYTES, BASE_HEX, NULL, 0x0, "", HFILL}}, + { &hf_scsi_add_cdblen, + {"Additional CDB Length", "scsi.spc2.addcdblen", FT_UINT8, BASE_DEC, + NULL, 0x0, "", HFILL}}, + { &hf_scsi_svcaction, + {"Service Action", "scsi.spc2.svcaction", FT_UINT16, BASE_HEX, NULL, + 0x0, "", HFILL}}, }; /* Setup protocol subtree array */ |