TianoCore EDK2 master
Loading...
Searching...
No Matches
IScsiProto.h File Reference

Go to the source code of this file.

Data Structures

struct  _ISCSI_BASIC_HEADER
 
struct  _ISCSI_ADDTIONAL_HEADER
 
struct  _ISCSI_BI_EXP_READ_DATA_LEN_AHS
 
struct  _SCSI_COMMAND
 
struct  _SCSI_RESPONSE
 
struct  _ISCSI_SENSE_DATA
 
struct  _ISCSI_TMF_REQUEST
 
struct  _ISCSI_TMF_RESPONSE
 
struct  _ISCSI_SCSI_DATA_OUT
 
struct  _ISCSI_SCSI_DATA_IN
 
struct  _ISCSI_READY_TO_TRANSFER
 
struct  _ISCSI_ASYNC_MESSAGE
 
struct  _ISCSI_LOGIN_REQUEST
 
struct  _ISCSI_LOGIN_RESPONSE
 
struct  _ISCSI_LOGOUT_REQUEST
 
struct  _ISCSI_LOGOUT_RESPONSE
 
struct  _ISCSI_SNACK_REQUEST
 
struct  _ISCSI_REJECT
 
struct  _ISCSI_NOP_OUT
 
struct  _ISCSI_NOP_IN
 
struct  _ISCSI_XFER_CONTEXT
 
struct  _ISCSI_IN_BUFFER_CONTEXT
 
struct  _ISCSI_TCB
 
struct  _ISCSI_KEY_VALUE_PAIR
 

Macros

#define ISCSI_SEQ_EQ(s1, s2)   ((s1) == (s2))
 
#define ISCSI_SEQ_LT(s1, s2)
 
#define ISCSI_SEQ_GT(s1, s2)
 
#define ISCSI_WELL_KNOWN_PORT   3260
 
#define ISCSI_MAX_CONNS_PER_SESSION   1
 
#define DEFAULT_MAX_RECV_DATA_SEG_LEN   8192
 
#define MAX_RECV_DATA_SEG_LEN_IN_FFP   65536
 
#define DEFAULT_MAX_OUTSTANDING_R2T   1
 
#define ISCSI_VERSION_MAX   0x00
 
#define ISCSI_VERSION_MIN   0x00
 
#define ISCSI_CHECK_MEDIA_LOGIN_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)
 
#define ISCSI_CHECK_MEDIA_GET_DHCP_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)
 
#define ISCSI_REDIRECT_ADDR_START_DELIMITER   '['
 
#define ISCSI_REDIRECT_ADDR_END_DELIMITER   ']'
 
#define ISCSI_KEY_AUTH_METHOD   "AuthMethod"
 
#define ISCSI_KEY_HEADER_DIGEST   "HeaderDigest"
 
#define ISCSI_KEY_DATA_DIGEST   "DataDigest"
 
#define ISCSI_KEY_MAX_CONNECTIONS   "MaxConnections"
 
#define ISCSI_KEY_TARGET_NAME   "TargetName"
 
#define ISCSI_KEY_INITIATOR_NAME   "InitiatorName"
 
#define ISCSI_KEY_TARGET_ALIAS   "TargetAlias"
 
#define ISCSI_KEY_INITIATOR_ALIAS   "InitiatorAlias"
 
#define ISCSI_KEY_TARGET_ADDRESS   "TargetAddress"
 
#define ISCSI_KEY_INITIAL_R2T   "InitialR2T"
 
#define ISCSI_KEY_IMMEDIATE_DATA   "ImmediateData"
 
#define ISCSI_KEY_TARGET_PORTAL_GROUP_TAG   "TargetPortalGroupTag"
 
#define ISCSI_KEY_MAX_BURST_LENGTH   "MaxBurstLength"
 
#define ISCSI_KEY_FIRST_BURST_LENGTH   "FirstBurstLength"
 
#define ISCSI_KEY_DEFAULT_TIME2WAIT   "DefaultTime2Wait"
 
#define ISCSI_KEY_DEFAULT_TIME2RETAIN   "DefaultTime2Retain"
 
#define ISCSI_KEY_MAX_OUTSTANDING_R2T   "MaxOutstandingR2T"
 
#define ISCSI_KEY_DATA_PDU_IN_ORDER   "DataPDUInOrder"
 
#define ISCSI_KEY_DATA_SEQUENCE_IN_ORDER   "DataSequenceInOrder"
 
#define ISCSI_KEY_ERROR_RECOVERY_LEVEL   "ErrorRecoveryLevel"
 
#define ISCSI_KEY_SESSION_TYPE   "SessionType"
 
#define ISCSI_KEY_MAX_RECV_DATA_SEGMENT_LENGTH   "MaxRecvDataSegmentLength"
 
#define ISCSI_KEY_VALUE_NONE   "None"
 
#define CONN_STATE_FREE   0
 
#define CONN_STATE_XPT_WAIT   1
 
#define CONN_STATE_IN_LOGIN   2
 
#define CONN_STATE_LOGGED_IN   3
 
#define CONN_STATE_IN_LOGOUT   4
 
#define CONN_STATE_LOGOUT_REQUESTED   5
 
#define CONN_STATE_CLEANUP_WAIT   6
 
#define CONN_STATE_IN_CLEANUP   7
 
#define SESSION_STATE_FREE   0
 
#define SESSION_STATE_LOGGED_IN   1
 
#define SESSION_STATE_FAILED   2
 
#define ISCSI_RESERVED_TAG   0xffffffff
 
#define ISCSI_REQ_IMMEDIATE   0x40
 
#define ISCSI_OPCODE_MASK   0x3F
 
#define ISCSI_SET_OPCODE(PduHdr, Op, Flgs)   ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) = ((Op) | (Flgs)))
 
#define ISCSI_GET_OPCODE(PduHdr)   ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) & ISCSI_OPCODE_MASK)
 
#define ISCSI_CHECK_OPCODE(PduHdr, Op)   ((((PduHdr)->OpCode) & ISCSI_OPCODE_MASK) == (Op))
 
#define ISCSI_IMMEDIATE_ON(PduHdr)   ((PduHdr)->OpCode & ISCSI_REQ_IMMEDIATE)
 
#define ISCSI_SET_FLAG(PduHdr, Flag)   (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags |= (BOOLEAN)(Flag))
 
#define ISCSI_CLEAR_FLAG(PduHdr, Flag)   (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags &= ~(Flag))
 
#define ISCSI_FLAG_ON(PduHdr, Flag)   ((BOOLEAN) ((((ISCSI_BASIC_HEADER *) (PduHdr))->Flags & (Flag)) == (Flag)))
 
#define ISCSI_SET_STAGES(PduHdr, Cur, Nxt)   ((PduHdr)->Flags = (UINT8) ((PduHdr)->Flags | ((Cur) << 2 | (Nxt))))
 
#define ISCSI_GET_CURRENT_STAGE(PduHdr)   ((UINT8) (((PduHdr)->Flags >> 2) & 0x3))
 
#define ISCSI_GET_NEXT_STAGE(PduHdr)   ((UINT8) (((PduHdr)->Flags) & 0x3))
 
#define ISCSI_GET_PAD_LEN(DataLen)   ((~(DataLen) + 1) & 0x3)
 
#define ISCSI_ROUNDUP(DataLen)   (((DataLen) + 3) &~(0x3))
 
#define HTON24(Dst, Src)
 
#define NTOH24(src)   (((src)[0] << 16) | ((src)[1] << 8) | ((src)[2]))
 
#define ISCSI_GET_DATASEG_LEN(PduHdr)   NTOH24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength)
 
#define ISCSI_SET_DATASEG_LEN(PduHdr, Len)   HTON24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength, (Len))
 
#define ISCSI_GET_BUFFER_OFFSET(PduHdr)   NTOHL (((ISCSI_SCSI_DATA_IN *) (PduHdr))->BufferOffset)
 
#define ISCSI_OPCODE_NOP_OUT   0x00
 
#define ISCSI_OPCODE_SCSI_CMD   0x01
 
#define ISCSI_OPCODE_SCSI_TMF_REQ   0x02
 
#define ISCSI_OPCODE_LOGIN_REQ   0x03
 
#define ISCSI_OPCODE_TEXT_REQ   0x04
 
