aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iscsi.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-13 09:16:45 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-13 09:16:45 +0000
commit8826c144f7b723f6cabe7d40ca9345b946ed2109 (patch)
tree14e337c2027f01206afa0731e0dcc35c0eca0cc9 /epan/dissectors/packet-iscsi.c
parentd516bcbb78173f381edfb22868272ec3fca8cdef (diff)
pass the relative data offset of data in/out pdu's to the scsi data in/out dissector (dissect_scsi_payload) so that we can later add reassembly of data pdu's
and also (if reassembly is disabled) only dissect the initial (offset==0) data pdu. dissect_scsi_payload() does not yet use this parameter. now that we have both data offset and expected data length/bidir expected data length and also the read/write flags availabe we have what we need to reassemble data in/out pdus (modulo overflow/underflow but those are so rare we can worry about them later). ndmp: ndmp conceptually always has a data in and a data out phase and never fragment the data into smaller pdu's os that dissector always report offset as 0. svn path=/trunk/; revision=19511
Diffstat (limited to 'epan/dissectors/packet-iscsi.c')
-rw-r--r--epan/dissectors/packet-iscsi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 8668189219..853d713838 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -756,6 +756,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
itl_nexus_t *itl=NULL;
guint ahs_cdb_length=0;
guint ahs_cdb_offset=0;
+ guint32 data_offset=0;
if(paddedDataSegmentLength & 3)
paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
@@ -1312,6 +1313,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
proto_tree_add_item(ti, hf_iscsi_ExpStatSN, tvb, offset + 28, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, FALSE);
+ data_offset=tvb_get_ntohl(tvb, offset+40);
+
offset = handleHeaderDigest(iscsi_session, ti, tvb, offset, 48);
/* do not update offset here because the data segment is
* dissected below */
@@ -1356,6 +1359,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
proto_tree_add_item(ti, hf_iscsi_MaxCmdSN, tvb, offset + 32, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_DataSN, tvb, offset + 36, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_BufferOffset, tvb, offset + 40, 4, FALSE);
+ data_offset=tvb_get_ntohl(tvb, offset+40);
+
if(iscsi_protocol_version > ISCSI_PROTOCOL_DRAFT09) {
proto_tree_add_item(ti, hf_iscsi_SCSIData_ResidualCount, tvb, offset + 44, 4, FALSE);
}
@@ -1604,7 +1609,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
data_tvb=tvb_new_subset(tvb, immediate_data_offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
TRUE,
- &cdata->itlq, itl);
+ &cdata->itlq, itl,
+ 0);
}
}
else if (opcode == ISCSI_OPCODE_SCSI_RESPONSE) {
@@ -1652,7 +1658,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
data_tvb=tvb_new_subset(tvb, offset, tvb_len, tvb_rlen);
dissect_scsi_payload (data_tvb, pinfo, tree,
(opcode==ISCSI_OPCODE_SCSI_DATA_OUT),
- &cdata->itlq, itl);
+ &cdata->itlq, itl,
+ data_offset);
}
if(S_bit){