pass lun (and status) to scsi subdissector so we can filter
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 17 Feb 2005 12:07:45 +0000 (12:07 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 17 Feb 2005 12:07:45 +0000 (12:07 +0000)
on scsi.lun   and prettify the summary line a bit.

ndmp still needs some work to track luns between commands
and fcp needs verification it works for volumesetaddressing.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13420 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-fcp.c
epan/dissectors/packet-iscsi.c
epan/dissectors/packet-ndmp.c
epan/dissectors/packet-scsi.c
epan/dissectors/packet-scsi.h

index 41f16147217f2630abe30268aff8c72ecb7f41ed..bf579c3c2c31ae8cbcbeed2d059f2728cf63fcef 100644 (file)
@@ -245,6 +245,7 @@ dissect_fcp_cmnd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     fcp_conv_data_t *cdata;
     fcp_conv_key_t ckey, *req_key;
     scsi_task_id_t task_key;
+    guint16 lun=0xffff;
 
     /* Determine the length of the FCP part of the packet */
     flags = tvb_get_guint8 (tvb, offset+10);
@@ -299,47 +300,53 @@ dissect_fcp_cmnd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         g_hash_table_insert (fcp_req_hash, req_key, cdata);
     }
     
+    /* XXX this one is redundant  right?  ronnie
     dissect_scsi_cdb (tvb, pinfo, fcp_tree, offset+12, 16+add_len,
-                      SCSI_DEV_UNKNOWN);
+                      SCSI_DEV_UNKNOWN, lun);
+    */
 
     if (tree) {
         ti = proto_tree_add_protocol_format (tree, proto_fcp, tvb, 0, len,
                                              "FCP_CMND");
         fcp_tree = proto_item_add_subtree (ti, ett_fcp);
-        proto_tree_add_uint_hidden (fcp_tree, hf_fcp_type, tvb, offset, 0, 0);
-                                    
-        lun0 = tvb_get_guint8 (tvb, offset);
-
-        /* Display single-level LUNs in decimal for clarity */
-        /* I'm taking a shortcut here by assuming that if the first byte of the
-         * LUN field is 0, it is a single-level LUN. This is not true. For a
-         * real single-level LUN, all 8 bytes except byte 1 must be 0.
-         */
-        if (lun0) {
-            cdata->fcp_lun = -1;
-            proto_tree_add_item (fcp_tree, hf_fcp_multilun, tvb, offset, 8, 0);
-        }
-        else {
-            cdata->fcp_lun = tvb_get_guint8 (tvb, offset+1);
-            proto_tree_add_item (fcp_tree, hf_fcp_singlelun, tvb, offset+1,
-                                 1, 0);
-        }
-
-        proto_tree_add_item (fcp_tree, hf_fcp_crn, tvb, offset+8, 1, 0);
-        proto_tree_add_item (fcp_tree, hf_fcp_taskattr, tvb, offset+9, 1, 0);
-        proto_tree_add_uint_format (fcp_tree, hf_fcp_taskmgmt, tvb, offset+10,
-                                    1, flags,
-                                    "Task Management Flags: 0x%x (%s)",
-                                    flags,
-                                    task_mgmt_flags_to_str (flags, str));
-        proto_tree_add_item (fcp_tree, hf_fcp_addlcdblen, tvb, offset+11, 1, 0);
-        proto_tree_add_item (fcp_tree, hf_fcp_rddata, tvb, offset+11, 1, 0);
-        proto_tree_add_item (fcp_tree, hf_fcp_wrdata, tvb, offset+11, 1, 0);
-        dissect_scsi_cdb (tvb, pinfo, tree, offset+12, 16+add_len,
-                          SCSI_DEV_UNKNOWN);
-        proto_tree_add_item (fcp_tree, hf_fcp_dl, tvb, offset+12+16+add_len,
-                             4, 0);
+    }    
+    proto_tree_add_uint_hidden (fcp_tree, hf_fcp_type, tvb, offset, 0, 0);
+    
+    lun0 = tvb_get_guint8 (tvb, offset);
+    
+    /* Display single-level LUNs in decimal for clarity */
+    /* I'm taking a shortcut here by assuming that if the first byte of the
+     * LUN field is 0, it is a single-level LUN. This is not true. For a
+     * real single-level LUN, all 8 bytes except byte 1 must be 0.
+     */
+    if (lun0) {
+      cdata->fcp_lun = -1;
+      proto_tree_add_item (fcp_tree, hf_fcp_multilun, tvb, offset, 8, 0);
+      lun=tvb_get_guint8(tvb, offset)&0x3f;
+      lun<<=8;
+      lun|=tvb_get_guint8(tvb, offset+1);
     }
