public abstract class TargetMessageParser extends AbstractMessageParser
This abstract class is the base class of all target message parsers defined in the iSCSI Protocol (RFC3720). This class defines some methods, which are common in all parsers to simplify the parsing process.
| Modifier and Type | Field and Description |
|---|---|
protected int |
expectedCommandSequenceNumber
Next Expected Commamd Sequence Number.
|
protected int |
maximumCommandSequenceNumber
Maximum Command Sequence Number.
|
protected int |
statusSequenceNumber
Status Sequence Number.
|
logicalUnitNumber, protocolDataUnit| Constructor and Description |
|---|
TargetMessageParser(ProtocolDataUnit initProtocolDataUnit)
Default constructor, creates a new, empty
TargetMessageParser object. |
| Modifier and Type | Method and Description |
|---|---|
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 |
deserializeBytes24to27(int line)
Parse the bytes
24 till 27 in the Basic Header
Segment. |
protected void |
deserializeBytes28to31(int line)
Parse the bytes
28 till 31 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. |
int |
getExpectedCommandSequenceNumber()
Next Expected Commamd Sequence Number from this Initiator
ExpCmdSN is a Sequence Number
that the target iSCSI returns
to the initiator to acknowledge command reception. |
int |
getMaximumCommandSequenceNumber()
Maximum Command Sequence Number from this Initiator
MaxCmdSN is a Sequence Number that the
target iSCSI returns to the initiator to
indicate the maximum CmdSN the initiator can send. |
String |
getShortInfo()
Returns the short version of the used sequence numbers of this parser
instance.
|
int |
getStatusSequenceNumber()
The Status Sequence Number (StatSN) is a Sequence Number that the target
iSCSI layer generates per connection and that in turn, enables the
initiator to acknowledge status reception.
|
boolean |
incrementSequenceNumber()
This
AbstractMessageParser instance affects the
incrementation of the Expected Status Sequence Number. |
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 |
serializeBytes24to27()
Serializes the bytes
24 till 27 in the Basic
Header Segment. |
protected int |
serializeBytes28to31()
Serializes the bytes
28 till 31 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 |
setExpectedCommandSequenceNumber(int newExpectedCommandSequenceNumber)
Sets the Expected Command Sequence Number of this
TargetMessageParser object to the given
value. |
void |
setMaximumCommandSequenceNumber(int newMaximumCommandSequenceNumber)
Sets the Maximum Command Sequence Number of this
TargetMessageParser object to the given
value. |
void |
setStatusSequenceNumber(int newStatusSequenceNumber)
Sets the Status Sequence Number of this
TargetMessageParser object to the given value. |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
canContainAdditionalHeaderSegments, canHaveDigests, checkIntegrity, deserializeBytes12to15, deserializeBytes8to11, getDataSegmentFormat, getLogicalUnitNumber, serializeBytes12to15, serializeBytes8to11, setLogicalUnitNumberprotected int statusSequenceNumber
protected int expectedCommandSequenceNumber
protected int maximumCommandSequenceNumber
public TargetMessageParser(ProtocolDataUnit initProtocolDataUnit)
TargetMessageParser object.initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this TargetMessageParser subclass
object.public String getShortInfo()
getShortInfo in class AbstractMessageParserpublic String toString()
toString in class AbstractMessageParserpublic void clear()
clear in class AbstractMessageParserpublic boolean incrementSequenceNumber()
AbstractMessageParser instance affects the
incrementation of the Expected Status Sequence Number.incrementSequenceNumber in class AbstractMessageParsertrue, if the counter has to be incremented. Else false.public final int getExpectedCommandSequenceNumber()
ExpCmdSN is a Sequence Number
that the target iSCSI returns
to the initiator to acknowledge command reception. It is used to update a
local variable with the same name. An ExpCmdSN equal to MaxCmdSN+1 indicates
that the target cannot accept new
commands.public final int getMaximumCommandSequenceNumber()
MaxCmdSN is a Sequence Number that the
target iSCSI returns to the initiator to
indicate the maximum CmdSN the initiator can send. It is
used to update a local variable with the same name. If MaxCmdSN is equal to
ExpCmdSN-1, this indicates
to the initiator that the target cannot receive any additional commands.
When MaxCmdSN changes at the target while the target has no
pending PDUs to convey this information to the initiator, it MUST
generate a NOP-IN to carry the new MaxCmdSN.public final int getStatusSequenceNumber()
StatSN is
incremented by 1 for every response/status sent on a
connection except for responses sent as a result of a retry or SNACK. In
the case of responses sent due to a retransmission request, the StatSN MUST be the same as
the first time the PDU was sent
unless the connection has since been restarted.public final void setExpectedCommandSequenceNumber(int newExpectedCommandSequenceNumber)
TargetMessageParser object to the given
value.newExpectedCommandSequenceNumber - The new Expected Command Sequence Number.public final void setMaximumCommandSequenceNumber(int newMaximumCommandSequenceNumber)
TargetMessageParser object to the given
value.newMaximumCommandSequenceNumber - The new Maximum Command Sequence Number.public final void setStatusSequenceNumber(int newStatusSequenceNumber)
TargetMessageParser object to the given value.newStatusSequenceNumber - The new Status Sequence Number.protected void deserializeBytes1to3(int line)
throws InternetSCSIException
1 till 3 in the Basic Header
Segment.deserializeBytes1to3 in class AbstractMessageParserline - 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 AbstractMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes24to27(int line)
throws InternetSCSIException
24 till 27 in the Basic Header
Segment.deserializeBytes24to27 in class AbstractMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected final void deserializeBytes28to31(int line)
throws InternetSCSIException
28 till 31 in the Basic Header
Segment.deserializeBytes28to31 in class AbstractMessageParserline - 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 AbstractMessageParserline - 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 AbstractMessageParserline - 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 AbstractMessageParserline - 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 AbstractMessageParserline - The actual lineInternetSCSIException - If any violation of the iSCSI-Standard emerge.protected int serializeBytes1to3()
1 till 3 in the Basic
Header Segment.serializeBytes1to3 in class AbstractMessageParserprotected int serializeBytes20to23()
20 till 23 in the Basic
Header Segment.serializeBytes20to23 in class AbstractMessageParserprotected int serializeBytes24to27()
24 till 27 in the Basic
Header Segment.serializeBytes24to27 in class AbstractMessageParserprotected int serializeBytes28to31()
28 till 31 in the Basic
Header Segment.serializeBytes28to31 in class AbstractMessageParserprotected int serializeBytes32to35()
32 till 35 in the Basic
Header Segment.serializeBytes32to35 in class AbstractMessageParserprotected int serializeBytes36to39()
36 till 39 in the Basic
Header Segment.serializeBytes36to39 in class AbstractMessageParserprotected int serializeBytes40to43()
40 till 43 in the Basic
Header Segment.serializeBytes40to43 in class AbstractMessageParserprotected int serializeBytes44to47()
44 till 47 in the Basic
Header Segment.serializeBytes44to47 in class AbstractMessageParserCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.