iPXE
|
iSCSI protocol More...
#include <stdint.h>
#include <ipxe/socket.h>
#include <ipxe/scsi.h>
#include <ipxe/chap.h>
#include <ipxe/refcnt.h>
#include <ipxe/xfer.h>
#include <ipxe/process.h>
#include <ipxe/acpi.h>
#include <ipxe/settings.h>
Go to the source code of this file.
Data Structures | |
union | iscsi_segment_lengths |
iSCSI segment lengths More... | |
struct | iscsi_bhs_common |
iSCSI basic header segment common fields More... | |
struct | iscsi_bhs_common_response |
iSCSI basic header segment common request fields More... | |
struct | iscsi_bhs_login_request |
iSCSI login request basic header segment More... | |
struct | iscsi_bhs_login_response |
iSCSI login response basic header segment More... | |
struct | iscsi_bhs_scsi_command |
iSCSI SCSI command basic header segment More... | |
struct | iscsi_bhs_scsi_response |
iSCSI SCSI response basic header segment More... | |
struct | iscsi_bhs_data_in |
iSCSI data-in basic header segment More... | |
struct | iscsi_bhs_data_out |
iSCSI data-out basic header segment More... | |
struct | iscsi_bhs_r2t |
iSCSI request to transfer basic header segment More... | |
struct | iscsi_nop_in |
iSCSI NOP-In basic header segment More... | |
union | iscsi_bhs |
An iSCSI basic header segment. More... | |
struct | iscsi_session |
An iSCSI session. More... | |
Macros | |
#define | ISCSI_PORT 3260 |
Default iSCSI port. More... | |
#define | ISCSI_FIRST_BURST_LEN 65536 |
Default iSCSI first burst length. More... | |
#define | ISCSI_MAX_BURST_LEN 262144 |
Default iSCSI maximum burst length. More... | |
#define | ISCSI_MAX_RECV_DATA_SEG_LEN 8192 |
Default iSCSI maximum receive data segment length. More... | |
#define | ISCSI_AHS_LEN(segment_lengths) ( (segment_lengths).bytes.ahs_len ) |
The length of the additional header segment, in dwords. More... | |
#define | ISCSI_DATA_LEN(segment_lengths) ( ntohl ( (segment_lengths).ahs_and_data_len ) & 0xffffff ) |
The length of the data segment, in bytes, excluding any padding. More... | |
#define | ISCSI_DATA_PAD_LEN(segment_lengths) ( ( 0 - (segment_lengths).bytes.data_len[2] ) & 0x03 ) |
The padding of the data segment, in bytes. More... | |
#define | ISCSI_SET_LENGTHS(segment_lengths, ahs_len, data_len) |
Set additional header and data segment lengths. More... | |
#define | ISCSI_OPCODE_MASK 0x3f |
Opcode mask. More... | |
#define | ISCSI_FLAG_IMMEDIATE 0x40 |
Immediate delivery. More... | |
#define | ISCSI_FLAG_FINAL 0x80 |
Final PDU of a sequence. More... | |
#define | ISCSI_TAG_MAGIC 0x18ae0000 |
iSCSI tag magic marker More... | |
#define | ISCSI_TAG_RESERVED 0xffffffff |
iSCSI reserved tag value More... | |
#define | ISCSI_OPCODE_LOGIN_REQUEST 0x03 |
Login request opcode. More... | |
#define | ISCSI_LOGIN_FLAG_TRANSITION 0x80 |
Willingness to transition to next stage. More... | |
#define | ISCSI_LOGIN_FLAG_CONTINUE 0x40 |
Key=value pairs continued in subsequent request. More... | |
#define | ISCSI_LOGIN_CSG_MASK 0x0c |
#define | ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION 0x00 |
#define | ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION 0x04 |
#define | ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE 0x0c |
#define | ISCSI_LOGIN_NSG_MASK 0x03 |
#define | ISCSI_LOGIN_NSG_SECURITY_NEGOTIATION 0x00 |
#define | ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION 0x01 |
#define | ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE 0x03 |
#define | ISCSI_ISID_IANA 0x40000000 |
ISID IANA format marker. More... | |
#define | IANA_EN_FEN_SYSTEMS 10019 |
Fen Systems Ltd. More... | |
#define | ISCSI_OPCODE_LOGIN_RESPONSE 0x23 |
Login response opcode. More... | |
#define | ISCSI_STATUS_SUCCESS 0x00 |
#define | ISCSI_STATUS_REDIRECT 0x01 |
#define | ISCSI_STATUS_INITIATOR_ERROR 0x02 |
#define | ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION 0x01 |
#define | ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION 0x02 |
#define | ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND 0x03 |
#define | ISCSI_STATUS_INITIATOR_ERROR_REMOVED 0x04 |
#define | ISCSI_STATUS_TARGET_ERROR 0x03 |
#define | ISCSI_STATUS_TARGET_ERROR_UNAVAILABLE 0x01 |
#define | ISCSI_STATUS_TARGET_ERROR_NO_RESOURCES 0x02 |
#define | ISCSI_OPCODE_SCSI_COMMAND 0x01 |
SCSI command opcode. More... | |
#define | ISCSI_COMMAND_FLAG_READ 0x40 |
Command will read data. More... | |
#define | ISCSI_COMMAND_FLAG_WRITE 0x20 |
Command will write data. More... | |
#define | ISCSI_COMMAND_ATTR_UNTAGGED 0x00 |
#define | ISCSI_COMMAND_ATTR_SIMPLE 0x01 |
#define | ISCSI_COMMAND_ATTR_ORDERED 0x02 |
#define | ISCSI_COMMAND_ATTR_HEAD_OF_QUEUE 0x03 |
#define | ISCSI_COMMAND_ATTR_ACA 0x04 |
#define | ISCSI_OPCODE_SCSI_RESPONSE 0x21 |
SCSI response opcode. More... | |
#define | ISCSI_RESPONSE_COMMAND_COMPLETE 0x00 |
SCSI command completed at target. More... | |
#define | ISCSI_RESPONSE_TARGET_FAILURE 0x01 |
SCSI target failure. More... | |
#define | ISCSI_RESPONSE_FLAG_OVERFLOW 0x20 |
Data overflow occurred. More... | |
#define | ISCSI_RESPONSE_FLAG_UNDERFLOW 0x40 |
Data underflow occurred. More... | |
#define | ISCSI_OPCODE_DATA_IN 0x25 |
Data-in opcode. More... | |
#define | ISCSI_DATA_FLAG_ACKNOWLEDGE 0x40 |
Data requires acknowledgement. More... | |
#define | ISCSI_DATA_FLAG_OVERFLOW 0x04 |
Data overflow occurred. More... | |
#define | ISCSI_DATA_FLAG_UNDERFLOW 0x02 |
Data underflow occurred. More... | |
#define | ISCSI_DATA_FLAG_STATUS 0x01 |
SCSI status code and overflow/underflow flags are valid. More... | |
#define | ISCSI_OPCODE_DATA_OUT 0x05 |
Data-out opcode. More... | |
#define | ISCSI_OPCODE_R2T 0x31 |
R2T opcode. More... | |
#define | ISCSI_OPCODE_NOP_IN 0x20 |
NOP-In opcode. More... | |
#define | ISCSI_STATUS_SECURITY_NEGOTIATION_PHASE |
iSCSI session is currently in the security negotiation phase More... | |
#define | ISCSI_STATUS_OPERATIONAL_NEGOTIATION_PHASE |
iSCSI session is currently in the operational parameter negotiation phase More... | |
#define | ISCSI_STATUS_FULL_FEATURE_PHASE ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE |
iSCSI session is currently in the full feature phase More... | |
#define | ISCSI_STATUS_PHASE_MASK ( ISCSI_LOGIN_CSG_MASK | ISCSI_LOGIN_NSG_MASK ) |
Mask for all iSCSI session phases. More... | |
#define | ISCSI_STATUS_STRINGS_SECURITY 0x0100 |
iSCSI session needs to send the initial security negotiation strings More... | |
#define | ISCSI_STATUS_STRINGS_CHAP_ALGORITHM 0x0200 |
iSCSI session needs to send the CHAP_A string More... | |
#define | ISCSI_STATUS_STRINGS_CHAP_RESPONSE 0x0400 |
iSCSI session needs to send the CHAP response More... | |
#define | ISCSI_STATUS_STRINGS_CHAP_CHALLENGE 0x0800 |
iSCSI session needs to send the mutual CHAP challenge More... | |
#define | ISCSI_STATUS_STRINGS_OPERATIONAL 0x1000 |
iSCSI session needs to send the operational negotiation strings More... | |
#define | ISCSI_STATUS_STRINGS_MASK 0xff00 |
Mask for all iSCSI "needs to send" flags. More... | |
#define | ISCSI_STATUS_AUTH_FORWARD_REQUIRED 0x00010000 |
Target has requested forward (initiator) authentication. More... | |
#define | ISCSI_STATUS_AUTH_REVERSE_REQUIRED 0x00020000 |
Initiator requires target (reverse) authentication. More... | |
#define | ISCSI_STATUS_AUTH_REVERSE_OK 0x00040000 |
Target authenticated itself correctly. More... | |
#define | ISCSI_DEFAULT_IQN_PREFIX "iqn.2010-04.org.ipxe" |
Default initiator IQN prefix. More... | |
Enumerations | |
enum | iscsi_tx_state { ISCSI_TX_IDLE = 0, ISCSI_TX_BHS, ISCSI_TX_AHS, ISCSI_TX_DATA } |
State of an iSCSI TX engine. More... | |
enum | iscsi_rx_state { ISCSI_RX_BHS = 0, ISCSI_RX_AHS, ISCSI_RX_DATA, ISCSI_RX_DATA_PADDING } |
State of an iSCSI RX engine. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
const struct setting initiator_iqn_setting | __setting (SETTING_SANBOOT_EXTRA, initiator-iqn) |
iSCSI protocol
Definition in file iscsi.h.
#define ISCSI_FIRST_BURST_LEN 65536 |
#define ISCSI_MAX_BURST_LEN 262144 |
#define ISCSI_MAX_RECV_DATA_SEG_LEN 8192 |
#define ISCSI_AHS_LEN | ( | segment_lengths | ) | ( (segment_lengths).bytes.ahs_len ) |
#define ISCSI_DATA_LEN | ( | segment_lengths | ) | ( ntohl ( (segment_lengths).ahs_and_data_len ) & 0xffffff ) |
#define ISCSI_DATA_PAD_LEN | ( | segment_lengths | ) | ( ( 0 - (segment_lengths).bytes.data_len[2] ) & 0x03 ) |
#define ISCSI_SET_LENGTHS | ( | segment_lengths, | |
ahs_len, | |||
data_len | |||
) |
Set additional header and data segment lengths.
#define ISCSI_TAG_RESERVED 0xffffffff |
#define ISCSI_OPCODE_LOGIN_REQUEST 0x03 |
#define ISCSI_LOGIN_FLAG_TRANSITION 0x80 |
#define ISCSI_LOGIN_FLAG_CONTINUE 0x40 |
#define IANA_EN_FEN_SYSTEMS 10019 |
#define ISCSI_OPCODE_LOGIN_RESPONSE 0x23 |
#define ISCSI_COMMAND_FLAG_READ 0x40 |
#define ISCSI_COMMAND_FLAG_WRITE 0x20 |
#define ISCSI_OPCODE_SCSI_RESPONSE 0x21 |
#define ISCSI_RESPONSE_COMMAND_COMPLETE 0x00 |
#define ISCSI_RESPONSE_TARGET_FAILURE 0x01 |
#define ISCSI_RESPONSE_FLAG_OVERFLOW 0x20 |
#define ISCSI_RESPONSE_FLAG_UNDERFLOW 0x40 |
#define ISCSI_DATA_FLAG_ACKNOWLEDGE 0x40 |
#define ISCSI_DATA_FLAG_OVERFLOW 0x04 |
#define ISCSI_DATA_FLAG_UNDERFLOW 0x02 |
#define ISCSI_DATA_FLAG_STATUS 0x01 |
#define ISCSI_STATUS_SECURITY_NEGOTIATION_PHASE |
iSCSI session is currently in the security negotiation phase
#define ISCSI_STATUS_OPERATIONAL_NEGOTIATION_PHASE |
iSCSI session is currently in the operational parameter negotiation phase
#define ISCSI_STATUS_FULL_FEATURE_PHASE ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE |
#define ISCSI_STATUS_PHASE_MASK ( ISCSI_LOGIN_CSG_MASK | ISCSI_LOGIN_NSG_MASK ) |
#define ISCSI_STATUS_STRINGS_SECURITY 0x0100 |
#define ISCSI_STATUS_STRINGS_CHAP_ALGORITHM 0x0200 |
#define ISCSI_STATUS_STRINGS_CHAP_RESPONSE 0x0400 |
#define ISCSI_STATUS_STRINGS_CHAP_CHALLENGE 0x0800 |
#define ISCSI_STATUS_STRINGS_OPERATIONAL 0x1000 |
#define ISCSI_STATUS_STRINGS_MASK 0xff00 |
#define ISCSI_STATUS_AUTH_FORWARD_REQUIRED 0x00010000 |
#define ISCSI_STATUS_AUTH_REVERSE_REQUIRED 0x00020000 |
#define ISCSI_STATUS_AUTH_REVERSE_OK 0x00040000 |
#define ISCSI_DEFAULT_IQN_PREFIX "iqn.2010-04.org.ipxe" |
enum iscsi_tx_state |
enum iscsi_rx_state |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
const struct setting initiator_iqn_setting __setting | ( | SETTING_SANBOOT_EXTRA | , |
initiator- | iqn | ||
) |