+    else {
+      cdata->fcp_lun = tvb_get_guint8 (tvb, offset+1);
+      proto_tree_add_item (fcp_tree, hf_fcp_singlelun, tvb, offset+1,
+                          1, 0);
+      lun=tvb_get_guint8(tvb, offset+1);
+    }
+
+    proto_tree_add_item (fcp_tree, hf_fcp_crn, tvb, offset+8, 1, 0);
+    proto_tree_add_item (fcp_tree, hf_fcp_taskattr, tvb, offset+9, 1, 0);
+    proto_tree_add_uint_format (fcp_tree, hf_fcp_taskmgmt, tvb, offset+10,
+                               1, flags,
+                               "Task Management Flags: 0x%x (%s)",
+                               flags,
+                               task_mgmt_flags_to_str (flags, str));
+    proto_tree_add_item (fcp_tree, hf_fcp_addlcdblen, tvb, offset+11, 1, 0);
+    proto_tree_add_item (fcp_tree, hf_fcp_rddata, tvb, offset+11, 1, 0);
+    proto_tree_add_item (fcp_tree, hf_fcp_wrdata, tvb, offset+11, 1, 0);
+    dissect_scsi_cdb (tvb, pinfo, tree, offset+12, 16+add_len,
+                     SCSI_DEV_UNKNOWN, lun);
+    proto_tree_add_item (fcp_tree, hf_fcp_dl, tvb, offset+12+16+add_len,
+                        4, 0);
 }
 
 static void
@@ -377,10 +384,10 @@ dissect_fcp_data (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             proto_tree_add_uint_hidden (fcp_tree, hf_fcp_singlelun, tvb,
                                         0, 0, cdata->fcp_lun);
 
-        dissect_scsi_payload (tvb, pinfo, tree, 0, FALSE, cdata->fcp_dl);
+        dissect_scsi_payload (tvb, pinfo, tree, 0, FALSE, cdata->fcp_dl, cdata->fcp_lun);
     }
     else {
-        dissect_scsi_payload (tvb, pinfo, tree, 0, FALSE, 0);
+        dissect_scsi_payload (tvb, pinfo, tree, 0, FALSE, 0, 0xffff);
     }
 }
 
@@ -472,7 +479,8 @@ dissect_fcp_rsp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         }
         if (flags & 0x2) {
             dissect_scsi_snsinfo (tvb, pinfo, tree, offset+24+rsplen,
-                                  tvb_get_ntohl (tvb, offset+16));
+                                  tvb_get_ntohl (tvb, offset+16), 
+                                 cdata?cdata->fcp_lun:0xffff);
         }
         if (cdata) {
             g_mem_chunk_free (fcp_req_vals, cdata);
index 0a5b47214c1344ebd2bb44ad2737de328e31dc13..89ecc353ab1967a077f1e0b707afd8aba7c2fed0 100644 (file)
@@ -859,6 +859,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
     iscsi_conv_data_t *cdata = NULL;
     scsi_task_id_t task_key;
     int paddedDataSegmentLength = data_segment_len;
+    guint16 lun=0xffff;
+
     if(paddedDataSegmentLength & 3)
        paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
 
@@ -1067,6 +1069,22 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
                proto_tree_add_boolean(ti, hf_iscsi_I, tvb, offset + 0, 1, b);
     }
 
