Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_login.c File Reference
#include "ocs.h"
#include "ocs_iscsi.h"
#include "ocs_iscsi_spec.h"
#include "ocs_common.h"
#include "ocs_hal.h"
#include "ocs_iscsi_api.h"
#include "ocs_login.h"
#include "ocs_cxn.h"
#include "ocs_session.h"
#include "ocs_md5.h"

Go to the source code of this file.

Detailed Description

Implements the iSCSI Login interface functions.

This module queues requests when insufficient resources exist to send the request immediately.

Definition in file ocs_login.c.

Macros

#define OCS_TEXT_TIMEOUT_MS   (1 * 1000) /* 1 second */
 

Functions

static int32_t ocs_iscsi_login_buffer_get (ocs_cxn_t *cxn)
 Get an available login buffer from the pre-allocated pool. More...
 
static void ocs_iscsi_login_buffer_free (ocs_cxn_t *cxn)
 Return a login buffer to the pre-allocated pool. More...
 
static int32_t ocs_iscsi_login_retries_allocate (ocs_iscsi_t *iscsi)
 Allocate the iSCSI retry buffers and add them to the pool. More...
 
static void ocs_iscsi_login_retries_free (ocs_iscsi_t *iscsi)
 Free the iSCSI login retry buffers. More...
 
static ocs_iscsi_lgn_retry_t * ocs_iscsi_login_retry_get (ocs_iscsi_t *iscsi)
 Get an available retry buffer from the pre-allocated pool. More...
 
static void ocs_iscsi_login_retry_free (ocs_iscsi_t *iscsi, ocs_iscsi_lgn_retry_t *retry)
 Return a login retry buffer to the pre-allocated pool. More...
 
