/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _ISCSI_IF_H
#define _ISCSI_IF_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#endif
#include <sys/iscsi_protocol.h>
/*
* Each of the top level structures have a version field as
* the first member. That version value will be set by the
* caller. The consumer of the structure will check to see
* if the version is correct.
*/
/*
* Login parameter values are used instead of ascii text
* between the IMA plug-in and kernel.
*/
/*
* number of login parameters - needs to be updated when new parameter added
*/
/*
* Used internally by the persistent store code. Currently a bitmap is kept of
* which params are currently set. This allows for quick a look up instead of
* cycling through the possible entries. Using an unsigned int as the bitmap we
* can have parameter numbers up through 31. Since the current only has 22
* we're okay.
*/
/*
* Special case. When this parameter value is set in iscsi_param_set_t
* the member s_value (type iscsi_param_set_t) is not used.
* The name field contains the InitiatorName for the system which
* should be used for all future sessions.
*/
/*
* ioctls supported by the driver.
*/
/*
* Misc. defines
*/
/* digest level defines */
#define ISCSI_DIGEST_NONE 0
/*
* A last error associated with each target session is returned in the
* iscsi_target_t structure.
*/
typedef enum iscsi_error {
/*
* The values associated with each enum is based on the IMA specification.
*/
typedef enum iSCSIDiscoveryMethod {
/*
* Since there is no specification about boot discovery method,
* we should leave a value gap in case of other discovery
* methods added.
*/
/*
* Before anything can be done to a target it must have an OID.
*/
typedef struct iscsi_oid {
/*
* tpgt is only 16 bits per spec. use 32 in ioctl to reduce
* packing issue. Also -1 tpgt denotes default value. iSCSI
* stack will detemermine tpgt during login.
*/
} iscsi_oid_t;
#define ISCSI_OID_NOTSET 0
/*
* iSCSI Login Parameters - Reference iscsi draft for
* definitions of the below login params.
*/
typedef struct iscsi_login_params {
int default_time_to_wait;
int header_digest;
int data_digest;
int max_connections;
int max_outstanding_r2t;
int error_recovery_level;
/*
* Once parameters have been set via ISCSI_SET_PARAM the login is initiated
* by sending an ISCSI_LOGIN ioctl with the following structure filled in.
*/
typedef struct entry {
int e_vers;
union {
} e_u;
/*
* e_insize indicates which of the previous structs is valid.
*/
int e_insize;
int e_port;
int e_tpgt;
/* e_boot should be true if a boot session is created. */
} entry_t;
/*
* Used when setting or gettnig the Initiator Name or Alias.
*/
typedef struct node_name {
int n_len;
} node_name_t;
typedef struct _iSCSIMinMaxValue {
typedef struct _iSCSIBoolValue {
typedef struct _iSCSIParamValueGet {
typedef struct _iSCSILoginParamGet {
/*
* To indicate whether session or connection related param is
* being requested.
*/
typedef struct iscsi_set_value {
/*
* All of the members of this structure are set by the user agent and
* consumed by the driver.
*/
typedef struct iSCSILoginParamSet {
/* Data structure used for tunable object parameters */
typedef struct _iSCSITunableValue {
typedef struct iSCSITunalbeParamObject {
/*
* Data in this structure is set by the user agent and consumed by
* the driver.
*/
typedef struct chap_props {
typedef enum authMethod {
} authMethod_t;
/*
* Data in this structure is set by the user agent and consumed by
* the driver.
*/
typedef struct auth_props {
/*
* Data in this structure is set by the user agent and consumed by
* the driver.
*/
typedef struct radius_props {
union {
} r_addr;
/*
* r_insize indicates which of the previous structs is valid.
*/
int r_insize;
typedef struct _IPAddress {
union {
} i_addr;
/* i_insize determines which is valid in the union above */
int i_insize;
typedef struct _iSCSITargetAddressKey {
} iscsi_addr_t;
typedef struct _iSCSITargetAddressKeyProperties {
typedef struct _iSCSITargetProperties {
/* ---- If connected == B_TRUE then lastErr has no meaning. ---- */
/*
* Target portal group tag = -1 value means default.
*/
typedef struct _iSCSITargetDeviceList {
typedef struct _iSCSIStaticTargetProperties {
typedef enum iscsi_lun_status {
/*
* SCSI inquiry vendor and product identifier buffer length - these values are
* defined by the identifier length plus 1 byte for the
* null termination.
*/
typedef struct iscsi_lun_props {
typedef struct iscsi_if_lun {
typedef struct iscsi_lun_list {
typedef struct iscsi_conn_props {
union {
union {
typedef struct iscsi_if_conn {
typedef struct iscsi_conn_list {
typedef enum iSNSDiscoveryMethod {
typedef struct iSCSIDiscoveryProperties {
typedef struct iscsi_uscsi {
int iu_tpgt;
#if defined(_SYSCALL32)
typedef struct iscsi_uscsi32 {
int iu_tpgt;
#endif /* _SYSCALL32 */
typedef struct iscsi_sendtgts_entry {
/* ---- Node name, NULL terminated UTF-8 string ---- */
int ste_tpgt;
typedef struct iscsi_sendtgts_list {
typedef struct iscsi_statictgt_entry {
/* iSNS Draft - section 4.1.1. */
typedef struct isns_portal_group {
union {
} pg_ip_addr;
int insize;
typedef struct isns_portal_group_list {
typedef struct isns_server_portal_group_list {
/* lowered max config sessions due to ct_power_cnt >= 0 assert */
typedef struct iscsi_config_sess {
/* iscsi re-enumeration */
typedef struct iscsi_reen {
} iscsi_reen_t;
/* iscsi booting prop */
typedef struct iscsi_boot_property {
int iscsiboot;
(sizeof (iscsi_config_sess_t) + \
/*
* Event class and subclass information
*/
#ifdef _KERNEL
/* ---- iscsi_utils.c ---- */
extern int iscsid_open(char *, int, int);
extern int iscsid_close(int);
extern int iscsid_remove(char *filename);
extern int iscsid_errno;
#endif
/*
* Function prototypes for those routines found in the common code
*/
/* ---- utils.c ---- */
extern boolean_t utils_iqn_create(char *, int);
extern char *prt_bitmap(int, char *, char *, int);
extern char *utils_map_param(int);
#ifdef __cplusplus
}
#endif
#endif /* _ISCSI_IF_H */