#define ISCSI_OPCODE_SCSI_DATA_OUT   0x05
 
#define ISCSI_OPCODE_LOGOUT_REQ   0x06
 
#define ISCSI_OPCODE_SNACK_REQ   0x10
 
#define ISCSI_OPCODE_VENDOR_I0   0x1c
 
#define ISCSI_OPCODE_VENDOR_I1   0x1d
 
#define ISCSI_OPCODE_VENDOR_I2   0x1e
 
#define ISCSI_OPCODE_NOP_IN   0x20
 
#define ISCSI_OPCODE_SCSI_RSP   0x21
 
#define ISCSI_OPCODE_SCSI_TMF_RSP   0x22
 
#define ISCSI_OPCODE_LOGIN_RSP   0x23
 
#define ISCSI_OPCODE_TEXT_RSP   0x24
 
#define ISCSI_OPCODE_SCSI_DATA_IN   0x25
 
#define ISCSI_OPCODE_LOGOUT_RSP   0x26
 
#define ISCSI_OPCODE_R2T   0x31
 
#define ISCSI_OPCODE_ASYNC_MSG   0x32
 
#define ISCSI_OPCODE_VENDOR_T0   0x3c
 
#define ISCSI_OPCODE_VENDOR_T1   0x3d
 
#define ISCSI_OPCODE_VENDOR_T2   0x3e
 
#define ISCSI_OPCODE_REJECT   0x3f
 
#define ISCSI_BHS_FLAG_FINAL   0x80
 
#define ISCSI_AHS_TYPE_EXT_CDB   0x1
 
#define ISCSI_AHS_TYPE_BI_EXP_READ_DATA_LEN   0x2
 
#define SCSI_CMD_PDU_FLAG_READ   0x40
 
#define SCSI_CMD_PDU_FLAG_WRITE   0x20
 
#define ISCSI_CMD_PDU_TASK_ATTR_MASK   0x07
 
#define ISCSI_TASK_ATTR_UNTAGGED   0x00
 
#define ISCSI_TASK_ATTR_SIMPLE   0x01
 
#define ISCSI_TASK_ATTR_ORDERD   0x02
 
#define ISCSI_TASK_ATTR_HOQ   0x03
 
#define ISCSI_TASK_ATTR_ACA   0x04
 
#define SCSI_RSP_PDU_FLAG_BI_READ_OVERFLOW   0x10
 
#define SCSI_RSP_PDU_FLAG_BI_READ_UNDERFLOW   0x08
 
#define SCSI_RSP_PDU_FLAG_OVERFLOW   0x04
 
#define SCSI_RSP_PDU_FLAG_UNDERFLOW   0x02
 
#define ISCSI_SERVICE_RSP_COMMAND_COMPLETE_AT_TARGET   0x00
 
#define ISCSI_SERVICE_RSP_TARGET_FAILURE   0x01
 
#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_COMPLETE   0
 
#define ISCSI_TMF_RSP_PDU_RSP_TASK_NOT_EXIST   1
 
#define ISCSI_TMF_RSP_PDU_RSP_LUN_NOT_EXIST   2
 
#define ISCSI_TMF_RSP_PDU_RSP_TASK_STILL_ALLEGIANT   3
 
#define ISCSI_TMF_RSP_PDU_RSP_TASK_REASSGIN_NOT_SUPPORTED   4
 
#define ISCSI_TMF_RSP_PDU_RSP_NOT_SUPPORTED   5
 
#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_AHTH_FAILED   6
 
#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_REJECTED   255
 
#define SCSI_DATA_IN_PDU_FLAG_ACKKNOWLEDGE   0x40
 
#define SCSI_DATA_IN_PDU_FLAG_OVERFLOW   SCSI_RSP_PDU_FLAG_OVERFLOW
 
#define SCSI_DATA_IN_PDU_FLAG_UNDERFLOW   SCSI_RSP_PDU_FLAG_UNDERFLOW
 
#define SCSI_DATA_IN_PDU_FLAG_STATUS_VALID   0x01
 
#define ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT   0x80
 
#define ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE   0x40
 
#define ISCSI_LOGIN_RSP_PDU_FLAG_TRANSIT   ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT
 
#define ISCSI_LOGIN_RSP_PDU_FLAG_CONTINUE   ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE
 
#define ISCSI_LOGIN_STATUS_SUCCESS   0
 
#define ISCSI_LOGIN_STATUS_REDIRECTION   1
 
#define ISCSI_LOGIN_STATUS_INITIATOR_ERROR   2
 
#define ISCSI_LOGIN_STATUS_TARGET_ERROR   3
 
#define ISCSI_LOGOUT_REASON_CLOSE_SESSION   0
 
#define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION   1
 
#define ISCSI_LOGOUT_REASON_REMOVE_CONNECTION_FOR_RECOVERY   2
 
#define ISCSI_LOGOUT_RESPONSE_SESSION_CLOSED_SUCCESS   0
 
#define ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND   1
 
#define ISCSI_LOGOUT_RESPONSE_RECOVERY_NOT_SUPPORTED   2
 
#define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED   3
 
#define ISCSI_SNACK_REQUEST_TYPE_DATA_OR_R2T   0
 
#define ISCSI_SNACK_REQUEST_TYPE_STATUS   1
 
#define ISCSI_SNACK_REQUEST_TYPE_DATA_ACK   2
 
#define ISCSI_SNACK_REQUEST_TYPE_RDATA   3
 
#define ISCSI_SECURITY_NEGOTIATION   0
 
#define ISCSI_LOGIN_OPERATIONAL_NEGOTIATION   1
 
#define ISCSI_FULL_FEATURE_PHASE   3
 

Typedefs

typedef struct _ISCSI_SESSION ISCSI_SESSION
 
typedef struct _ISCSI_CONNECTION ISCSI_CONNECTION
 
typedef struct _ISCSI_BASIC_HEADER ISCSI_BASIC_HEADER
 
typedef struct _ISCSI_ADDTIONAL_HEADER ISCSI_ADDITIONAL_HEADER
 
typedef struct _ISCSI_BI_EXP_READ_DATA_LEN_AHS ISCSI_BI_EXP_READ_DATA_LEN_AHS
 
typedef struct _SCSI_COMMAND SCSI_COMMAND
 
typedef struct _SCSI_RESPONSE SCSI_RESPONSE
 
typedef struct _ISCSI_SENSE_DATA ISCSI_SENSE_DATA
 
typedef struct _ISCSI_TMF_REQUEST ISCSI_TMF_REQUEST
 
typedef struct _ISCSI_TMF_RESPONSE ISCSI_TMF_RESPONSE
 
typedef struct _ISCSI_SCSI_DATA_OUT ISCSI_SCSI_DATA_OUT
 
typedef struct _ISCSI_SCSI_DATA_IN ISCSI_SCSI_DATA_IN
 
typedef struct _ISCSI_READY_TO_TRANSFER ISCSI_READY_TO_TRANSFER
 
typedef struct _ISCSI_ASYNC_MESSAGE ISCSI_ASYNC_MESSAGE
 
typedef struct _ISCSI_LOGIN_REQUEST ISCSI_LOGIN_REQUEST
 
typedef struct _ISCSI_LOGIN_RESPONSE ISCSI_LOGIN_RESPONSE
 
typedef struct _ISCSI_LOGOUT_REQUEST ISCSI_LOGOUT_REQUEST
 
typedef struct _ISCSI_LOGOUT_RESPONSE ISCSI_LOGOUT_RESPONSE
 
typedef struct _ISCSI_SNACK_REQUEST ISCSI_SNACK_REQUEST
 
typedef struct _ISCSI_REJECT ISCSI_REJECT
 
typedef struct _ISCSI_NOP_OUT ISCSI_NOP_OUT
 
typedef struct _ISCSI_NOP_IN ISCSI_NOP_IN
 
typedef struct _ISCSI_XFER_CONTEXT ISCSI_XFER_CONTEXT
 
typedef struct _ISCSI_IN_BUFFER_CONTEXT ISCSI_IN_BUFFER_CONTEXT
 
typedef struct _ISCSI_TCB ISCSI_TCB
 
typedef struct _ISCSI_KEY_VALUE_PAIR ISCSI_KEY_VALUE_PAIR
 

