libstmf.h revision fdcc480a6215c1e81d58d8e7af8c84fd6f1faa50
/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LIBSTMF_H
#define _LIBSTMF_H
#include <time.h>
#include <libnvpair.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Constants and Types */
/* LU and Local Port states */
#define STMF_LOGICAL_UNIT_OFFLINE 0
#define STMF_LOGICAL_UNIT_OFFLINING 1
#define STMF_LOGICAL_UNIT_ONLINE 2
#define STMF_LOGICAL_UNIT_ONLINING 3
#define STMF_LOGICAL_UNIT_UNREGISTERED 4
#define STMF_TARGET_PORT_OFFLINE 5
#define STMF_TARGET_PORT_OFFLINING 6
#define STMF_TARGET_PORT_ONLINE 7
#define STMF_TARGET_PORT_ONLINING 8
#define STMF_SERVICE_STATE_ONLINE 9
#define STMF_SERVICE_STATE_OFFLINE 10
#define STMF_SERVICE_STATE_ONLINING 11
#define STMF_SERVICE_STATE_OFFLINING 12
#define STMF_SERVICE_STATE_UNKNOWN 13
#define STMF_CONFIG_STATE_NONE 14
#define STMF_CONFIG_STATE_INIT 15
#define STMF_CONFIG_STATE_INIT_DONE 16
#define STMF_CONFIG_STATE_UNKNOWN 17
#define STMF_IDENT_LENGTH 255
/* API status return values */
#define STMF_STATUS_SUCCESS 0x0000
#define STMF_STATUS_ERROR 0x8000
/* Failures for stmfCreateLu */
/* Initiator Name Types */
#define STMF_FC_PORT_WWN 1
#define STMF_ISCSI_NAME 2
/* provider types */
#define STMF_LU_PROVIDER_TYPE 1
#define STMF_PORT_PROVIDER_TYPE 2
/* LU Resource types */
#define STMF_DISK 0
/* Persistence methods */
#define STMF_PERSIST_SMF 1
#define STMF_PERSIST_NONE 2
/* Logical unit access states */
#define STMF_ACCESS_ACTIVE "0"
#define STMF_ACCESS_ACTIVE_TO_STANDBY "1"
#define STMF_ACCESS_STANDBY "2"
#define STMF_ACCESS_STANDBY_TO_ACTIVE "3"
/*
* LU Disk Properties
*/
enum {
STMF_LU_PROP_ALIAS = 1,
};
/* devid code set and name types */
#define EUI_64_TYPE 2
#define NAA_TYPE 3
#define SCSI_NAME_TYPE 8
#define BINARY_CODE_SET 1
#define ASCII_CODE_SET 2
#define UTF_8_CODE_SET 3
typedef enum _stmfProtocol
{
STMF_PROTOCOL_SCSI = 1,
STMF_PROTOCOL_SSA = 2,
STMF_PROTOCOL_SRP = 4,
STMF_PROTOCOL_ISCSI = 5,
} stmfProtocol;
typedef struct _stmfGuid
{
} stmfGuid;
typedef struct _stmfGuidList
{
} stmfGuidList;
typedef struct _stmfState
{
int operationalState;
int configState;
} stmfState;
typedef struct _stmfDevid
{
} stmfDevid;
typedef struct _stmfDevidList
{
typedef char stmfGroupName[256];
typedef char stmfProviderName[256];
typedef struct _stmfGroupList
{
typedef struct _stmfProvider
{
int providerType;
} stmfProvider;
typedef struct _stmfProviderList
{
typedef struct _stmfSession
{
char alias[256];
} stmfSession;
typedef struct _stmfSessionList
{
typedef struct _stmfViewEntry
{
typedef struct _stmfViewEntryList
{
typedef struct _stmfViewEntryProperties
{
typedef struct _stmfGroupProperties
{
typedef struct _stmfTargetProperties
{
char alias[256];
typedef struct _stmfLogicalUnitProperties
{
char alias[256];
char providerName[256];
typedef void * luResource;
typedef struct _stmfLogicalUnitProviderProperties
{
char providerName[MAXPATHLEN];
typedef struct _stmfLocalPortProviderProperties
{
char providerName[MAXPATHLEN];
/* API prototypes */
void stmfDestroyProxyDoor(int hdl);
void stmfFreeMemory(void *);
int stmfGetState(stmfState *);
int stmfLoadConfig(void);
const char *propVal);
int stmfOffline(void);
int stmfOnline(void);
#ifdef __cplusplus
}
#endif
#endif /* _LIBSTMF_H */