38 #ifndef _OCS_ISCSI_API_H
39 #define _OCS_ISCSI_API_H
76 uint8_t ip_address[16];
84 uint8_t ip_address[16];
91 typedef struct ocs_chap_user_s {
102 typedef struct ocs_vlan_portal_info_s {
122 typedef struct iscsi_api_tgt_s
129 typedef struct iscsi_api_s
179 uint32_t mode, uint32_t type);
181 uint32_t type, uint32_t *secret_len);
204 uint32_t max_entries,
226 uint32_t max_entries,
235 void *pkt, uint32_t *pkt_len, uint32_t buff_len);
238 uint32_t type, uint32_t mode);
240 uint32_t type, uint32_t mode);
243 typedef int32_t (*
ocs_iscsi_pdu_cb_t)(ocs_io_t *io, uint32_t exp_cmdsn, uint32_t max_cmdsn, uint8_t response);
245 uint32_t data_size,
bool is_login,
bool set_dm,
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)
structure for storing VLAN id and interface handle together
ocs_sport_t * ocs_iscsi_tgt_get_free_sport(ocs_t *ocs)
Get a next free sport object index.
ocs_link_state_e
enum identifying the link state.
int32_t ocs_iscsi_tgt_add(ocs_t *ocs, char *name, char *alias)
Adds a target.
ocs_list_t ocs_list_link_t
int32_t ocs_iscsi_isns_esi_listen_start(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Starts an iSNS ESI TCP listen socket.
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_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.
structure for storing CHAP usernames and passwords.
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.
int32_t ocs_iscsi_mtu_set(ocs_t *ocs, uint8_t is_jumbo)
Sets the TCP MTU size of the iSCSI device.
int32_t ocs_iscsi_find_portal_from_vlan(ocs_t *ocs, uint32_t vlan_id, ocs_hal_portal_t *iface_handle)
Helper function to find respective interface handle of VLAN id.
ocs_session_type_e
enum identifying the types of IP addresses.
int32_t ocs_iscsi_listen_start(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Starts a TCP listen socket.
int32_t ocs_iscsi_chap_user_del(ocs_t *ocs, char *username, uint32_t type, uint32_t mode)
Delete CHAP user.
char * ocs_iscsi_ini_get_name(ocs_t *ocs)
Return this initiator's name.
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.
int32_t ocs_iscsi_send_context_udpate(ocs_cxn_t *cxn)
Sends the login parameters to the FW.
uint32_t ocs_hal_portal_t
#define OCS_ISCSI_MAX_ALIAS_SIZE
char * ocs_iscsi_tgt_get_names(ocs_t *ocs, uint32_t index)
Returns the target name based on the index.
uint8_t * ocs_iscsi_mac_get(ocs_t *ocs)
Gets the MAC address of the iSCSI device.
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.
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.
int32_t ocs_iscsi_listen_stop(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Stops a TCP listen socket.
ocs_ip_address_subnet_t ipsub
ocs_hal_portal_t ocs_iscsi_portal_get_default(ocs_t *ocs)
Retrieves the default portal.
int32_t ocs_iscsi_ip_address_remove(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub)
Remove the IP address to the specified interface.
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.
int32_t ocs_iscsi_ip_address_query(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_type_e ip_type, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_subnet_t *ipsub)
Queries the IP addresses on the default interface.
ocs_hal_portal_t iface_handle
int32_t ocs_iscsi_api_initialize(ocs_t *ocs)
Initialize the higher level iSCSI software.
ocs_thread_t link_cfg_thread
int32_t ocs_iscsi_isns_esi_listen_stop(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Stops an iSNS ESI TCP listen socket.
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 c...
int32_t ocs_iscsi_portal_delete(ocs_t *ocs, ocs_hal_portal_t portal)
Removes a previously-created portal.
int32_t ocs_iscsi_gateway_set(ocs_t *ocs, ocs_ip_address_t *gateway)
Sets the IP gateway address.
int32_t ocs_iscsi_mac_set(ocs_t *ocs, uint8_t *mac_address)
Sets the MAC address of the iSCSI device.
int32_t ocs_iscsi_tgt_add_sport(ocs_t *ocs, ocs_sport_t *sport)
Add sport to iscsi target.
structure wrapping an IP address and subnet together with their type.
char * ocs_iscsi_ini_get_alias(ocs_t *ocs)
Returns the initiator alias.
int32_t ocs_iscsi_portal_remove_ip_addresses(ocs_t *ocs, ocs_hal_portal_t iface_handle)
Check and remove IP addresses of the corresponding interface.
ocs_ip_type_e
enum identifying the types of IP addresses.
int32_t ocs_iscsi_chap_list_get(ocs_t *ocs, char *userbuf, int32_t buflen)
Return CHAP list items.
int32_t ocs_iscsi_isns_send(ocs_t *ocs, ocs_ip_address_t *isns_server, uint32_t tcp_port, void *buffer, uint32_t *pkt_len, uint32_t buff_len)
Sends an iSNS packet to a server to test the interface.
int32_t ocs_iscsi_ip_address_add(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub)
Adds the IP address to the specified interface.
int32_t ocs_iscsi_isns_discover(ocs_t *ocs, ocs_hal_portal_t portal, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_t *ip)
Discovers the iSNS through the DHCP service.
Stores information needed to manage targets.
#define OCS_MAX_ISCSI_NAME
ocs_ip_address_t * isns_servers
int32_t ocs_iscsi_portal_create(ocs_t *ocs, unsigned int vlan_id, ocs_hal_portal_t *portal)
Creates a portal for a VLAN.
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.
int32_t(* ocs_iscsi_pdu_cb_t)(ocs_io_t *io, uint32_t exp_cmdsn, uint32_t max_cmdsn, uint8_t response)
structure wrapping an IP address together with it's type.
void ocs_iscsi_tgt_del_sport(ocs_t *ocs, uint32_t sport_index)
Delete sport from iscsi target.
char * ocs_iscsi_tgt_get_alias(ocs_t *ocs, uint32_t index)
Returns the target alias based on the index.
int32_t ocs_iscsi_api_shutdown(ocs_t *ocs)
Initialize the higher level iSCSI software.