+    /* we need the LUN value for some of the commands so we can pass it
+       across to the SCSI dissector.
+       Not correct but simple  and probably accurate enough :
+       If bit 6 of first bit is 0   then just take second byte as the LUN
+       If bit 6 of first bit is 1, then take 6 bits from first byte
+           and all of second byte and pretend it is the lun value
+          people that care can add host specific dissection of vsa later.
+    */
+    if(tvb_get_guint8(tvb, offset+8)&0x40){
+      /* volume set addressing */
+      lun=tvb_get_guint8(tvb,offset+8)&0x3f;
+      lun<<=8;
+      lun|=tvb_get_guint8(tvb,offset+9);
+    } else {
+      lun=tvb_get_guint8(tvb,offset+9);
+    }
 
     if(opcode == ISCSI_OPCODE_NOP_OUT) {
            /* NOP Out */
@@ -1653,7 +1671,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
                  ~(X_BIT | I_BIT) :
                  ~I_BIT)) == ISCSI_OPCODE_SCSI_COMMAND) {
         /* SCSI Command */
-        dissect_scsi_cdb (tvb, pinfo, tree, cdb_offset, 16, SCSI_DEV_UNKNOWN);
+        dissect_scsi_cdb (tvb, pinfo, tree, cdb_offset, 16, SCSI_DEV_UNKNOWN, lun);
     }
     else if (opcode == ISCSI_OPCODE_SCSI_RESPONSE) {
         if (scsi_status == 0x2) {
@@ -1667,18 +1685,21 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
                if(senseLen > 0)
                    dissect_scsi_snsinfo (tvb, pinfo, tree, offset,
                                          iscsi_min (senseLen,
-                                                    end_offset-offset));
+                                                    end_offset-offset),
+                                         lun);
            }
         }
         else {
-            dissect_scsi_rsp (tvb, pinfo, tree);
+            dissect_scsi_rsp (tvb, pinfo, tree, lun, scsi_status);
         }
     }
     else if ((opcode == ISCSI_OPCODE_SCSI_DATA_IN) ||
              (opcode == ISCSI_OPCODE_SCSI_DATA_OUT)) {
         /* offset is setup correctly by the iscsi code for response above */
-        dissect_scsi_payload (tvb, pinfo, tree, offset, FALSE,
-                              iscsi_min (data_segment_len, end_offset-offset));
+        dissect_scsi_payload (tvb, pinfo, tree, offset, 
+                             (opcode==ISCSI_OPCODE_SCSI_DATA_OUT),
+                              iscsi_min (data_segment_len, end_offset-offset),
+                             lun);
     }
 }
 
index 002178d56bb5341dd650b4fcfbd16158f2193e41..81ef863461ecf6127f6d16417d430e8d69cb0d04 100644 (file)
@@ -1,3 +1,6 @@
+/* TODO: fixup LUN tracking so we can pass the proper LUN across to
+   dissect_scsi_xxx()
+*/
 /* packet-ndmp.c
  * Routines for NDMP dissection
  * 2001 Ronnie Sahlberg (see AUTHORS for email)
@@ -1099,7 +1102,7 @@ dissect_execute_cdb_cdb(tvbuff_t *tvb, int offset, packet_info *pinfo,
        offset += 4;
 
        if (cdb_len != 0) {
-               dissect_scsi_cdb(tvb, pinfo, tree, offset, cdb_len, devtype);
+               dissect_scsi_cdb(tvb, pinfo, tree, offset, cdb_len, devtype, 0xffff);
                offset += cdb_len_full;
        }
 
@@ -1131,7 +1134,7 @@ dissect_execute_cdb_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, proto
 
        if (payload_len != 0) {
                dissect_scsi_payload(tvb, pinfo, tree, offset, isreq,
-                   payload_len);
+                   payload_len, 0xffff);
                offset += payload_len_full;
        }
 
@@ -1235,7 +1238,7 @@ dissect_execute_cdb_sns(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre
        offset += 4;
 
        if (sns_len != 0) {
-               dissect_scsi_snsinfo(tvb, pinfo, tree, offset, sns_len);
+               dissect_scsi_snsinfo(tvb, pinfo, tree, offset, sns_len, 0xffff);
                offset += sns_len_full;
        }
 
index 87a67a730ba1d882077b59967994b08ac50c111a..d214cce9e976c941aa993f78ae1d1bee1a9e6fd7 100644 (file)
  * There are four main routines that are provided:
  * o dissect_scsi_cdb - invoked on receiving a SCSI Command
  *   void dissect_scsi_cdb (tvbuff_t *, packet_info *, proto_tree *, guint,
- *   guint);
+ *   guint, guint16);
  * o dissect_scsi_payload - invoked to decode SCSI responses
  *   void dissect_scsi_payload (tvbuff_t *, packet_info *, proto_tree *, guint,
- *                              gboolean, guint32);
+ *                              gboolean, guint32, guint16);
  *   The final parameter is the length of the response field that is negotiated
  *   as part of the SCSI transport layer. If this is not tracked by the
  *   transport, it can be set to 0.
  * o dissect_scsi_rsp - invoked to destroy the data structures associated with a
  *                      SCSI task.
- *   void dissect_scsi_rsp (tvbuff_t *, packet_info *, proto_tree *);
+ *   void dissect_scsi_rsp (tvbuff_t *, packet_info *, proto_tree *, guint16, 
+ *                          guint8);
  * o dissect_scsi_snsinfo - invoked to decode the sense data provided in case of
  *                          an error.
  *   void dissect_scsi_snsinfo (tvbuff_t *, packet_info *, proto_tree *, guint,
- *   guint);
+ *   guint, guint16);
  *
  * In addition to this, the other requirement made from the transport is to
  * provide a unique way to determine a SCSI task. In Fibre Channel networks,
@@ -87,6 +88,8 @@
 #include "packet-scsi.h"
 
 static int proto_scsi                    = -1;
+static int hf_scsi_lun                   = -1;
+static int hf_scsi_status                = -1;
 static int hf_scsi_spcopcode             = -1;
 static int hf_scsi_sbcopcode             = -1;
 static int hf_scsi_sscopcode             = -1;
@@ -4250,23 +4253,38 @@ dissect_scsi_smc2_readelementstatus (tvbuff_t *tvb, packet_info *pinfo,
 }
 
 void
-dissect_scsi_rsp (tvbuff_t *tvb _U_, packet_info *pinfo _U_,
-                  proto_tree *tree _U_)
+dissect_scsi_rsp (tvbuff_t *tvb, packet_info *pinfo _U_,
+                  proto_tree *tree, guint16 lun, guint8 scsi_status)
 {
-    /* Nothing to do here, just blow up the data structures for this SCSI
-     * transaction
-    if (tree)
-        scsi_end_task (pinfo);
+    proto_item *ti;
+    proto_tree *scsi_tree = NULL;
+
+    /* Nothing really to do here, just print some stuff passed to us
+     * and blow up the data structures for this SCSI task.
      */
