From 494e873eb07eb366f9dcac28ef6dc8ea9315369f Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 11 Oct 2006 10:38:59 +0000 Subject: [PATCH] move the ITL and the ITLQ structure to packet-scsi.h where it belongs svn path=/trunk/; revision=19492 --- epan/dissectors/packet-fc.c | 1 + epan/dissectors/packet-fc.h | 45 ------------------------------ epan/dissectors/packet-fcct.c | 1 + epan/dissectors/packet-fcdns.c | 1 + epan/dissectors/packet-fcels.c | 1 + epan/dissectors/packet-fcfcs.c | 1 + epan/dissectors/packet-fcfzs.c | 1 + epan/dissectors/packet-fclctl.c | 1 + epan/dissectors/packet-fcp.c | 2 +- epan/dissectors/packet-fcsb3.c | 1 + epan/dissectors/packet-fcsp.c | 1 + epan/dissectors/packet-fcswils.c | 1 + epan/dissectors/packet-ipfc.c | 1 + epan/dissectors/packet-iscsi.c | 1 - epan/dissectors/packet-llc.c | 1 + epan/dissectors/packet-ndmp.c | 1 - epan/dissectors/packet-scsi-osd.c | 2 +- epan/dissectors/packet-scsi.c | 2 +- epan/dissectors/packet-scsi.h | 46 +++++++++++++++++++++++++++++++ gtk/conversations_fc.c | 1 + gtk/fc_stat.c | 1 + gtk/hostlist_fc.c | 1 + gtk/scsi_stat.c | 2 +- tap-iousers.c | 1 + 24 files changed, 66 insertions(+), 51 deletions(-) diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 1922873397..72503b818c 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -49,6 +49,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fclctl.h" #include "packet-fcbls.h" diff --git a/epan/dissectors/packet-fc.h b/epan/dissectors/packet-fc.h index dbd19f3070..67e79eba04 100644 --- a/epan/dissectors/packet-fc.h +++ b/epan/dissectors/packet-fc.h @@ -125,51 +125,6 @@ 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 { - 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; - void *extra_data; /* extra data that that is task specific */ -} 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 */ diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c index 99834c7303..27f3548865 100644 --- a/epan/dissectors/packet-fcct.c +++ b/epan/dissectors/packet-fcct.c @@ -44,6 +44,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcct.h" diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c index 68b62fbad0..794dc27941 100644 --- a/epan/dissectors/packet-fcdns.c +++ b/epan/dissectors/packet-fcdns.c @@ -51,6 +51,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcct.h" #include "packet-fcdns.h" diff --git a/epan/dissectors/packet-fcels.c b/epan/dissectors/packet-fcels.c index c4a013ce10..afb7fffe12 100644 --- a/epan/dissectors/packet-fcels.c +++ b/epan/dissectors/packet-fcels.c @@ -50,6 +50,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcels.h" diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c index 294142557a..18d7ee7816 100644 --- a/epan/dissectors/packet-fcfcs.c +++ b/epan/dissectors/packet-fcfcs.c @@ -45,6 +45,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcct.h" #include "packet-fcfcs.h" diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c index 3d276809d6..95dac45b01 100644 --- a/epan/dissectors/packet-fcfzs.c +++ b/epan/dissectors/packet-fcfzs.c @@ -51,6 +51,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcct.h" #include "packet-fcfzs.h" diff --git a/epan/dissectors/packet-fclctl.c b/epan/dissectors/packet-fclctl.c index ca8bd98098..17999a2d99 100644 --- a/epan/dissectors/packet-fclctl.c +++ b/epan/dissectors/packet-fclctl.c @@ -45,6 +45,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fclctl.h" diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c index 1ce32a66c4..c32499e93e 100644 --- a/epan/dissectors/packet-fcp.c +++ b/epan/dissectors/packet-fcp.c @@ -46,9 +46,9 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcp.h" -#include "packet-scsi.h" /* Initialize the protocol and registered fields */ static int proto_fcp = -1; diff --git a/epan/dissectors/packet-fcsb3.c b/epan/dissectors/packet-fcsb3.c index 46b8c3657d..99ff7fe51a 100644 --- a/epan/dissectors/packet-fcsb3.c +++ b/epan/dissectors/packet-fcsb3.c @@ -52,6 +52,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcsb3.h" diff --git a/epan/dissectors/packet-fcsp.c b/epan/dissectors/packet-fcsp.c index ca7c893896..e323ce7c0c 100644 --- a/epan/dissectors/packet-fcsp.c +++ b/epan/dissectors/packet-fcsp.c @@ -52,6 +52,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" /* Message Codes */ diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index 2d15848133..48c0695be5 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -45,6 +45,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-fcswils.h" #include "packet-fcct.h" diff --git a/epan/dissectors/packet-ipfc.c b/epan/dissectors/packet-ipfc.c index 25c05fd8db..a4e4953876 100644 --- a/epan/dissectors/packet-ipfc.c +++ b/epan/dissectors/packet-ipfc.c @@ -39,6 +39,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-ipfc.h" #include "packet-llc.h" diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 8e747cc2fd..9355c21972 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -45,7 +45,6 @@ #include #include #include -#include "packet-fc.h" #include "packet-scsi.h" #include "epan/nstime.h" #include diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index 864dfc90e0..d2b9f81a45 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -37,6 +37,7 @@ #include #include #include +#include "packet-scsi.h" #include "packet-fc.h" #include "packet-ip.h" #include "packet-ipx.h" diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c index 4b70864739..7502e49d15 100644 --- a/epan/dissectors/packet-ndmp.c +++ b/epan/dissectors/packet-ndmp.c @@ -43,7 +43,6 @@ #include #include "packet-rpc.h" #include "packet-tcp.h" -#include "packet-fc.h" #include "packet-scsi.h" #include "packet-frame.h" #include diff --git a/epan/dissectors/packet-scsi-osd.c b/epan/dissectors/packet-scsi-osd.c index 9c71131b45..85c156cb65 100644 --- a/epan/dissectors/packet-scsi-osd.c +++ b/epan/dissectors/packet-scsi-osd.c @@ -35,8 +35,8 @@ #include #include #include -#include "packet-fc.h" #include "packet-scsi.h" +#include "packet-fc.h" #include "packet-scsi-osd.h" diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index 425de78bd8..c5c71d148c 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -91,8 +91,8 @@ #include #include #include -#include "packet-fc.h" #include "packet-scsi.h" +#include "packet-fc.h" #include "packet-scsi-osd.h" static int proto_scsi = -1; diff --git a/epan/dissectors/packet-scsi.h b/epan/dissectors/packet-scsi.h index 69f62331f1..41b82f696d 100644 --- a/epan/dissectors/packet-scsi.h +++ b/epan/dissectors/packet-scsi.h @@ -26,6 +26,52 @@ #define __PACKET_SCSI_H_ +/* 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 { + 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; + void *extra_data; /* extra data that that is task specific */ +} 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; + + /* list of commands for each commandset */ typedef void (*scsi_dissector_t)(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, diff --git a/gtk/conversations_fc.c b/gtk/conversations_fc.c index 75a3719876..e9a5005ed6 100644 --- a/gtk/conversations_fc.c +++ b/gtk/conversations_fc.c @@ -39,6 +39,7 @@ #include #include "../register.h" #include "conversations_table.h" +#include #include diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c index 71a204e156..1837901ad4 100644 --- a/gtk/fc_stat.c +++ b/gtk/fc_stat.c @@ -40,6 +40,7 @@ #include #include +#include #include #include "../register.h" #include "../timestats.h" diff --git a/gtk/hostlist_fc.c b/gtk/hostlist_fc.c index 8ff756882b..b1ead4526c 100644 --- a/gtk/hostlist_fc.c +++ b/gtk/hostlist_fc.c @@ -40,6 +40,7 @@ #include "../register.h" #include "hostlist_table.h" #include +#include #include diff --git a/gtk/scsi_stat.c b/gtk/scsi_stat.c index b25e03c086..bbbce8e81d 100644 --- a/gtk/scsi_stat.c +++ b/gtk/scsi_stat.c @@ -50,8 +50,8 @@ #include "service_response_time_table.h" #include "gtkglobals.h" #include -#include #include +#include static GtkWidget *dlg=NULL; diff --git a/tap-iousers.c b/tap-iousers.c index 9444e05c85..c030f469a7 100644 --- a/tap-iousers.c +++ b/tap-iousers.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include