int32_t ocs_iscsi_login_cb_free_lgn_mem (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
 
int32_t ocs_iscsi_login_cb_no_lgn_mem (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
 Function to free resources for login responses. More...
 
int32_t ocs_iscsi_login_tgt_nop_cb_free_lgn_mem (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
 Function to target NOP completions. More...
 
int32_t ocs_iscsi_login_tgt_nop_cb_no_lgn_mem (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
 Function to target NOP completions. More...
 
static void ocs_iscsi_login_convert_bin_to_hexstring (uint8_t *bin, uint32_t nbytes, char *str, uint32_t max_str)
 Converts binary to an ASCII hex string. More...
 
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...
 
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...
 
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...
 
static void ocs_iscsi_login_set_dslen (iscsi_hdr_dw2_t *dw, unsigned int count)
 Fill in the data segment length in a PDU header. More...
 
static char * ocs_iscsi_login_find_key (char *key, char *text, unsigned int length)
 Find a key within the passed login text. More...
 
static ocs_login_key_t ocs_iscsi_login_locate_key_locations (char *data, uint32_t data_len, uint32_t pos, uint32_t *equal_pos, uint32_t *null_pos)
 Finds the next equal and null termination for the key. More...
 
static int32_t ocs_iscsi_login_find_value (char *text, const char *value)
 Searches the list of comma-separated values for a specific value. More...
 
static uint32_t ocs_iscsi_login_send_key (ocs_cxn_t *cxn, ocs_login_key_t key, char *strptr, uint32_t avail_bytes)
 Function to send iSCSI login keys. More...
 
static int32_t ocs_iscsi_login_recv_key (ocs_cxn_t *cxn, ocs_login_key_t key, char *value, uint8_t *status_detail)
 Function to receive a login key and update the login structure. More...
 
static ocs_sport_t * ocs_iscsi_login_convert_tgt_name (ocs_cxn_t *cxn, char *tgt_name)
 Convert a target name to a sport object. More...
 
static int32_t ocs_iscsi_login_check_first (ocs_cxn_t *cxn, iscsi_login_cmd_hdr_t *pi, uint8_t *status, uint8_t *status_detail, char *data, uint32_t data_len)
 Function to validate the initial login PDU. More...
 
static uint32_t ocs_iscsi_login_negotiate (ocs_cxn_t *cxn, uint8_t phase, uint8_t *status, uint8_t *status_detail, char *recv, uint32_t recv_len, char *rsp, uint32_t rsp_size)
 Function to negotiate iSCSI keys. More...
 
static uint32_t ocs_iscsi_login_convert_hexstring_to_bin (char *hex_str, uint8_t *bin, uint32_t nbytes)
 Function to negotiate CHAP keys. More...
 
static int32_t ocs_iscsi_login_negotiate_chap_tgt (ocs_cxn_t *cxn, uint8_t *status, uint8_t *status_detail, char *rsp, uint32_t rsp_size, uint32_t *rsp_len)
 Function to negotiate CHAP keys on a target connection. More...
 
static int32_t ocs_iscsi_login_negotiate_chap_ini (ocs_cxn_t *cxn, uint8_t *status, uint8_t *status_detail, char *rsp, uint32_t rsp_size, uint32_t *rsp_len)
 Function to negotiate CHAP keys on an initiator connection. More...
 
static int32_t ocs_iscsi_recv_common_queue (ocs_cxn_t *cxn, ocs_iscsi_retry_type_e type, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
 Function to queue a receive request. More...
 
static ocs_cxn_q_cbit_t * ocs_iscsi_cbit_pdu_setup (ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t *status, uint8_t *status_detail, char **recv_ptr, uint32_t *recv_len, char **resp_ptr, uint32_t *resp_size)
 Does the initial checks and processing for the continue bit. More...
 
static void ocs_iscsi_cbit_fill_buffer (ocs_cxn_t *cxn, uint8_t status, uint32_t *len)
 Copies the appropriate send data from the c bit processing. More...
 
static void ocs_iscsi_cbit_backout (ocs_cxn_t *cxn, ocs_cxn_q_cbit_t *cbit)
 Backs out the adding of a cbit object on this connection. More...
 
void ocs_iscsi_cbit_cleanup (ocs_cxn_t *cxn)
 Sends the login parameters to the firmware. 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...
 
static int32_t ocs_iscsi_send_login_rsp_invalid_during_login_queue (ocs_cxn_t *cxn, uint32_t itt)
 Function to queue a send login request. 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...
 
static int32_t ocs_iscsi_send_login_queue (ocs_cxn_t *cxn, bool is_discovery, char *tgt_name)
 Function to queue a send login request. 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...
 
uint32_t ocs_iscsi_add_cluster_tgt_keys (ocs_cxn_t *cxn, char *resp_ptr, uint32_t resp_size, uint32_t plen_orig)
 Add iSCSI cluster target name and address. More...
 
static int32_t ocs_iscsi_add_tgt_keys (ocs_cxn_t *cxn, char *resp_ptr, uint32_t resp_size, uint32_t plen_orig, char *tgt_name)
 Add targets to the sendTarget response. 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...
 
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...
 
static int32_t ocs_iscsi_send_logout_queue (ocs_cxn_t *cxn, uint8_t immediate, uint8_t reason_code)
 Function to queue a send logout request. 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...
 
static int32_t ocs_iscsi_send_logout_rsp_queue (ocs_cxn_t *cxn, uint8_t response, uint32_t itt)
 Function to queue a send logout response request. 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...
 
static int32_t ocs_iscsi_send_nop_out_queue (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
 Function to queue a send nop-out request. 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...
 
static int32_t ocs_iscsi_send_nop_in_queue (ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
 Function to queue a send nop-in request. 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...
 
static int32_t ocs_iscsi_send_reject_queue (ocs_cxn_t *cxn, void *hdr, uint32_t hdr_len, uint8_t reason)
 Function to queue a send reject request. 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...
 
static int32_t ocs_iscsi_send_async_queue (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)
 Function to queue an asynchronous request. 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...
 

Variables

const ocs_login_key_def_t ocs_login_key_defs [KEY_MAX]
 
static const char chap [] = "CHAP"
 
static const char none [] = "None"
 
static const char crc32c [] = "CRC32C"
 
static const char yes [] = "Yes"
 
static const char no [] = "No"
 
static const char all [] = "All"
 
static const char rfc3720 [] = "RFC3720"
 
static const char irrelevant [] = "Irrelevant"
 

Macro Details

#define OCS_TEXT_TIMEOUT_MS   (1 * 1000) /* 1 second */

Definition at line 56 of file ocs_login.c.

Function Details

uint32_t ocs_iscsi_add_cluster_tgt_keys ( ocs_cxn_t *  cxn,
char *  resp_ptr,
uint32_t  resp_size,
uint32_t  plen_orig 
)

Add iSCSI cluster target name and address.

Parameters
cxnPointer to the connection object.
resp_ptrPointer to the start of the response buffer.
resp_sizeSize of the response buffer.
plen_origPayload length added so far.
Returns
Returns the number of bytes added to the payload.

Definition at line 3357 of file ocs_login.c.

void ocs_iscsi_ffp_text_timeout ( void *  arg)

This function is called to check for stalled text negotiations for a connection on a target.

Parameters
argPointer to the connection object.

Definition at line 3496 of file ocs_login.c.

static void ocs_iscsi_login_buffer_free ( ocs_cxn_t *  cxn)
static

Return a login buffer to the pre-allocated pool.

Parameters
cxnPointer to the connection object.

Definition at line 328 of file ocs_login.c.

static int32_t ocs_iscsi_login_buffer_get ( ocs_cxn_t *  cxn)
static

Get an available login buffer from the pre-allocated pool.

Parameters
cxnPointer to the connection object.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 309 of file ocs_login.c.

int32_t ocs_iscsi_login_cb_free_lgn_mem ( ocs_hal_io_t *  io,
ocs_cxn_t *  cxn,
int32_t  status,
ocs_ini_cmpl_fields_t *  ini_fields,
void *  ul_arg 
)

Definition at line 4968 of file ocs_login.c.

int32_t ocs_iscsi_login_cb_no_lgn_mem ( ocs_hal_io_t *  io,
ocs_cxn_t *  cxn,
int32_t  status,
ocs_ini_cmpl_fields_t *  ini_fields,
void *  ul_arg 
)

Function to free resources for login responses.

Parameters
ioPointer to the io object.
cxnPointer to the connection object.
statusStatus of the IO (1 = good).
ini_fieldsPointer to the initiator completion fields.
ul_argPointer to the login memory structure.
Returns
Returns 0 on success.

Definition at line 4937 of file ocs_login.c.

static int32_t ocs_iscsi_login_check_first ( ocs_cxn_t *  cxn,
iscsi_login_cmd_hdr_t *  pi,
uint8_t *  status,
uint8_t *  status_detail,
char *  data,
uint32_t  data_len 
)
static

Function to validate the initial login PDU.

Parameters
cxnPointer to the connection object.
piPointer to the inbound PDU header.
statusReturns the login status based on the received keys.
status_detailReturns the login status detail based on the received keys.
dataPointer to the payload data.
data_lenLength of the data received.
Returns
Returns 0 on success.

Definition at line 1404 of file ocs_login.c.

static void ocs_iscsi_login_convert_bin_to_hexstring ( uint8_t *  bin,
uint32_t  nbytes,
char *  str,
uint32_t  max_str 
)
static

Converts binary to an ASCII hex string.

Parameters
binPointer to the binary array.
nbytesNumber of bytes to convert.
strPointer to the output string.
max_strMaximum size string allowed.

Definition at line 1738 of file ocs_login.c.

static uint32_t ocs_iscsi_login_convert_hexstring_to_bin ( char *  hex_str,
uint8_t *  bin,
uint32_t  nbytes 
)
static

Function to negotiate CHAP keys.

Parameters
hex_strPointer to the hex string.
binPointer to the binary array.
nbytesNumber of bytes in the binary array.
Returns
Returns the number of binary bytes converted.

Definition at line 1762 of file ocs_login.c.

static ocs_sport_t* ocs_iscsi_login_convert_tgt_name ( ocs_cxn_t *  cxn,
char *  tgt_name 
)
static

Convert a target name to a sport object.

Parameters
cxnPointer to the connection object.
tgt_nameTarget name string.
Returns
Pointer to a sport, or NULL if no match was found.

Definition at line 1369 of file ocs_login.c.

static char* ocs_iscsi_login_find_key ( char *  key,
char *  text,
unsigned int  length 
)
static

Find a key within the passed login text.

Parameters
keyPointer to the requested key.
textPointer to the text to search.
lengthLength of the text buffer.
Returns
Returns pointer to the value string for the key, or NULL if not found.

Definition at line 576 of file ocs_login.c.

static int32_t ocs_iscsi_login_find_value ( char *  text,
const char *  value 
)
static

Searches the list of comma-separated values for a specific value.

Parameters
textPointer to the return from ocs_iscsi_login_find_key().
valuePointer to the value to find.
Returns
Returns 1 if found, or 0 if not found.

Definition at line 692 of file ocs_login.c.

static ocs_login_key_t ocs_iscsi_login_locate_key_locations ( char *  data,
uint32_t  data_len,
uint32_t  pos,
uint32_t *  equal_pos,
uint32_t *  null_pos 
)
static

Finds the next equal and null termination for the key.

Parameters
dataPointer to the payload data.
data_lenLength of the data received.
posCurrent position in the payload.
equal_posReturns the position of the equal sign.
null_posReturns the position of the null termination character (may include padding bytes).
Returns
Returns enum for the key, or KEY_MAX if not recognized.

Definition at line 626 of file ocs_login.c.

static uint32_t ocs_iscsi_login_negotiate ( ocs_cxn_t *  cxn,
uint8_t  phase,
uint8_t *  status,
uint8_t *  status_detail,
char *  recv,
uint32_t  recv_len,
char *  rsp,
uint32_t  rsp_size 
)
static

Function to negotiate iSCSI keys.

Parameters
cxnPointer to the connection object.
phaseLogin phase being negotiated.
statusReturns the login status based on the received keys.
status_detailReturns the login status detail based on the received keys.
recvPointer to the payload data.
recv_lenLength of the data received.
rspPointer to the the login response payload.
rsp_sizeMaximum size of the response.
Returns
Returns the payload length.

Definition at line 1582 of file ocs_login.c.

static int32_t ocs_iscsi_login_negotiate_chap_ini ( ocs_cxn_t *  cxn,
uint8_t *  status,
uint8_t *  status_detail,
char *  rsp,
uint32_t  rsp_size,
uint32_t *  rsp_len 
)
static

Function to negotiate CHAP keys on an initiator connection.

Parameters
cxnPointer to the connection object.
statusReturns the login status based on the received keys.
status_detailReturns the login status detail based on the received keys.
rspPointer to the login response payload.
rsp_sizeMaximum size of the response payload.
rsp_lenPointer to the current length of the response.
Returns
Returns the value for the transition bit.

Definition at line 2012 of file ocs_login.c.

static int32_t ocs_iscsi_login_negotiate_chap_tgt ( ocs_cxn_t *  cxn,
uint8_t *  status,
uint8_t *  status_detail,
char *  rsp,
uint32_t  rsp_size,
uint32_t *  rsp_len 
)
static

Function to negotiate CHAP keys on a target connection.

Parameters
cxnPointer to the connection object.
statusReturns the login status based on the received keys.
status_detailReturns the login status detail based on the received keys.
rspPointer to the the login response payload.
rsp_sizeMaximum size of the response payload.
rsp_lenPointer to the current length of the response.
Returns
Returns the value for the transition bit.

Definition at line 1816 of file ocs_login.c.

static int32_t ocs_iscsi_login_recv_key ( ocs_cxn_t *  cxn,
ocs_login_key_t  key,
char *  value,
uint8_t *  status_detail 
)
static

Function to receive a login key and update the login structure.

Parameters
cxnPointer to the connection object.
keyLogin key enum that was received.
valueValue sent for the key.
status_detailReturns the status detail field if an error occurs.
Returns
Returns 0 on success.

Definition at line 1011 of file ocs_login.c.

static int32_t ocs_iscsi_login_retries_allocate ( ocs_iscsi_t *  iscsi)
static

Allocate the iSCSI retry buffers and add them to the pool.

Parameters
iscsiPointer to the iSCSI object.
Returns
Returns 0 on success, or a non-zero value otherwise.

Definition at line 354 of file ocs_login.c.

static void ocs_iscsi_login_retries_free ( ocs_iscsi_t *  iscsi)
static

Free the iSCSI login retry buffers.

Parameters
iscsiPointer to the iSCSI object.

Definition at line 379 of file ocs_login.c.

static void ocs_iscsi_login_retry_free ( ocs_iscsi_t *  iscsi,
ocs_iscsi_lgn_retry_t *  retry 
)
static

Return a login retry buffer to the pre-allocated pool.

Parameters
iscsiPointer to the iSCSI object.
retryPointer to the login retry object.

Definition at line 542 of file ocs_login.c.

static ocs_iscsi_lgn_retry_t * ocs_iscsi_login_retry_get ( ocs_iscsi_t *  iscsi)
static

Get an available retry buffer from the pre-allocated pool.

Parameters
iscsiPointer to the iSCSI object.
Returns
Pointer to retry object on success, or NULL otherwise.

Definition at line 515 of file ocs_login.c.

static uint32_t ocs_iscsi_login_send_key ( ocs_cxn_t *  cxn,
ocs_login_key_t  key,
char *  strptr,
uint32_t  avail_bytes 
)
static

Function to send iSCSI login keys.

Parameters
cxnPointer to the connection object.
keyLogin key to send.
strptrPointer of where to place output.
avail_bytesNumber of bytes remaining in the payload.
Returns
Returns the number of bytes added to the payload.

Definition at line 725 of file ocs_login.c.

static void ocs_iscsi_login_set_dslen ( iscsi_hdr_dw2_t *  dw,
unsigned int  count 
)
static

Fill in the data segment length in a PDU header.

Parameters
dwPointer to the dword in the BHS.
countData segment length.

Definition at line 558 of file ocs_login.c.

int32_t ocs_iscsi_login_tgt_nop_cb_free_lgn_mem ( ocs_hal_io_t *  io,
ocs_cxn_t *  cxn,
int32_t  status,
ocs_ini_cmpl_fields_t *  ini_fields,
void *  ul_arg 
)

Function to target NOP completions.

Parameters
ioPointer to the io object.
cxnPointer to the connection object.
statusStatus of the IO (1 = good).
ini_fieldsPointer to the initiator completion fields.
ul_argPointer to the login memory structure.
Returns
Returns 0 on success.

Definition at line 4887 of file ocs_login.c.

int32_t ocs_iscsi_login_tgt_nop_cb_no_lgn_mem ( ocs_hal_io_t *  io,
ocs_cxn_t *  cxn,
int32_t  status,
ocs_ini_cmpl_fields_t *  ini_fields,
void *  ul_arg 
)

Function to target NOP completions.

Parameters
ioPointer to the io object.
cxnPointer to the connection object.
statusStatus of the IO (1 = good).
ini_fieldsPointer to the initiator completion fields.
ul_argPointer to the login memory structure.
Returns
Returns 0 on success.

Definition at line 4912 of file ocs_login.c.

static int32_t ocs_iscsi_recv_common_queue ( ocs_cxn_t *  cxn,
ocs_iscsi_retry_type_e  type,
ocs_hal_rq_buffer_t *  hdr,
uint32_t  hdr_len,
ocs_hal_rq_buffer_t *  data,
uint32_t  data_len 
)
static

Function to queue a receive request.

Parameters
cxnPointer to the connection object.
typeType of request being queued.
hdrDMA memory information for the header.
hdr_lenLength of the header received.
dataDMA memory information for the data.
data_lenLength of the data received.
Returns
Returns 0 on success.

Definition at line 2194 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.

Parameters
cxnPointer to the connection object.
payloadVirtual memory containing the payload to send.
payload_lenLength of the payload to send.
reasonThe iSCSI asynchronous reason.
lunSCSI LUN.
param1Parameter 1 in the asynchronous PDU.
param2Parameter 2 in the asynchronous PDU.
param3Parameter 3 in the asynchronous PDU.
Returns
Returns 0 on success.

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.

Parameters
cxnPointer to the connection object.
is_discoveryTRUE for a discovery session.
tgt_nameTarget name for a normal session.
Returns
Returns 0 on success.

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).

Parameters
cxnPointer to the connection object.
ittInitiator task tag of the received PDU.
Returns
Returns 0 on success.

Definition at line 2815 of file ocs_login.c.

static int32_t ocs_iscsi_send_logout_queue ( ocs_cxn_t *  cxn,
uint8_t  immediate,
uint8_t  reason_code 
)
static

Function to queue a send logout request.

Parameters
cxnPointer to the connection object.
immediateTRUE if sending as an immediate command.
reason_codeThe logout reason.
Returns
Returns 0 on success.

Definition at line 3958 of file ocs_login.c.

static int32_t ocs_iscsi_send_logout_rsp_queue ( ocs_cxn_t *  cxn,
uint8_t  response,
uint32_t  itt 
)
static

Function to queue a send logout response request.

Parameters
cxnPointer to the connection object.
responseLogout response per the iSCSI specification.
ittInitiator task tag of the logout request.
Returns
Returns 0 on success.

Definition at line 4061 of file ocs_login.c.

static int32_t ocs_iscsi_send_nop_in_queue ( ocs_cxn_t *  cxn,
uint64_t  lun,
uint32_t  itt,
uint32_t  ttt,
char *  data_ptr,
uint32_t  data_len 
)
static

Function to queue a send nop-in request.

Parameters
cxnpointer to the connection object
lunthe lun for the PDU (Host byte order)
ittthe initiator task tag (Host byte order)
tttthe target transfer tag (Host byte order)
data_ptrpointer to the payload data (may be NULL)
data_lenlength of the payload data
Returns
Returns 0 on success.

Definition at line 4354 of file ocs_login.c.

static int32_t ocs_iscsi_send_nop_out_queue ( ocs_cxn_t *  cxn,
uint64_t  lun,
uint32_t  itt,
uint32_t  ttt,
char *  data_ptr,
uint32_t  data_len 
)
static

Function to queue a send nop-out request.

Parameters
cxnPointer to the connection object.
lunLUN for the PDU (Host byte order).
ittInitiator task tag (Host byte order).
tttTarget transfer tag (Host byte order).
data_ptrPointer to the payload data (may be NULL).
data_lenLength of the payload data.
Returns
Returns 0 on success.

Definition at line 4200 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.

Parameters
cxnPointer to the connection object.
hdrVirtual memory information for the rejected header.
hdr_lenLength of the header received.
reasonThe iSCSI reject reason.
Returns
Returns 0 on success.

Definition at line 4652 of file ocs_login.c.

Variable Details

const char all[] = "All"
static

Definition at line 154 of file ocs_login.c.

const char chap[] = "CHAP"
static

Definition at line 149 of file ocs_login.c.

const char crc32c[] = "CRC32C"
static

Definition at line 151 of file ocs_login.c.

const char irrelevant[] = "Irrelevant"
static

Definition at line 156 of file ocs_login.c.

const char no[] = "No"
static

Definition at line 153 of file ocs_login.c.

const char none[] = "None"
static

Definition at line 150 of file ocs_login.c.

const ocs_login_key_def_t ocs_login_key_defs[KEY_MAX]

Definition at line 58 of file ocs_login.c.

const char rfc3720[] = "RFC3720"
static

Definition at line 155 of file ocs_login.c.

const char yes[] = "Yes"
static

Definition at line 152 of file ocs_login.c.