aboutsummaryrefslogtreecommitdiffstats
path: root/packet-iscsi.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-13 01:17:58 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-02-13 01:17:58 +0000
commit52c0b327bd22f3d0d7e44e86df90b92a7ccb3ced (patch)
tree37db49888f31541b17fde38a34e1802571ea441f /packet-iscsi.c
parent244f5985452a5135832be54028e682c8ed35155d (diff)
Have the private data for the SCSI dissection routines be a pointer to a
structure containing a 32-bit conversation ID (which uniquely identifies conversations between a SCSI initiator and target) and a 32-bit task ID (which uniquely identifies a task within that conversation). Have the NDMP dissector create conversations when it sees an "execute CDB" request, and use the conversation index as the conversation ID and the sequence number for requests and reply sequence for replies as the task ID. Have it use "dissect_scsi_payload()" to dissect the payload of "execute CDB" requests and replies. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4726 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-iscsi.c')
-rw-r--r--packet-iscsi.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/packet-iscsi.c b/packet-iscsi.c
index e6697de963..8b5348de4a 100644
--- a/packet-iscsi.c
+++ b/packet-iscsi.c
@@ -6,7 +6,7 @@
* Optionally, may be compiled for compatibility with
* draft-ietf-ips-iscsi-08.txt by defining DRAFT08
*
- * $Id: packet-iscsi.c,v 1.25 2002/02/02 03:27:54 guy Exp $
+ * $Id: packet-iscsi.c,v 1.26 2002/02/13 01:17:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -706,6 +706,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
conversation_t *conversation = NULL;
iscsi_conv_data_t *cdata = NULL;
iscsi_conv_key_t ckey, *req_key;
+ scsi_task_id_t task_key;
int paddedDataSegmentLength = data_segment_len;
if(paddedDataSegmentLength & 3)
paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
@@ -731,8 +732,14 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
cdata = (iscsi_conv_data_t *)g_hash_table_lookup (iscsi_req_hash,
&ckey);
+
+ task_key.conv_id = ckey.conv_idx;
+ task_key.task_id = ckey.itt;
+ pinfo->private_data = &task_key;
+ } else {
+ /* no conversation, meaning we didn't see the request */
+ pinfo->private_data = NULL;
}
- pinfo->private_data = cdata;
if (cdata) {
del_usecs = (pinfo->fd->abs_secs - cdata->abs_secs)* 1000000 +
@@ -761,8 +768,6 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
*/
cdata->abs_usecs = pinfo->fd->abs_usecs;
cdata->abs_secs = pinfo->fd->abs_secs;
- /* The SCSI protocol uses this as the key to detect a
- * SCSI-level conversation. */
}
else {
req_key = g_mem_chunk_alloc (iscsi_req_keys);
@@ -774,10 +779,13 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
cdata->abs_secs = pinfo->fd->abs_secs;
g_hash_table_insert (iscsi_req_hash, req_key, cdata);
- /* The SCSI protocol uses this as the key to detect a
- * SCSI-level conversation. */
}
- pinfo->private_data = cdata;
+
+ /* The SCSI protocol uses this as the key to detect a
+ * SCSI-level conversation. */
+ task_key.conv_id = ckey.conv_idx;
+ task_key.task_id = ckey.itt;
+ pinfo->private_data = &task_key;
}
else {
pinfo->private_data = NULL;