public class SCSICommandParser extends InitiatorMessageParser
This class parses a SCSI Command message defined in the iSCSI Standard (RFC3720).
ExpStatSN - 1 (mod 2**32) have been received
(acknowledges status) on the connection.
| Modifier and Type | Class and Description |
|---|---|
static class |
SCSICommandParser.TaskAttributes
This enumeration defines all valid types of additional header segments,
which are defined by the iSCSI standard (RFC3720).
|
commandSequenceNumber, expectedStatusSequenceNumberlogicalUnitNumber, protocolDataUnit| Constructor and Description |
|---|
SCSICommandParser(ProtocolDataUnit initProtocolDataUnit)
Default constructor, creates a new, empty
SCSICommandParser object. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canContainAdditionalHeaderSegments()
If this method returns
true, it indicates that this derived
AbstractMessageParser can contain one or more Additional Header Segments. |
protected void |
checkIntegrity()
This method checks, if all parsed fields are valid.
|
void |
clear()
This method sets all settings to their initial values.
|
protected void |
deserializeBytes1to3(int line)
Parse the bytes
1 till 3 in the Basic Header
Segment. |
protected void |
deserializeBytes20to23(int line)
Parse the bytes
20 till 23 in the Basic Header
Segment. |
protected void |
deserializeBytes32to35(int line)
Parse the bytes
32 till 35 in the Basic Header
Segment. |
protected void |
deserializeBytes36to39(int line)
Parse the bytes
36 till 39 in the Basic Header
Segment. |
protected void |
deserializeBytes40to43(int line)
Parse the bytes
40 till 43 in the Basic Header
Segment. |
protected void |
deserializeBytes44to47(int line)
Parse the bytes
44 till 47 in the Basic Header
Segment. |
ByteBuffer |
getCDB()
There are
16 bytes in the CDB field to accommodate the
commonly used CDBs. |
DataSegmentFactory.DataSegmentFormat |
getDataSegmentFormat()
If this method returns
true, hen it indicates that the data
segment data is interpreted as binary data. |
int |
getExpectedDataTransferLength()
For unidirectional operations, the Expected Data Transfer Length field
contains the number of bytes of data involved in this SCSI operation.
|
SCSICommandParser.TaskAttributes |
getTaskAttributes() |
boolean |
isReadExpectedFlag()
The command expects input data (read).
|
boolean |
isWriteExpectedFlag()
The command expects output data (write).
|
protected int |
serializeBytes1to3()
Serializes the bytes
1 till 3 in the Basic
Header Segment. |
protected int |
serializeBytes20to23()
Serializes the bytes
20 till 23 in the Basic
Header Segment. |
protected int |
serializeBytes32to35()
Serializes the bytes
32 till 35 in the Basic
Header Segment. |
protected int |
serializeBytes36to39()
Serializes the bytes
36 till 39 in the Basic
Header Segment. |
protected int |
serializeBytes40to43()
Serializes the bytes
40 till 43 in the Basic
Header Segment. |
protected int |
serializeBytes44to47()
Serializes the bytes
44 till 47 in the Basic
Header Segment. |
void |
setCommandDescriptorBlock(ByteBuffer newCDB)
Sets the new Command Descriptor Block.
|
void |
setExpectedDataTransferLength(int newExpectedDataTransferLength) |
void |
setReadExpectedFlag(boolean newReadExpectedFlag) |
void |
setTaskAttributes(SCSICommandParser.TaskAttributes newTaskAttributes) |
void |
setWriteExpectedFlag(boolean newWriteExpectedFlag) |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
deserializeBytes24to27, deserializeBytes28to31, getCommandSequenceNumber, getExpectedStatusSequenceNumber, getShortInfo, incrementSequenceNumber, serializeBytes24to27, serializeBytes28to31, setCommandSequenceNumber, setExpectedStatusSequenceNumbercanHaveDigests, deserializeBytes12to15, deserializeBytes8to11, getLogicalUnitNumber, serializeBytes12to15, serializeBytes8to11, setLogicalUnitNumberpublic SCSICommandParser(ProtocolDataUnit initProtocolDataUnit)
SCSICommandParser object.initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this SCSICommandParser subclass object.public final String toString()
toString in class InitiatorMessageParserpublic final DataSegmentFactory.DataSegmentFormat getDataSegmentFormat()
true, hen it indicates that the data
segment data is interpreted as binary data. Else the data segment data
must be interpreted as Text Format.getDataSegmentFormat in class AbstractMessageParserDataSegmentFactory.DataSegmentFormatpublic final boolean canContainAdditionalHeaderSegments()
true, it indicates that this derived
AbstractMessageParser can contain one or more Additional Header Segments.canContainAdditionalHeaderSegments in class AbstractMessageParsertrue, if this AbstractMessageParser object
can contain one or more AHSs.AdditionalHeaderSegmentpublic final void clear()
clear in class InitiatorMessageParserpublic final ByteBuffer getCDB()
16 bytes in the CDB field to accommodate the
commonly used CDBs. Whenever the CDB is larger than 16 bytes, an Extended CDB AHS MUST be
used to contain the CDB spillover.ByteBuffer with the content of the Command
Descriptor Blocks contained in this SCSICommandParser object.public final int getExpectedDataTransferLength()
1 and R flag
set to 0), the initiator uses this field to specify the
number of bytes of data it expects to transfer for this operation. For a
unidirectional read operation (W flag set to 0 and R flag
set to 1), the initiator uses this field to specify the
number of bytes of data it expects the target to transfer to the
initiator. It corresponds to the SAM2 byte count.
For bidirectional operations (both R and W flags are set to 1 ), this field contains the
number of data bytes involved in the write transfer. For bidirectional operations, an additional header
segment MUST be present in the header sequence that indicates the Bidirectional Read Expected Data
Transfer Length. The Expected Data Transfer Length field and the Bidirectional Read Expected Data
Transfer Length field correspond to the SAM2 byte count.
If the Expected Data Transfer Length for a write and the length of the immediate data part that follows
the command (if any) are the same, then no more data PDUs are expected to follow. In this case, the F
bit MUST be set to 1.
If the Expected Data Transfer Length is higher than the FirstBurstLength (the negotiated maximum amount of unsolicited data the target will accept), the initiator MUST send the maximum amount of unsolicited data OR ONLY the immediate data, if any.
Upon completion of a data transfer, the target informs the initiator (through residual counts) of how many bytes were actually processed (sent and/or received) by the target.
public final boolean isReadExpectedFlag()
true,if a read command is expected. Else false.public final void setReadExpectedFlag(boolean newReadExpectedFlag)
newReadExpectedFlag - The readExpectedFlag to set.public final SCSICommandParser.TaskAttributes getTaskAttributes()
public final void setTaskAttributes(SCSICommandParser.TaskAttributes newTaskAttributes)
newTaskAttributes - The taskAttributes to set.public final boolean isWriteExpectedFlag()
true,if a write command is expected. Else false.public final void setWriteExpectedFlag(boolean newWriteExpectedFlag)
newWriteExpectedFlag - The writeExpectedFlag to set.public final void setCommandDescriptorBlock(ByteBuffer newCDB)
newCDB - The new Command Descriptor Block.public final void setExpectedDataTransferLength(int newExpectedDataTransferLength)
newExpectedDataTransferLength - The expectedDataTransferLength to set.protected final void deserializeBytes1to3(int line)
throws InternetSCSIException
1 till 3 in the Basic Header
Segment.deserializeBytes1to3 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes20to23(int line)
throws InternetSCSIException
20 till 23 in the Basic Header
Segment.deserializeBytes20to23 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes32to35(int line)
throws InternetSCSIException
32 till 35 in the Basic Header
Segment.deserializeBytes32to35 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes36to39(int line)
throws InternetSCSIException
36 till 39 in the Basic Header
Segment.deserializeBytes36to39 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes40to43(int line)
throws InternetSCSIException
40 till 43 in the Basic Header
Segment.deserializeBytes40to43 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes44to47(int line)
throws InternetSCSIException
44 till 47 in the Basic Header
Segment.deserializeBytes44to47 in class InitiatorMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void checkIntegrity()
throws InternetSCSIException
checkIntegrity in class AbstractMessageParserInternetSCSIException - If the integrity is violated.protected final int serializeBytes1to3()
1 till 3 in the Basic
Header Segment.serializeBytes1to3 in class InitiatorMessageParserprotected final int serializeBytes20to23()
20 till 23 in the Basic
Header Segment.serializeBytes20to23 in class InitiatorMessageParserprotected final int serializeBytes32to35()
32 till 35 in the Basic
Header Segment.serializeBytes32to35 in class InitiatorMessageParserprotected final int serializeBytes36to39()
36 till 39 in the Basic
Header Segment.serializeBytes36to39 in class InitiatorMessageParserprotected final int serializeBytes40to43()
40 till 43 in the Basic
Header Segment.serializeBytes40to43 in class InitiatorMessageParserprotected final int serializeBytes44to47()
44 till 47 in the Basic
Header Segment.serializeBytes44to47 in class InitiatorMessageParserCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.