+    if (tree) {
+        ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, 0,
+                                             0, "SCSI Response");
+        scsi_tree = proto_item_add_subtree (ti, ett_scsi);
+
+       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_status, tvb, 0, 0, scsi_status);
+       PROTO_ITEM_SET_GENERATED(ti);
+    }
+    if (check_col (pinfo->cinfo, COL_INFO)) {
+         col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI: Response LUN:0x%02x (%s)", lun, val_to_str(scsi_status, scsi_status_val, "Unknown (0x%08x)"));
+     }
+
 }
 
 void
 dissect_scsi_snsinfo (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                      guint offset, guint snslen)
+                      guint offset, guint snslen, guint16 lun)
 {
     guint8 flags;
     proto_item *ti;
-    proto_tree *sns_tree;
+    proto_tree *sns_tree=NULL;
 
     scsi_end_task (pinfo);
 
@@ -4274,37 +4292,45 @@ dissect_scsi_snsinfo (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
         ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
                                              snslen, "SCSI: SNS Info");
         sns_tree = proto_item_add_subtree (ti, ett_scsi);
+    }
 
-        flags = tvb_get_guint8 (tvb, offset);
-        proto_tree_add_text (sns_tree, tvb, offset, 1, "Valid: %u",
-                             (flags & 0x80) >> 7);
-        proto_tree_add_item (sns_tree, hf_scsi_sns_errtype, tvb, offset, 1, 0);
-        flags = tvb_get_guint8 (tvb, offset+2);
-        proto_tree_add_text (sns_tree, tvb, offset+2, 1,
+
+    ti=proto_tree_add_uint(sns_tree, hf_scsi_lun, tvb, 0, 0, lun);
+    PROTO_ITEM_SET_GENERATED(ti);
+    if (check_col (pinfo->cinfo, COL_INFO)) {
+         col_append_fstr (pinfo->cinfo, COL_INFO, " LUN:0x%02x ", lun);
+    }
+
+
+    flags = tvb_get_guint8 (tvb, offset);
+    proto_tree_add_text (sns_tree, tvb, offset, 1, "Valid: %u",
+                         (flags & 0x80) >> 7);
+    proto_tree_add_item (sns_tree, hf_scsi_sns_errtype, tvb, offset, 1, 0);
+    flags = tvb_get_guint8 (tvb, offset+2);
+    proto_tree_add_text (sns_tree, tvb, offset+2, 1,
                              "Filemark: %u, EOM: %u, ILI: %u",
                              (flags & 0x80) >> 7, (flags & 0x40) >> 6,
                              (flags & 0x20) >> 5);
-        proto_tree_add_item (sns_tree, hf_scsi_snskey, tvb, offset+2, 1, 0);
-        proto_tree_add_item (sns_tree, hf_scsi_snsinfo, tvb, offset+3, 4, 0);
-        proto_tree_add_item (sns_tree, hf_scsi_addlsnslen, tvb, offset+7, 1, 0);
-        proto_tree_add_text (sns_tree, tvb, offset+8, 4,
+    proto_tree_add_item (sns_tree, hf_scsi_snskey, tvb, offset+2, 1, 0);
+    proto_tree_add_item (sns_tree, hf_scsi_snsinfo, tvb, offset+3, 4, 0);
+    proto_tree_add_item (sns_tree, hf_scsi_addlsnslen, tvb, offset+7, 1, 0);
+    proto_tree_add_text (sns_tree, tvb, offset+8, 4,
                              "Command-Specific Information: %s",
                              tvb_bytes_to_str (tvb, offset+8, 4));
-        proto_tree_add_item (sns_tree, hf_scsi_ascascq, tvb, offset+12, 2, 0);
-        proto_tree_add_item_hidden (sns_tree, hf_scsi_asc, tvb, offset+12, 1, 0);
-        proto_tree_add_item_hidden (sns_tree, hf_scsi_ascq, tvb, offset+13,
+    proto_tree_add_item (sns_tree, hf_scsi_ascascq, tvb, offset+12, 2, 0);
+    proto_tree_add_item_hidden (sns_tree, hf_scsi_asc, tvb, offset+12, 1, 0);
+    proto_tree_add_item_hidden (sns_tree, hf_scsi_ascq, tvb, offset+13,
                                     1, 0);
-        proto_tree_add_item (sns_tree, hf_scsi_fru, tvb, offset+14, 1, 0);
-        proto_tree_add_item (sns_tree, hf_scsi_sksv, tvb, offset+15, 1, 0);
-        proto_tree_add_text (sns_tree, tvb, offset+15, 3,
+    proto_tree_add_item (sns_tree, hf_scsi_fru, tvb, offset+14, 1, 0);
+    proto_tree_add_item (sns_tree, hf_scsi_sksv, tvb, offset+15, 1, 0);
+    proto_tree_add_text (sns_tree, tvb, offset+15, 3,
                              "Sense Key Specific: %s",
                              tvb_bytes_to_str (tvb, offset+15, 3));
-    }
 }
 
 void
 dissect_scsi_cdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                  guint start, guint cdblen, gint devtype_arg)
+                  guint start, guint cdblen, gint devtype_arg, guint16 lun)
 {
     int offset = start;
     proto_item *ti;
@@ -4380,12 +4406,12 @@ dissect_scsi_cdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
     if (valstr != NULL) {
         if (check_col (pinfo->cinfo, COL_INFO)) {
-            col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI: %s", valstr);
+            col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI: %s LUN:0x%02x ", valstr, lun);
         }
     }
     else {
         if (check_col (pinfo->cinfo, COL_INFO)) {
-            col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI Command: 0x%02x", opcode);
+            col_add_fstr (pinfo->cinfo, COL_INFO, "SCSI Command: 0x%02x LUN:0x%02x ", opcode, lun);
         }
     }
 
@@ -4402,6 +4428,10 @@ dissect_scsi_cdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                              cdblen, "SCSI CDB");
         scsi_tree = proto_item_add_subtree (ti, ett_scsi);
 