Enumerations

enum  DATA_DIRECTION { DataIn = 0 , DataOut = 1 , DataBi = 2 }
 
enum  ISCSI_DIGEST_TYPE { IScsiDigestNone , IScsiDigestCRC32 }
 

Functions

VOID IScsiAttatchConnection (IN OUT ISCSI_SESSION *Session, IN OUT ISCSI_CONNECTION *Conn)
 
VOID IScsiDetatchConnection (IN OUT ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiConnLogin (IN OUT ISCSI_CONNECTION *Conn, IN UINT16 Timeout)
 
ISCSI_CONNECTIONIScsiCreateConnection (IN ISCSI_SESSION *Session)
 
VOID IScsiDestroyConnection (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiSessionLogin (IN ISCSI_SESSION *Session)
 
EFI_STATUS IScsiSessionReLogin (IN ISCSI_SESSION *Session)
 
EFI_STATUS IScsiSendLoginReq (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiReceiveLoginRsp (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiAddKeyValuePair (IN OUT NET_BUF *Pdu, IN CHAR8 *Key, IN CHAR8 *Value)
 
NET_BUFIScsiPrepareLoginReq (IN OUT ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiProcessLoginRsp (IN OUT ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
 
EFI_STATUS IScsiUpdateTargetAddress (IN OUT ISCSI_SESSION *Session, IN CHAR8 *Data, IN UINT32 Len)
 
VOID EFIAPI IScsiFreeNbufList (VOID *Arg)
 
EFI_STATUS IScsiReceivePdu (IN ISCSI_CONNECTION *Conn, OUT NET_BUF **Pdu, IN ISCSI_IN_BUFFER_CONTEXT *Context OPTIONAL, IN BOOLEAN HeaderDigest, IN BOOLEAN DataDigest, IN EFI_EVENT TimeoutEvent OPTIONAL)
 
EFI_STATUS IScsiCheckOpParams (IN OUT ISCSI_CONNECTION *Conn)
 
VOID IScsiFillOpParams (IN ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
 
EFI_STATUS IScsiPadSegment (IN OUT NET_BUF *Pdu, IN UINT32 Len)
 
LIST_ENTRYIScsiBuildKeyValueList (IN CHAR8 *Data, IN UINT32 Len)
 
CHAR8 * IScsiGetValueByKeyFromList (IN OUT LIST_ENTRY *KeyValueList, IN CHAR8 *Key)
 
VOID IScsiFreeKeyValueList (IN LIST_ENTRY *KeyValueList)
 
EFI_STATUS IScsiNormalizeName (IN OUT CHAR8 *Name, IN UINTN Len)
 
EFI_STATUS IScsiExecuteScsiCommand (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS IScsiSessionReinstatement (IN ISCSI_SESSION *Session)
 
VOID IScsiSessionInit (IN OUT ISCSI_SESSION *Session, IN BOOLEAN Recovery)
 
VOID IScsiSessionAbort (IN OUT ISCSI_SESSION *Session)
 

Detailed Description

The header file of iSCSI Protocol that defines many specific data structures.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file IScsiProto.h.

Macro Definition Documentation

◆ CONN_STATE_CLEANUP_WAIT

#define CONN_STATE_CLEANUP_WAIT   6

Definition at line 78 of file IScsiProto.h.

◆ CONN_STATE_FREE

#define CONN_STATE_FREE   0

connection state for initiator

Definition at line 72 of file IScsiProto.h.

◆ CONN_STATE_IN_CLEANUP

#define CONN_STATE_IN_CLEANUP   7

Definition at line 79 of file IScsiProto.h.

◆ CONN_STATE_IN_LOGIN

#define CONN_STATE_IN_LOGIN   2

Definition at line 74 of file IScsiProto.h.

◆ CONN_STATE_IN_LOGOUT

#define CONN_STATE_IN_LOGOUT   4

Definition at line 76 of file IScsiProto.h.

◆ CONN_STATE_LOGGED_IN

#define CONN_STATE_LOGGED_IN   3

Definition at line 75 of file IScsiProto.h.

◆ CONN_STATE_LOGOUT_REQUESTED

#define CONN_STATE_LOGOUT_REQUESTED   5

Definition at line 77 of file IScsiProto.h.

◆ CONN_STATE_XPT_WAIT

#define CONN_STATE_XPT_WAIT   1

Definition at line 73 of file IScsiProto.h.

◆ DEFAULT_MAX_OUTSTANDING_R2T

#define DEFAULT_MAX_OUTSTANDING_R2T   1

Definition at line 32 of file IScsiProto.h.

◆ DEFAULT_MAX_RECV_DATA_SEG_LEN

#define DEFAULT_MAX_RECV_DATA_SEG_LEN   8192

Definition at line 30 of file IScsiProto.h.

◆ HTON24

#define HTON24 (   Dst,
  Src 
)
Value:
do { \
(Dst)[0] = (UINT8) ((UINT8) ((Src) >> 16) & 0xFF); \
(Dst)[1] = (UINT8) ((UINT8) ((Src) >> 8) & 0xFF); \
(Dst)[2] = (UINT8) ((UINT8) (Src) & 0xFF); \
} while (0);

Definition at line 107 of file IScsiProto.h.

◆ ISCSI_AHS_TYPE_BI_EXP_READ_DATA_LEN

#define ISCSI_AHS_TYPE_BI_EXP_READ_DATA_LEN   0x2

Definition at line 158 of file IScsiProto.h.

◆ ISCSI_AHS_TYPE_EXT_CDB

#define ISCSI_AHS_TYPE_EXT_CDB   0x1

Definition at line 157 of file IScsiProto.h.

◆ ISCSI_BHS_FLAG_FINAL

#define ISCSI_BHS_FLAG_FINAL   0x80

Definition at line 152 of file IScsiProto.h.

◆ ISCSI_CHECK_MEDIA_GET_DHCP_WAITING_TIME

#define ISCSI_CHECK_MEDIA_GET_DHCP_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)

Definition at line 38 of file IScsiProto.h.

◆ ISCSI_CHECK_MEDIA_LOGIN_WAITING_TIME

#define ISCSI_CHECK_MEDIA_LOGIN_WAITING_TIME   EFI_TIMER_PERIOD_SECONDS(20)

Definition at line 37 of file IScsiProto.h.

◆ ISCSI_CHECK_OPCODE

#define ISCSI_CHECK_OPCODE (   PduHdr,
  Op 
)    ((((PduHdr)->OpCode) & ISCSI_OPCODE_MASK) == (Op))

Definition at line 95 of file IScsiProto.h.

◆ ISCSI_CLEAR_FLAG

#define ISCSI_CLEAR_FLAG (   PduHdr,
  Flag 
)    (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags &= ~(Flag))

Definition at line 98 of file IScsiProto.h.

◆ ISCSI_CMD_PDU_TASK_ATTR_MASK

#define ISCSI_CMD_PDU_TASK_ATTR_MASK   0x07

Definition at line 163 of file IScsiProto.h.

◆ ISCSI_FLAG_ON

#define ISCSI_FLAG_ON (   PduHdr,
  Flag 
)    ((BOOLEAN) ((((ISCSI_BASIC_HEADER *) (PduHdr))->Flags & (Flag)) == (Flag)))

Definition at line 99 of file IScsiProto.h.

◆ ISCSI_FULL_FEATURE_PHASE

#define ISCSI_FULL_FEATURE_PHASE   3

Definition at line 229 of file IScsiProto.h.

◆ ISCSI_GET_BUFFER_OFFSET

#define ISCSI_GET_BUFFER_OFFSET (   PduHdr)    NTOHL (((ISCSI_SCSI_DATA_IN *) (PduHdr))->BufferOffset)

Definition at line 118 of file IScsiProto.h.

◆ ISCSI_GET_CURRENT_STAGE

#define ISCSI_GET_CURRENT_STAGE (   PduHdr)    ((UINT8) (((PduHdr)->Flags >> 2) & 0x3))

Definition at line 101 of file IScsiProto.h.

◆ ISCSI_GET_DATASEG_LEN

#define ISCSI_GET_DATASEG_LEN (   PduHdr)    NTOH24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength)

Definition at line 116 of file IScsiProto.h.

◆ ISCSI_GET_NEXT_STAGE

#define ISCSI_GET_NEXT_STAGE (   PduHdr)    ((UINT8) (((PduHdr)->Flags) & 0x3))

Definition at line 102 of file IScsiProto.h.

◆ ISCSI_GET_OPCODE

#define ISCSI_GET_OPCODE (   PduHdr)    ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) & ISCSI_OPCODE_MASK)

Definition at line 94 of file IScsiProto.h.

◆ ISCSI_GET_PAD_LEN

#define ISCSI_GET_PAD_LEN (   DataLen)    ((~(DataLen) + 1) & 0x3)

Definition at line 104 of file IScsiProto.h.

◆ ISCSI_IMMEDIATE_ON

#define ISCSI_IMMEDIATE_ON (   PduHdr)    ((PduHdr)->OpCode & ISCSI_REQ_IMMEDIATE)

Definition at line 96 of file IScsiProto.h.

◆ ISCSI_KEY_AUTH_METHOD

#define ISCSI_KEY_AUTH_METHOD   "AuthMethod"

Definition at line 43 of file IScsiProto.h.

◆ ISCSI_KEY_DATA_DIGEST

#define ISCSI_KEY_DATA_DIGEST   "DataDigest"

Definition at line 45 of file IScsiProto.h.

◆ ISCSI_KEY_DATA_PDU_IN_ORDER

#define ISCSI_KEY_DATA_PDU_IN_ORDER   "DataPDUInOrder"

Definition at line 60 of file IScsiProto.h.

◆ ISCSI_KEY_DATA_SEQUENCE_IN_ORDER

#define ISCSI_KEY_DATA_SEQUENCE_IN_ORDER   "DataSequenceInOrder"

Definition at line 61 of file IScsiProto.h.

◆ ISCSI_KEY_DEFAULT_TIME2RETAIN

#define ISCSI_KEY_DEFAULT_TIME2RETAIN   "DefaultTime2Retain"

Definition at line 58 of file IScsiProto.h.

◆ ISCSI_KEY_DEFAULT_TIME2WAIT

#define ISCSI_KEY_DEFAULT_TIME2WAIT   "DefaultTime2Wait"

Definition at line 57 of file IScsiProto.h.

◆ ISCSI_KEY_ERROR_RECOVERY_LEVEL

#define ISCSI_KEY_ERROR_RECOVERY_LEVEL   "ErrorRecoveryLevel"

Definition at line 62 of file IScsiProto.h.

◆ ISCSI_KEY_FIRST_BURST_LENGTH

#define ISCSI_KEY_FIRST_BURST_LENGTH   "FirstBurstLength"

Definition at line 56 of file IScsiProto.h.

◆ ISCSI_KEY_HEADER_DIGEST

#define ISCSI_KEY_HEADER_DIGEST   "HeaderDigest"

Definition at line 44 of file IScsiProto.h.

◆ ISCSI_KEY_IMMEDIATE_DATA

#define ISCSI_KEY_IMMEDIATE_DATA   "ImmediateData"

Definition at line 53 of file IScsiProto.h.

◆ ISCSI_KEY_INITIAL_R2T

#define ISCSI_KEY_INITIAL_R2T   "InitialR2T"

Definition at line 52 of file IScsiProto.h.

◆ ISCSI_KEY_INITIATOR_ALIAS

#define ISCSI_KEY_INITIATOR_ALIAS   "InitiatorAlias"

Definition at line 50 of file IScsiProto.h.

◆ ISCSI_KEY_INITIATOR_NAME

#define ISCSI_KEY_INITIATOR_NAME   "InitiatorName"

Definition at line 48 of file IScsiProto.h.

◆ ISCSI_KEY_MAX_BURST_LENGTH

#define ISCSI_KEY_MAX_BURST_LENGTH   "MaxBurstLength"

Definition at line 55 of file IScsiProto.h.

◆ ISCSI_KEY_MAX_CONNECTIONS

#define ISCSI_KEY_MAX_CONNECTIONS   "MaxConnections"

Definition at line 46 of file IScsiProto.h.

◆ ISCSI_KEY_MAX_OUTSTANDING_R2T

#define ISCSI_KEY_MAX_OUTSTANDING_R2T   "MaxOutstandingR2T"

Definition at line 59 of file IScsiProto.h.

◆ ISCSI_KEY_MAX_RECV_DATA_SEGMENT_LENGTH

#define ISCSI_KEY_MAX_RECV_DATA_SEGMENT_LENGTH   "MaxRecvDataSegmentLength"

Definition at line 64 of file IScsiProto.h.

◆ ISCSI_KEY_SESSION_TYPE

#define ISCSI_KEY_SESSION_TYPE   "SessionType"

Definition at line 63 of file IScsiProto.h.

◆ ISCSI_KEY_TARGET_ADDRESS

#define ISCSI_KEY_TARGET_ADDRESS   "TargetAddress"

Definition at line 51 of file IScsiProto.h.

◆ ISCSI_KEY_TARGET_ALIAS

#define ISCSI_KEY_TARGET_ALIAS   "TargetAlias"

Definition at line 49 of file IScsiProto.h.

◆ ISCSI_KEY_TARGET_NAME

#define ISCSI_KEY_TARGET_NAME   "TargetName"

Definition at line 47 of file IScsiProto.h.

◆ ISCSI_KEY_TARGET_PORTAL_GROUP_TAG

#define ISCSI_KEY_TARGET_PORTAL_GROUP_TAG   "TargetPortalGroupTag"

Definition at line 54 of file IScsiProto.h.

◆ ISCSI_KEY_VALUE_NONE

#define ISCSI_KEY_VALUE_NONE   "None"

Definition at line 66 of file IScsiProto.h.

◆ ISCSI_LOGIN_OPERATIONAL_NEGOTIATION

#define ISCSI_LOGIN_OPERATIONAL_NEGOTIATION   1

Definition at line 228 of file IScsiProto.h.

◆ ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE

#define ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE   0x40

Definition at line 203 of file IScsiProto.h.

◆ ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT

#define ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT   0x80

Definition at line 202 of file IScsiProto.h.

◆ ISCSI_LOGIN_RSP_PDU_FLAG_CONTINUE

#define ISCSI_LOGIN_RSP_PDU_FLAG_CONTINUE   ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE

Definition at line 206 of file IScsiProto.h.

◆ ISCSI_LOGIN_RSP_PDU_FLAG_TRANSIT

#define ISCSI_LOGIN_RSP_PDU_FLAG_TRANSIT   ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT

Definition at line 205 of file IScsiProto.h.

◆ ISCSI_LOGIN_STATUS_INITIATOR_ERROR

#define ISCSI_LOGIN_STATUS_INITIATOR_ERROR   2

Definition at line 210 of file IScsiProto.h.

◆ ISCSI_LOGIN_STATUS_REDIRECTION

#define ISCSI_LOGIN_STATUS_REDIRECTION   1

Definition at line 209 of file IScsiProto.h.

◆ ISCSI_LOGIN_STATUS_SUCCESS

#define ISCSI_LOGIN_STATUS_SUCCESS   0

Definition at line 208 of file IScsiProto.h.

◆ ISCSI_LOGIN_STATUS_TARGET_ERROR

#define ISCSI_LOGIN_STATUS_TARGET_ERROR   3

Definition at line 211 of file IScsiProto.h.

◆ ISCSI_LOGOUT_REASON_CLOSE_CONNECTION

#define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION   1

Definition at line 214 of file IScsiProto.h.

◆ ISCSI_LOGOUT_REASON_CLOSE_SESSION

#define ISCSI_LOGOUT_REASON_CLOSE_SESSION   0

Definition at line 213 of file IScsiProto.h.

◆ ISCSI_LOGOUT_REASON_REMOVE_CONNECTION_FOR_RECOVERY

#define ISCSI_LOGOUT_REASON_REMOVE_CONNECTION_FOR_RECOVERY   2

Definition at line 215 of file IScsiProto.h.

◆ ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND

#define ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND   1

Definition at line 218 of file IScsiProto.h.

◆ ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED

#define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED   3

Definition at line 220 of file IScsiProto.h.

◆ ISCSI_LOGOUT_RESPONSE_RECOVERY_NOT_SUPPORTED

#define ISCSI_LOGOUT_RESPONSE_RECOVERY_NOT_SUPPORTED   2

Definition at line 219 of file IScsiProto.h.

◆ ISCSI_LOGOUT_RESPONSE_SESSION_CLOSED_SUCCESS

#define ISCSI_LOGOUT_RESPONSE_SESSION_CLOSED_SUCCESS   0

Definition at line 217 of file IScsiProto.h.

◆ ISCSI_MAX_CONNS_PER_SESSION

#define ISCSI_MAX_CONNS_PER_SESSION   1

Definition at line 28 of file IScsiProto.h.

◆ ISCSI_OPCODE_ASYNC_MSG

#define ISCSI_OPCODE_ASYNC_MSG   0x32

Definition at line 146 of file IScsiProto.h.

◆ ISCSI_OPCODE_LOGIN_REQ

#define ISCSI_OPCODE_LOGIN_REQ   0x03

Definition at line 126 of file IScsiProto.h.

◆ ISCSI_OPCODE_LOGIN_RSP

#define ISCSI_OPCODE_LOGIN_RSP   0x23

Definition at line 141 of file IScsiProto.h.

◆ ISCSI_OPCODE_LOGOUT_REQ

#define ISCSI_OPCODE_LOGOUT_REQ   0x06

Definition at line 129 of file IScsiProto.h.

◆ ISCSI_OPCODE_LOGOUT_RSP

#define ISCSI_OPCODE_LOGOUT_RSP   0x26

Definition at line 144 of file IScsiProto.h.

◆ ISCSI_OPCODE_MASK

#define ISCSI_OPCODE_MASK   0x3F

Definition at line 91 of file IScsiProto.h.

◆ ISCSI_OPCODE_NOP_IN

#define ISCSI_OPCODE_NOP_IN   0x20

Definition at line 138 of file IScsiProto.h.

◆ ISCSI_OPCODE_NOP_OUT

#define ISCSI_OPCODE_NOP_OUT   0x00

Definition at line 123 of file IScsiProto.h.

◆ ISCSI_OPCODE_R2T

#define ISCSI_OPCODE_R2T   0x31

Definition at line 145 of file IScsiProto.h.

◆ ISCSI_OPCODE_REJECT

#define ISCSI_OPCODE_REJECT   0x3f

Definition at line 150 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_CMD

#define ISCSI_OPCODE_SCSI_CMD   0x01

Definition at line 124 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_DATA_IN

#define ISCSI_OPCODE_SCSI_DATA_IN   0x25

Definition at line 143 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_DATA_OUT

#define ISCSI_OPCODE_SCSI_DATA_OUT   0x05

Definition at line 128 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_RSP

#define ISCSI_OPCODE_SCSI_RSP   0x21

Definition at line 139 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_TMF_REQ

#define ISCSI_OPCODE_SCSI_TMF_REQ   0x02

Definition at line 125 of file IScsiProto.h.

◆ ISCSI_OPCODE_SCSI_TMF_RSP

#define ISCSI_OPCODE_SCSI_TMF_RSP   0x22

Definition at line 140 of file IScsiProto.h.

◆ ISCSI_OPCODE_SNACK_REQ

#define ISCSI_OPCODE_SNACK_REQ   0x10

Definition at line 130 of file IScsiProto.h.

◆ ISCSI_OPCODE_TEXT_REQ

#define ISCSI_OPCODE_TEXT_REQ   0x04

Definition at line 127 of file IScsiProto.h.

◆ ISCSI_OPCODE_TEXT_RSP

#define ISCSI_OPCODE_TEXT_RSP   0x24

Definition at line 142 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_I0

#define ISCSI_OPCODE_VENDOR_I0   0x1c

Definition at line 131 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_I1

#define ISCSI_OPCODE_VENDOR_I1   0x1d

Definition at line 132 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_I2

#define ISCSI_OPCODE_VENDOR_I2   0x1e

Definition at line 133 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_T0

#define ISCSI_OPCODE_VENDOR_T0   0x3c

Definition at line 147 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_T1

#define ISCSI_OPCODE_VENDOR_T1   0x3d

Definition at line 148 of file IScsiProto.h.

◆ ISCSI_OPCODE_VENDOR_T2

#define ISCSI_OPCODE_VENDOR_T2   0x3e

Definition at line 149 of file IScsiProto.h.

◆ ISCSI_REDIRECT_ADDR_END_DELIMITER

#define ISCSI_REDIRECT_ADDR_END_DELIMITER   ']'

Definition at line 41 of file IScsiProto.h.

◆ ISCSI_REDIRECT_ADDR_START_DELIMITER

#define ISCSI_REDIRECT_ADDR_START_DELIMITER   '['

Definition at line 40 of file IScsiProto.h.

◆ ISCSI_REQ_IMMEDIATE

#define ISCSI_REQ_IMMEDIATE   0x40

Definition at line 90 of file IScsiProto.h.

◆ ISCSI_RESERVED_TAG

#define ISCSI_RESERVED_TAG   0xffffffff

Definition at line 88 of file IScsiProto.h.

◆ ISCSI_ROUNDUP

#define ISCSI_ROUNDUP (   DataLen)    (((DataLen) + 3) &~(0x3))

Definition at line 105 of file IScsiProto.h.

◆ ISCSI_SECURITY_NEGOTIATION

#define ISCSI_SECURITY_NEGOTIATION   0

Definition at line 227 of file IScsiProto.h.

◆ ISCSI_SEQ_EQ

#define ISCSI_SEQ_EQ (   s1,
  s2 
)    ((s1) == (s2))

Definition at line 15 of file IScsiProto.h.

◆ ISCSI_SEQ_GT

#define ISCSI_SEQ_GT (   s1,
  s2 
)
Value:
( \
(((INT32) (s1) < (INT32) (s2)) && (s2 - s1) > ((UINT32) 1 << 31)) || \
(((INT32) (s1) > (INT32) (s2)) && (s1 - s2) < ((UINT32) 1 << 31)) \
)

Definition at line 21 of file IScsiProto.h.

◆ ISCSI_SEQ_LT

#define ISCSI_SEQ_LT (   s1,
  s2 
)
Value:
( \
(((INT32) (s1) < (INT32) (s2)) && (s2 - s1) < ((UINT32) 1 << 31)) || \
(((INT32) (s1) > (INT32) (s2)) && (s1 - s2) > ((UINT32) 1 << 31)) \
)

Definition at line 16 of file IScsiProto.h.

◆ ISCSI_SERVICE_RSP_COMMAND_COMPLETE_AT_TARGET

#define ISCSI_SERVICE_RSP_COMMAND_COMPLETE_AT_TARGET   0x00

Definition at line 185 of file IScsiProto.h.

◆ ISCSI_SERVICE_RSP_TARGET_FAILURE

#define ISCSI_SERVICE_RSP_TARGET_FAILURE   0x01

Definition at line 186 of file IScsiProto.h.

◆ ISCSI_SET_DATASEG_LEN

#define ISCSI_SET_DATASEG_LEN (   PduHdr,
  Len 
)    HTON24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength, (Len))

