public class DataInParser extends TargetMessageParser
expectedCommandSequenceNumber, maximumCommandSequenceNumber, statusSequenceNumberlogicalUnitNumber, protocolDataUnit| Constructor and Description |
|---|
DataInParser(ProtocolDataUnit initProtocolDataUnit)
Default constructor, creates a new, empty DataInParser object.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
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. |
int |
getBufferOffset()
The Buffer Offset field contains the offset of this PDU payload data
within the complete data transfer.
|
DataSegmentFactory.DataSegmentFormat |
getDataSegmentFormat()
If this method returns
true, hen it indicates that the data
segment data is interpreted as binary data. |
int |
getDataSequenceNumber()
For input (read) or bidirectional Data-In PDUs, the DataSN is the input
PDU number within the data transfer for the command identified by the
Initiator Task Tag.
|
int |
getResidualCount()
The Residual Count field MUST be valid in the case where either the U bit
or the O bit is set.
|
String |
getShortInfo()
Returns the short version of the used sequence numbers of this parser
instance.
|
SCSIStatus |
getStatus()
The Status field is used to report the SCSI status of the command (as
specified in [SAM2]) and is only valid if the Response Code is Command
Completed at target.
|
int |
getTargetTaskTag()
On outgoing data, the Target Transfer Tag is provided to the target if
the transfer is honoring an R2T.
|
boolean |
incrementSequenceNumber()
This
AbstractMessageParser instance affects the
incrementation of the Expected Status Sequence Number. |
boolean |
isAcknowledgeFlag()
For sessions with ErrorRecoveryLevel
1 or higher, the target
sets this bit to 1 to indicate that it requests a positive
acknowledgement from the initiator for the data received. |
boolean |
isBidirectionalReadResidualOverflow()
In this case, the Bidirectional Read Residual Count indicates the number
of bytes that were not transferred to the initiator because the
initiator’s Expected Bidirectional Read Data Transfer Length was not
sufficient.
|
boolean |
isBidirectionalReadResidualUnderflow()
In this case, the Bidirectional Read Residual Count indicates the number
of bytes that were not transferred to the initiator out of the number of
bytes expected to be transferred.
|
boolean |
isResidualOverflow()
In this case, the Residual Count indicates the number of bytes that were
not transferred because the initiator’s Expected Data Transfer Length was
not sufficient.
|
boolean |
isResidualUnderflow()
In this case, the Residual Count indicates the number of bytes that were
not transferred out of the number of bytes that were expected to be
transferred.
|
boolean |
isStatusFlag()
Set this to indicate that the Command Status field contains status.
|
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 |
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 |
setAcknowledgeFlag(boolean acknowledgeFlag) |
void |
setBufferOffset(int bufferOffset) |
void |
setDataSequenceNumber(int dataSequenceNumber) |
void |
setResidualCount(int residualCount) |
void |
setResidualOverflowFlag(boolean residualOverflowFlag) |
void |
setResidualUnderflowFlag(boolean residualUnderflowFlag) |
void |
setStatus(SCSIStatus status) |
void |
setStatusFlag(boolean statusFlag) |
void |
setTargetTransferTag(int targetTransferTag) |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
deserializeBytes24to27, deserializeBytes28to31, deserializeBytes32to35, getExpectedCommandSequenceNumber, getMaximumCommandSequenceNumber, getStatusSequenceNumber, serializeBytes24to27, serializeBytes28to31, serializeBytes32to35, setExpectedCommandSequenceNumber, setMaximumCommandSequenceNumber, setStatusSequenceNumbercanContainAdditionalHeaderSegments, canHaveDigests, deserializeBytes12to15, deserializeBytes8to11, getLogicalUnitNumber, serializeBytes12to15, serializeBytes8to11, setLogicalUnitNumberpublic DataInParser(ProtocolDataUnit initProtocolDataUnit)
initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this DataInParser subclass object.public String getShortInfo()
getShortInfo in class TargetMessageParserpublic String toString()
toString in class TargetMessageParserpublic 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 void clear()
clear in class TargetMessageParserpublic final boolean incrementSequenceNumber()
AbstractMessageParser instance affects the
incrementation of the Expected Status Sequence Number.incrementSequenceNumber in class TargetMessageParsertrue, if the counter has to be incremented. Else false.public int getBufferOffset()
public int getDataSequenceNumber()
public int getResidualCount()
public int getTargetTaskTag()
1; otherwise they are
reserved. The Target Transfer Tag and LUN are copied by the initiator
into the SNACK of type DataACK that it issues as a result of receiving a
SCSI Data-In PDU with the A bit set to 1.0xffffffff is reserved and means that the
Target Transfer Tag is not supplied. If the Target Transfer Tag is
provided, then the LUN field MUST hold a valid value and be consistent
with whatever was specified with the command; otherwise, the LUN field is
reserved.public boolean isAcknowledgeFlag()
1 or higher, the target
sets this bit to 1 to indicate that it requests a positive
acknowledgement from the initiator for the data received. The target
should use the A bit moderately; it MAY only set the A bit to 1 once every MaxBurstLength
bytes, or on the last Data-In
PDU that concludes the entire requested read data transfer for the task
from the target’s perspective, and it MUST NOT do so more frequently. The
target MUST NOT set to 1 the A bit for sessions
with ErrorRecoveryLevel=0. The initiator MUST ignore the A
bit
On receiving a Data-In PDU with the A bit set to 1 on a session with ErrorRecoveryLevel
greater than 0, if there are no holes in the read data until that Data-In PDU, the
initiator MUST issue a SNACK of type DataACK except when it is able to acknowledge the status for the
task immediately via ExpStatSN on other outbound PDUs if the status for the task is also received. In
the latter case (acknowledgement through ExpStatSN), sending a SNACK of type DataACK in response to the
A bit is OPTIONAL, but if it is done, it must not be sent after the status acknowledgement through
ExpStatSN. If the initiator has detected holes in the read data prior to that Data-In PDU, it MUST
postpone issuing the SNACK of type DataACK until the holes are filled. An initiator also MUST NOT
acknowledge the status for the task before those holes are filled. A status acknowledgement for a task
that generated the Data-In PDUs is considered by the target as an implicit acknowledgement of the
Data-In PDUs if such an acknowledgement was requested by the target.
true, if the AcknowledgeBit is set. Else false.public boolean isBidirectionalReadResidualOverflow()
True, if the ReadResidualOverflow-Flag of this
object is set. Else false.public boolean isBidirectionalReadResidualUnderflow()
True, if the ReadResidualUnderflow-Flag of this
object is set. Else false.public boolean isResidualOverflow()
True, if the ResidualOverflow-Flag of this object is
set. Else false.public boolean isResidualUnderflow()
True, if the ResidualUnderflow-Flag of this object
is set. Else false.public SCSIStatus getStatus()
If a SCSI device error is detected while data from the initiator is still expected (the command PDU did not contain all the data and the target has not received a Data PDU with the final bit Set), the target MUST wait until it receives a Data PDU with the F bit set in the last expected sequence before sending the Response PDU.
SCSIStatuspublic boolean isStatusFlag()
1, the F bit MUST also be
set to 1.1 and their values are
defined in Section 10.4 SCSI Response.True, if the Status-Flag of this object is set. Else false.public void setAcknowledgeFlag(boolean acknowledgeFlag)
public void setResidualOverflowFlag(boolean residualOverflowFlag)
public void setResidualUnderflowFlag(boolean residualUnderflowFlag)
public void setStatusFlag(boolean statusFlag)
public void setStatus(SCSIStatus status)
public void setTargetTransferTag(int targetTransferTag)
public void setDataSequenceNumber(int dataSequenceNumber)
public void setBufferOffset(int bufferOffset)
public void setResidualCount(int residualCount)
protected void deserializeBytes1to3(int line)
throws InternetSCSIException
1 till 3 in the Basic Header
Segment.deserializeBytes1to3 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes20to23(int line)
throws InternetSCSIException
20 till 23 in the Basic Header
Segment.deserializeBytes20to23 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes36to39(int line)
throws InternetSCSIException
36 till 39 in the Basic Header
Segment.deserializeBytes36to39 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes40to43(int line)
throws InternetSCSIException
40 till 43 in the Basic Header
Segment.deserializeBytes40to43 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void deserializeBytes44to47(int line)
throws InternetSCSIException
44 till 47 in the Basic Header
Segment.deserializeBytes44to47 in class TargetMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected void checkIntegrity()
throws InternetSCSIException
checkIntegrity in class AbstractMessageParserInternetSCSIException - If the integrity is violated.protected int serializeBytes1to3()
1 till 3 in the Basic
Header Segment.serializeBytes1to3 in class TargetMessageParserprotected int serializeBytes20to23()
20 till 23 in the Basic
Header Segment.serializeBytes20to23 in class TargetMessageParserprotected int serializeBytes36to39()
36 till 39 in the Basic
Header Segment.serializeBytes36to39 in class TargetMessageParserprotected int serializeBytes40to43()
40 till 43 in the Basic
Header Segment.serializeBytes40to43 in class TargetMessageParserprotected int serializeBytes44to47()
44 till 47 in the Basic
Header Segment.serializeBytes44to47 in class TargetMessageParserCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.