iPXE
|
iSCSI protocol More...
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include <byteswap.h>
#include <ipxe/vsprintf.h>
#include <ipxe/socket.h>
#include <ipxe/iobuf.h>
#include <ipxe/uri.h>
#include <ipxe/xfer.h>
#include <ipxe/open.h>
#include <ipxe/scsi.h>
#include <ipxe/process.h>
#include <ipxe/uaccess.h>
#include <ipxe/tcpip.h>
#include <ipxe/settings.h>
#include <ipxe/features.h>
#include <ipxe/base16.h>
#include <ipxe/base64.h>
#include <ipxe/ibft.h>
#include <ipxe/blockdev.h>
#include <ipxe/efi/efi_path.h>
#include <ipxe/iscsi.h>
Go to the source code of this file.
Data Structures | |
struct | iscsi_string_type |
An iSCSI text string that we want to handle. More... | |
Enumerations | |
enum | iscsi_root_path_component { RP_SERVERNAME = 0, RP_PROTOCOL, RP_PORT, RP_LUN, RP_TARGETNAME, NUM_RP_COMPONENTS } |
iSCSI root path components (as per RFC4173) More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
FEATURE (FEATURE_PROTOCOL, "iSCSI", DHCP_EB_FEATURE_ISCSI, 1) | |
static void | iscsi_start_tx (struct iscsi_session *iscsi) |
Start up a new TX PDU. More... | |
static void | iscsi_start_login (struct iscsi_session *iscsi) |
Build iSCSI login request BHS. More... | |
static void | iscsi_start_data_out (struct iscsi_session *iscsi, unsigned int datasn) |
Build iSCSI data-out BHS. More... | |
static void | iscsi_rx_buffered_data_done (struct iscsi_session *iscsi) |
Finish receiving PDU data into buffer. More... | |
static int | iscsi_rx_buffered_data (struct iscsi_session *iscsi, const void *data, size_t len) |
Receive PDU data into buffer. More... | |
static void | iscsi_free (struct refcnt *refcnt) |
Free iSCSI session. More... | |
static void | iscsi_close (struct iscsi_session *iscsi, int rc) |
Shut down iSCSI interface. More... | |
static void | iscsi_new_itt (struct iscsi_session *iscsi) |
Assign new iSCSI initiator task tag. More... | |
static int | iscsi_open_connection (struct iscsi_session *iscsi) |
Open iSCSI transport-layer connection. More... | |
static void | iscsi_close_connection (struct iscsi_session *iscsi, int rc) |
Close iSCSI transport-layer connection. More... | |
static void | iscsi_scsi_done (struct iscsi_session *iscsi, int rc, struct scsi_rsp *rsp) |
Mark iSCSI SCSI operation as complete. More... | |
static void | iscsi_start_command (struct iscsi_session *iscsi) |
Build iSCSI SCSI command BHS. More... | |
static int | iscsi_rx_scsi_response (struct iscsi_session *iscsi, const void *data, size_t len, size_t remaining) |
Receive data segment of an iSCSI SCSI response PDU. More... | |
static int | iscsi_rx_data_in (struct iscsi_session *iscsi, const void *data, size_t len, size_t remaining) |
Receive data segment of an iSCSI data-in PDU. More... | |
static int | iscsi_rx_r2t (struct iscsi_session *iscsi, const void *data __unused, size_t len __unused, size_t remaining __unused) |
Receive data segment of an iSCSI R2T PDU. More... | |
static void | iscsi_data_out_done (struct iscsi_session *iscsi) |
Complete iSCSI data-out PDU transmission. More... | |
static int | iscsi_tx_data_out (struct iscsi_session *iscsi) |
Send iSCSI data-out data segment. More... | |
static int | iscsi_rx_nop_in (struct iscsi_session *iscsi, const void *data __unused, size_t len __unused, size_t remaining __unused) |
Receive data segment of an iSCSI NOP-In. More... | |
static int | iscsi_build_login_request_strings (struct iscsi_session *iscsi, void *data, size_t len) |
Build iSCSI login request strings. More... | |
static void | iscsi_login_request_done (struct iscsi_session *iscsi) |
Complete iSCSI login request PDU transmission. More... | |
static int | iscsi_tx_login_request (struct iscsi_session *iscsi) |
Transmit data segment of an iSCSI login request PDU. More... | |
static int | iscsi_large_binary_decode (const char *encoded, uint8_t *raw, size_t len) |
Decode large binary value. More... | |
static int | iscsi_handle_targetaddress_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI TargetAddress text value. More... | |
static int | iscsi_handle_authmethod_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI AuthMethod text value. More... | |
static int | iscsi_handle_maxburstlength_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI MaxBurstLength text value. More... | |
static int | iscsi_handle_chap_a_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI CHAP_A text value. More... | |
static int | iscsi_handle_chap_i_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI CHAP_I text value. More... | |
static int | iscsi_handle_chap_c_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI CHAP_C text value. More... | |
static int | iscsi_handle_chap_n_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI CHAP_N text value. More... | |
static int | iscsi_handle_chap_r_value (struct iscsi_session *iscsi, const char *value) |
Handle iSCSI CHAP_R text value. More... | |
static int | iscsi_handle_string (struct iscsi_session *iscsi, const char *string) |
Handle iSCSI string. More... | |
static int | iscsi_handle_strings (struct iscsi_session *iscsi, const char *strings, size_t len) |
Handle iSCSI strings. More... | |
static int | iscsi_status_to_rc (unsigned int status_class, unsigned int status_detail) |
Convert iSCSI response status to return status code. More... | |
static int | iscsi_rx_login_response (struct iscsi_session *iscsi, const void *data, size_t len, size_t remaining) |
Receive data segment of an iSCSI login response PDU. More... | |
static void | iscsi_tx_pause (struct iscsi_session *iscsi) |
Pause TX engine. More... | |
static void | iscsi_tx_resume (struct iscsi_session *iscsi) |
Resume TX engine. More... | |
static int | iscsi_tx_nothing (struct iscsi_session *iscsi __unused) |
Transmit nothing. More... | |
static int | iscsi_tx_bhs (struct iscsi_session *iscsi) |
Transmit basic header segment of an iSCSI PDU. More... | |
static int | iscsi_tx_data (struct iscsi_session *iscsi) |
Transmit data segment of an iSCSI PDU. More... | |
static void | iscsi_tx_done (struct iscsi_session *iscsi) |
Complete iSCSI PDU transmission. More... | |
static void | iscsi_tx_step (struct iscsi_session *iscsi) |
Transmit iSCSI PDU. More... | |
static int | iscsi_rx_bhs (struct iscsi_session *iscsi, const void *data, size_t len, size_t remaining __unused) |
Receive basic header segment of an iSCSI PDU. More... | |
static int | iscsi_rx_discard (struct iscsi_session *iscsi __unused, const void *data __unused, size_t len __unused, size_t remaining __unused) |
Discard portion of an iSCSI PDU. More... | |
static int | iscsi_rx_data (struct iscsi_session *iscsi, const void *data, size_t len, size_t remaining) |
Receive data segment of an iSCSI PDU. More... | |
static int | iscsi_socket_deliver (struct iscsi_session *iscsi, struct io_buffer *iobuf, struct xfer_metadata *meta __unused) |
Receive new data. More... | |
static int | iscsi_vredirect (struct iscsi_session *iscsi, int type, va_list args) |
Handle redirection event. More... | |
static size_t | iscsi_scsi_window (struct iscsi_session *iscsi) |
Check iSCSI flow-control window. More... | |
static int | iscsi_scsi_command (struct iscsi_session *iscsi, struct interface *parent, struct scsi_cmd *command) |
Issue iSCSI SCSI command. More... | |
static void | iscsi_scsi_capacity (struct iscsi_session *iscsi, struct block_device_capacity *capacity) |
Update SCSI block device capacity. More... | |
static struct acpi_descriptor * | iscsi_describe (struct iscsi_session *iscsi) |
Get iSCSI ACPI descriptor. More... | |
static void | iscsi_command_close (struct iscsi_session *iscsi, int rc) |
Close iSCSI command. More... | |
const struct setting initiator_iqn_setting | __setting (SETTING_SANBOOT_EXTRA, initiator-iqn) |
iSCSI initiator IQN setting More... | |
const struct setting reverse_username_setting | __setting (SETTING_AUTH_EXTRA, reverse-username) |
iSCSI reverse username setting More... | |
static int | iscsi_parse_root_path (struct iscsi_session *iscsi, const char *root_path) |
Parse iSCSI root path. More... | |
static int | iscsi_fetch_settings (struct iscsi_session *iscsi) |
Fetch iSCSI settings. More... | |
static int | iscsi_check_auth (struct iscsi_session *iscsi) |
Check iSCSI authentication details. More... | |
static int | iscsi_open (struct interface *parent, struct uri *uri) |
Open iSCSI URI. More... | |
Variables | |
static struct iscsi_string_type | iscsi_string_types [] |
iSCSI text strings that we want to handle More... | |
static struct process_descriptor | iscsi_process_desc |
iSCSI TX process descriptor More... | |
static struct interface_operation | iscsi_socket_operations [] |
iSCSI socket interface operations More... | |
static struct interface_descriptor | iscsi_socket_desc |
iSCSI socket interface descriptor More... | |
static struct interface_operation | iscsi_control_op [] |
iSCSI SCSI command-issuing interface operations More... | |
static struct interface_descriptor | iscsi_control_desc |
iSCSI SCSI command-issuing interface descriptor More... | |
static struct interface_operation | iscsi_data_op [] |
iSCSI SCSI command interface operations More... | |
static struct interface_descriptor | iscsi_data_desc |
iSCSI SCSI command interface descriptor More... | |
struct uri_opener iscsi_uri_opener | __uri_opener |
iSCSI URI opener More... | |
iSCSI protocol
Definition in file iscsi.c.
#define EACCES_INCORRECT_TARGET_USERNAME __einfo_error ( EINFO_EACCES_INCORRECT_TARGET_USERNAME ) |
#define EINFO_EACCES_INCORRECT_TARGET_USERNAME __einfo_uniqify ( EINFO_EACCES, 0x01, "Incorrect target username" ) |
#define EACCES_INCORRECT_TARGET_PASSWORD __einfo_error ( EINFO_EACCES_INCORRECT_TARGET_PASSWORD ) |
#define EINFO_EACCES_INCORRECT_TARGET_PASSWORD __einfo_uniqify ( EINFO_EACCES, 0x02, "Incorrect target password" ) |
#define EINVAL_ROOT_PATH_TOO_SHORT __einfo_error ( EINFO_EINVAL_ROOT_PATH_TOO_SHORT ) |
#define EINFO_EINVAL_ROOT_PATH_TOO_SHORT __einfo_uniqify ( EINFO_EINVAL, 0x01, "Root path too short" ) |
#define EINVAL_BAD_CREDENTIAL_MIX __einfo_error ( EINFO_EINVAL_BAD_CREDENTIAL_MIX ) |
#define EINFO_EINVAL_BAD_CREDENTIAL_MIX __einfo_uniqify ( EINFO_EINVAL, 0x02, "Bad credential mix" ) |
#define EINVAL_NO_ROOT_PATH __einfo_error ( EINFO_EINVAL_NO_ROOT_PATH ) |
#define EINFO_EINVAL_NO_ROOT_PATH __einfo_uniqify ( EINFO_EINVAL, 0x03, "No root path" ) |
#define EINVAL_NO_TARGET_IQN __einfo_error ( EINFO_EINVAL_NO_TARGET_IQN ) |
#define EINFO_EINVAL_NO_TARGET_IQN __einfo_uniqify ( EINFO_EINVAL, 0x04, "No target IQN" ) |
#define EINVAL_NO_INITIATOR_IQN __einfo_error ( EINFO_EINVAL_NO_INITIATOR_IQN ) |
#define EINFO_EINVAL_NO_INITIATOR_IQN __einfo_uniqify ( EINFO_EINVAL, 0x05, "No initiator IQN" ) |
#define EINVAL_MAXBURSTLENGTH __einfo_error ( EINFO_EINVAL_MAXBURSTLENGTH ) |
#define EINFO_EINVAL_MAXBURSTLENGTH __einfo_uniqify ( EINFO_EINVAL, 0x06, "Invalid MaxBurstLength" ) |
#define EIO_TARGET_UNAVAILABLE __einfo_error ( EINFO_EIO_TARGET_UNAVAILABLE ) |
#define EINFO_EIO_TARGET_UNAVAILABLE __einfo_uniqify ( EINFO_EIO, 0x01, "Target not currently operational" ) |
#define EIO_TARGET_NO_RESOURCES __einfo_error ( EINFO_EIO_TARGET_NO_RESOURCES ) |
#define EINFO_EIO_TARGET_NO_RESOURCES __einfo_uniqify ( EINFO_EIO, 0x02, "Target out of resources" ) |
#define ENOTSUP_INITIATOR_STATUS __einfo_error ( EINFO_ENOTSUP_INITIATOR_STATUS ) |
#define EINFO_ENOTSUP_INITIATOR_STATUS __einfo_uniqify ( EINFO_ENOTSUP, 0x01, "Unsupported initiator status" ) |
#define ENOTSUP_OPCODE __einfo_error ( EINFO_ENOTSUP_OPCODE ) |
#define EINFO_ENOTSUP_OPCODE __einfo_uniqify ( EINFO_ENOTSUP, 0x02, "Unsupported opcode" ) |
#define ENOTSUP_DISCOVERY __einfo_error ( EINFO_ENOTSUP_DISCOVERY ) |
#define EINFO_ENOTSUP_DISCOVERY __einfo_uniqify ( EINFO_ENOTSUP, 0x03, "Discovery not supported" ) |
#define ENOTSUP_TARGET_STATUS __einfo_error ( EINFO_ENOTSUP_TARGET_STATUS ) |
#define EINFO_ENOTSUP_TARGET_STATUS __einfo_uniqify ( EINFO_ENOTSUP, 0x04, "Unsupported target status" ) |
#define EPERM_INITIATOR_AUTHENTICATION __einfo_error ( EINFO_EPERM_INITIATOR_AUTHENTICATION ) |
#define EINFO_EPERM_INITIATOR_AUTHENTICATION __einfo_uniqify ( EINFO_EPERM, 0x01, "Initiator authentication failed" ) |
#define EPERM_INITIATOR_AUTHORISATION __einfo_error ( EINFO_EPERM_INITIATOR_AUTHORISATION ) |
#define EINFO_EPERM_INITIATOR_AUTHORISATION __einfo_uniqify ( EINFO_EPERM, 0x02, "Initiator not authorised" ) |
#define EPROTO_INVALID_CHAP_ALGORITHM __einfo_error ( EINFO_EPROTO_INVALID_CHAP_ALGORITHM ) |
#define EINFO_EPROTO_INVALID_CHAP_ALGORITHM __einfo_uniqify ( EINFO_EPROTO, 0x01, "Invalid CHAP algorithm" ) |
#define EPROTO_INVALID_CHAP_IDENTIFIER __einfo_error ( EINFO_EPROTO_INVALID_CHAP_IDENTIFIER ) |
#define EINFO_EPROTO_INVALID_CHAP_IDENTIFIER __einfo_uniqify ( EINFO_EPROTO, 0x02, "Invalid CHAP identifier" ) |
#define EPROTO_INVALID_LARGE_BINARY __einfo_error ( EINFO_EPROTO_INVALID_LARGE_BINARY ) |
#define EINFO_EPROTO_INVALID_LARGE_BINARY __einfo_uniqify ( EINFO_EPROTO, 0x03, "Invalid large binary value" ) |
#define EPROTO_INVALID_CHAP_RESPONSE __einfo_error ( EINFO_EPROTO_INVALID_CHAP_RESPONSE ) |
#define EINFO_EPROTO_INVALID_CHAP_RESPONSE __einfo_uniqify ( EINFO_EPROTO, 0x04, "Invalid CHAP response" ) |
#define EPROTO_INVALID_KEY_VALUE_PAIR __einfo_error ( EINFO_EPROTO_INVALID_KEY_VALUE_PAIR ) |
#define EINFO_EPROTO_INVALID_KEY_VALUE_PAIR __einfo_uniqify ( EINFO_EPROTO, 0x05, "Invalid key/value pair" ) |
#define EPROTO_VALUE_REJECTED __einfo_error ( EINFO_EPROTO_VALUE_REJECTED ) |
#define EINFO_EPROTO_VALUE_REJECTED __einfo_uniqify ( EINFO_EPROTO, 0x06, "Parameter rejected" ) |
iSCSI root path components (as per RFC4173)
Enumerator | |
---|---|
RP_SERVERNAME | |
RP_PROTOCOL | |
RP_PORT | |
RP_LUN | |
RP_TARGETNAME | |
NUM_RP_COMPONENTS |
Definition at line 1965 of file iscsi.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
FEATURE | ( | FEATURE_PROTOCOL | , |
"iSCSI" | , | ||
DHCP_EB_FEATURE_ISCSI | , | ||
1 | |||
) |
|
static |
Start up a new TX PDU.
iscsi | iSCSI session |
This initiates the process of sending a new PDU. Only one PDU may be in transit at any one time.
Definition at line 1439 of file iscsi.c.
References assert(), ISCSI_TX_BHS, ISCSI_TX_IDLE, iscsi_tx_resume(), memset(), iscsi_session::tx_bhs, and iscsi_session::tx_state.
Referenced by iscsi_start_command(), iscsi_start_data_out(), and iscsi_start_login().
|
static |
Build iSCSI login request BHS.
iscsi | iSCSI session |
Definition at line 771 of file iscsi.c.
References assert(), iscsi_session::cmdsn, DBGC, htonl, htons, IANA_EN_FEN_SYSTEMS, iscsi_build_login_request_strings(), ISCSI_FLAG_IMMEDIATE, ISCSI_ISID_IANA, ISCSI_LOGIN_CSG_MASK, ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION, ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION, ISCSI_LOGIN_FLAG_TRANSITION, ISCSI_OPCODE_LOGIN_REQUEST, ISCSI_SET_LENGTHS, iscsi_start_tx(), ISCSI_STATUS_PHASE_MASK, iscsi_session::isid_iana_qual, iscsi_session::itt, len, iscsi_bhs::login_request, NULL, request, iscsi_session::statsn, iscsi_session::status, and iscsi_session::tx_bhs.
Referenced by iscsi_open_connection(), and iscsi_rx_login_response().
|
static |
Build iSCSI data-out BHS.
iscsi | iSCSI session |
datasn | Data sequence number within the transfer |
Definition at line 528 of file iscsi.c.
References iscsi_session::command, iscsi_bhs::data_out, iscsi_bhs_data_out::datasn, DBGC, iscsi_bhs_data_out::expstatsn, iscsi_bhs_data_out::flags, htonl, ISCSI_FLAG_FINAL, ISCSI_OPCODE_DATA_OUT, ISCSI_SET_LENGTHS, iscsi_start_tx(), iscsi_bhs_data_out::itt, iscsi_session::itt, len, iscsi_bhs_data_out::lengths, scsi_cmd::lun, iscsi_bhs_data_out::lun, offset, iscsi_bhs_data_out::offset, iscsi_bhs_data_out::opcode, iscsi_session::statsn, iscsi_session::transfer_len, iscsi_session::transfer_offset, iscsi_bhs_data_out::ttt, iscsi_session::ttt, and iscsi_session::tx_bhs.
Referenced by iscsi_data_out_done(), and iscsi_rx_r2t().
|
static |
Finish receiving PDU data into buffer.
iscsi | iSCSI session |
Definition at line 161 of file iscsi.c.
References free, NULL, and iscsi_session::rx_buffer.
Referenced by iscsi_close_connection(), iscsi_free(), iscsi_rx_login_response(), and iscsi_rx_scsi_response().
|
static |
Receive PDU data into buffer.
iscsi | iSCSI session |
data | Data to receive |
len | Length of data |
rc | Return status code |
This can be used when the RX PDU type handler wishes to buffer up all received data and process the PDU as a single unit. The caller is repsonsible for calling iscsi_rx_buffered_data_done() after processing the data.
Definition at line 179 of file iscsi.c.
References assert(), data, ENOMEM, len, malloc(), memcpy(), iscsi_session::rx_buffer, iscsi_session::rx_len, and iscsi_session::rx_offset.
Referenced by iscsi_rx_login_response(), and iscsi_rx_scsi_response().
|
static |
Free iSCSI session.
refcnt | Reference counter |
Definition at line 201 of file iscsi.c.
References iscsi_session::chap, chap_finish(), iscsi_session::command, container_of, free, iscsi_session::initiator_iqn, iscsi_session::initiator_password, iscsi_session::initiator_username, iscsi_rx_buffered_data_done(), iscsi_session::target_address, iscsi_session::target_iqn, iscsi_session::target_password, and iscsi_session::target_username.
Referenced by iscsi_open().
|
static |
Shut down iSCSI interface.
iscsi | iSCSI session |
rc | Reason for close |
Definition at line 224 of file iscsi.c.
References iscsi_session::control, iscsi_session::data, DBGC, ECONNRESET, intfs_shutdown(), NULL, iscsi_session::process, process_del(), rc, iscsi_session::socket, and strerror().
Referenced by iscsi_command_close(), iscsi_open(), iscsi_socket_deliver(), iscsi_tx_step(), and iscsi_vredirect().
|
static |
Assign new iSCSI initiator task tag.
iscsi | iSCSI session |
Definition at line 245 of file iscsi.c.
References ISCSI_TAG_MAGIC, and iscsi_session::itt.
Referenced by iscsi_open_connection(), and iscsi_scsi_command().
|
static |
Open iSCSI transport-layer connection.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 257 of file iscsi.c.
References assert(), DBGC, htons, ISCSI_MAX_BURST_LEN, iscsi_new_itt(), ISCSI_RX_BHS, iscsi_start_login(), ISCSI_STATUS_AUTH_REVERSE_REQUIRED, ISCSI_STATUS_SECURITY_NEGOTIATION_PHASE, ISCSI_STATUS_STRINGS_SECURITY, ISCSI_TX_IDLE, iscsi_session::isid_iana_qual, iscsi_session::max_burst_len, memset(), NULL, random(), rc, iscsi_session::rx_offset, iscsi_session::rx_state, SOCK_STREAM, iscsi_session::socket, sockaddr_tcpip::st_port, iscsi_session::status, strerror(), iscsi_session::target_address, iscsi_session::target_port, iscsi_session::target_username, iscsi_session::tx_state, and xfer_open_named_socket().
Referenced by iscsi_open(), and iscsi_rx_login_response().
|
static |
Close iSCSI transport-layer connection.
iscsi | iSCSI session |
rc | Reason for close |
Closes the transport-layer connection and resets the session state ready to attempt a fresh login.
Definition at line 307 of file iscsi.c.
References iscsi_session::chap, chap_finish(), intf_restart(), ISCSI_RX_BHS, iscsi_rx_buffered_data_done(), ISCSI_TX_IDLE, rc, iscsi_session::rx_offset, iscsi_session::rx_state, iscsi_session::socket, iscsi_session::status, and iscsi_session::tx_state.
Referenced by iscsi_rx_login_response().
|
static |
Mark iSCSI SCSI operation as complete.
iscsi | iSCSI session |
rc | Return status code |
rsp | SCSI response, if any |
Note that iscsi_scsi_done() will not close the connection, and must therefore be called only when the internal state machines are in an appropriate state, otherwise bad things may happen on the next call to iscsi_scsi_command(). The general rule is to call iscsi_scsi_done() only at the end of receiving a PDU; at this point the TX and RX engines should both be idle.
Definition at line 339 of file iscsi.c.
References assert(), iscsi_session::command, iscsi_session::data, free, intf_restart(), ISCSI_TX_IDLE, iscsi_session::itt, NULL, rc, rsp, scsi_response(), and iscsi_session::tx_state.
Referenced by iscsi_rx_data_in(), and iscsi_rx_scsi_response().
|
static |
Build iSCSI SCSI command BHS.
iscsi | iSCSI session |
We don't currently support bidirectional commands (i.e. with both Data-In and Data-Out segments); these would require providing code to generate an AHS, and there doesn't seem to be any need for it at the moment.
Definition at line 377 of file iscsi.c.
References assert(), scsi_cmd::cdb, iscsi_session::cmdsn, iscsi_session::command, scsi_cmd::data_in, scsi_cmd::data_in_len, scsi_cmd::data_out, scsi_cmd::data_out_len, DBGC2, htonl, ISCSI_COMMAND_ATTR_SIMPLE, ISCSI_COMMAND_FLAG_READ, ISCSI_COMMAND_FLAG_WRITE, ISCSI_FLAG_FINAL, ISCSI_OPCODE_SCSI_COMMAND, iscsi_start_tx(), iscsi_session::itt, scsi_cmd::lun, memcpy(), SCSI_CDB_DATA, SCSI_CDB_FORMAT, iscsi_bhs::scsi_command, iscsi_session::statsn, and iscsi_session::tx_bhs.
Referenced by iscsi_scsi_command().
|
static |
Receive data segment of an iSCSI SCSI response PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Definition at line 417 of file iscsi.c.
References data, data_len, DBGC, EIO, iscsi_bhs_scsi_response::flags, ISCSI_DATA_FLAG_OVERFLOW, ISCSI_DATA_FLAG_UNDERFLOW, ISCSI_DATA_LEN, ISCSI_RESPONSE_COMMAND_COMPLETE, iscsi_rx_buffered_data(), iscsi_rx_buffered_data_done(), iscsi_scsi_done(), len, iscsi_bhs_scsi_response::lengths, memset(), ntohl, rc, iscsi_bhs_scsi_response::residual_count, iscsi_bhs_scsi_response::response, rsp, iscsi_session::rx_bhs, iscsi_session::rx_buffer, scsi_parse_sense(), iscsi_bhs::scsi_response, iscsi_bhs_scsi_response::status, and strerror().
Referenced by iscsi_rx_data().
|
static |
Receive data segment of an iSCSI data-in PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Definition at line 470 of file iscsi.c.
References assert(), iscsi_session::command, copy_to_user(), data, scsi_cmd::data_in, iscsi_bhs::data_in, scsi_cmd::data_in_len, iscsi_bhs_data_in::flags, ISCSI_DATA_FLAG_STATUS, ISCSI_FLAG_FINAL, iscsi_scsi_done(), len, ntohl, NULL, offset, iscsi_bhs_data_in::offset, iscsi_session::rx_bhs, and iscsi_session::rx_offset.
Referenced by iscsi_rx_data().
|
static |
Receive data segment of an iSCSI R2T PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Definition at line 507 of file iscsi.c.
References iscsi_start_data_out(), iscsi_bhs_r2t::len, ntohl, iscsi_bhs_r2t::offset, iscsi_bhs::r2t, iscsi_session::rx_bhs, iscsi_session::transfer_len, iscsi_session::transfer_offset, iscsi_bhs_r2t::ttt, and iscsi_session::ttt.
Referenced by iscsi_rx_data().
|
static |
Complete iSCSI data-out PDU transmission.
iscsi | iSCSI session |
Definition at line 566 of file iscsi.c.
References iscsi_bhs::data_out, iscsi_bhs_data_out::datasn, iscsi_bhs_data_out::flags, ISCSI_FLAG_FINAL, iscsi_start_data_out(), ntohl, and iscsi_session::tx_bhs.
Referenced by iscsi_tx_done().
|
static |
Send iSCSI data-out data segment.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 582 of file iscsi.c.
References assert(), iscsi_session::command, copy_from_user(), scsi_cmd::data_out, iscsi_bhs::data_out, scsi_cmd::data_out_len, ENOMEM, iob_put, ISCSI_DATA_LEN, ISCSI_DATA_PAD_LEN, len, iscsi_bhs_data_out::lengths, memset(), ntohl, NULL, offset, iscsi_bhs_data_out::offset, pad_len, iscsi_session::socket, iscsi_session::tx_bhs, xfer_alloc_iob(), and xfer_deliver_iob().
Referenced by iscsi_tx_data().
|
static |
Receive data segment of an iSCSI NOP-In.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Definition at line 617 of file iscsi.c.
References DBGC, DBGC2, htonl, ISCSI_TAG_RESERVED, iscsi_bhs::nop_in, ntohl, iscsi_session::rx_bhs, and iscsi_nop_in::ttt.
Referenced by iscsi_rx_data().
|
static |
Build iSCSI login request strings.
iscsi | iSCSI session |
These are the initial set of strings sent in the first login request PDU. We want the following settings:
HeaderDigest=None DataDigest=None MaxConnections=1 (irrelevant; we make only one connection anyway) [4] InitialR2T=Yes [1] ImmediateData=No (irrelevant; we never send immediate data) [4] MaxRecvDataSegmentLength=8192 (default; we don't care) [3] MaxBurstLength=262144 (default; we don't care) [3] FirstBurstLength=65536 (irrelevant due to other settings) [5] DefaultTime2Wait=0 [2] DefaultTime2Retain=0 [2] MaxOutstandingR2T=1 DataPDUInOrder=Yes DataSequenceInOrder=Yes ErrorRecoveryLevel=0
[1] InitialR2T has an OR resolution function, so the target may force us to use it. We therefore simplify our logic by always using it.
[2] These ensure that we can safely start a new task once we have reconnected after a failure, without having to manually tidy up after the old one.
[3] We are quite happy to use the RFC-defined default values for these parameters, but some targets (notably OpenSolaris) incorrectly assume a default value of zero, so we explicitly specify the default values.
[4] We are quite happy to use the RFC-defined default values for these parameters, but some targets (notably a QNAP TS-639Pro) fail unless they are supplied, so we explicitly specify the default values.
[5] FirstBurstLength is defined to be irrelevant since we already force InitialR2T=Yes and ImmediateData=No, but some targets (notably LIO as of kernel 4.11) fail unless it is specified, so we explicitly specify the default value.
Definition at line 692 of file iscsi.c.
References assert(), base16_encoded_len(), iscsi_session::chap, iscsi_session::chap_challenge, data, iscsi_session::initiator_iqn, iscsi_session::initiator_username, ISCSI_FIRST_BURST_LEN, ISCSI_MAX_BURST_LEN, ISCSI_MAX_RECV_DATA_SEG_LEN, ISCSI_STATUS_STRINGS_CHAP_ALGORITHM, ISCSI_STATUS_STRINGS_CHAP_CHALLENGE, ISCSI_STATUS_STRINGS_CHAP_RESPONSE, ISCSI_STATUS_STRINGS_OPERATIONAL, ISCSI_STATUS_STRINGS_SECURITY, len, NULL, chap_response::response, chap_response::response_len, ssnprintf(), iscsi_session::status, iscsi_session::target_iqn, and iscsi_session::target_username.
Referenced by iscsi_start_login(), and iscsi_tx_login_request().
|
static |
Complete iSCSI login request PDU transmission.
iscsi | iSCSI session |
Definition at line 813 of file iscsi.c.
References iscsi_session::chap, chap_finish(), ISCSI_STATUS_STRINGS_MASK, and iscsi_session::status.
Referenced by iscsi_tx_done().
|
static |
Transmit data segment of an iSCSI login request PDU.
iscsi | iSCSI session |
rc | Return status code |
For login requests, the data segment consists of the login strings.
Definition at line 830 of file iscsi.c.
References io_buffer::data, ENOMEM, iob_put, iscsi_build_login_request_strings(), ISCSI_DATA_LEN, ISCSI_DATA_PAD_LEN, len, iscsi_bhs::login_request, memset(), pad_len, request, iscsi_session::socket, iscsi_session::tx_bhs, xfer_alloc_iob(), and xfer_deliver_iob().
Referenced by iscsi_tx_data().
Decode large binary value.
encoded | Encoded large binary value |
raw | Raw data |
len | Length of data buffer |
len | Length of raw data, or negative error |
Definition at line 856 of file iscsi.c.
References base64_decode(), EPROTO_INVALID_LARGE_BINARY, len, raw, and tolower().
Referenced by iscsi_handle_chap_c_value(), and iscsi_handle_chap_r_value().
|
static |
Handle iSCSI TargetAddress text value.
iscsi | iSCSI session |
value | TargetAddress value |
rc | Return status code |
Definition at line 879 of file iscsi.c.
References DBGC, ENOMEM, free, htons, ISCSI_PORT, NULL, strchr(), strdup(), strtoul(), iscsi_session::target_address, iscsi_session::target_port, and value.
|
static |
Handle iSCSI AuthMethod text value.
iscsi | iSCSI session |
value | AuthMethod value |
rc | Return status code |
Definition at line 909 of file iscsi.c.
References DBGC, ISCSI_STATUS_AUTH_FORWARD_REQUIRED, ISCSI_STATUS_STRINGS_CHAP_ALGORITHM, iscsi_session::status, strcmp(), and value.
|
static |
Handle iSCSI MaxBurstLength text value.
iscsi | iSCSI session |
value | MaxBurstLength value |
rc | Return status code |
Definition at line 930 of file iscsi.c.
References DBGC, EINVAL_MAXBURSTLENGTH, end, iscsi_session::max_burst_len, strtoul(), and value.
|
static |
|
static |
Handle iSCSI CHAP_I text value.
iscsi | iSCSI session |
value | CHAP_I value |
rc | Return status code |
Definition at line 978 of file iscsi.c.
References iscsi_session::chap, chap_finish(), chap_init(), chap_set_identifier(), chap_update(), DBGC, EPROTO_INVALID_CHAP_IDENTIFIER, iscsi_session::initiator_password, md5_algorithm, rc, strerror(), strlen(), strtoul(), and value.
|
static |
Handle iSCSI CHAP_C text value.
iscsi | iSCSI session |
value | CHAP_C value |
rc | Return status code |
Definition at line 1019 of file iscsi.c.
References iscsi_session::chap, iscsi_session::chap_challenge, chap_respond(), chap_update(), DBGC, ENOMEM, free, iscsi_large_binary_decode(), ISCSI_STATUS_STRINGS_CHAP_CHALLENGE, ISCSI_STATUS_STRINGS_CHAP_RESPONSE, len, malloc(), random(), rc, iscsi_session::status, strerror(), strlen(), iscsi_session::target_username, and value.
|
static |
Handle iSCSI CHAP_N text value.
iscsi | iSCSI session |
value | CHAP_N value |
rc | Return status code |
Definition at line 1074 of file iscsi.c.
References DBGC, EACCES_INCORRECT_TARGET_USERNAME, strcmp(), iscsi_session::target_username, and value.
|
static |
Handle iSCSI CHAP_R text value.
iscsi | iSCSI session |
value | CHAP_R value |
rc | Return status code |
Definition at line 1103 of file iscsi.c.
References iscsi_session::chap, iscsi_session::chap_challenge, chap_finish(), chap_init(), chap_respond(), chap_set_identifier(), chap_update(), DBGC, EACCES_INCORRECT_TARGET_PASSWORD, ENOMEM, EPROTO_INVALID_CHAP_RESPONSE, free, iscsi_large_binary_decode(), ISCSI_STATUS_AUTH_REVERSE_OK, len, malloc(), md5_algorithm, memcmp(), rc, chap_response::response, chap_response::response_len, iscsi_session::status, strerror(), strlen(), iscsi_session::target_password, and value.
|
static |
Handle iSCSI string.
iscsi | iSCSI session |
string | iSCSI string (in "key=value" format) |
rc | Return status code |
Definition at line 1205 of file iscsi.c.
References DBGC, EPROTO_INVALID_KEY_VALUE_PAIR, EPROTO_VALUE_REJECTED, iscsi_string_types, rc, strchr(), strcmp(), strerror(), string, strncmp(), type, and value.
Referenced by iscsi_handle_strings().
|
static |
Handle iSCSI strings.
iscsi | iSCSI session |
string | iSCSI string buffer |
len | Length of string buffer |
rc | Return status code |
Definition at line 1255 of file iscsi.c.
References iscsi_handle_string(), len, rc, and strnlen().
Referenced by iscsi_rx_login_response().
|
static |
Convert iSCSI response status to return status code.
status_class | iSCSI status class |
status_detail | iSCSI status detail |
rc | Return status code |
Definition at line 1282 of file iscsi.c.
References EINVAL, EIO_TARGET_NO_RESOURCES, EIO_TARGET_UNAVAILABLE, ENODEV, ENOTSUP_INITIATOR_STATUS, ENOTSUP_TARGET_STATUS, EPERM_INITIATOR_AUTHENTICATION, EPERM_INITIATOR_AUTHORISATION, ISCSI_STATUS_INITIATOR_ERROR, ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION, ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION, ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND, ISCSI_STATUS_INITIATOR_ERROR_REMOVED, ISCSI_STATUS_TARGET_ERROR, ISCSI_STATUS_TARGET_ERROR_NO_RESOURCES, and ISCSI_STATUS_TARGET_ERROR_UNAVAILABLE.
Referenced by iscsi_rx_login_response().
|
static |
Receive data segment of an iSCSI login response PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Definition at line 1320 of file iscsi.c.
References iscsi_session::control, data, DBGC, EIO, EPROTO, iscsi_bhs_login_response::flags, iscsi_close_connection(), iscsi_handle_strings(), ISCSI_LOGIN_FLAG_TRANSITION, ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE, ISCSI_LOGIN_NSG_MASK, ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION, iscsi_open_connection(), iscsi_rx_buffered_data(), iscsi_rx_buffered_data_done(), iscsi_start_login(), ISCSI_STATUS_AUTH_REVERSE_OK, ISCSI_STATUS_AUTH_REVERSE_REQUIRED, ISCSI_STATUS_FULL_FEATURE_PHASE, ISCSI_STATUS_OPERATIONAL_NEGOTIATION_PHASE, ISCSI_STATUS_PHASE_MASK, ISCSI_STATUS_REDIRECT, ISCSI_STATUS_STRINGS_MASK, ISCSI_STATUS_STRINGS_OPERATIONAL, iscsi_status_to_rc(), len, iscsi_bhs::login_response, rc, iscsi_session::rx_bhs, iscsi_session::rx_buffer, iscsi_session::rx_len, iscsi_session::status, iscsi_bhs_login_response::status_class, iscsi_bhs_login_response::status_detail, strerror(), and xfer_window_changed().
Referenced by iscsi_rx_data().
|
static |
Pause TX engine.
iscsi | iSCSI session |
Definition at line 1418 of file iscsi.c.
References iscsi_session::process, and process_del().
Referenced by iscsi_tx_done(), and iscsi_tx_step().
|
static |
Resume TX engine.
iscsi | iSCSI session |
Definition at line 1427 of file iscsi.c.
References iscsi_session::process, and process_add().
Referenced by iscsi_start_tx().
|
static |
Transmit nothing.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 1459 of file iscsi.c.
Referenced by iscsi_tx_step().
|
static |
Transmit basic header segment of an iSCSI PDU.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 1469 of file iscsi.c.
References iscsi_session::socket, iscsi_session::tx_bhs, and xfer_deliver_raw().
Referenced by iscsi_tx_step().
|
static |
Transmit data segment of an iSCSI PDU.
iscsi | iSCSI session |
rc | Return status code |
Handle transmission of part of a PDU data segment. iscsi::tx_bhs will be valid when this is called.
Definition at line 1483 of file iscsi.c.
References iscsi_bhs::common, common, ISCSI_OPCODE_DATA_OUT, ISCSI_OPCODE_LOGIN_REQUEST, ISCSI_OPCODE_MASK, iscsi_tx_data_out(), iscsi_tx_login_request(), and iscsi_session::tx_bhs.
Referenced by iscsi_tx_step().
|
static |
Complete iSCSI PDU transmission.
iscsi | iSCSI session |
Called when a PDU has been completely transmitted and the TX state machine is about to enter the idle state. iscsi::tx_bhs will be valid for the just-completed PDU when this is called.
Definition at line 1506 of file iscsi.c.
References iscsi_bhs::common, common, iscsi_data_out_done(), iscsi_login_request_done(), ISCSI_OPCODE_DATA_OUT, ISCSI_OPCODE_LOGIN_REQUEST, ISCSI_OPCODE_MASK, iscsi_tx_pause(), and iscsi_session::tx_bhs.
Referenced by iscsi_tx_step().
|
static |
Transmit iSCSI PDU.
iscsi | iSCSI session |
buf | Temporary data buffer |
len | Length of temporary data buffer |
Constructs data to be sent for the current TX state
Definition at line 1534 of file iscsi.c.
References assert(), iscsi_bhs::common, common, DBGC, iscsi_close(), ISCSI_DATA_LEN, ISCSI_TX_AHS, ISCSI_TX_BHS, iscsi_tx_bhs(), ISCSI_TX_DATA, iscsi_tx_data(), iscsi_tx_done(), ISCSI_TX_IDLE, iscsi_tx_nothing(), iscsi_tx_pause(), rc, iscsi_session::socket, strerror(), tx, iscsi_session::tx_bhs, iscsi_session::tx_state, and xfer_window().
|
static |
Receive basic header segment of an iSCSI PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
This fills in iscsi::rx_bhs with the data from the BHS portion of the received PDU.
Definition at line 1613 of file iscsi.c.
References iscsi_bhs::bytes, iscsi_bhs::common, data, DBGC2, ISCSI_DATA_LEN, len, iscsi_bhs_common::lengths, memcpy(), iscsi_bhs_common::opcode, iscsi_session::rx_bhs, and iscsi_session::rx_offset.
Referenced by iscsi_socket_deliver().
|
static |
Discard portion of an iSCSI PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
This discards data from a portion of a received PDU.
Definition at line 1635 of file iscsi.c.
Referenced by iscsi_socket_deliver().
|
static |
Receive data segment of an iSCSI PDU.
iscsi | iSCSI session |
data | Received data |
len | Length of received data |
remaining | Data remaining after this data |
rc | Return status code |
Handle processing of part of a PDU data segment. iscsi::rx_bhs will be valid when this is called.
Definition at line 1654 of file iscsi.c.
References iscsi_session::cmdsn, iscsi_bhs::common_response, data, DBGC, ENOTSUP_OPCODE, iscsi_bhs_common_response::expcmdsn, ISCSI_OPCODE_DATA_IN, ISCSI_OPCODE_LOGIN_RESPONSE, ISCSI_OPCODE_MASK, ISCSI_OPCODE_NOP_IN, ISCSI_OPCODE_R2T, ISCSI_OPCODE_SCSI_RESPONSE, iscsi_rx_data_in(), iscsi_rx_login_response(), iscsi_rx_nop_in(), iscsi_rx_r2t(), iscsi_rx_scsi_response(), len, ntohl, iscsi_bhs_common_response::opcode, iscsi_session::rx_bhs, iscsi_bhs_common_response::statsn, and iscsi_session::statsn.
Referenced by iscsi_socket_deliver().
|
static |
Receive new data.
iscsi | iSCSI session |
iobuf | I/O buffer |
meta | Data transfer metadata |
rc | Return status code |
This handles received PDUs. The receive strategy is to fill in iscsi::rx_bhs with the contents of the BHS portion of the PDU, throw away any AHS portion, and then process each part of the data portion as it arrives. The data processing routine therefore always has a full copy of the BHS available, even for portions of the data in different packets to the BHS.
Definition at line 1698 of file iscsi.c.
References assert(), iscsi_bhs::common, common, data, io_buffer::data, DBGC, done, EINVAL, free_iob(), iob_len(), iob_pull, ISCSI_AHS_LEN, iscsi_close(), ISCSI_DATA_LEN, ISCSI_DATA_PAD_LEN, ISCSI_RX_AHS, ISCSI_RX_BHS, iscsi_rx_bhs(), ISCSI_RX_DATA, iscsi_rx_data(), ISCSI_RX_DATA_PADDING, iscsi_rx_discard(), len, rc, rx, iscsi_session::rx_bhs, iscsi_session::rx_len, iscsi_session::rx_offset, iscsi_session::rx_state, and strerror().
|
static |
Handle redirection event.
iscsi | iSCSI session |
type | Location type |
args | Remaining arguments depend upon location type |
rc | Return status code |
Definition at line 1782 of file iscsi.c.
References iscsi_close(), LOCATION_SOCKET, memcpy(), peer, rc, iscsi_session::socket, iscsi_session::target_sockaddr, tmp, type, va_arg, va_copy, va_end, and xfer_vreopen().
|
static |
Check iSCSI flow-control window.
iscsi | iSCSI session |
len | Length of window |
Definition at line 1838 of file iscsi.c.
References iscsi_session::command, ISCSI_STATUS_FULL_FEATURE_PHASE, ISCSI_STATUS_PHASE_MASK, NULL, and iscsi_session::status.
Referenced by iscsi_scsi_command().
|
static |
Issue iSCSI SCSI command.
iscsi | iSCSI session |
parent | Parent interface |
command | SCSI command |
tag | Command tag, or negative error |
Definition at line 1858 of file iscsi.c.
References iscsi_session::command, iscsi_session::data, DBGC, ENOMEM, EOPNOTSUPP, intf_plug_plug(), iscsi_new_itt(), iscsi_scsi_window(), iscsi_start_command(), iscsi_session::itt, malloc(), and memcpy().
|
static |
Update SCSI block device capacity.
iscsi | iSCSI session |
capacity | Block device capacity |
Definition at line 1894 of file iscsi.c.
References block_device_capacity::blksize, iscsi_session::max_burst_len, and block_device_capacity::max_count.
|
static |
Get iSCSI ACPI descriptor.
iscsi | iSCSI session |
desc | ACPI descriptor |
Definition at line 1912 of file iscsi.c.
References iscsi_session::desc.
|
static |
Close iSCSI command.
iscsi | iSCSI session |
rc | Reason for close |
Definition at line 1937 of file iscsi.c.
References iscsi_session::command, iscsi_session::data, ECANCELED, intf_restart(), iscsi_close(), NULL, and rc.
const struct setting initiator_iqn_setting __setting | ( | SETTING_SANBOOT_EXTRA | , |
initiator- | iqn | ||
) |
iSCSI initiator IQN setting
const struct setting reverse_password_setting __setting | ( | SETTING_AUTH_EXTRA | , |
reverse- | username | ||
) |
iSCSI reverse username setting
iSCSI reverse password setting
|
static |
Parse iSCSI root path.
iscsi | iSCSI session |
root_path | iSCSI root path (as per RFC4173) |
rc | Return status code |
Definition at line 2008 of file iscsi.c.
References DBGC, EINVAL_ROOT_PATH_TOO_SHORT, ENOMEM, free, ISCSI_PORT, iscsi_session::lun, NULL, NUM_RP_COMPONENTS, rc, RP_LUN, RP_PORT, RP_SERVERNAME, RP_TARGETNAME, scsi_parse_lun(), strdup(), strtoul(), iscsi_session::target_address, iscsi_session::target_iqn, and iscsi_session::target_port.
Referenced by iscsi_open().
|
static |
Fetch iSCSI settings.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 2080 of file iscsi.c.
References asprintf(), assert(), DBGC, EINVAL_NO_INITIATOR_IQN, ENOMEM, fetch_string_setting_copy(), fetch_uuid_setting(), free, iscsi_session::initiator_iqn, iscsi_session::initiator_password, iscsi_session::initiator_username, ISCSI_DEFAULT_IQN_PREFIX, len, NULL, iscsi_session::target_password, iscsi_session::target_username, and uuid_ntoa().
Referenced by iscsi_open().
|
static |
Check iSCSI authentication details.
iscsi | iSCSI session |
rc | Return status code |
Definition at line 2143 of file iscsi.c.
References DBGC, EINVAL_BAD_CREDENTIAL_MIX, iscsi_session::initiator_password, iscsi_session::initiator_username, iscsi_session::target_password, and iscsi_session::target_username.
Referenced by iscsi_open().
Open iSCSI URI.
parent | Parent interface |
uri | URI |
rc | Return status code |
Definition at line 2174 of file iscsi.c.
References acpi_init(), iscsi_session::control, iscsi_session::data, DBGC, iscsi_session::desc, EINVAL_NO_ROOT_PATH, EINVAL_NO_TARGET_IQN, ENOMEM, ENOTSUP_DISCOVERY, iscsi_session::initiator_iqn, intf_init(), iscsi_check_auth(), iscsi_close(), iscsi_control_desc, iscsi_data_desc, iscsi_fetch_settings(), iscsi_free(), iscsi_open_connection(), iscsi_parse_root_path(), iscsi_process_desc, iscsi_socket_desc, iscsi_session::lun, uri::opaque, iscsi_session::process, process_init_stopped(), rc, ref_init, ref_put, iscsi_session::refcnt, scsi_open(), iscsi_session::socket, strerror(), iscsi_session::target_address, iscsi_session::target_iqn, and zalloc().
|
static |
iSCSI text strings that we want to handle
Definition at line 1186 of file iscsi.c.
Referenced by iscsi_handle_string().
|
static |
iSCSI TX process descriptor
Definition at line 1598 of file iscsi.c.
Referenced by iscsi_open().
|
static |
iSCSI socket interface operations
|
static |
iSCSI socket interface descriptor
Definition at line 1823 of file iscsi.c.
Referenced by iscsi_open().
|
static |
iSCSI SCSI command-issuing interface operations
|
static |
iSCSI SCSI command-issuing interface descriptor
Definition at line 1928 of file iscsi.c.
Referenced by iscsi_open().
|
static |
iSCSI SCSI command interface operations
|
static |
iSCSI SCSI command interface descriptor
Definition at line 1955 of file iscsi.c.
Referenced by iscsi_open().
struct uri_opener iscsi_uri_opener __uri_opener |
iSCSI URI opener