Definition at line 117 of file IScsiProto.h.

◆ ISCSI_SET_FLAG

#define ISCSI_SET_FLAG (   PduHdr,
  Flag 
)    (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags |= (BOOLEAN)(Flag))

Definition at line 97 of file IScsiProto.h.

◆ ISCSI_SET_OPCODE

#define ISCSI_SET_OPCODE (   PduHdr,
  Op,
  Flgs 
)    ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) = ((Op) | (Flgs)))

Definition at line 93 of file IScsiProto.h.

◆ ISCSI_SET_STAGES

#define ISCSI_SET_STAGES (   PduHdr,
  Cur,
  Nxt 
)    ((PduHdr)->Flags = (UINT8) ((PduHdr)->Flags | ((Cur) << 2 | (Nxt))))

Definition at line 100 of file IScsiProto.h.

◆ ISCSI_SNACK_REQUEST_TYPE_DATA_ACK

#define ISCSI_SNACK_REQUEST_TYPE_DATA_ACK   2

Definition at line 224 of file IScsiProto.h.

◆ ISCSI_SNACK_REQUEST_TYPE_DATA_OR_R2T

#define ISCSI_SNACK_REQUEST_TYPE_DATA_OR_R2T   0

Definition at line 222 of file IScsiProto.h.

◆ ISCSI_SNACK_REQUEST_TYPE_RDATA