+       ti=proto_tree_add_uint(scsi_tree, hf_scsi_lun, tvb, 0, 0, lun);
+       PROTO_ITEM_SET_GENERATED(ti);
+       
+
         if (valstr != NULL) {
             if (cmd == SCSI_CMND_SPC2) {
                 proto_tree_add_uint_format (scsi_tree, hf_scsi_spcopcode, tvb,
@@ -4707,7 +4737,8 @@ dissect_scsi_cdb (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
 void
 dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-                      guint offset, gboolean isreq, guint32 payload_len)
+                      guint offset, gboolean isreq, guint32 payload_len,
+                     guint16 lun)
 {
     proto_item *ti;
     proto_tree *scsi_tree = NULL;
@@ -4739,6 +4770,14 @@ dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                                              scsi_spc2_val,
                                                              "0x%02x"),
                                                  isreq ? "Request" : "Response");
+           if (check_col (pinfo->cinfo, COL_INFO)) {
+             col_add_fstr (pinfo->cinfo, COL_INFO, 
+                           "SCSI: Data %s LUN:0x%02x (%s %s) ", 
+                           isreq ? "Out" : "In", 
+                           lun, 
+                           val_to_str (opcode, scsi_spc2_val, "0x%02x"),
+                           isreq ? "Request" : "Response");
+           }
             break;
 
         case SCSI_CMND_SBC2:
@@ -4749,6 +4788,14 @@ dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                                              scsi_sbc2_val,
                                                              "0x%02x"),
                                                  isreq ? "Request" : "Response");
