1fcf3ce44SJohn Forte /*
2fcf3ce44SJohn Forte  * CDDL HEADER START
3fcf3ce44SJohn Forte  *
4fcf3ce44SJohn Forte  * The contents of this file are subject to the terms of the
5fcf3ce44SJohn Forte  * Common Development and Distribution License (the "License").
6fcf3ce44SJohn Forte  * You may not use this file except in compliance with the License.
7fcf3ce44SJohn Forte  *
8fcf3ce44SJohn Forte  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fcf3ce44SJohn Forte  * or http://www.opensolaris.org/os/licensing.
10fcf3ce44SJohn Forte  * See the License for the specific language governing permissions
11fcf3ce44SJohn Forte  * and limitations under the License.
12fcf3ce44SJohn Forte  *
13fcf3ce44SJohn Forte  * When distributing Covered Code, include this CDDL HEADER in each
14fcf3ce44SJohn Forte  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fcf3ce44SJohn Forte  * If applicable, add the following below this CDDL HEADER, with the
16fcf3ce44SJohn Forte  * fields enclosed by brackets "[]" replaced with your own identifying
17fcf3ce44SJohn Forte  * information: Portions Copyright [yyyy] [name of copyright owner]
18fcf3ce44SJohn Forte  *
19fcf3ce44SJohn Forte  * CDDL HEADER END
20fcf3ce44SJohn Forte  */
21fcf3ce44SJohn Forte /*
22*4b31676fSsrivijitha dugganapalli  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23fcf3ce44SJohn Forte  */
24fcf3ce44SJohn Forte 
25fcf3ce44SJohn Forte #ifndef	_LIBSTMF_H
26fcf3ce44SJohn Forte #define	_LIBSTMF_H
27fcf3ce44SJohn Forte 
28fcf3ce44SJohn Forte #include <time.h>
29fcf3ce44SJohn Forte #include <sys/param.h>
30fcf3ce44SJohn Forte #include <libnvpair.h>
31fcf3ce44SJohn Forte 
32fcf3ce44SJohn Forte #ifdef	__cplusplus
33fcf3ce44SJohn Forte extern "C" {
34fcf3ce44SJohn Forte #endif
35fcf3ce44SJohn Forte 
36fcf3ce44SJohn Forte /* Constants and Types */
37fcf3ce44SJohn Forte 
38fcf3ce44SJohn Forte /* LU and Local Port states */
39fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_OFFLINE	0
40fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_OFFLINING	1
41fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_ONLINE	2
42fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_ONLINING	3
43fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_UNREGISTERED	4
44fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_OFFLINE	5
45fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_OFFLINING	6
46fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_ONLINE		7
47fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_ONLINING	8
48fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_ONLINE	9
49fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_OFFLINE	10
50fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_ONLINING	11
51fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_OFFLINING	12
52fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_UNKNOWN	13
53fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_NONE		14
54fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_INIT		15
55fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_INIT_DONE	16
56fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_UNKNOWN	17
57*4b31676fSsrivijitha dugganapalli #define	STMF_DEFAULT_LU_STATE		18
58*4b31676fSsrivijitha dugganapalli #define	STMF_DEFAULT_TARGET_PORT_STATE	19
59fcf3ce44SJohn Forte 
60fcf3ce44SJohn Forte #define	STMF_IDENT_LENGTH   255
61fcf3ce44SJohn Forte 
62fcf3ce44SJohn Forte /* API status return values */
63fcf3ce44SJohn Forte #define	STMF_STATUS_SUCCESS	    0x0000
64fcf3ce44SJohn Forte #define	STMF_STATUS_ERROR	    0x8000
65fcf3ce44SJohn Forte #define	STMF_ERROR_BUSY			(STMF_STATUS_ERROR | 0x01)
66fcf3ce44SJohn Forte #define	STMF_ERROR_NOT_FOUND		(STMF_STATUS_ERROR | 0x02)
67fcf3ce44SJohn Forte #define	STMF_ERROR_MEMBER_NOT_FOUND	(STMF_STATUS_ERROR | 0x03)
68fcf3ce44SJohn Forte #define	STMF_ERROR_GROUP_NOT_FOUND	(STMF_STATUS_ERROR | 0x04)
69fcf3ce44SJohn Forte #define	STMF_ERROR_PERM			(STMF_STATUS_ERROR | 0x05)
70fcf3ce44SJohn Forte #define	STMF_ERROR_NOMEM		(STMF_STATUS_ERROR | 0x06)
71fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_ARG		(STMF_STATUS_ERROR | 0x07)
72fcf3ce44SJohn Forte #define	STMF_ERROR_EXISTS		(STMF_STATUS_ERROR | 0x08)
73fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_NOT_FOUND	(STMF_STATUS_ERROR | 0x09)
74fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_ONLINE	(STMF_STATUS_ERROR | 0x0a)
75fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_OFFLINE	(STMF_STATUS_ERROR | 0x0b)
76fcf3ce44SJohn Forte #define	STMF_ERROR_GROUP_IN_USE		(STMF_STATUS_ERROR | 0x0c)
77fcf3ce44SJohn Forte #define	STMF_ERROR_LUN_IN_USE		(STMF_STATUS_ERROR | 0x0d)
78fcf3ce44SJohn Forte #define	STMF_ERROR_VE_CONFLICT		(STMF_STATUS_ERROR | 0x0e)
79fcf3ce44SJohn Forte #define	STMF_ERROR_CONFIG_NONE		(STMF_STATUS_ERROR | 0x0f)
80fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_DATA_VERSION (STMF_STATUS_ERROR | 0x10)
81fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_HG		(STMF_STATUS_ERROR | 0x11)
82fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_TG		(STMF_STATUS_ERROR | 0x12)
83fcf3ce44SJohn Forte #define	STMF_ERROR_PROV_DATA_STALE	(STMF_STATUS_ERROR | 0x13)
848fe96085Stim szeto #define	STMF_ERROR_NO_PROP		(STMF_STATUS_ERROR | 0x14)
858fe96085Stim szeto #define	STMF_ERROR_NO_PROP_VAL		(STMF_STATUS_ERROR | 0x15)
868fe96085Stim szeto #define	STMF_ERROR_MISSING_PROP_VAL	(STMF_STATUS_ERROR | 0x16)
878fe96085Stim szeto #define	STMF_ERROR_INVALID_BLOCKSIZE	(STMF_STATUS_ERROR | 0x17)
888fe96085Stim szeto #define	STMF_ERROR_FILE_ALREADY		(STMF_STATUS_ERROR | 0x18)
898fe96085Stim szeto #define	STMF_ERROR_INVALID_PROPSIZE	(STMF_STATUS_ERROR | 0x19)
908fe96085Stim szeto #define	STMF_ERROR_INVALID_PROP		(STMF_STATUS_ERROR | 0x20)
918fe96085Stim szeto #define	STMF_ERROR_PERSIST_TYPE		(STMF_STATUS_ERROR | 0x21)
925c8cac22Stim szeto #define	STMF_ERROR_TG_ONLINE		(STMF_STATUS_ERROR | 0x22)
9345039663SJohn Forte #define	STMF_ERROR_ACCESS_STATE_SET	(STMF_STATUS_ERROR | 0x23)
9445039663SJohn Forte #define	STMF_ERROR_NO_PROP_STANDBY	(STMF_STATUS_ERROR | 0x24)
9545039663SJohn Forte #define	STMF_ERROR_POST_MSG_FAILED	(STMF_STATUS_ERROR | 0x25)
9645039663SJohn Forte #define	STMF_ERROR_DOOR_INSTALLED	(STMF_STATUS_ERROR | 0x26)
978fe96085Stim szeto 
988fe96085Stim szeto /* Failures for stmfCreateLu */
998fe96085Stim szeto #define	STMF_ERROR_FILE_IN_USE		(STMF_STATUS_ERROR | 0x100)
1008fe96085Stim szeto #define	STMF_ERROR_INVALID_BLKSIZE	(STMF_STATUS_ERROR | 0x101)
1018fe96085Stim szeto #define	STMF_ERROR_GUID_IN_USE		(STMF_STATUS_ERROR | 0x102)
1028fe96085Stim szeto #define	STMF_ERROR_META_FILE_NAME	(STMF_STATUS_ERROR | 0x103)
1038fe96085Stim szeto #define	STMF_ERROR_DATA_FILE_NAME	(STMF_STATUS_ERROR | 0x104)
1048fe96085Stim szeto #define	STMF_ERROR_SIZE_OUT_OF_RANGE	(STMF_STATUS_ERROR | 0x105)
1058fe96085Stim szeto #define	STMF_ERROR_LU_BUSY		(STMF_STATUS_ERROR | 0x106)
1068fe96085Stim szeto #define	STMF_ERROR_META_CREATION	(STMF_STATUS_ERROR | 0x107)
1078fe96085Stim szeto #define	STMF_ERROR_FILE_SIZE_INVALID	(STMF_STATUS_ERROR | 0x108)
1088fe96085Stim szeto #define	STMF_ERROR_WRITE_CACHE_SET	(STMF_STATUS_ERROR | 0x109)
109fcf3ce44SJohn Forte 
110fcf3ce44SJohn Forte /* Initiator Name Types */
111fcf3ce44SJohn Forte #define	STMF_FC_PORT_WWN	    1
112fcf3ce44SJohn Forte #define	STMF_ISCSI_NAME		    2
113fcf3ce44SJohn Forte 
114fcf3ce44SJohn Forte 
115fcf3ce44SJohn Forte /* provider types */
116fcf3ce44SJohn Forte #define	STMF_LU_PROVIDER_TYPE	1
117fcf3ce44SJohn Forte #define	STMF_PORT_PROVIDER_TYPE	2
118fcf3ce44SJohn Forte 
1198fe96085Stim szeto /* LU Resource types */
1208fe96085Stim szeto #define	STMF_DISK   0
1218fe96085Stim szeto 
1228fe96085Stim szeto /* Persistence methods */
1238fe96085Stim szeto #define	STMF_PERSIST_SMF	1
1248fe96085Stim szeto #define	STMF_PERSIST_NONE	2
1258fe96085Stim szeto 
12645039663SJohn Forte /* Logical unit access states */
12745039663SJohn Forte #define	STMF_ACCESS_ACTIVE		"0"
12845039663SJohn Forte #define	STMF_ACCESS_ACTIVE_TO_STANDBY   "1"
12945039663SJohn Forte #define	STMF_ACCESS_STANDBY		"2"
13045039663SJohn Forte #define	STMF_ACCESS_STANDBY_TO_ACTIVE	"3"
13145039663SJohn Forte 
1328fe96085Stim szeto /*
1338fe96085Stim szeto  * LU Disk Properties
1348fe96085Stim szeto  */
1358fe96085Stim szeto 
1368fe96085Stim szeto enum {
1378fe96085Stim szeto 	STMF_LU_PROP_ALIAS = 1,
1388fe96085Stim szeto 	STMF_LU_PROP_BLOCK_SIZE,
1398fe96085Stim szeto 	STMF_LU_PROP_COMPANY_ID,
1408fe96085Stim szeto 	STMF_LU_PROP_FILENAME,
1418fe96085Stim szeto 	STMF_LU_PROP_GUID,
1428fe96085Stim szeto 	STMF_LU_PROP_META_FILENAME,
1432f624233SNattuvetty Bhavyan 	STMF_LU_PROP_MGMT_URL,
1448fe96085Stim szeto 	STMF_LU_PROP_NEW,
1458fe96085Stim szeto 	STMF_LU_PROP_SIZE,
1468fe96085Stim szeto 	STMF_LU_PROP_WRITE_PROTECT,
1478fe96085Stim szeto 	STMF_LU_PROP_WRITE_CACHE_DISABLE,
1488fe96085Stim szeto 	STMF_LU_PROP_VID,
1498fe96085Stim szeto 	STMF_LU_PROP_PID,
15045039663SJohn Forte 	STMF_LU_PROP_SERIAL_NUM,
151fdcc480aSJohn Forte 	STMF_LU_PROP_ACCESS_STATE,
152fdcc480aSJohn Forte 	STMF_LU_PROP_HOST_ID
1538fe96085Stim szeto };
1548fe96085Stim szeto 
155fcf3ce44SJohn Forte 
156fcf3ce44SJohn Forte /* devid code set and name types */
157fcf3ce44SJohn Forte #define	EUI_64_TYPE	2
158fcf3ce44SJohn Forte #define	NAA_TYPE	3
159fcf3ce44SJohn Forte #define	SCSI_NAME_TYPE	8
160fcf3ce44SJohn Forte 
161fcf3ce44SJohn Forte #define	BINARY_CODE_SET	1
162fcf3ce44SJohn Forte #define	ASCII_CODE_SET	2
163fcf3ce44SJohn Forte #define	UTF_8_CODE_SET	3
164fcf3ce44SJohn Forte 
165fcf3ce44SJohn Forte typedef enum _stmfProtocol
166fcf3ce44SJohn Forte {
167fcf3ce44SJohn Forte 	STMF_PROTOCOL_FIBRE_CHANNEL =	0,
16845039663SJohn Forte 	STMF_PROTOCOL_SCSI =		1,
16945039663SJohn Forte 	STMF_PROTOCOL_SSA =		2,
17045039663SJohn Forte 	STMF_PROTOCOL_IEEE_1394 =	3,
17145039663SJohn Forte 	STMF_PROTOCOL_SRP =		4,
17245039663SJohn Forte 	STMF_PROTOCOL_ISCSI =		5,
17345039663SJohn Forte 	STMF_PROTOCOL_SAS =		6
174fcf3ce44SJohn Forte } stmfProtocol;
175fcf3ce44SJohn Forte 
176fcf3ce44SJohn Forte 
177fcf3ce44SJohn Forte typedef struct _stmfGuid
178fcf3ce44SJohn Forte {
179fcf3ce44SJohn Forte 	uchar_t	guid[16];
180fcf3ce44SJohn Forte } stmfGuid;
181fcf3ce44SJohn Forte 
182fcf3ce44SJohn Forte typedef struct _stmfGuidList
183fcf3ce44SJohn Forte {
184fcf3ce44SJohn Forte 	uint32_t cnt;
185fcf3ce44SJohn Forte 	stmfGuid guid[1];
186fcf3ce44SJohn Forte } stmfGuidList;
187fcf3ce44SJohn Forte 
188fcf3ce44SJohn Forte typedef struct _stmfState
189fcf3ce44SJohn Forte {
190fcf3ce44SJohn Forte 	int operationalState;
191fcf3ce44SJohn Forte 	int configState;
192fcf3ce44SJohn Forte } stmfState;
193fcf3ce44SJohn Forte 
194fcf3ce44SJohn Forte typedef struct _stmfDevid
195fcf3ce44SJohn Forte {
196fcf3ce44SJohn Forte 	uint8_t identLength;	/* length of ident */
197fcf3ce44SJohn Forte 	uint8_t	ident[STMF_IDENT_LENGTH]; /* SCSI name string ident */
198fcf3ce44SJohn Forte } stmfDevid;
199fcf3ce44SJohn Forte 
200fcf3ce44SJohn Forte typedef struct _stmfDevidList
201fcf3ce44SJohn Forte {
202fcf3ce44SJohn Forte 	uint32_t cnt;
203fcf3ce44SJohn Forte 	stmfDevid devid[1];
204fcf3ce44SJohn Forte } stmfDevidList;
205fcf3ce44SJohn Forte 
206fcf3ce44SJohn Forte typedef char stmfGroupName[256];
207fcf3ce44SJohn Forte typedef char stmfProviderName[256];
208fcf3ce44SJohn Forte 
209fcf3ce44SJohn Forte typedef struct _stmfGroupList
210fcf3ce44SJohn Forte {
211fcf3ce44SJohn Forte 	uint32_t cnt;
212fcf3ce44SJohn Forte 	stmfGroupName name[1];
213fcf3ce44SJohn Forte } stmfGroupList;
214fcf3ce44SJohn Forte 
215fcf3ce44SJohn Forte typedef struct _stmfProvider
216fcf3ce44SJohn Forte {
217fcf3ce44SJohn Forte 	int providerType;
218fcf3ce44SJohn Forte 	stmfProviderName name;
219fcf3ce44SJohn Forte } stmfProvider;
220fcf3ce44SJohn Forte 
221fcf3ce44SJohn Forte typedef struct _stmfProviderList
222fcf3ce44SJohn Forte {
223fcf3ce44SJohn Forte 	uint32_t cnt;
224fcf3ce44SJohn Forte 	stmfProvider provider[1];
225fcf3ce44SJohn Forte } stmfProviderList;
226fcf3ce44SJohn Forte 
227fcf3ce44SJohn Forte typedef struct _stmfSession
228fcf3ce44SJohn Forte {
229fcf3ce44SJohn Forte 	stmfDevid initiator;
230fcf3ce44SJohn Forte 	char alias[256];
231fcf3ce44SJohn Forte 	time_t creationTime;
232fcf3ce44SJohn Forte } stmfSession;
233fcf3ce44SJohn Forte 
234fcf3ce44SJohn Forte typedef struct _stmfSessionList
235fcf3ce44SJohn Forte {
236fcf3ce44SJohn Forte 	uint32_t cnt;
237fcf3ce44SJohn Forte 	stmfSession session[1];
238fcf3ce44SJohn Forte } stmfSessionList;
239fcf3ce44SJohn Forte 
240fcf3ce44SJohn Forte 
241fcf3ce44SJohn Forte typedef struct _stmfViewEntry
242fcf3ce44SJohn Forte {
243fcf3ce44SJohn Forte 	boolean_t	veIndexValid;	/* if B_TRUE, veIndex is valid value */
244fcf3ce44SJohn Forte 	uint32_t	veIndex;	/* View Entry index */
245fcf3ce44SJohn Forte 	boolean_t	allHosts;	/* all initiator ports */
246fcf3ce44SJohn Forte 	stmfGroupName   hostGroup;	/* Host Group Name */
247fcf3ce44SJohn Forte 	boolean_t	allTargets;	/* B_TRUE = targetGroup is invalid */
248fcf3ce44SJohn Forte 	stmfGroupName	targetGroup;	/* Target Group Name */
249fcf3ce44SJohn Forte 	boolean_t	luNbrValid;	/* if B_TRUE, luNbr is a valid value */
250fcf3ce44SJohn Forte 	uchar_t		luNbr[8];	/* LU number for this view entry */
251fcf3ce44SJohn Forte } stmfViewEntry;
252fcf3ce44SJohn Forte 
253fcf3ce44SJohn Forte typedef struct _stmfViewEntryList
254fcf3ce44SJohn Forte {
255fcf3ce44SJohn Forte 	uint32_t cnt;
256fcf3ce44SJohn Forte 	stmfViewEntry ve[1];
257fcf3ce44SJohn Forte } stmfViewEntryList;
258fcf3ce44SJohn Forte 
259fcf3ce44SJohn Forte typedef struct _stmfViewEntryProperties
260fcf3ce44SJohn Forte {
261fcf3ce44SJohn Forte 	stmfGuid	associatedLogicalUnitGuid;
262fcf3ce44SJohn Forte 	stmfViewEntry	viewEntry;
263fcf3ce44SJohn Forte } stmfViewEntryProperties;
264fcf3ce44SJohn Forte 
265fcf3ce44SJohn Forte typedef struct _stmfGroupProperties
266fcf3ce44SJohn Forte {
267fcf3ce44SJohn Forte 	uint32_t	cnt;
268fcf3ce44SJohn Forte 	stmfDevid	name[1];
269fcf3ce44SJohn Forte } stmfGroupProperties;
270fcf3ce44SJohn Forte 
271fcf3ce44SJohn Forte typedef struct _stmfTargetProperties
272fcf3ce44SJohn Forte {
273fcf3ce44SJohn Forte 	stmfProviderName providerName;
274fcf3ce44SJohn Forte 	char		 alias[256];
275fcf3ce44SJohn Forte 	uint16_t	 status;
276fcf3ce44SJohn Forte 	stmfProtocol	 protocol;
277fcf3ce44SJohn Forte 	stmfDevid	 devid;
278fcf3ce44SJohn Forte } stmfTargetProperties;
279fcf3ce44SJohn Forte 
280fcf3ce44SJohn Forte typedef struct _stmfLogicalUnitProperties
281fcf3ce44SJohn Forte {
282fcf3ce44SJohn Forte 	char	    alias[256];
283fcf3ce44SJohn Forte 	uchar_t	    vendor[8];
284fcf3ce44SJohn Forte 	uchar_t	    product[16];
285fcf3ce44SJohn Forte 	uchar_t	    revision[4];
286fcf3ce44SJohn Forte 	uint32_t    status;
287fcf3ce44SJohn Forte 	char	    providerName[256];
288fcf3ce44SJohn Forte 	stmfGuid    luid;
289fcf3ce44SJohn Forte } stmfLogicalUnitProperties;
290fcf3ce44SJohn Forte 
2918fe96085Stim szeto typedef void * luResource;
2928fe96085Stim szeto 
293fcf3ce44SJohn Forte typedef struct _stmfLogicalUnitProviderProperties
294fcf3ce44SJohn Forte {
295fcf3ce44SJohn Forte 	char	    providerName[MAXPATHLEN];
296fcf3ce44SJohn Forte 	uint32_t    instance;
297fcf3ce44SJohn Forte 	uint32_t    status;
298fcf3ce44SJohn Forte 	uchar_t	    rsvd[64];
299fcf3ce44SJohn Forte } stmfLogicalUnitProviderProperties;
300fcf3ce44SJohn Forte 
301fcf3ce44SJohn Forte typedef struct _stmfLocalPortProviderProperties
302fcf3ce44SJohn Forte {
303fcf3ce44SJohn Forte 	char	    providerName[MAXPATHLEN];
304fcf3ce44SJohn Forte 	uint32_t    instance;
305fcf3ce44SJohn Forte 	uint32_t    status;
306fcf3ce44SJohn Forte 	uchar_t	    rsvd[64];
307fcf3ce44SJohn Forte } stmfLocalPortProviderProperties;
308fcf3ce44SJohn Forte 
309fcf3ce44SJohn Forte /* API prototypes */
310fcf3ce44SJohn Forte int stmfAddToHostGroup(stmfGroupName *hostGroupName, stmfDevid *name);
311fcf3ce44SJohn Forte int stmfAddToTargetGroup(stmfGroupName *targetGroupName, stmfDevid *targetName);
312fcf3ce44SJohn Forte int stmfAddViewEntry(stmfGuid *lu, stmfViewEntry *viewEntry);
313fcf3ce44SJohn Forte int stmfClearProviderData(char *providerName, int providerType);
314fcf3ce44SJohn Forte int stmfCreateHostGroup(stmfGroupName *hostGroupName);
3158fe96085Stim szeto int stmfCreateLu(luResource hdl, stmfGuid *luGuid);
3168fe96085Stim szeto int stmfCreateLuResource(uint16_t dType, luResource *hdl);
317fcf3ce44SJohn Forte int stmfCreateTargetGroup(stmfGroupName *targetGroupName);
318fcf3ce44SJohn Forte int stmfDeleteHostGroup(stmfGroupName *hostGroupName);
3198fe96085Stim szeto int stmfDeleteLu(stmfGuid *luGuid);
320fcf3ce44SJohn Forte int stmfDeleteTargetGroup(stmfGroupName *targetGroupName);
32145039663SJohn Forte void stmfDestroyProxyDoor(int hdl);
322fcf3ce44SJohn Forte int stmfDevidFromIscsiName(char *iscsiName, stmfDevid *devid);
323fcf3ce44SJohn Forte int stmfDevidFromWwn(uchar_t wwn[8], stmfDevid *devid);
3248fe96085Stim szeto int stmfFreeLuResource(luResource hdl);
325fcf3ce44SJohn Forte void stmfFreeMemory(void *);
32645039663SJohn Forte int stmfGetAluaState(boolean_t *enabled, uint32_t *node);
3277beff157SJohn Forte int stmfGetGlobalLuProp(uint16_t dType, uint32_t prop, char *propVal,
3287beff157SJohn Forte     size_t *propLen);
329fcf3ce44SJohn Forte int stmfGetHostGroupList(stmfGroupList **initiatorGroupList);
330fcf3ce44SJohn Forte int stmfGetHostGroupMembers(stmfGroupName *hostGroupName,
331fcf3ce44SJohn Forte     stmfGroupProperties **groupProperties);
332fcf3ce44SJohn Forte int stmfGetLocalPortProviderList(stmfProviderList **localPortProviderList);
333fcf3ce44SJohn Forte int stmfGetLocalPortProviderProperties(stmfProviderName *providerName,
334fcf3ce44SJohn Forte     stmfLocalPortProviderProperties *providerProperties);
335fcf3ce44SJohn Forte int stmfGetLogicalUnitList(stmfGuidList **logicalUnitList);
336fcf3ce44SJohn Forte int stmfGetLogicalUnitProperties(stmfGuid *logicalUnit,
337fcf3ce44SJohn Forte     stmfLogicalUnitProperties *logicalUnitProps);
338fcf3ce44SJohn Forte int stmfGetLogicalUnitProviderList(stmfProviderList **logicalUnitProviderList);
339fcf3ce44SJohn Forte int stmfGetLogicalUnitProviderProperties(stmfProviderName *providerName,
340fcf3ce44SJohn Forte     stmfLogicalUnitProviderProperties *providerProperties);
3418fe96085Stim szeto int stmfGetLuProp(luResource hdl, uint32_t propType, char *prop,
3428fe96085Stim szeto     size_t *propLen);
3438fe96085Stim szeto int stmfGetLuResource(stmfGuid *luGuid, luResource *hdl);
3448fe96085Stim szeto int stmfGetPersistMethod(uint8_t *persistType, boolean_t serviceState);
345fcf3ce44SJohn Forte int stmfGetProviderData(char *providerName, nvlist_t **nvl, int providerType);
346fcf3ce44SJohn Forte int stmfGetProviderDataProt(char *providerName, nvlist_t **nvl,
347fcf3ce44SJohn Forte     int providerType, uint64_t *setToken);
348fcf3ce44SJohn Forte int stmfGetSessionList(stmfDevid *target, stmfSessionList **sessionList);
349fcf3ce44SJohn Forte int stmfGetState(stmfState *);
350fcf3ce44SJohn Forte int stmfGetTargetGroupList(stmfGroupList **targetGroupList);
351fcf3ce44SJohn Forte int stmfGetTargetGroupMembers(stmfGroupName *targetGroupName,
352fcf3ce44SJohn Forte     stmfGroupProperties **groupProperties);
353fcf3ce44SJohn Forte int stmfGetTargetList(stmfDevidList **targetList);
354fcf3ce44SJohn Forte int stmfGetTargetProperties(stmfDevid *target,
355fcf3ce44SJohn Forte     stmfTargetProperties *targetProps);
356fcf3ce44SJohn Forte int stmfGetViewEntryList(stmfGuid *lu, stmfViewEntryList **viewEntryList);
3578fe96085Stim szeto int stmfImportLu(uint16_t dType, char *fname, stmfGuid *luGuid);
35845039663SJohn Forte int stmfInitProxyDoor(int *hdl, int fd);
359fcf3ce44SJohn Forte int stmfLoadConfig(void);
36045039663SJohn Forte int stmfLuStandby(stmfGuid *luGuid);
3618fe96085Stim szeto int stmfModifyLu(stmfGuid *luGuid, uint32_t prop, const char *propVal);
3628fe96085Stim szeto int stmfModifyLuByFname(uint16_t dType, const char *fname, uint32_t prop,
3638fe96085Stim szeto     const char *propVal);
364fcf3ce44SJohn Forte int stmfOffline(void);
365fcf3ce44SJohn Forte int stmfOfflineTarget(stmfDevid *devid);
366fcf3ce44SJohn Forte int stmfOfflineLogicalUnit(stmfGuid *logicalUnit);
367fcf3ce44SJohn Forte int stmfOnline(void);
368fcf3ce44SJohn Forte int stmfOnlineTarget(stmfDevid *devid);
369fcf3ce44SJohn Forte int stmfOnlineLogicalUnit(stmfGuid *logicalUnit);
37045039663SJohn Forte int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen);
371fcf3ce44SJohn Forte int stmfRemoveFromHostGroup(stmfGroupName *hostGroupName,
372fcf3ce44SJohn Forte     stmfDevid *initiatorName);
373fcf3ce44SJohn Forte int stmfRemoveFromTargetGroup(stmfGroupName *targetGroupName,
374fcf3ce44SJohn Forte     stmfDevid *targetName);
375fcf3ce44SJohn Forte int stmfRemoveViewEntry(stmfGuid *lu, uint32_t viewEntryIndex);
37645039663SJohn Forte int stmfSetAluaState(boolean_t enabled, uint32_t node);
3777beff157SJohn Forte int stmfSetGlobalLuProp(uint16_t dType, uint32_t propType, const char *propVal);
3788fe96085Stim szeto int stmfSetLuProp(luResource hdl, uint32_t propType, const char *propVal);
3798fe96085Stim szeto int stmfSetPersistMethod(uint8_t persistType, boolean_t serviceSet);
380fcf3ce44SJohn Forte int stmfSetProviderData(char *providerName, nvlist_t *nvl, int providerType);
381fcf3ce44SJohn Forte int stmfSetProviderDataProt(char *providerName, nvlist_t *nvl,
382fcf3ce44SJohn Forte     int providerType, uint64_t *setToken);
38363ed874aStim szeto int stmfValidateView(stmfViewEntry *viewEntry);
384*4b31676fSsrivijitha dugganapalli int stmfSetStmfProp(uint8_t propType, char *propVal);
385*4b31676fSsrivijitha dugganapalli int stmfGetStmfProp(uint8_t propType, char *propVal, size_t *propLen);
386*4b31676fSsrivijitha dugganapalli int stmfLoadStmfProps(void);
387fcf3ce44SJohn Forte 
388fcf3ce44SJohn Forte #ifdef	__cplusplus
389fcf3ce44SJohn Forte }
390fcf3ce44SJohn Forte #endif
391fcf3ce44SJohn Forte 
392fcf3ce44SJohn Forte #endif	/* _LIBSTMF_H */
393