iscsi_session Struct Reference

An iSCSI session. More...

#include <iscsi.h>


Data Fields

struct refcnt refcnt
 Reference counter.
struct xfer_interface socket
 Transport-layer socket.
char * target_address
 Target address.
unsigned int target_port
 Target port.
char * target_iqn
 Target IQN.
struct scsi_lun lun
 Logical Unit Number (LUN).
struct sockaddr target_sockaddr
 Target socket address (recorded only for iBFT).
int status
 Session status.
int retry_count
 Retry count.
char * initiator_username
 Initiator username (if any).
char * initiator_password
 Initiator password (if any).
char * target_username
 Target username (if any).
char * target_password
 Target password (if any).
unsigned char chap_challenge [17]
 CHAP challenge (for target auth only).
struct chap_response chap
 CHAP response (used for both initiator and target auth).
uint16_t tsih
 Target session identifying handle.
uint32_t itt
 Initiator task tag.
uint32_t ttt
 Target transfer tag.
uint32_t transfer_offset
 Transfer offset.
uint32_t transfer_len
 Transfer length.
uint32_t cmdsn
 Command sequence number.
uint32_t statsn
 Status sequence number.
union iscsi_bhs tx_bhs
 Basic header segment for current TX PDU.
enum iscsi_tx_state tx_state
 State of the TX engine.
struct process process
 TX process.
union iscsi_bhs rx_bhs
 Basic header segment for current RX PDU.
enum iscsi_rx_state rx_state
 State of the RX engine.
size_t rx_offset
 Byte offset within the current RX state.
size_t rx_len
 Length of the current RX state.
void * rx_buffer
 Buffer for received data (not always used).
struct scsi_commandcommand
 Current SCSI command.
int instant_rc
 Instant return code.


Detailed Description

An iSCSI session.

Definition at line 496 of file iscsi.h.


Field Documentation

Reference counter.

Definition at line 498 of file iscsi.h.

Referenced by iscsi_attach().

Target port.

Definition at line 506 of file iscsi.h.

Referenced by iscsi_handle_targetaddress_value(), iscsi_open_connection(), and iscsi_parse_root_path().

Logical Unit Number (LUN).

Definition at line 510 of file iscsi.h.

Referenced by iscsi_parse_root_path(), iscsi_start_command(), and iscsi_start_data_out().

Target socket address (recorded only for iBFT).

Definition at line 512 of file iscsi.h.

Referenced by ibft_fill_target(), and iscsi_vredirect().

Retry count.

Number of times that the connection has been retried. Reset upon a successful connection.

Definition at line 525 of file iscsi.h.

Referenced by iscsi_rx_login_response(), and iscsi_socket_close().

Initiator username (if any).

Definition at line 528 of file iscsi.h.

Referenced by ibft_fill_target_chap(), ibft_fill_target_reverse_chap(), iscsi_build_login_request_strings(), iscsi_free(), and iscsi_set_auth().

Initiator password (if any).

Definition at line 530 of file iscsi.h.

Referenced by ibft_fill_target_chap(), ibft_fill_target_reverse_chap(), iscsi_free(), iscsi_handle_chap_i_value(), and iscsi_set_auth().

Target password (if any).

Definition at line 534 of file iscsi.h.

Referenced by ibft_fill_target_reverse_chap(), iscsi_free(), iscsi_handle_chap_r_value(), and iscsi_set_auth().

unsigned char iscsi_session::chap_challenge[17]

CHAP challenge (for target auth only).

This is a block of random data; the first byte is used as the CHAP identifier (CHAP_I) and the remainder as the CHAP challenge (CHAP_C).

Definition at line 541 of file iscsi.h.

Referenced by iscsi_build_login_request_strings(), iscsi_handle_chap_c_value(), and iscsi_handle_chap_r_value().

Target session identifying handle.

This is assigned by the target when we first log in, and must be reused on subsequent login attempts.

Definition at line 550 of file iscsi.h.

Referenced by iscsi_rx_login_response(), and iscsi_start_login().

Initiator task tag.

This is the tag of the current command. It is incremented whenever a new command is started.

Definition at line 556 of file iscsi.h.

Referenced by iscsi_open_connection(), iscsi_start_command(), iscsi_start_data_out(), and iscsi_start_login().

Target transfer tag.

This is the tag attached to a sequence of data-out PDUs in response to an R2T.

Definition at line 562 of file iscsi.h.

Referenced by iscsi_rx_r2t(), and iscsi_start_data_out().

Transfer offset.

This is the offset for an in-progress sequence of data-out PDUs in response to an R2T.

Definition at line 569 of file iscsi.h.

Referenced by iscsi_rx_r2t(), and iscsi_start_data_out().

Transfer length.

This is the length for an in-progress sequence of data-out PDUs in response to an R2T.

Definition at line 576 of file iscsi.h.

Referenced by iscsi_rx_r2t(), and iscsi_start_data_out().

Command sequence number.

This is the sequence number of the current command, used to fill out the CmdSN field in iSCSI request PDUs. It is updated with the value of the ExpCmdSN field whenever we receive an iSCSI response PDU containing such a field.

Definition at line 584 of file iscsi.h.

Referenced by iscsi_rx_data(), iscsi_start_command(), and iscsi_start_login().

Status sequence number.

This is the most recent status sequence number present in the StatSN field of an iSCSI response PDU containing such a field. Whenever we send an iSCSI request PDU, we fill out the ExpStatSN field with this value plus one.

Definition at line 592 of file iscsi.h.

Referenced by iscsi_rx_data(), iscsi_start_command(), iscsi_start_data_out(), and iscsi_start_login().

State of the TX engine.

Definition at line 597 of file iscsi.h.

Referenced by iscsi_close_connection(), iscsi_open_connection(), iscsi_scsi_done(), iscsi_start_tx(), and iscsi_tx_step().

TX process.

Definition at line 599 of file iscsi.h.

Referenced by iscsi_attach(), and iscsi_detach().

Basic header segment for current RX PDU.

Definition at line 602 of file iscsi.h.

Referenced by iscsi_rx_bhs(), iscsi_rx_data(), iscsi_rx_data_in(), iscsi_rx_login_response(), iscsi_rx_r2t(), iscsi_rx_scsi_response(), and iscsi_socket_deliver_raw().

State of the RX engine.

Definition at line 604 of file iscsi.h.

Referenced by iscsi_close_connection(), iscsi_open_connection(), and iscsi_socket_deliver_raw().

Length of the current RX state.

Definition at line 608 of file iscsi.h.

Referenced by iscsi_rx_buffered_data(), iscsi_rx_login_response(), and iscsi_socket_deliver_raw().

Buffer for received data (not always used).

Definition at line 610 of file iscsi.h.

Referenced by iscsi_rx_buffered_data(), iscsi_rx_buffered_data_done(), and iscsi_rx_login_response().

Current SCSI command.

Set to NULL when command is complete.

Definition at line 616 of file iscsi.h.

Referenced by iscsi_command(), iscsi_rx_data_in(), iscsi_rx_scsi_response(), iscsi_scsi_done(), iscsi_start_command(), and iscsi_tx_data_out().

Instant return code.

Set to a non-zero value if all requests should return immediately. This can be used to e.g. avoid retrying logins that are doomed to fail authentication.

Definition at line 623 of file iscsi.h.

Referenced by iscsi_command(), iscsi_rx_login_response(), and iscsi_socket_close().


The documentation for this struct was generated from the following file:

Generated on Tue Apr 6 20:02:06 2010 for gPXE by  doxygen 1.5.7.1