aboutsummaryrefslogtreecommitdiffstats
path: root/packet-iscsi.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-02-13 01:17:58 +0000
committerGuy Harris <guy@alum.mit.edu>2002-02-13 01:17:58 +0000
commita006c4fcca985cbefa95e622558ff27bdcac91f0 (patch)
tree37db49888f31541b17fde38a34e1802571ea441f /packet-iscsi.c
parent2c62907ff6da38de0bf4258dc4f663906c8f63ee (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. svn path=/trunk/; revision=4726
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;