fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _ISCSI_IF_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _ISCSI_IF_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _KERNEL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/strsubr.h> /* for prototype of kstrgetmsg */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/socket.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/socketvar.h> /* for struct sonode */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <netinet/in.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/scsi/impl/uscsi.h>
1a1a84a324206b6b1f5f704ab166c4ebf78aed76Peter Dunlap#include <sys/iscsi_protocol.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each of the top level structures have a version field as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the first member. That version value will be set by the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * caller. The consumer of the structure will check to see
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * if the version is correct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_INTERFACE_VERSION 3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Login parameter values are used instead of ascii text
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * between the IMA plug-in and kernel.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DATA_SEQUENCE_IN_ORDER 0x0000 /* bool */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_IMMEDIATE_DATA 0x0001 /* bool */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_INITIAL_R2T 0x0002 /* bool */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DATA_PDU_IN_ORDER 0x0003 /* bool */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_HEADER_DIGEST 0x0004 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DATA_DIGEST 0x0005 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DEFAULT_TIME_2_RETAIN 0x0006 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DEFAULT_TIME_2_WAIT 0x0007 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_MAX_RECV_DATA_SEGMENT_LENGTH 0x0008 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_FIRST_BURST_LENGTH 0x0009 /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_MAX_BURST_LENGTH 0x000A /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_MAX_CONNECTIONS 0x000B /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_OUTSTANDING_R2T 0x000C /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_ERROR_RECOVERY_LEVEL 0x000D /* int */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * number of login parameters - needs to be updated when new parameter added
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_NUM_LOGIN_PARAM 0x000E
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used internally by the persistent store code. Currently a bitmap is kept of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * which params are currently set. This allows for quick a look up instead of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cycling through the possible entries. Using an unsigned int as the bitmap we
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * can have parameter numbers up through 31. Since the current only has 22
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * we're okay.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_DB_ENTRY 0x0020
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Special case. When this parameter value is set in iscsi_param_set_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the member s_value (type iscsi_param_set_t) is not used.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The name field contains the InitiatorName for the system which
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * should be used for all future sessions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_INITIATOR_NAME 0x0021
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN_PARAM_INITIATOR_ALIAS 0x0022
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DEVCTL "devctl"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DRIVER_DEVCTL "/devices/iscsi:" ISCSI_DEVCTL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ioctls supported by the driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_IOCTL (('i' << 24) | ('S' << 16) | ('C' << 8))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CREATE_OID (ISCSI_IOCTL | 2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGIN (ISCSI_IOCTL | 3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LOGOUT (ISCSI_IOCTL | 4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_PARAM_GET (ISCSI_IOCTL | 5)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_PARAM_SET (ISCSI_IOCTL | 6)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TARGET_PARAM_CLEAR (ISCSI_IOCTL | 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TARGET_OID_LIST_GET (ISCSI_IOCTL | 9)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TARGET_PROPS_GET (ISCSI_IOCTL | 10)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TARGET_PROPS_SET (ISCSI_IOCTL | 11)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TARGET_ADDRESS_GET (ISCSI_IOCTL | 12)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CHAP_SET (ISCSI_IOCTL | 13)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CHAP_GET (ISCSI_IOCTL | 14)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CHAP_CLEAR (ISCSI_IOCTL | 15)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_STATIC_GET (ISCSI_IOCTL | 16)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_STATIC_SET (ISCSI_IOCTL | 17)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_STATIC_CLEAR (ISCSI_IOCTL | 18)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_SET (ISCSI_IOCTL | 19)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_GET (ISCSI_IOCTL | 20)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_CLEAR (ISCSI_IOCTL | 21)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_PROPS (ISCSI_IOCTL | 22)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_ADDR_SET (ISCSI_IOCTL | 23)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_ADDR_LIST_GET (ISCSI_IOCTL | 24)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_ADDR_CLEAR (ISCSI_IOCTL | 25)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_RADIUS_SET (ISCSI_IOCTL | 26)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_RADIUS_GET (ISCSI_IOCTL | 27)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LUN_OID_LIST_GET (ISCSI_IOCTL | 29)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_LUN_PROPS_GET (ISCSI_IOCTL | 30)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CONN_OID_LIST_GET (ISCSI_IOCTL | 31)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CONN_PROPS_GET (ISCSI_IOCTL | 32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_USCSI (ISCSI_IOCTL | 33)
4246c8e92ef9ad6ada2b992b7af02832ff071bf7Jack Meng#define ISCSI_SMF_ONLINE (ISCSI_IOCTL | 34)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DISCOVERY_EVENTS (ISCSI_IOCTL | 35)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_AUTH_SET (ISCSI_IOCTL | 36)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_AUTH_GET (ISCSI_IOCTL | 37)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_AUTH_CLEAR (ISCSI_IOCTL | 38)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_SENDTGTS_GET (ISCSI_IOCTL | 39)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ISNS_SERVER_ADDR_SET (ISCSI_IOCTL | 40)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ISNS_SERVER_ADDR_LIST_GET (ISCSI_IOCTL | 41)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ISNS_SERVER_ADDR_CLEAR (ISCSI_IOCTL | 42)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ISNS_SERVER_GET (ISCSI_IOCTL | 43)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_GET_CONFIG_SESSIONS (ISCSI_IOCTL | 44)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_SET_CONFIG_SESSIONS (ISCSI_IOCTL | 45)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_INIT_NODE_NAME_SET (ISCSI_IOCTL | 46)
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng#define ISCSI_IS_ACTIVE (ISCSI_IOCTL | 47)
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng#define ISCSI_BOOTPROP_GET (ISCSI_IOCTL | 48)
4246c8e92ef9ad6ada2b992b7af02832ff071bf7Jack Meng#define ISCSI_SMF_OFFLINE (ISCSI_IOCTL | 49)
4246c8e92ef9ad6ada2b992b7af02832ff071bf7Jack Meng#define ISCSI_SMF_GET (ISCSI_IOCTL | 50)
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China#define ISCSI_TUNABLE_PARAM_GET (ISCSI_IOCTL | 51)
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China#define ISCSI_TUNABLE_PARAM_SET (ISCSI_IOCTL | 52)
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng#define ISCSI_TARGET_REENUM (ISCSI_IOCTL | 53)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DB_DUMP (ISCSI_IOCTL | 100) /* DBG */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Misc. defines
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CHAP_NAME_LEN 512
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CHAP_SECRET_LEN 16
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TGT_OID_LIST 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_STATIC_TGT_OID_LIST 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_TGT_PARAM_OID_LIST 0x0004
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_SESS_PARAM 0x0001
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_CONN_PARAM 0x0002
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* digest level defines */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DIGEST_NONE 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DIGEST_CRC32C 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DIGEST_CRC32C_NONE 2 /* offer both, prefer CRC32C */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DIGEST_NONE_CRC32C 3 /* offer both, prefer None */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * A last error associated with each target session is returned in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * iscsi_target_t structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum iscsi_error {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte NoError, AuthenticationError, LoginParamError, ConnectionReset
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_error_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The values associated with each enum is based on the IMA specification.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum iSCSIDiscoveryMethod {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodUnknown = 0,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodStatic = 1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodSLP = 2,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodISNS = 4,
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng iSCSIDiscoveryMethodSendTargets = 8,
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng /*
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng * Since there is no specification about boot discovery method,
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng * we should leave a value gap in case of other discovery
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng * methods added.
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng */
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng iSCSIDiscoveryMethodBoot = 128
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iSCSIDiscoveryMethod_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ALL_DISCOVERY_METHODS (iSCSIDiscoveryMethodStatic | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodSLP | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodISNS | \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethodSendTargets)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Before anything can be done to a target it must have an OID.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_oid {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t o_vers; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t o_name[ISCSI_MAX_NAME_LEN]; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * tpgt is only 16 bits per spec. use 32 in ioctl to reduce
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * packing issue. Also -1 tpgt denotes default value. iSCSI
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * stack will detemermine tpgt during login.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int o_tpgt; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t o_oid; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_oid_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_OID_NOTSET 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_INITIATOR_OID 1 /* Other OIDs follow > 1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_DEFAULT_TPGT -1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * iSCSI Login Parameters - Reference iscsi draft for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * definitions of the below login params.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_login_params {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t immediate_data;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t initial_r2t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int first_burst_length; /* range: 512 - 2**24-1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int max_burst_length; /* range: 512 - 2**24-1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t data_pdu_in_order;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t data_sequence_in_order;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int default_time_to_wait;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int default_time_to_retain;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int header_digest;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int data_digest;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int max_recv_data_seg_len; /* range: 512 - 2**24-1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int max_xmit_data_seg_len; /* range: 512 - 2**24-1 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int max_connections;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int max_outstanding_r2t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int error_recovery_level;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t ifmarker;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t ofmarker;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_login_params_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China#define ISCSI_TUNABLE_PARAM_RX_TIMEOUT_VALUE 0x0001
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China#define ISCSI_TUNABLE_PARAM_CONN_LOGIN_MAX 0x0002
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China#define ISCSI_TUNABLE_PARAM_LOGIN_POLLING_DELAY 0x0004
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Once parameters have been set via ISCSI_SET_PARAM the login is initiated
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * by sending an ISCSI_LOGIN ioctl with the following structure filled in.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct entry {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int e_vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t e_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in_addr u_in4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in6_addr u_in6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } e_u;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * e_insize indicates which of the previous structs is valid.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int e_insize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int e_port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int e_tpgt;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng /* e_boot should be true if a boot session is created. */
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng boolean_t e_boot;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} entry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used when setting or gettnig the Initiator Name or Alias.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct node_name {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char n_name[ISCSI_MAX_NAME_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int n_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} node_name_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSIMinMaxValue {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t i_current,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte i_default,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte i_min,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte i_max,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte i_incr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_int_info_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSIBoolValue {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t b_current,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte b_default;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_bool_info_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSIParamValueGet {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t v_valid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte v_settable;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_int_info_t v_integer;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_bool_info_t v_bool;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t v_name[ISCSI_MAX_NAME_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_get_value_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSILoginParamGet {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t g_vers; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t g_oid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t g_param; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_get_value_t g_value; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t g_conn_cid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * To indicate whether session or connection related param is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * being requested.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t g_param_type; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_param_get_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_set_value {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t v_integer;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t v_bool;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t v_name[ISCSI_MAX_NAME_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_set_value_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All of the members of this structure are set by the user agent and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * consumed by the driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iSCSILoginParamSet {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t s_vers,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte s_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t s_param;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_set_value_t s_value;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_param_set_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China/* Data structure used for tunable object parameters */
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing Chinatypedef struct _iSCSITunableValue {
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China uint32_t v_integer;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China boolean_t v_bool;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China uchar_t v_name[ISCSI_MAX_NAME_LEN];
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China} iscsi_tunable_value_t;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing Chinatypedef struct iSCSITunalbeParamObject {
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China boolean_t t_set;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China uint32_t t_oid;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China uint32_t t_param;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China iscsi_tunable_value_t t_value;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China} iscsi_tunable_object_t;
aff4bce51ecc47df7e5a6351b7cee6bc20408c63yi zhang - Sun Microsystems - Beijing China
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Data in this structure is set by the user agent and consumed by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct chap_props {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t c_vers,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte c_retries,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte c_oid;
2e0fe3efe5f9d579d4e44b3532d8e342c68b40cabing zhao - Sun Microsystems - Beijing China unsigned char c_user[ISCSI_MAX_C_USER_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t c_user_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char c_secret[16];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t c_secret_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_chap_props_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum authMethod {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodNone = 0x00,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodCHAP = 0x01,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodSRP = 0x02,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodKRB5 = 0x04,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodSPKM1 = 0x08,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethodSPKM2 = 0x10
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} authMethod_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Data in this structure is set by the user agent and consumed by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct auth_props {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t a_vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t a_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t a_bi_auth;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte authMethod_t a_auth_method;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_auth_props_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Data in this structure is set by the user agent and consumed by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the driver.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MAX_RAD_SHARED_SECRET_LEN 128
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct radius_props {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t r_vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t r_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in_addr u_in4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in6_addr u_in6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } r_addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * r_insize indicates which of the previous structs is valid.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int r_insize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t r_port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t r_shared_secret[MAX_RAD_SHARED_SECRET_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t r_radius_access;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t r_radius_config_valid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t r_shared_secret_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_radius_props_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _IPAddress {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in_addr in4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct in6_addr in6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } i_addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* i_insize determines which is valid in the union above */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int i_insize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_ipaddr_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSITargetAddressKey {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_ipaddr_t a_addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t a_port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte a_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_addr_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSITargetAddressKeyProperties {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t al_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte al_oid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t al_in_cnt; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t al_out_cnt; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t al_tpgt; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_addr_t al_addrs[1]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_addr_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSITargetProperties {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t p_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte p_oid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t p_name[ISCSI_MAX_NAME_LEN]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t p_name_len; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t p_alias[ISCSI_MAX_NAME_LEN]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t p_alias_len; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSCSIDiscoveryMethod_t p_discovery; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t p_connected; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t p_num_of_connections; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ---- If connected == B_TRUE then lastErr has no meaning. ---- */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_error_t p_last_err; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Target portal group tag = -1 value means default.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int p_tpgt_conf; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int p_tpgt_nego; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t p_isid[ISCSI_ISID_LEN]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t p_reserved[128];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_property_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSITargetDeviceList {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t tl_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tl_in_cnt, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tl_tgt_list_type, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tl_out_cnt, /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte tl_oid_list[1]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_target_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _iSCSIStaticTargetProperties {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t p_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte p_oid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t p_name[ISCSI_MAX_NAME_LEN]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t p_name_len; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_addr_list_t p_addr_list; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_static_property_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum iscsi_lun_status {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte LunValid, LunDoesNotExist
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_lun_status_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SCSI inquiry vendor and product identifier buffer length - these values are
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * defined by the identifier length plus 1 byte for the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * null termination.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_INQ_VID_BUF_LEN 9 /* 8 byte ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_INQ_PID_BUF_LEN 17 /* 16 byte ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_lun_props {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t lp_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_tgt_oid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_oid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_num, /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_status; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char lp_pathname[MAXPATHLEN], /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_vid[ISCSI_INQ_VID_BUF_LEN], /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lp_pid[ISCSI_INQ_PID_BUF_LEN]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte time_t lp_time_online; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_lun_props_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_if_lun {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t l_tgt_oid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_oid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte l_num;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_if_lun_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_lun_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ll_vers; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t ll_all_tgts; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ll_tgt_oid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ll_in_cnt, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ll_out_cnt; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_if_lun_t ll_luns[1]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_lun_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_conn_props {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t cp_vers, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cp_oid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cp_cid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cp_sess_oid; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sockaddr_in soa4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sockaddr_in6 soa6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } cp_local; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sockaddr_in soa4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sockaddr_in6 soa6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } cp_peer; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_login_params_t cp_params;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t cp_params_valid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_conn_props_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_if_conn {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t c_sess_oid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte c_oid,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte c_cid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_if_conn_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_conn_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t cl_vers; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t cl_all_sess; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t cl_sess_oid, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cl_in_cnt, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte cl_out_cnt; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_if_conn_t cl_list[1]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_conn_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum iSNSDiscoveryMethod {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSNSDiscoveryMethodStatic = 0,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSNSDiscoveryMethodDHCP = 1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iSNSDiscoveryMethodSLP = 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_method_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iSCSIDiscoveryProperties {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t iSNSDiscoverySettable;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t iSNSDiscoveryEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_method_t iSNSDiscoveryMethod;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char iSNSDomainName[256];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t SLPDiscoverySettable;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t SLPDiscoveryEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t StaticDiscoverySettable;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t StaticDiscoveryEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t SendTargetsDiscoverySettable;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t SendTargetsDiscoveryEnabled;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iSCSIDiscoveryProperties_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_uscsi {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int iu_tpgt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_lun;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct uscsi_cmd iu_ucmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_uscsi_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(_SYSCALL32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_uscsi32 {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_vers;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int iu_tpgt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t iu_lun;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct uscsi_cmd32 iu_ucmd;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_uscsi32_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SYSCALL32 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_sendtgts_entry {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ---- Node name, NULL terminated UTF-8 string ---- */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t ste_name[ISCSI_MAX_NAME_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_addr_t ste_ipaddr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ste_tpgt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_sendtgts_entry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_sendtgts_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte entry_t stl_entry; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t stl_in_cnt, /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte stl_out_cnt; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_sendtgts_entry_t stl_list[1]; /* Out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_sendtgts_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_statictgt_entry {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte entry_t te_entry; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t te_name[ISCSI_MAX_NAME_LEN]; /* In */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_target_entry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Draft - section 4.1.1. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_portal_group {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t pg_iscsi_name[ISCSI_MAX_NAME_LEN];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in_addr_t u_ip4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in6_addr_t u_ip6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } pg_ip_addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int insize;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in_port_t pg_port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t pg_tag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_ipaddr_t isns_server_ip;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t isns_server_port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_portal_group_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_portal_group_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t pg_in_cnt,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pg_out_cnt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_portal_group_t pg_list[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_portal_group_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_server_portal_group_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_addr_t addr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_portal_group_list_t addr_port_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_server_portal_group_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_MIN_CONFIG_SESSIONS 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* lowered max config sessions due to ct_power_cnt >= 0 assert */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_MAX_CONFIG_SESSIONS 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct iscsi_config_sess {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ics_ver;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ics_oid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte boolean_t ics_bound;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ics_in;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint_t ics_out;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_ipaddr_t ics_bindings[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} iscsi_config_sess_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng/* iscsi re-enumeration */
904e51f67bfac9f3ec88d9254757474c448808ebJack Mengtypedef struct iscsi_reen {
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng uint32_t re_ver;
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng uint32_t re_oid;
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng} iscsi_reen_t;
904e51f67bfac9f3ec88d9254757474c448808ebJack Meng
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng/* iscsi booting prop */
904e51f67bfac9f3ec88d9254757474c448808ebJack Mengtypedef struct iscsi_boot_property {
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng node_name_t ini_name;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng node_name_t tgt_name;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng iscsi_auth_props_t auth;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng iscsi_chap_props_t ini_chap;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng iscsi_chap_props_t tgt_chap;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng int iscsiboot;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng boolean_t hba_mpxio_enabled;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng} iscsi_boot_property_t;
6cefaae1e90a413ba01560575bb3998e1a3df40eJack Meng
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_SESSION_CONFIG_SIZE(SIZE) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (sizeof (iscsi_config_sess_t) + \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((SIZE - 1) * sizeof (iscsi_ipaddr_t)))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Event class and subclass information
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EC_ISCSI "EC_iSCSI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_STATIC_START "ESC_static_start"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_STATIC_END "ESC_static_end"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_SEND_TARGETS_START "ESC_send_targets_start"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_SEND_TARGETS_END "ESC_send_targets_end"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_SLP_START "ESC_slp_start"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_SLP_END "ESC_slp_end"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_ISNS_START "ESC_isns_start"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_ISNS_END "ESC_isns_end"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ESC_ISCSI_PROP_CHANGE "ESC_prop_change"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _KERNEL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ---- iscsi_utils.c ---- */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int iscsid_open(char *, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int iscsid_close(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int iscsid_remove(char *filename);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int iscsid_rename(char *oldname, char *newname);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern ssize_t iscsid_write(int, void *, ssize_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern ssize_t iscsid_read(int, void *, ssize_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern ssize_t iscsid_sendto(struct sonode *, void *, size_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sockaddr *, socklen_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern ssize_t iscsid_recvfrom(struct sonode *, void *buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t len);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int iscsid_errno;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function prototypes for those routines found in the common code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* ---- utils.c ---- */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern boolean_t utils_iqn_create(char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *prt_bitmap(int, char *, char *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern char *utils_map_param(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern boolean_t parse_addr_port_tpgt(char *in, char **addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int *type, char **port, char **tpgt);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISCSI_IF_H */