#define ISCSI_SNACK_REQUEST_TYPE_RDATA   3

Definition at line 225 of file IScsiProto.h.

◆ ISCSI_SNACK_REQUEST_TYPE_STATUS

#define ISCSI_SNACK_REQUEST_TYPE_STATUS   1

Definition at line 223 of file IScsiProto.h.

◆ ISCSI_TASK_ATTR_ACA

#define ISCSI_TASK_ATTR_ACA   0x04

Definition at line 172 of file IScsiProto.h.

◆ ISCSI_TASK_ATTR_HOQ

#define ISCSI_TASK_ATTR_HOQ   0x03

Definition at line 171 of file IScsiProto.h.

◆ ISCSI_TASK_ATTR_ORDERD

#define ISCSI_TASK_ATTR_ORDERD   0x02

Definition at line 170 of file IScsiProto.h.

◆ ISCSI_TASK_ATTR_SIMPLE

#define ISCSI_TASK_ATTR_SIMPLE   0x01

Definition at line 169 of file IScsiProto.h.

◆ ISCSI_TASK_ATTR_UNTAGGED

#define ISCSI_TASK_ATTR_UNTAGGED   0x00

Definition at line 168 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_FUNCTION_AHTH_FAILED

#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_AHTH_FAILED   6

Definition at line 194 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_FUNCTION_COMPLETE

