Remove all $Id$ from top of file
[metze/wireshark/wip.git] / epan / dissectors / packet-fc.h
index 75f01c62f7503590a8041f3e1719ccdbd7072900..4a7bf86e459b303c0168d1ab73188ce910c3ef43 100644 (file)
@@ -2,30 +2,31 @@
  * Basic Fibre Channel Header definitions
  * Copyright 2002 Dinesh G Dutt (ddutt@cisco.com)
  *
- * $Id$
- *
  * 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
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * 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_FC_H_
 #define __PACKET_FC_H_
 
+#include <epan/conversation.h>
+#include "ws_symbol_export.h"
+
 /* R_CTL upper bits creates a classification tree */
 #define FC_RCTL_DEV_DATA       0x00
 #define FC_RCTL_ELS            0x20
@@ -39,6 +40,7 @@
 #define FC_TYPE_CMNSVC         0x0  /* Used in PRLI Svc Param Page */
 
 /* TYPE definitions for Basic or Extended Link_Data */
+#define FC_TYPE_BLS            0x0
 #define FC_TYPE_ELS            0x1
 
 /* TYPE definitions for FC-4 */
 
 /*
  * the following allows TAP code access to the messages
- * without having to duplicate it. With MSVC and a 
+ * without having to duplicate it. With MSVC and a
  * libwireshark.dll, we need a special declaration.
  */
-WS_VAR_IMPORT const value_string fc_fc4_val[];
+WS_DLL_PUBLIC const value_string fc_fc4_val[];
 
 /* DF_CTL bits */
 #define FC_DFCTL_DH         0x03   /* Device_Header type bits: */
@@ -125,51 +127,12 @@ WS_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.
- */
-typedef struct _itlq_nexus_t {
+
+typedef struct _fc_exchange_t {
     guint32 first_exchange_frame;
     guint32 last_exchange_frame;
-    guint16 lun;         /* initialized to 0xffff == unknown */
-    guint16 scsi_opcode; /* initialized to 0xffff == unknown */
-    guint16 flags;
-    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_exchange_t;
 
 /* FC header structure */
 typedef struct _fc_hdr {
@@ -182,8 +145,25 @@ typedef struct _fc_hdr {
     guint16 rxid;
     guint8 r_ctl;
     guint8 cs_ctl;
-    itlq_nexus_t *itlq;
-    conversation_t *conversation;
+    guint16 lun;
+    fc_exchange_t* fc_ex;
+    guint32 relative_offset;
 } fc_hdr;
 
+#define FC_DATA_SOF_FIRST_FRAME   0x1
+#define FC_DATA_SOF_SOFF          0x2
+#define FC_DATA_EOF_LAST_FRAME    0x80
+#define FC_DATA_EOF_INVALID       0x40
+
+/* Data structure to pass into FC dissector */
+typedef struct _fc_data {
+    guint   ethertype;
+    guint8  sof_eof;              /**< FC's SOF/EOF encoding passed to FC decoder
+                                 * Bit 7 set if Last frame in sequence
+                                 * Bit 6 set if invalid frame content
+                                 * Bit 2 set if SOFf
+                                 * Bit 1 set if first frame in sequence
+                                 */
+} fc_data_t;
+
 #endif /* __PACKET_FC_H_ */