public final class LoginRequestParser extends InitiatorMessageParser
This class parses a Login Request message defined in the iSCSI Standard (RFC3720).
After establishing a TCP connection between an initiator and a target, the initiator MUST start a Login Phase to gain further access to the target’s resources.
The Login Phase (see Chapter 5) consists of a sequence of Login Requests and Responses that carry the same Initiator Task Tag.
Login Requests are always considered as immediate.
The version number of the current draft is0x00. As such, all devices MUST carry version
0x00 for both Version-min and Version-max.
Here the final flag has the following meaning: If set to 1, indicates that the initiator is
ready to transit to the next stage.
If the T bit is set to 1 and NSG is FullFeaturePhase,
then this also indicates that the initiator is ready for the Final Login Response (see Chapter 5).
1, indicates that the initiator is ready to transit to the
next stage.
If the T bit is set to 1 and NSG is FullFeaturePhase, then this also indicates that the
initiator is ready for the Final Login Response (see Chapter 5).
123, all other
Login Requests in the same Login Phase carry the CmdSN 123 and the first non-immediate command
in FullFeaturePhase also carries the CmdSN 123.500, then that PDU carries CmdSN=500. Subsequent Login
Requests that are needed to complete this Login Phase may carry a CmdSN higher than 500 if
non-immediate requests that were issued on other connections in the same session advance CmdSN.
commandSequenceNumber, expectedStatusSequenceNumberlogicalUnitNumber, protocolDataUnit| Constructor and Description |
|---|
LoginRequestParser(ProtocolDataUnit initProtocolDataUnit)
Default constructor, creates a new, empty
LoginRequestParser object. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHaveDigests()
If this method returns
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest. |
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 |
deserializeBytes12to15(int line)
Parse the bytes
12 till 15 in the Basic Header
Segment. |
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. |
int |
getConnectionID()
A unique ID for this connection within the session.
|
LoginStage |
getCurrentStageNumber()
Returns the Current Stage Number of this Login Request Message.
|
DataSegmentFactory.DataSegmentFormat |
getDataSegmentFormat()
If this method returns
true, hen it indicates that the data
segment data is interpreted as binary data. |
ISID |
getInitiatorSessionID()
Returns the Initiator Session ID (ISID) of this
LoginRequestParser object.
|
byte |
getMaxVersion()
Maximum Version number supported.
|
byte |
getMinVersion()
All Login Requests within the Login Phase MUST carry the same
Version-min.
|
LoginStage |
getNextStageNumber()
Returns the Next Stage Number of this Login Request Message.
|
short |
getTargetSessionIdentifyingHandle()
Target Session Identifying Handle (TSIH) must be set in the
first Login Request.
|
boolean |
isContinueFlag()
When set to
1, indicates that the text (set of key=value
pairs) in this Login Request is not complete (it will be continued on
subsequent Login Requests); otherwise, it indicates that this Login
Request ends a set of key=value pairs. |
protected int |
serializeBytes12to15()
Serializes the bytes
12 till 15 in the Basic
Header Segment. |
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 |
serializeBytes8to11()
Serializes the bytes
8 till 11 in the Basic
Header Segment. |
void |
setConnectionID(int initCID)
Sets the new Connection ID of this LoginRequestParser object.
|
void |
setContinueFlag(boolean initContinueFlag)
Sets the new state of the Continue Flag of this
LoginRequestParser obejct. |
void |
setCurrentStageNumber(LoginStage initCSG)
Sets the new Current Stage Number of this
LoginRequestParser object. |
void |
setInitiatorSessionID(ISID initISID)
Sets the new Initiator Session ID (ISID) of this
LoginRequestParser object. |
void |
setMaxVersion(byte initMaxVersion)
Sets the new Maximum Version number of this
LoginRequestParser object. |
void |
setMinVersion(byte initMinVersion)
Sets the new Minimum Version number of this
LoginRequestParser object. |
void |
setNextStageNumber(LoginStage initNSG)
Sets the new Next Stage Number of this
LoginRequestParser object. |
void |
setTargetSessionIdentifyingHandle(short initTSIH)
Sets the new Target Session Identifying Handle of this
LoginRequestParser object. |
String |
toString()
This method concatenate all the fields of a derived parser to allow an
easy generation of debug informations.
|
deserializeBytes24to27, deserializeBytes28to31, deserializeBytes32to35, deserializeBytes36to39, deserializeBytes40to43, deserializeBytes44to47, getCommandSequenceNumber, getExpectedStatusSequenceNumber, getShortInfo, incrementSequenceNumber, serializeBytes24to27, serializeBytes28to31, serializeBytes32to35, serializeBytes36to39, serializeBytes40to43, serializeBytes44to47, setCommandSequenceNumber, setExpectedStatusSequenceNumbercanContainAdditionalHeaderSegments, deserializeBytes8to11, getLogicalUnitNumber, setLogicalUnitNumberpublic LoginRequestParser(ProtocolDataUnit initProtocolDataUnit)
LoginRequestParser object.initProtocolDataUnit - The reference ProtocolDataUnit instance, which
contains this LoginRequestParser 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 canHaveDigests()
true, then it indicates that this
derived AbstractMessageParser instance can be protected by a
digest.canHaveDigests in class AbstractMessageParsertrue, if the ProtocolDataUnit can be protected by a
header and/or a data digest. Else false.public final void clear()
clear in class InitiatorMessageParserpublic final int getConnectionID()
All Login Requests within the Login Phase MUST carry the same CID.
The target MUST use the value presented with the first Login Request.
A Login Request with a non-zero TSIH and a CID equal to that of an existing
connection implies a logout of the connection followed by a Login (see Section 5.3.4 Connection
Reinstatement). For the details of the implicit Logout Request, see Section 10.14 Logout Request.
public final boolean isContinueFlag()
1, indicates that the text (set of key=value
pairs) in this Login Request is not complete (it will be continued on
subsequent Login Requests); otherwise, it indicates that this Login
Request ends a set of key=value pairs. A Login Request with the C bit set to
1 MUST have the T bit
set to 0.true, if the Continue Bit is set. Else false.public final LoginStage getCurrentStageNumber()
Through these fields, Current Stage (CSG) and Next Stage (NSG), the Login negotiation requests and responses are associated with a specific stage in the session (SecurityNegotiation, LoginOperationalNegotiation, FullFeaturePhase) and may indicate the next stage to which they want to move (see Chapter 5). The next stage value is only valid when the T bit is 1; otherwise, it is reserved.
The stage codes are:
0 - SecurityNegotiation1 - LoginOperationalNegotiation3 - FullFeaturePhaseAll other codes are reserved.
LoginStagepublic final ISID getInitiatorSessionID()
LoginRequestParser
object.ISIDpublic final byte getMaxVersion()
All Login Requests within the Login Phase MUST carry the same Version-max.
The target MUST use the value presented with the first Login Request.
public final byte getMinVersion()
public final LoginStage getNextStageNumber()
Through these fields, Current Stage (CSG) and Next Stage (NSG), the Login negotiation requests and responses are associated with a specific stage in the session (SecurityNegotiation, LoginOperationalNegotiation, FullFeaturePhase) and may indicate the next stage to which they want to move (see Chapter 5). The next stage value is only valid when the T bit is 1; otherwise, it is reserved.
The stage codes are:
0 - SecurityNegotiation1 - LoginOperationalNegotiation3 - FullFeaturePhaseAll other codes are reserved.
LoginStagepublic final short getTargetSessionIdentifyingHandle()
0 MUST be used on
the first connection for a new session. Otherwise, the TSIH sent
by the target at the conclusion of the successful login of the first
connection for this session MUST be used. The TSIH identifies to
the target the associated existing session for this new connection.
All Login Requests within a Login Phase MUST carry the same TSIH.
The target MUST check the value presented with the first Login Request and act as specified in Section 5.3.1 Login Phase Start.
public final void setConnectionID(int initCID)
initCID - The new Connection ID.getConnectionID()public final void setContinueFlag(boolean initContinueFlag)
LoginRequestParser obejct.initContinueFlag - The new state of the Continue Flag.isContinueFlag()public final void setCurrentStageNumber(LoginStage initCSG)
LoginRequestParser object.initCSG - The new Current Stage Number.getCurrentStageNumber()public final void setInitiatorSessionID(ISID initISID)
LoginRequestParser object.initISID - The new Initiator Session ID (ISID).public final void setMaxVersion(byte initMaxVersion)
LoginRequestParser object.initMaxVersion - The new Maximum Version.getMaxVersion()public final void setMinVersion(byte initMinVersion)
LoginRequestParser object.initMinVersion - The new Minimum Version.getMinVersion()public final void setNextStageNumber(LoginStage initNSG)
LoginRequestParser object.initNSG - The new Next Stage Number.getNextStageNumber()public final void setTargetSessionIdentifyingHandle(short initTSIH)
LoginRequestParser object.initTSIH - The new Target Session Identifying Handle.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 deserializeBytes12to15(int line)
throws InternetSCSIException
12 till 15 in the Basic Header
Segment.deserializeBytes12to15 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 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 serializeBytes8to11()
throws InternetSCSIException
8 till 11 in the Basic
Header Segment.serializeBytes8to11 in class AbstractMessageParserInternetSCSIException - if any violation of the iSCSI Standard (RFC3720) occurs.protected final int serializeBytes12to15()
12 till 15 in the Basic
Header Segment.serializeBytes12to15 in class AbstractMessageParserprotected final int serializeBytes20to23()
20 till 23 in the Basic
Header Segment.serializeBytes20to23 in class InitiatorMessageParserCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.