Go to the source code of this file.
Defines the iSCSI Login interface functions.
This module will queue requests when insufficent resources exist to send the request immediately.
Definition in file ocs_login.h.
Data Structures | |
| struct | ocs_login_key_def_t |
| Defines the fields required to track the login keys during negotiation. More... | |
Macros | |
| #define | KEY_FLAG_SEND_INI (1 << 0) /* specifies the sender of the key */ |
| #define | KEY_FLAG_SEND_TGT (1 << 1) |
| #define | KEY_FLAG_SEND_BOTH (KEY_FLAG_SEND_INI | KEY_FLAG_SEND_TGT) |
| #define | KEY_FLAG_PHASE_SEC (1 << 2) /* specifies the valid phases for the key */ |
| #define | KEY_FLAG_PHASE_OPER (1 << 3) |
| #define | KEY_FLAG_PHASE_FFP (1 << 4) |
| #define | KEY_FLAG_PHASE_SEC_OPER (KEY_FLAG_PHASE_SEC | KEY_FLAG_PHASE_OPER) |
| #define | KEY_FLAG_PHASE_ALL (KEY_FLAG_PHASE_SEC | KEY_FLAG_PHASE_OPER | KEY_FLAG_PHASE_FFP) |
| #define | KEY_FLAG_USE_LEADING (1 << 5) /* Valid on leading login only */ |
| #define | KEY_FLAG_USE_LOGIN (1 << 6) /* Valid on any login */ |
| #define | KEY_FLAG_VALID_DISC (1 << 7) /* Valid on discovery sessions */ |
| #define | KEY_FLAG_NEGOTIATE (1 << 8) /* This code should automatically negotiate the key */ |
| #define | KEY_FLAG_DEFAULT (1 << 9) /* Value is default, negotiation not required */ |
| #define | KEY_FLAG_ALLOW_MULTI (1 << 10) /* do not error if key is sent multiple times */ |
| #define | KEY_FLAG_ALLOW_LARGE (1 << 11) /* do not error if key value is > 255 characters */ |
| #define | OCS_LOGIN_ERROR_WRONG_STATE -10 |
| #define | OCS_LOGIN_ERROR_VIRT_ARRAY_TOO_SMALL -11 |
| #define | OCS_LOGIN_REQUEST_QUEUED -12 |
| #define | OCS_LOGIN_NO_QUEUING_RESOURCES -13 |
Functions | |
| int32_t | ocs_iscsi_login_initialize (ocs_iscsi_t *iscsi) |
| Initialize the login and retry object used within the login module. More... | |
| void | ocs_iscsi_login_teardown (ocs_iscsi_t *iscsi) |
| Releases the login and retry object used within the login module. More... | |
| ocs_hal_rtn_e | ocs_iscsi_login_cxn_cleanup (ocs_cxn_t *cxn) |
| Frees any retry objects for the connection. More... | |
| void | ocs_iscsi_login_retry (ocs_cxn_t *cxn) |
| Attempt to start a request on the retry queue. More... | |
| int32_t | ocs_iscsi_send_login (ocs_cxn_t *cxn, bool is_discovery, char *tgt_name) |
| Function to send an initial login PDU. More... | |
| ocs_pdu_process_rtn_e | ocs_iscsi_recv_login (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len) |
| Function to process a login PDU on a target. More... | |
| int32_t | ocs_iscsi_send_login_rsp_invalid_during_login (ocs_cxn_t *cxn, uint32_t itt) |
| Function to send an login Response PDU (invalid during login). More... | |
| int32_t | ocs_iscsi_recv_login_rsp (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len) |
| Function to process a login response PDU. More... | |
| void | ocs_iscsi_ffp_text_timeout (void *arg) |
| This function is called to check for stalled text negotiations for a connection on a target. More... | |
| ocs_pdu_process_rtn_e | ocs_iscsi_recv_text (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t *reject_reason) |
| Function to process a text PDU. More... | |
| int32_t | ocs_iscsi_send_logout (ocs_cxn_t *cxn, uint8_t immediate, uint8_t reason_code) |
| Function to send a logout PDU. More... | |
| ocs_pdu_process_rtn_e | ocs_iscsi_recv_logout (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len) |
| Function to process a logout PDU. More... | |
| int32_t | ocs_iscsi_send_logout_rsp (ocs_cxn_t *cxn, uint8_t response, uint32_t itt) |
| Function to send a logout response PDU. More... | |
| int32_t | ocs_iscsi_recv_logout_rsp (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len) |
| Handle logout response from a target. More... | |
| int32_t | ocs_iscsi_send_nop_out (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len) |
| Send NOP-Out from an initiator. More... | |
| int32_t | ocs_iscsi_send_nop_in (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len) |
| Send NOP-In from a target. More... | |
| int32_t | ocs_iscsi_recv_nop_in (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len) |
| Handle NOP-IN from a target. More... | |
| ocs_pdu_process_rtn_e | ocs_iscsi_recv_nop_out (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len) |
| Handle NOP-OUT from an initiator. More... | |
| int32_t | ocs_iscsi_send_reject (ocs_cxn_t *cxn, void *hdr, uint32_t hdr_len, uint8_t reason) |
| Sends a reject PDU for the supplied PDU header. More... | |
| int32_t | ocs_iscsi_send_async (ocs_cxn_t *cxn, void *payload, uint32_t payload_len, uint8_t reason, uint64_t lun, uint16_t param1, uint16_t param2, uint16_t param3) |
| Sends a asynchronous PDU with an optional payload. More... | |
| int32_t | ocs_iscsi_are_login_reqs_outstanding (ocs_cxn_t *cxn) |
| Checks to see if there are any retry or login IOs active on a connection. More... | |
| void | ocs_iscsi_cbit_cleanup (ocs_cxn_t *cxn) |
| Sends the login parameters to the firmware. More... | |
Variables | |
| const ocs_login_key_def_t | ocs_login_key_defs [] |
| #define KEY_FLAG_ALLOW_LARGE (1 << 11) /* do not error if key value is > 255 characters */ |
Definition at line 59 of file ocs_login.h.
| #define KEY_FLAG_ALLOW_MULTI (1 << 10) /* do not error if key is sent multiple times */ |
Definition at line 58 of file ocs_login.h.
| #define KEY_FLAG_DEFAULT (1 << 9) /* Value is default, negotiation not required */ |
Definition at line 57 of file ocs_login.h.
| #define KEY_FLAG_NEGOTIATE (1 << 8) /* This code should automatically negotiate the key */ |
Definition at line 56 of file ocs_login.h.
| #define KEY_FLAG_PHASE_ALL (KEY_FLAG_PHASE_SEC | KEY_FLAG_PHASE_OPER | KEY_FLAG_PHASE_FFP) |
Definition at line 52 of file ocs_login.h.
| #define KEY_FLAG_PHASE_FFP (1 << 4) |
Definition at line 50 of file ocs_login.h.
| #define KEY_FLAG_PHASE_OPER (1 << 3) |
Definition at line 49 of file ocs_login.h.
| #define KEY_FLAG_PHASE_SEC (1 << 2) /* specifies the valid phases for the key */ |
Definition at line 48 of file ocs_login.h.
| #define KEY_FLAG_PHASE_SEC_OPER (KEY_FLAG_PHASE_SEC | KEY_FLAG_PHASE_OPER) |
Definition at line 51 of file ocs_login.h.
| #define KEY_FLAG_SEND_BOTH (KEY_FLAG_SEND_INI | KEY_FLAG_SEND_TGT) |
Definition at line 47 of file ocs_login.h.
| #define KEY_FLAG_SEND_INI (1 << 0) /* specifies the sender of the key */ |
Definition at line 45 of file ocs_login.h.
| #define KEY_FLAG_SEND_TGT (1 << 1) |
Definition at line 46 of file ocs_login.h.
| #define KEY_FLAG_USE_LEADING (1 << 5) /* Valid on leading login only */ |
Definition at line 53 of file ocs_login.h.
| #define KEY_FLAG_USE_LOGIN (1 << 6) /* Valid on any login */ |
Definition at line 54 of file ocs_login.h.
| #define KEY_FLAG_VALID_DISC (1 << 7) /* Valid on discovery sessions */ |
Definition at line 55 of file ocs_login.h.
| #define OCS_LOGIN_ERROR_VIRT_ARRAY_TOO_SMALL -11 |
Definition at line 133 of file ocs_login.h.
| #define OCS_LOGIN_ERROR_WRONG_STATE -10 |
Definition at line 132 of file ocs_login.h.
| #define OCS_LOGIN_NO_QUEUING_RESOURCES -13 |
Definition at line 135 of file ocs_login.h.
| #define OCS_LOGIN_REQUEST_QUEUED -12 |
Definition at line 134 of file ocs_login.h.
| enum ocs_chap_state_e |
Defines the state of the CHAP negotiation.
| Enumerator | |
|---|---|
| OCS_CHAP_STATE_NOT_SELECTED | |
| OCS_CHAP_STATE_CHAP_SELECTED | |
| OCS_CHAP_STATE_WAIT_FOR_ALGORITHIM | |
| OCS_CHAP_STATE_SENT_CHALLENGE_REQ | |
| OCS_CHAP_STATE_SENT_CHALLENGE_RSP | |
| OCS_CHAP_STATE_COMPLETE | |
Definition at line 112 of file ocs_login.h.
| enum ocs_login_key_t |
enum identifying valid login keys.
Definition at line 64 of file ocs_login.h.
| void ocs_iscsi_ffp_text_timeout | ( | void * | arg | ) |
This function is called to check for stalled text negotiations for a connection on a target.
| arg | Pointer to the connection object. |
Definition at line 3496 of file ocs_login.c.
| int32_t ocs_iscsi_send_async | ( | ocs_cxn_t * | cxn, |
| void * | payload, | ||
| uint32_t | payload_len, | ||
| uint8_t | reason, | ||
| uint64_t | lun, | ||
| uint16_t | param1, | ||
| uint16_t | param2, | ||
| uint16_t | param3 | ||
| ) |
Sends a asynchronous PDU with an optional payload.
| cxn | Pointer to the connection object. |
| payload | Virtual memory containing the payload to send. |
| payload_len | Length of the payload to send. |
| reason | The iSCSI asynchronous reason. |
| lun | SCSI LUN. |
| param1 | Parameter 1 in the asynchronous PDU. |
| param2 | Parameter 2 in the asynchronous PDU. |
| param3 | Parameter 3 in the asynchronous PDU. |
Definition at line 4792 of file ocs_login.c.
| int32_t ocs_iscsi_send_login | ( | ocs_cxn_t * | cxn, |
| bool | is_discovery, | ||
| char * | tgt_name | ||
| ) |
Function to send an initial login PDU.
| cxn | Pointer to the connection object. |
| is_discovery | TRUE for a discovery session. |
| tgt_name | Target name for a normal session. |
Definition at line 3182 of file ocs_login.c.
| int32_t ocs_iscsi_send_login_rsp_invalid_during_login | ( | ocs_cxn_t * | cxn, |
| uint32_t | itt | ||
| ) |
Function to send an login Response PDU (invalid during login).
| cxn | Pointer to the connection object. |
| itt | Initiator task tag of the received PDU. |
Definition at line 2815 of file ocs_login.c.
| int32_t ocs_iscsi_send_reject | ( | ocs_cxn_t * | cxn, |
| void * | hdr, | ||
| uint32_t | hdr_len, | ||
| uint8_t | reason | ||
| ) |
Sends a reject PDU for the supplied PDU header.
| cxn | Pointer to the connection object. |
| hdr | Virtual memory information for the rejected header. |
| hdr_len | Length of the header received. |
| reason | The iSCSI reject reason. |
Definition at line 4652 of file ocs_login.c.
| const ocs_login_key_def_t ocs_login_key_defs[] |
Definition at line 58 of file ocs_login.c.