scsi osd additions
[obnox/wireshark/wip.git] / epan / dissectors / packet-fc.h
index c8bbd081f014c0a559322036e8d86acf7f8dfeff..6d4be5876c67efe4568b87e387b6b387d8b95a6e 100644 (file)
@@ -4,8 +4,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  * 
  * This program is free software; you can redistribute it and/or
@@ -57,9 +57,9 @@
 /*
  * the following allows TAP code access to the messages
  * without having to duplicate it. With MSVC and a 
- * libethereal.dll, we need a special declaration.
+ * libwireshark.dll, we need a special declaration.
  */
-ETH_VAR_IMPORT const value_string fc_fc4_val[];
+WS_VAR_IMPORT const value_string fc_fc4_val[];
 
 /* DF_CTL bits */
 #define FC_DFCTL_DH         0x03   /* Device_Header type bits: */
@@ -125,19 +125,53 @@ ETH_VAR_IMPORT const value_string fc_fc4_val[];
 #define FC_FCTL_ABTS_MASK              0x000030
 #define FC_FCTL_REL_OFFSET             0x000008
 
+/* Structure containing itl nexus data :
+ * The itlq nexus is a structure containing data specific
+ * for a initiator target lun combination.
+ */
+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 
+                           * 0: the commandset is known from a INQ PDU
+                           * 1: is using the "default" from preferences.
+                           * The lower 7 bits represent the commandset used
+                           * for decoding commands on this itl nexus.
+                           * The field is initialized to 0xff == unknown.
+                           */
+} itl_nexus_t;
+
 /* Structure containing itlq nexus data :
  * The itlq nexus is a structure containing data specific
  * for a initiator target lun queue/commandid combination.
  */
-/* XXX the LUN field will later be moved into an itl_nexusu_t structure */
 typedef struct _itlq_nexus_t {
     guint32 first_exchange_frame;
     guint32 last_exchange_frame;
     guint16 lun;         /* initialized to 0xffff == unknown */
     guint16 scsi_opcode; /* initialized to 0xffff == unknown */
+    guint16 flags;
+    guint16 svcaction;
+    guint32 alloc_len; /* we need to track alloc_len between the CDB and 
+                        * the DATA pdus for some opcodes. 
+                        */
     nstime_t fc_time;
 } itlq_nexus_t;
 
+
+#define SCSI_PDU_TYPE_CDB       1
+#define SCSI_PDU_TYPE_DATA      2
+#define SCSI_PDU_TYPE_RSP       4
+#define SCSI_PDU_TYPE_SNS       5
+typedef struct _scsi_task_data {
+    int type;
+    itlq_nexus_t *itlq;
+    itl_nexus_t *itl;
+} scsi_task_data_t;
+
+
+
 /* FC header structure */
 typedef struct _fc_hdr {
     address s_id;
@@ -149,7 +183,8 @@ typedef struct _fc_hdr {
     guint16 rxid;
     guint8 r_ctl;
     guint8 cs_ctl;
-    itlq_nexus_t *fced;
+    itlq_nexus_t *itlq;
+    conversation_t *conversation;
 } fc_hdr;
 
 #endif /* __PACKET_FC_H_ */