#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_COMPLETE   0

Definition at line 188 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_FUNCTION_REJECTED

#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_REJECTED   255

Definition at line 195 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_LUN_NOT_EXIST

#define ISCSI_TMF_RSP_PDU_RSP_LUN_NOT_EXIST   2

Definition at line 190 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_NOT_SUPPORTED

#define ISCSI_TMF_RSP_PDU_RSP_NOT_SUPPORTED   5

Definition at line 193 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_TASK_NOT_EXIST

#define ISCSI_TMF_RSP_PDU_RSP_TASK_NOT_EXIST   1

Definition at line 189 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_TASK_REASSGIN_NOT_SUPPORTED

#define ISCSI_TMF_RSP_PDU_RSP_TASK_REASSGIN_NOT_SUPPORTED   4

Definition at line 192 of file IScsiProto.h.

◆ ISCSI_TMF_RSP_PDU_RSP_TASK_STILL_ALLEGIANT

#define ISCSI_TMF_RSP_PDU_RSP_TASK_STILL_ALLEGIANT   3

Definition at line 191 of file IScsiProto.h.

◆ ISCSI_VERSION_MAX

#define ISCSI_VERSION_MAX   0x00

Definition at line 34 of file IScsiProto.h.

◆ ISCSI_VERSION_MIN

#define ISCSI_VERSION_MIN   0x00

Definition at line 35 of file IScsiProto.h.

◆ ISCSI_WELL_KNOWN_PORT

#define ISCSI_WELL_KNOWN_PORT   3260

Definition at line 27 of file IScsiProto.h.

◆ MAX_RECV_DATA_SEG_LEN_IN_FFP

#define MAX_RECV_DATA_SEG_LEN_IN_FFP   65536

Definition at line 31 of file IScsiProto.h.

◆ NTOH24

#define NTOH24 (   src)    (((src)[0] << 16) | ((src)[1] << 8) | ((src)[2]))

Definition at line 114 of file IScsiProto.h.

◆ SCSI_CMD_PDU_FLAG_READ

#define SCSI_CMD_PDU_FLAG_READ   0x40

Definition at line 160 of file IScsiProto.h.

◆ SCSI_CMD_PDU_FLAG_WRITE

#define SCSI_CMD_PDU_FLAG_WRITE   0x20

Definition at line 161 of file IScsiProto.h.

◆ SCSI_DATA_IN_PDU_FLAG_ACKKNOWLEDGE

#define SCSI_DATA_IN_PDU_FLAG_ACKKNOWLEDGE   0x40

Definition at line 197 of file IScsiProto.h.

◆ SCSI_DATA_IN_PDU_FLAG_OVERFLOW

#define SCSI_DATA_IN_PDU_FLAG_OVERFLOW   SCSI_RSP_PDU_FLAG_OVERFLOW

Definition at line 198 of file IScsiProto.h.

◆ SCSI_DATA_IN_PDU_FLAG_STATUS_VALID

#define SCSI_DATA_IN_PDU_FLAG_STATUS_VALID   0x01

Definition at line 200 of file IScsiProto.h.

◆ SCSI_DATA_IN_PDU_FLAG_UNDERFLOW

#define SCSI_DATA_IN_PDU_FLAG_UNDERFLOW   SCSI_RSP_PDU_FLAG_UNDERFLOW

Definition at line 199 of file IScsiProto.h.

◆ SCSI_RSP_PDU_FLAG_BI_READ_OVERFLOW

#define SCSI_RSP_PDU_FLAG_BI_READ_OVERFLOW   0x10

Definition at line 177 of file IScsiProto.h.

◆ SCSI_RSP_PDU_FLAG_BI_READ_UNDERFLOW

#define SCSI_RSP_PDU_FLAG_BI_READ_UNDERFLOW   0x08

Definition at line 178 of file IScsiProto.h.

◆ SCSI_RSP_PDU_FLAG_OVERFLOW

#define SCSI_RSP_PDU_FLAG_OVERFLOW   0x04

Definition at line 179 of file IScsiProto.h.

◆ SCSI_RSP_PDU_FLAG_UNDERFLOW

#define SCSI_RSP_PDU_FLAG_UNDERFLOW   0x02

Definition at line 180 of file IScsiProto.h.

◆ SESSION_STATE_FAILED

#define SESSION_STATE_FAILED   2

Definition at line 86 of file IScsiProto.h.

◆ SESSION_STATE_FREE

#define SESSION_STATE_FREE   0

session state for initiator

Definition at line 84 of file IScsiProto.h.

◆ SESSION_STATE_LOGGED_IN

#define SESSION_STATE_LOGGED_IN   1

Definition at line 85 of file IScsiProto.h.

Typedef Documentation

◆ ISCSI_BASIC_HEADER

iSCSI Basic Header Segment

◆ ISCSI_CONNECTION

Definition at line 232 of file IScsiProto.h.

◆ ISCSI_LOGIN_REQUEST

Login Request.

◆ ISCSI_LOGIN_RESPONSE

Login Response.

◆ ISCSI_LOGOUT_REQUEST

Logout Request.

◆ ISCSI_LOGOUT_RESPONSE

Logout Response.

◆ ISCSI_NOP_IN

typedef struct _ISCSI_NOP_IN ISCSI_NOP_IN

NOP-In.

◆ ISCSI_NOP_OUT

typedef struct _ISCSI_NOP_OUT ISCSI_NOP_OUT

NOP-Out.

◆ ISCSI_READY_TO_TRANSFER

Ready To Transfer.

◆ ISCSI_REJECT

typedef struct _ISCSI_REJECT ISCSI_REJECT

Reject.

◆ ISCSI_SCSI_DATA_IN

SCSI Data-In

◆ ISCSI_SCSI_DATA_OUT

SCSI Data-Out

◆ ISCSI_SESSION

typedef struct _ISCSI_SESSION ISCSI_SESSION

Definition at line 231 of file IScsiProto.h.

◆ ISCSI_SNACK_REQUEST

SNACK Request.

◆ ISCSI_TMF_REQUEST

iSCSI Task Management Function Request.

◆ ISCSI_TMF_RESPONSE

iSCSI Task Management Function Response.

◆ SCSI_COMMAND

typedef struct _SCSI_COMMAND SCSI_COMMAND

SCSI Command

◆ SCSI_RESPONSE

typedef struct _SCSI_RESPONSE SCSI_RESPONSE

SCSI Response

Enumeration Type Documentation

◆ DATA_DIRECTION

enum DATA_DIRECTION

Definition at line 234 of file IScsiProto.h.

◆ ISCSI_DIGEST_TYPE

enum ISCSI_DIGEST_TYPE

Definition at line 580 of file IScsiProto.h.

Function Documentation

◆ IScsiAddKeyValuePair()