+           if (check_col (pinfo->cinfo, COL_INFO)) {
+             col_add_fstr (pinfo->cinfo, COL_INFO, 
+                           "SCSI: Data %s LUN:0x%02x (%s %s) ", 
+                           isreq ? "Out" : "In", 
+                           lun, 
+                           val_to_str (opcode, scsi_sbc2_val, "0x%02x"),
+                           isreq ? "Request" : "Response");
+           }
             break;
 
         case SCSI_CMND_SSC2:
@@ -4759,6 +4806,14 @@ dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                                              scsi_ssc2_val,
                                                              "0x%02x"),
                                                  isreq ? "Request" : "Response");
+           if (check_col (pinfo->cinfo, COL_INFO)) {
+             col_add_fstr (pinfo->cinfo, COL_INFO, 
+                           "SCSI: Data %s LUN:0x%02x (%s %s) ", 
+                           isreq ? "Out" : "In", 
+                           lun, 
+                           val_to_str (opcode, scsi_ssc2_val, "0x%02x"),
+                           isreq ? "Request" : "Response");
+           }
             break;
 
         case SCSI_CMND_SMC2:
@@ -4769,6 +4824,14 @@ dissect_scsi_payload (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                                              scsi_smc2_val,
                                                              "0x%02x"),
                                                  isreq ? "Request" : "Response");
+           if (check_col (pinfo->cinfo, COL_INFO)) {
+             col_add_fstr (pinfo->cinfo, COL_INFO, 
+                           "SCSI: Data %s LUN:0x%02x (%s %s) ", 
+                           isreq ? "Out" : "In", 
+                           lun, 
+                           val_to_str (opcode, scsi_smc2_val, "0x%02x"),
+                           isreq ? "Request" : "Response");
+           }
             break;
 
         default:
@@ -4783,6 +4846,11 @@ 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);
+    }
+
     if (tree == NULL) {
         /*
          * We have to dissect INQUIRY responses, in order to determine the
@@ -5051,6 +5119,14 @@ proto_register_scsi (void)
 {
     /* Setup list of header fields  See Section 1.6.1 for details*/
     static hf_register_info hf[] = {
+       /*16 bit to print something useful for weirdo 
+               volume set addressing hosts*/
+       { &hf_scsi_lun, 
+          {"LUN", "scsi.lun", FT_UINT16, BASE_HEX, 
+           NULL, 0x0, "LUN", HFILL}},
+       { &hf_scsi_status,
+         { "Status", "scsi.status", FT_UINT8, BASE_HEX, 
+          VALS(scsi_status_val), 0, "SCSI command status value", HFILL }},
         { &hf_scsi_spcopcode,
           {"SPC-2 Opcode", "scsi.spc.opcode", FT_UINT8, BASE_HEX,
            VALS (scsi_spc2_val), 0x0, "", HFILL}},
index ed2ff42e7c6f9ca039d029f93ae677c88226c2b7..d5d167b026a6c8c3685becf5c255dc5f742cc04f 100644 (file)
@@ -63,11 +63,11 @@ extern const value_string scsi_status_val[];
  * FCP/iSCSI
  */
 void dissect_scsi_cdb (tvbuff_t *, packet_info *, proto_tree *, guint, guint,
-                       gint);
-void dissect_scsi_rsp (tvbuff_t *, packet_info *, proto_tree *);
+                       gint, guint16);
+void dissect_scsi_rsp (tvbuff_t *, packet_info *, proto_tree *, guint16, guint8);
 void dissect_scsi_payload (tvbuff_t *, packet_info *, proto_tree *, guint,
-                           gboolean, guint32);
-void dissect_scsi_snsinfo (tvbuff_t *, packet_info *, proto_tree *, guint, guint);
+                           gboolean, guint32, guint16);
+void dissect_scsi_snsinfo (tvbuff_t *, packet_info *, proto_tree *, guint, guint, guint16);
 
 /*
  * Private data to be supplied to those functions via "pinfo->private_data";