SCSI dissector from treating data digests as payload.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4552
f5534014-38df-0310-8fa8-
9805f1628bb7
*
* Conforms to the protocol described in: draft-ietf-ips-iscsi-08.txt
*
*
* Conforms to the protocol described in: draft-ietf-ips-iscsi-08.txt
*
- * $Id: packet-iscsi.c,v 1.19 2002/01/10 01:28:43 guy Exp $
+ * $Id: packet-iscsi.c,v 1.20 2002/01/16 20:25:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
conversation_t *conversation = NULL;
iscsi_conv_data_t *cdata = NULL;
iscsi_conv_key_t ckey, *req_key;
conversation_t *conversation = NULL;
iscsi_conv_data_t *cdata = NULL;
iscsi_conv_key_t ckey, *req_key;
+ int paddedDataSegmentLength = data_segment_len;
+ if(paddedDataSegmentLength & 3)
+ paddedDataSegmentLength += 4 - (paddedDataSegmentLength & 3);
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
/* Make entries in Protocol column and Info column on summary display */
if (check_col(pinfo->cinfo, COL_PROTOCOL))
proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 44, 4, FALSE);
offset = handleHeaderDigest(ti, tvb, offset, 48);
proto_tree_add_item(ti, hf_iscsi_ExpDataSN, tvb, offset + 36, 4, FALSE);
proto_tree_add_item(ti, hf_iscsi_SCSIResponse_BidiReadResidualCount, tvb, offset + 44, 4, FALSE);
offset = handleHeaderDigest(ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
}
else if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION) {
/* Task Management Function */
}
else if(opcode == ISCSI_OPCODE_TASK_MANAGEMENT_FUNCTION) {
/* Task Management Function */
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);
offset = handleHeaderDigest(ti, tvb, offset, 48);
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);
offset = handleHeaderDigest(ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
}
else if(opcode == ISCSI_OPCODE_SCSI_DATA_IN) {
/* SCSI Data In (read) */
}
else if(opcode == ISCSI_OPCODE_SCSI_DATA_IN) {
/* SCSI Data In (read) */
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);
offset = handleHeaderDigest(ti, tvb, offset, 48);
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);
offset = handleHeaderDigest(ti, tvb, offset, 48);
+ /* do not update offset here because the data segment is
+ * dissected below */
+ handleDataDigest(ti, tvb, offset, paddedDataSegmentLength);
}
else if(opcode == ISCSI_OPCODE_LOGOUT_COMMAND) {
/* Logout Command */
}
else if(opcode == ISCSI_OPCODE_LOGOUT_COMMAND) {
/* Logout Command */
* Routines for decoding SCSI CDBs and responses
* Author: Dinesh G Dutt (ddutt@cisco.com)
*
* Routines for decoding SCSI CDBs and responses
* Author: Dinesh G Dutt (ddutt@cisco.com)
*
- * $Id: packet-scsi.c,v 1.1 2002/01/10 01:28:43 guy Exp $
+ * $Id: packet-scsi.c,v 1.2 2002/01/16 20:25:07 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
if (tree) {
if (cmd == SCSI_CMND_SPC2) {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
if (tree) {
if (cmd == SCSI_CMND_SPC2) {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
"SCSI Payload (%s %s)",
val_to_str (opcode,
scsi_spc2_val,
"SCSI Payload (%s %s)",
val_to_str (opcode,
scsi_spc2_val,
}
else if (cmd == SCSI_CMND_SBC2) {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
}
else if (cmd == SCSI_CMND_SBC2) {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
"SCSI Payload (%s %s)",
val_to_str (opcode,
scsi_sbc2_val,
"SCSI Payload (%s %s)",
val_to_str (opcode,
scsi_sbc2_val,
}
else {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
}
else {
ti = proto_tree_add_protocol_format (tree, proto_scsi, tvb, offset,
"SCSI Payload (0x%02x %s)",
opcode,
isreq ? "Request" : "Response");
"SCSI Payload (0x%02x %s)",
opcode,
isreq ? "Request" : "Response");