EFI_STATUS IScsiAddKeyValuePair ( IN OUT NET_BUF Pdu,
IN CHAR8 *  Key,
IN CHAR8 *  Value 
)

Add an iSCSI key-value pair as a string into the data segment of the Login Request PDU. The DataSegmentLength and the actual size of the net buffer containing this PDU will be updated.

Parameters
[in,out]PduThe iSCSI PDU whose data segment the key-value pair will be added to.
[in]KeyThe key name string.
[in]ValueThe value string.
Return values
EFI_SUCCESSThe key-valu pair is added to the PDU's datasegment and the correspondence length fields are updated.
EFI_OUT_OF_RESOURCESThere is not enough space in the PDU to add the key-value pair.

Add an iSCSI key-value pair as a string into the data segment of the Login Request PDU. The DataSegmentLength and the actual size of the net buffer containing this PDU will be updated.

Parameters
[in,out]PduThe iSCSI PDU whose data segment the key-value pair will be added to.
[in]KeyThe key name string.
[in]ValueThe value string.
Return values
EFI_SUCCESSThe key-value pair is added to the PDU's data segment and the correspondence length fields are updated.
EFI_OUT_OF_RESOURCESThere is not enough space in the PDU to add the key-value pair.
EFI_PROTOCOL_ERRORThere is no such data in the net buffer.

Definition at line 677 of file IScsiProto.c.

◆ IScsiAttatchConnection()

VOID IScsiAttatchConnection ( IN OUT ISCSI_SESSION Session,
IN OUT ISCSI_CONNECTION Conn 
)

Attach the iSCSI connection to the iSCSI session.

Parameters
[in,out]SessionThe iSCSI session.
[in,out]ConnThe iSCSI connection.

Definition at line 21 of file IScsiProto.c.

◆ IScsiBuildKeyValueList()

LIST_ENTRY * IScsiBuildKeyValueList ( IN CHAR8 *  Data,
IN UINT32  Len 
)

Build a key-value list from the data segment.

Parameters
[in]DataThe data segment containing the key-value pairs.
[in]LenLength of the data segment.
Returns
The key-value list.
Return values
NULLOther errors as indicated.

Definition at line 1876 of file IScsiProto.c.

◆ IScsiCheckOpParams()

EFI_STATUS IScsiCheckOpParams ( IN OUT ISCSI_CONNECTION Conn)

Check and get the result of the parameter negotiation.

Parameters
[in,out]ConnThe connection in iSCSI login.
Return values
EFI_SUCCESSThe parameter check is passed and negotiation is finished.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 1505 of file IScsiProto.c.

◆ IScsiConnLogin()

EFI_STATUS IScsiConnLogin ( IN OUT ISCSI_CONNECTION Conn,
IN UINT16  Timeout 
)

This function performs the iSCSI connection login.

Parameters
[in,out]ConnThe iSCSI connection to login.
TimeoutThe timeout value in milliseconds.
Return values
EFI_SUCCESSThe iSCSI connection is logged into the iSCSI target.
EFI_TIMEOUTTimeout occurred during the login procedure.
OthersOther errors as indicated.

This function does the iSCSI connection login.

Parameters
[in,out]ConnThe iSCSI connection to login.
TimeoutThe timeout value in millisecond.
Return values
EFI_SUCCESSThe iSCSI connection is logged into the iSCSI target.
EFI_TIMEOUTTimeout occurred during the login procedure.
OthersOther errors as indicated.

Definition at line 122 of file IScsiProto.c.

◆ IScsiCreateConnection()

ISCSI_CONNECTION * IScsiCreateConnection ( IN ISCSI_SESSION Session)

Create a TCP connection for the iSCSI session.

Parameters
[in]SessionPoints to the iSCSI session.
Returns
The newly created iSCSI connection.

Definition at line 194 of file IScsiProto.c.

◆ IScsiDestroyConnection()

VOID IScsiDestroyConnection ( IN ISCSI_CONNECTION Conn)

Destroy an iSCSI connection.

Parameters
[in]ConnThe connection to destroy.

Definition at line 310 of file IScsiProto.c.

◆ IScsiDetatchConnection()

VOID IScsiDetatchConnection ( IN OUT ISCSI_CONNECTION Conn)

Detach the iSCSI connection from the session it belongs to.

Parameters
[in,out]ConnThe iSCSI connection.

Definition at line 38 of file IScsiProto.c.

◆ IScsiExecuteScsiCommand()

EFI_STATUS IScsiExecuteScsiCommand ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru,
IN UINT8 *  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.

Parameters
[in]PassThruThe EXT SCSI PASS THRU protocol.
[in]TargetThe target ID.
[in]LunThe LUN.
[in,out]PacketThe request packet containing IO request, SCSI command buffer and buffers to read/write.
Return values
EFI_SUCCESSThe SCSI command is executed and the result is updated to the Packet.
EFI_DEVICE_ERRORSession state was not as required.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_READYThe target can not accept new commands.
OthersOther errors as indicated.

Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.

Parameters
[in]PassThruThe EXT SCSI PASS THRU protocol.
[in]TargetThe target ID.
[in]LunThe LUN.
[in,out]PacketThe request packet containing IO request, SCSI command buffer and buffers to read/write.
Return values
EFI_SUCCESSThe SCSI command is executed and the result is updated to the Packet.
EFI_DEVICE_ERRORSession state was not as required.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORThere is no such data in the net buffer.
EFI_NOT_READYThe target can not accept new commands.
OthersOther errors as indicated.

Definition at line 2904 of file IScsiProto.c.

◆ IScsiFillOpParams()

VOID IScsiFillOpParams ( IN ISCSI_CONNECTION Conn,
IN OUT NET_BUF Pdu 
)

Fill the operational parameters.

Parameters
[in]ConnThe connection in iSCSI login.
[in,out]PduThe iSCSI login request PDU to fill the parameters.

Definition at line 1779 of file IScsiProto.c.

◆ IScsiFreeKeyValueList()

VOID IScsiFreeKeyValueList ( IN LIST_ENTRY KeyValueList)

Free the key-value list.

Parameters
[in]KeyValueListThe key-value list.

Definition at line 1978 of file IScsiProto.c.

◆ IScsiFreeNbufList()

VOID EFIAPI IScsiFreeNbufList ( VOID *  Arg)

The callback function to free the net buffer list.

Parameters
[in]ArgThe opaque parameter.

Definition at line 1262 of file IScsiProto.c.

◆ IScsiGetValueByKeyFromList()

CHAR8 * IScsiGetValueByKeyFromList ( IN OUT LIST_ENTRY KeyValueList,
IN CHAR8 *  Key 
)

Get the value string by the key name from the key-value list. If found, the key-value entry will be removed from the list.

Parameters
[in,out]KeyValueListThe key-value list.
[in]KeyThe key name to find.
Returns
The value string.
Return values
NULLThe key value pair can not be found.

Get the value string by the key name from the key-value list. If found, the key-value entry will be removed from the list.

Parameters
[in,out]KeyValueListThe key-value list.
[in]KeyThe key name to find.
Returns
The value string.
Return values
NULLThe key value pair cannot be found.

Definition at line 1945 of file IScsiProto.c.

◆ IScsiNormalizeName()

EFI_STATUS IScsiNormalizeName ( IN OUT CHAR8 *  Name,
IN UINTN  Len 
)

Normalize the iSCSI name according to RFC.

Parameters
[in,out]NameThe iSCSI name.
[in]Lenlength of the iSCSI name.
Return values
EFI_SUCCESSThe iSCSI name is valid and normalized.
EFI_PROTOCOL_ERRORThe iSCSI name is mal-formatted or not in the IQN format.

Normalize the iSCSI name according to RFC.

Parameters
[in,out]NameThe iSCSI name.
[in]LenLength of the iSCSI name.
Return values
EFI_SUCCESSThe iSCSI name is valid and normalized.
EFI_PROTOCOL_ERRORThe iSCSI name is malformatted or not in the IQN format.

Definition at line 2006 of file IScsiProto.c.

◆ IScsiPadSegment()

EFI_STATUS IScsiPadSegment ( IN OUT NET_BUF Pdu,
IN UINT32  Len 
)

Pad the iSCSI AHS or data segment to an integer number of 4 byte words.

