Go to the source code of this file.
Implements the iSCSI API interface functions.
Definition in file ocs_iscsi_api.c.
Macros | |
| #define | OCS_ISCSI_API_INIT_DELAY_MS 100 |
| #define | OCS_EXPORT(...) |
Functions | |
| static int32_t | ocs_iscsi_api_link_configure_thread (ocs_thread_t *mythread) |
| Configures the link on initial link up. More... | |
| ocs_sport_t * | ocs_iscsi_tgt_get_free_sport (ocs_t *ocs) |
| Get a next free sport object index. More... | |
| int32_t | ocs_iscsi_tgt_add_sport (ocs_t *ocs, ocs_sport_t *sport) |
| Add sport to iscsi target. More... | |
| void | ocs_iscsi_tgt_del_sport (ocs_t *ocs, uint32_t sport_index) |
| Delete sport from iscsi target. More... | |
| int32_t | ocs_iscsi_tgt_add (ocs_t *ocs, char *name, char *alias) |
| Adds a target. More... | |
| char * | ocs_iscsi_tgt_get_names (ocs_t *ocs, uint32_t index) |
| Returns the target name based on the index. More... | |
| char * | ocs_iscsi_tgt_get_alias (ocs_t *ocs, uint32_t index) |
| Returns the target alias based on the index. More... | |
| ocs_ip_address_t * | ocs_iscsi_tgt_get_ip_address (ocs_t *ocs, char *tgt_name, uint32_t index) |
| Returns the IP address of the target name based on the index. More... | |
| uint32_t | ocs_iscsi_tgt_get_portal_group (ocs_t *ocs, char *tgt_name, ocs_ip_address_t *ip_address) |
| Returns the portal group of an IP address of the target name. More... | |
| uint8_t | ocs_iscsi_tgt_require_chap (ocs_t *ocs, char *tgt_name, ocs_session_type_e type) |
| Returns TRUE if CHAP is required for the session type. More... | |
| uint32_t | ocs_iscsi_tgt_is_access_allowed (ocs_t *ocs, char *tgt_name, char *ini_name) |
| Checks if this initiator is allowed access to a target. More... | |
| char * | ocs_iscsi_ini_get_name (ocs_t *ocs) |
| Return this initiator's name. More... | |
| char * | ocs_iscsi_ini_get_alias (ocs_t *ocs) |
| Returns the initiator alias. More... | |
| int32_t | ocs_iscsi_api_initialize (ocs_t *ocs) |
| Initialize the higher level iSCSI software. More... | |
| int32_t | ocs_iscsi_api_shutdown (ocs_t *ocs) |
| Initialize the higher level iSCSI software. More... | |
| static uint8_t | ocs_iscsi_api_not_local_target (ocs_t *ocs, char *remote_name) |
| Checks to see if the target name is this target. More... | |
| static void | ocs_iscsi_api_isns_connect (ocs_t *ocs, void *ret, uint16_t nodes_count) |
| Logs into any remote targets discovered through iSNS that are not this device. More... | |
| static void | ocs_iscsi_isns_configure (ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_t *isns_servers) |
| Register/query the iSNS server. More... | |
| static void | ocs_iscsi_api_non_mgmt_config (ocs_t *ocs, ocs_hal_portal_t portal) |
| static void | ocs_iscsi_api_link_configure (ocs_t *ocs) |
| Configures the link on initial link up. More... | |
| void | ocs_iscsi_api_link_state (ocs_t *ocs, ocs_link_state_e link_state) |
| Notifies the higher level iSCSI software of the link state. More... | |
| uint32_t | ocs_iscsi_get_max_cxns (ocs_t *ocs, char *tgt_name, char *ini_name) |
| Returns the maximum number of connections allowed per session. More... | |
| char * | ocs_iscsi_get_chap_name (ocs_t *ocs, uint8_t sess_type, uint32_t mode, uint32_t type) |
| Returns the CHAP user name of corresponding type. More... | |
| char * | ocs_iscsi_get_chap_secret (ocs_t *ocs, char *name, uint32_t mode, uint32_t type, uint32_t *secret_len) |
| Returns the unenctypted CHAP secret for a specific user name. Note: Passwords should be at least 16 characters. More... | |
| int32_t | ocs_iscsi_chap_user_add (ocs_t *ocs, char *username, char *secret, uint32_t type, uint32_t mode) |
| Add CHAP user. If CHAP user of same type is already exists, return error. More... | |
| int32_t | ocs_iscsi_chap_user_del (ocs_t *ocs, char *username, uint32_t type, uint32_t mode) |
| Delete CHAP user. More... | |
| int32_t | ocs_iscsi_chap_list_count (ocs_t *ocs) |
| Returns the count of chap_list. More... | |
| int32_t | ocs_iscsi_chap_list_get (ocs_t *ocs, char *userbuf, int32_t buflen) |
| Return CHAP list items. More... | |
| static int32_t | ocs_iscsi_unassisted_pdu_cb (struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg) |
| int32_t | ocs_iscsi_unassisted_pdu_send (ocs_t *ocs, ocs_io_t *io, ocs_cxn_t *cxn, void *bhs, void *data, uint32_t data_size, bool is_login, bool set_dm, ocs_iscsi_pdu_cb_t cb) |
| int32_t | ocs_iscsi_login_cb (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg) |
| static int32_t | ocs_iscsi_send_context_udpate_cb (ocs_hal_io_t *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg) |
| Function to receieve the callback for a context update. More... | |
| int32_t | ocs_iscsi_send_context_udpate (ocs_cxn_t *cxn) |
| Sends the login parameters to the FW. More... | |
| OCS_EXPORT (ocs_iscsi_unassisted_pdu_send) | |
| OCS_EXPORT (ocs_iscsi_ini_get_name) | |
| OCS_EXPORT (ocs_iscsi_mac_get) | |
| OCS_EXPORT (ocs_iscsi_rx_buffers_free) | |
| OCS_EXPORT (ocs_xport_control) | |
| OCS_EXPORT (ocs_iscsi_register_link_state_callback) | |
| OCS_EXPORT (ocs_iscsi_unregister_link_state_callback) | |
| OCS_EXPORT (ocs_iscsi_send_context_udpate) | |
| #define OCS_EXPORT | ( | ... | ) |
Definition at line 1392 of file ocs_iscsi_api.c.
| #define OCS_ISCSI_API_INIT_DELAY_MS 100 |
Definition at line 46 of file ocs_iscsi_api.c.
| OCS_EXPORT | ( | ocs_iscsi_unassisted_pdu_send | ) |
| OCS_EXPORT | ( | ocs_iscsi_ini_get_name | ) |
| OCS_EXPORT | ( | ocs_iscsi_mac_get | ) |
| OCS_EXPORT | ( | ocs_iscsi_rx_buffers_free | ) |
| OCS_EXPORT | ( | ocs_xport_control | ) |
| OCS_EXPORT | ( | ocs_iscsi_register_link_state_callback | ) |
| OCS_EXPORT | ( | ocs_iscsi_unregister_link_state_callback | ) |
| OCS_EXPORT | ( | ocs_iscsi_send_context_udpate | ) |
| int32_t ocs_iscsi_api_initialize | ( | ocs_t * | ocs | ) |
Initialize the higher level iSCSI software.
| ocs | Pointer to the ocs structure |
Definition at line 364 of file ocs_iscsi_api.c.
|
static |
Logs into any remote targets discovered through iSNS that are not this device.
| ocs | Pointer to the ocs structure |
| ret | Pointer from the iSNS query |
| nodes_count | The number of nodes discovered |
Definition at line 640 of file ocs_iscsi_api.c.
|
static |
Configures the link on initial link up.
| ocs | Pointer to the ocs structure |
Definition at line 835 of file ocs_iscsi_api.c.
|
static |
Configures the link on initial link up.
| mythread | pointer to thread object |
Definition at line 921 of file ocs_iscsi_api.c.
| void ocs_iscsi_api_link_state | ( | ocs_t * | ocs, |
| ocs_link_state_e | link_state | ||
| ) |
Notifies the higher level iSCSI software of the link state.
| ocs | Pointer to the ocs structure |
| link_state | Provides the status of the link |
Definition at line 953 of file ocs_iscsi_api.c.
|
static |
Definition at line 750 of file ocs_iscsi_api.c.
|
static |
Checks to see if the target name is this target.
| ocs | Pointer to the ocs structure |
| remote_name | Pointer to the target name |
Definition at line 611 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_api_shutdown | ( | ocs_t * | ocs | ) |
Initialize the higher level iSCSI software.
| ocs | Pointer to the ocs structure |
Definition at line 469 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_chap_list_count | ( | ocs_t * | ocs | ) |
Returns the count of chap_list.
Definition at line 1155 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_chap_list_get | ( | ocs_t * | ocs, |
| char * | userbuf, | ||
| int32_t | buflen | ||
| ) |
Return CHAP list items.
| ocs | OCS context |
| userbuf | User buffer to which chap_list items are copied |
| buflen | User buffer length |
zero on success, otherwise a negative value
Definition at line 1180 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_chap_user_add | ( | ocs_t * | ocs, |
| char * | username, | ||
| char * | secret, | ||
| uint32_t | type, | ||
| uint32_t | mode | ||
| ) |
Add CHAP user. If CHAP user of same type is already exists, return error.
| ocs | Pointer to the ocs structure |
| username | Username to add |
| secret | Secret to add |
| type | CHAP type is incoming or outgoing |
| mode | Target or Initiator mode |
Return zero on success, otherwise a negative value
Definition at line 1043 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_chap_user_del | ( | ocs_t * | ocs, |
| char * | username, | ||
| uint32_t | type, | ||
| uint32_t | mode | ||
| ) |
Delete CHAP user.
| ocs | Pointer to the ocs structure |
| username | Username to delete |
| type | CHAP type is incoming or outgoing |
| mode | Target or Initiator mode |
Return zero on success, otherwise a negative value
Definition at line 1095 of file ocs_iscsi_api.c.
| char* ocs_iscsi_get_chap_name | ( | ocs_t * | ocs, |
| uint8_t | sess_type, | ||
| uint32_t | mode, | ||
| uint32_t | type | ||
| ) |
Returns the CHAP user name of corresponding type.
| ocs | Pointer to the ocs structure |
| sess_type | Either discovery or nomal session |
| mode | Username for Target mode or Initaitor mode |
| type | CHAP incoming or outgoing |
Definition at line 983 of file ocs_iscsi_api.c.
| char* ocs_iscsi_get_chap_secret | ( | ocs_t * | ocs, |
| char * | name, | ||
| uint32_t | mode, | ||
| uint32_t | type, | ||
| uint32_t * | secret_len | ||
| ) |
Returns the unenctypted CHAP secret for a specific user name. Note: Passwords should be at least 16 characters.
| ocs | Pointer to the ocs structure |
| name | Username to which the secret to be identified |
| secret_len | Length of the secret code |
Definition at line 1009 of file ocs_iscsi_api.c.
| uint32_t ocs_iscsi_get_max_cxns | ( | ocs_t * | ocs, |
| char * | tgt_name, | ||
| char * | ini_name | ||
| ) |
Returns the maximum number of connections allowed per session.
| ocs | Pointer to the ocs structure |
| tgt_name | The iSCSI target name |
| ini_name | The iSCSI initiator name |
Definition at line 970 of file ocs_iscsi_api.c.
| char* ocs_iscsi_ini_get_alias | ( | ocs_t * | ocs | ) |
Returns the initiator alias.
| ocs | Pointer to the ocs structure |
Definition at line 350 of file ocs_iscsi_api.c.
| char* ocs_iscsi_ini_get_name | ( | ocs_t * | ocs | ) |
Return this initiator's name.
| ocs | Pointer to the ocs structure. |
Definition at line 325 of file ocs_iscsi_api.c.
|
static |
Register/query the iSNS server.
| ocs | Pointer to the ocs structure |
| portal | The portal to use for iSNS |
| isns_servers | The table allocated to query the iSNS addresses |
Definition at line 679 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_login_cb | ( | ocs_hal_io_t * | io, |
| ocs_cxn_t * | cxn, | ||
| int32_t | status, | ||
| ocs_ini_cmpl_fields_t * | ini_fields, | ||
| void * | ul_arg | ||
| ) |
|
static |
Function to receieve the callback for a context update.
| io | pointer to the io object |
| cxn | pointer to the connection object |
| status | the status of the IO (1 = good) |
| ini_fields | pointer to the initiator completion fields |
| ul_arg | pointer to the login memory structure |
Definition at line 1330 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_tgt_add | ( | ocs_t * | ocs, |
| char * | name, | ||
| char * | alias | ||
| ) |
Adds a target.
| ocs | Pointer to the ocs structure. |
| name | Target name. |
| alias | Target alias. |
Definition at line 155 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_tgt_add_sport | ( | ocs_t * | ocs, |
| ocs_sport_t * | sport | ||
| ) |
Add sport to iscsi target.
| ocs | Pointer to the ocs structure. |
| scst_tgt | Pointer to SCST target |
| sport | SPORT that associates SCST target |
Definition at line 85 of file ocs_iscsi_api.c.
| void ocs_iscsi_tgt_del_sport | ( | ocs_t * | ocs, |
| uint32_t | sport_index | ||
| ) |
Delete sport from iscsi target.
| ocs | Pointer to the ocs structure |
| sport_index | SPORT index to be deleted |
Definition at line 127 of file ocs_iscsi_api.c.
| char* ocs_iscsi_tgt_get_alias | ( | ocs_t * | ocs, |
| uint32_t | index | ||
| ) |
Returns the target alias based on the index.
| ocs | Pointer to the ocs structure. |
| index | Index into the target name list. |
Definition at line 215 of file ocs_iscsi_api.c.
| ocs_sport_t* ocs_iscsi_tgt_get_free_sport | ( | ocs_t * | ocs | ) |
Get a next free sport object index.
| ocs | Pointer to the ocs structure. |
Definition at line 57 of file ocs_iscsi_api.c.
| ocs_ip_address_t* ocs_iscsi_tgt_get_ip_address | ( | ocs_t * | ocs, |
| char * | tgt_name, | ||
| uint32_t | index | ||
| ) |
Returns the IP address of the target name based on the index.
| ocs | Pointer to the ocs structure. |
| tgt_name | The iSCSI target name. |
| index | Index into the IP Address list. |
Definition at line 244 of file ocs_iscsi_api.c.
| char* ocs_iscsi_tgt_get_names | ( | ocs_t * | ocs, |
| uint32_t | index | ||
| ) |
Returns the target name based on the index.
| ocs | Pointer to the ocs structure. |
| index | Index into the target name list. |
Definition at line 186 of file ocs_iscsi_api.c.
| uint32_t ocs_iscsi_tgt_get_portal_group | ( | ocs_t * | ocs, |
| char * | tgt_name, | ||
| ocs_ip_address_t * | ip_address | ||
| ) |
Returns the portal group of an IP address of the target name.
| ocs | Pointer to the ocs structure. |
| tgt_name | The iSCSI target name. |
| ip_address | IP address. |
Definition at line 276 of file ocs_iscsi_api.c.
| uint32_t ocs_iscsi_tgt_is_access_allowed | ( | ocs_t * | ocs, |
| char * | tgt_name, | ||
| char * | ini_name | ||
| ) |
Checks if this initiator is allowed access to a target.
| ocs | Pointer to the ocs structure. |
| tgt_name | The iSCSI target name. |
| ini_name | The iSCSI initiator name. |
Definition at line 310 of file ocs_iscsi_api.c.
| uint8_t ocs_iscsi_tgt_require_chap | ( | ocs_t * | ocs, |
| char * | tgt_name, | ||
| ocs_session_type_e | type | ||
| ) |
Returns TRUE if CHAP is required for the session type.
| ocs | Pointer to the ocs structure. |
| tgt_name | The iSCSI target name. |
| type | Either discovery or normal sessions. |
Definition at line 293 of file ocs_iscsi_api.c.
|
static |
Definition at line 1218 of file ocs_iscsi_api.c.
| int32_t ocs_iscsi_unassisted_pdu_send | ( | ocs_t * | ocs, |
| ocs_io_t * | io, | ||
| ocs_cxn_t * | cxn, | ||
| void * | bhs, | ||
| void * | data, | ||
| uint32_t | data_size, | ||
| bool | is_login, | ||
| bool | set_dm, | ||
| ocs_iscsi_pdu_cb_t | cb | ||
| ) |
Definition at line 1258 of file ocs_iscsi_api.c.