Remove all $Id$ from top of file
[metze/wireshark/wip.git] / epan / dissectors / packet-scsi.h
index f2284ab3fa30c2e7116445aa367b8b755a7fc9c0..7d059426dffdd2934a37babd07de40eca6d995dd 100644 (file)
@@ -1,8 +1,6 @@
 /* packet-scsi.h
  * Author: Dinesh G Dutt (ddutt@cisco.com)
  *
- * $Id$
- *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 2002 Gerald Combs
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #ifndef __PACKET_SCSI_H_
 #define __PACKET_SCSI_H_
 
+#include <epan/exceptions.h>
 
 /* Structure containing itl nexus data :
  * The itlq nexus is a structure containing data specific
@@ -34,7 +33,7 @@ typedef struct _itl_nexus_t {
 #define SCSI_CMDSET_DEFAULT    0x80
 #define SCSI_CMDSET_MASK       0x7f
     guint8 cmdset;         /* This is a bitfield.
-                           * The MSB (0x80) represents whether 
+                           * The MSB (0x80) represents whether
                            * 0: the commandset is known from a INQ PDU
                            * 1: is using the "default" from preferences.
                            * The lower 7 bits represent the commandset used
@@ -59,7 +58,7 @@ typedef struct _itlq_nexus_t {
 #define SCSI_DATA_WRITE        0x0002
     guint16 task_flags; /* Flags set by the transport for this
                         * scsi task.
-                        * 
+                        *
                         * If there is no data being transferred both flags
                         * are 0 and both data lengths below are undefined.
                         *
@@ -67,15 +66,15 @@ typedef struct _itlq_nexus_t {
                         * data being transferred is held in data_length
                         * and bidir_data_length is undefined.
                         *
-                        * If both flags are set (a bidirectional transfer) 
+                        * If both flags are set (a bidirectional transfer)
                         * data_length specifies the amount of DATA-OUT and
                         * bidir_data_length specifies the amount of DATA-IN
                         */
     guint32 data_length;
     guint32 bidir_data_length;
 
-    guint32 alloc_len; /* we need to track alloc_len between the CDB and 
-                        * the DATA pdus for some opcodes. 
+    guint32 alloc_len; /* we need to track alloc_len between the CDB and
+                        * the DATA pdus for some opcodes.
                         */
     nstime_t fc_time;
 
@@ -115,6 +114,7 @@ typedef struct _scsi_cdb_table_t {
 #define SCSI_SPC_COPY_AND_VERIFY         0x3A
 #define SCSI_SPC_INQUIRY                 0x12
 #define SCSI_SPC_EXTCOPY                 0x83
+#define SCSI_SPC_RECVCOPY               0x84
 #define SCSI_SPC_LOGSELECT               0x4C
 #define SCSI_SPC_LOGSENSE                0x4D
 #define SCSI_SPC_MODESELECT6             0x15
@@ -129,7 +129,7 @@ typedef struct _scsi_cdb_table_t {
 #define SCSI_SPC_RCVDIAGRESULTS          0x1C
 #define SCSI_SPC_RELEASE6                0x17
 #define SCSI_SPC_RELEASE10               0x57
-#define SCSI_SPC_REPORTDEVICEID          0xA3
+#define SCSI_SPC_MGMT_PROTOCOL_IN        0xA3
 #define SCSI_SPC_REPORTLUNS              0xA0
 #define SCSI_SPC_REQSENSE                0x03
 #define SCSI_SPC_RESERVE6                0x16
@@ -143,6 +143,7 @@ typedef struct _scsi_cdb_table_t {
 void dissect_spc_inquiry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint32 payload_len, scsi_task_data_t *cdata);
 void dissect_spc_logselect(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_);
 void dissect_spc_logsense(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_);
+void dissect_spc_mgmt_protocol_in(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_);
 void dissect_spc_modeselect6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
 void dissect_spc_modesense6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
 void dissect_spc_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, gboolean isreq, gboolean iscdb, guint payload_len, scsi_task_data_t *cdata);
@@ -160,6 +161,8 @@ void dissect_spc_reserve10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
 void dissect_spc_release10 (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_);
 void dissect_spc_senddiagnostic (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_);
 void dissect_spc_extcopy (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_);
+void dissect_spc_recvcopy (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_);
+
 
 
 
@@ -210,8 +213,10 @@ void dissect_scsi_payload (tvbuff_t *, packet_info *, proto_tree *,
                            guint32 relative_offset);
 void dissect_scsi_snsinfo (tvbuff_t *, packet_info *, proto_tree *, guint, guint, itlq_nexus_t *, itl_nexus_t *);
 
-WS_VAR_IMPORT const value_string scsi_mmc_vals[];
+void dissect_scsi_lun(proto_tree *, tvbuff_t *, guint);
 
+extern const int *cdb_control_fields[6];
+extern gint ett_scsi_control;
 extern int hf_scsi_control;
 extern int hf_scsi_alloclen16;
 
@@ -222,12 +227,17 @@ extern int hf_scsi_alloclen16;
 #define EXTENDED_FORM              0x08
 #define SERVICE_READ_CAPACITY16           0x10
 #define SERVICE_READ_LONG16       0x11
+#define SERVICE_GET_LBA_STATUS     0x12
 
 extern const value_string service_action_vals[];
 extern const value_string scsi_devid_codeset_val[];
 extern const value_string scsi_devid_idtype_val[];
 extern value_string_ext scsi_asc_val_ext;
 
+/* 0xA3 MGMT PROTOCOL IN service actions */
+#define MPI_MANAGEMENT_PROTOCOL_IN           0x10
+#define MPI_REPORT_SUPPORTED_OPERATION_CODES 0x0C
+
 /* These two defines are used to handle cases where data coming back from
  * the device is truncated due to a too short allocation_length specified
  * in the command CDB.
@@ -285,9 +295,6 @@ extern value_string_ext scsi_asc_val_ext;
                        THROW(ScsiBoundsError);                         \
                }                                                       \
            }                                                           \
-       CATCH_ALL {                                                     \
-               RETHROW;                                                \
-       }                                                               \
        ENDTRY;                                                         \
     }