Parameters
[in,out]PduThe iSCSI pdu which contains segments to pad.
[in]LenThe length of the last segment in the PDU.
Return values
EFI_SUCCESSThe segment is padded or no need to pad it.
EFI_OUT_OF_RESOURCESThere is not enough remaining free space to add the padding bytes.

Pad the iSCSI AHS or data segment to an integer number of 4 byte words.

Parameters
[in,out]PduThe iSCSI pdu which contains segments to pad.
[in]LenThe length of the last segment in the PDU.
Return values
EFI_SUCCESSThe segment is padded or there is no need to pad it.
EFI_OUT_OF_RESOURCESThere is not enough remaining free space to add the padding bytes.

Definition at line 1843 of file IScsiProto.c.

◆ IScsiPrepareLoginReq()

NET_BUF * IScsiPrepareLoginReq ( IN OUT ISCSI_CONNECTION Conn)

Prepare the iSCSI login request to be sent according to the current login status.

Parameters
[in,out]ConnThe connection in the iSCSI login phase.
Returns
The pointer to the net buffer containing the iSCSI login request built.
Return values
NULLOther errors as indicated.

Definition at line 749 of file IScsiProto.c.

◆ IScsiProcessLoginRsp()

EFI_STATUS IScsiProcessLoginRsp ( IN OUT ISCSI_CONNECTION Conn,
IN OUT NET_BUF Pdu 
)

Process the iSCSI Login Response.

Parameters
[in,out]ConnThe connection on which the iSCSI login response is received.
[in,out]PduThe iSCSI login response PDU.
Return values
EFI_SUCCESSThe iSCSI login response PDU is processed and all check are passed.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error happened.
EFI_MEDIA_CHANGEDTarget is redirected.
OthersOther errors as indicated.

Process the iSCSI Login Response.

Parameters
[in,out]ConnThe connection on which the iSCSI login response is received.
[in,out]PduThe iSCSI login response PDU.
Return values
EFI_SUCCESSThe iSCSI login response PDU is processed, and all checks are passed.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_MEDIA_CHANGEDTarget is redirected.
OthersOther errors as indicated.

Definition at line 865 of file IScsiProto.c.

◆ IScsiReceiveLoginRsp()

EFI_STATUS IScsiReceiveLoginRsp ( IN ISCSI_CONNECTION Conn)

Receive and process the iSCSI login response.

Parameters
[in]ConnThe connection in the iSCSI login phase.
Return values
EFI_SUCCESSThe iSCSI login response PDU is received and processed.
OthersOther errors as indicated.

Definition at line 631 of file IScsiProto.c.

◆ IScsiReceivePdu()

EFI_STATUS IScsiReceivePdu ( IN ISCSI_CONNECTION Conn,
OUT NET_BUF **  Pdu,
IN ISCSI_IN_BUFFER_CONTEXT *Context  OPTIONAL,
IN BOOLEAN  HeaderDigest,
IN BOOLEAN  DataDigest,
IN EFI_EVENT TimeoutEvent  OPTIONAL 
)

Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and an optional data segment. The two parts will be put into two blocks of buffers in the net buffer. The digest check will be conducted in this function if needed and the digests will be trimmed from the PDU buffer.

Parameters
[in]ConnThe iSCSI connection to receive data from.
[out]PduThe received iSCSI pdu.
[in]ContextThe context used to describe information on the caller provided buffer to receive data segment of the iSCSI pdu, it's optional.
[in]HeaderDigestWhether there will be header digest received.
[in]DataDigestWhether there will be data digest.
[in]TimeoutEventThe timeout event, it's optional.
Return values
EFI_SUCCESSAn iSCSI pdu is received.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
OthersOther errors as indicated.

Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and an optional data segment. The two parts will be put into two blocks of buffers in the net buffer. The digest check will be conducted in this function if needed and the digests will be trimmed from the PDU buffer.

Parameters
[in]ConnThe iSCSI connection to receive data from.
[out]PduThe received iSCSI pdu.
[in]ContextThe context used to describe information on the caller provided buffer to receive data segment of the iSCSI pdu. It is optional.
[in]HeaderDigestWhether there will be header digest received.
[in]DataDigestWhether there will be data digest.
[in]TimeoutEventThe timeout event. It is optional.
Return values
EFI_SUCCESSAn iSCSI pdu is received.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
OthersOther errors as indicated.

Definition at line 1307 of file IScsiProto.c.

◆ IScsiSendLoginReq()

EFI_STATUS IScsiSendLoginReq ( IN ISCSI_CONNECTION Conn)

Build and send the iSCSI login request to the iSCSI target according to the current login stage.

Parameters
[in]ConnThe connection in the iSCSI login phase.
Return values
EFI_SUCCESSThe iSCSI login request PDU is built and sent on this connection.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_DEVICE_ERRORSome kind of device error happened.

Build and send the iSCSI login request to the iSCSI target according to the current login stage.

Parameters
[in]ConnThe connection in the iSCSI login phase.
Return values
EFI_SUCCESSThe iSCSI login request PDU is built and sent on this connection.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_DEVICE_ERRORSome kind of device error occurred.

Definition at line 596 of file IScsiProto.c.

◆ IScsiSessionAbort()

VOID IScsiSessionAbort ( IN OUT ISCSI_SESSION Session)

Abort the iSCSI session, that is, reset all the connection and free the resources.

Parameters
[in,out]SessionThe iSCSI session.

Abort the iSCSI session. That is, reset all the connection(s), and free the resources.

Parameters
[in,out]SessionThe iSCSI session.

Definition at line 3166 of file IScsiProto.c.

◆ IScsiSessionInit()

VOID IScsiSessionInit ( IN OUT ISCSI_SESSION Session,
IN BOOLEAN  Recovery 
)

Initialize some session parameters before login.

Parameters
[in,out]SessionThe iSCSI session.
[in]RecoveryWhether the request is from a fresh new start or recovery.

Definition at line 3125 of file IScsiProto.c.

◆ IScsiSessionLogin()

EFI_STATUS IScsiSessionLogin ( IN ISCSI_SESSION Session)

Login the iSCSI session.

Parameters
[in]SessionThe iSCSI session
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NO_MEDIAThere was a media error.
OthersOther errors as indicated.

Login the iSCSI session.

Parameters
[in]SessionThe iSCSI session.
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NO_MEDIAThere was a media error.
OthersOther errors as indicated.

Definition at line 452 of file IScsiProto.c.

◆ IScsiSessionReinstatement()

EFI_STATUS IScsiSessionReinstatement ( IN ISCSI_SESSION Session)

Reinstate the session on some error.

Parameters
[in]SessionThe iSCSI session
Return values
EFI_SUCCESSThe session is reinstated from some error.
OtherReinstatement failed.

Definition at line 3095 of file IScsiProto.c.

◆ IScsiSessionReLogin()

EFI_STATUS IScsiSessionReLogin ( IN ISCSI_SESSION Session)

Wait for IPsec negotiation, then try to login the iSCSI session again.

Parameters
[in]SessionThe iSCSI session
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error happened.

Wait for IPsec negotiation, then try to login the iSCSI session again.

Parameters
[in]SessionThe iSCSI session.
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.

Definition at line 547 of file IScsiProto.c.

◆ IScsiUpdateTargetAddress()

EFI_STATUS IScsiUpdateTargetAddress ( IN OUT ISCSI_SESSION Session,
IN CHAR8 *  Data,
IN UINT32  Len 
)

Updated the target information according the data received in the iSCSI login response with an target redirection status.

Parameters
[in,out]SessionThe iSCSI session.
[in]DataThe data segment which should contain the TargetAddress key-value list.
[in]LenLength of the data.
Return values
EFI_SUCCESSThe target address is updated.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_FOUNDThe TargetAddress key is not found.
OthersOther errors as indicated.

Updated the target information according the data received in the iSCSI login response with an target redirection status.

Parameters
[in,out]SessionThe iSCSI session.
[in]DataThe data segment that should contain the TargetAddress key-value list.
[in]LenLength of the data.
Return values
EFI_SUCCESSThe target address is updated.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_FOUNDThe TargetAddress key is not found.
OthersOther errors as indicated.

Definition at line 1103 of file IScsiProto.c.