xref: /titanic_52/usr/src/lib/libstmf/common/libstmf.h (revision 450396635f70344c58b6b1e4db38cf17ff34445c)
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 /*
228fe96085Stim szeto  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23fcf3ce44SJohn Forte  * Use is subject to license terms.
24fcf3ce44SJohn Forte  */
25fcf3ce44SJohn Forte 
26fcf3ce44SJohn Forte #ifndef	_LIBSTMF_H
27fcf3ce44SJohn Forte #define	_LIBSTMF_H
28fcf3ce44SJohn Forte 
29fcf3ce44SJohn Forte #include <time.h>
30fcf3ce44SJohn Forte #include <sys/param.h>
31fcf3ce44SJohn Forte #include <libnvpair.h>
32fcf3ce44SJohn Forte 
33fcf3ce44SJohn Forte #ifdef	__cplusplus
34fcf3ce44SJohn Forte extern "C" {
35fcf3ce44SJohn Forte #endif
36fcf3ce44SJohn Forte 
37fcf3ce44SJohn Forte /* Constants and Types */
38fcf3ce44SJohn Forte 
39fcf3ce44SJohn Forte /* LU and Local Port states */
40fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_OFFLINE	0
41fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_OFFLINING	1
42fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_ONLINE	2
43fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_ONLINING	3
44fcf3ce44SJohn Forte #define	STMF_LOGICAL_UNIT_UNREGISTERED	4
45fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_OFFLINE	5
46fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_OFFLINING	6
47fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_ONLINE		7
48fcf3ce44SJohn Forte #define	STMF_TARGET_PORT_ONLINING	8
49fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_ONLINE	9
50fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_OFFLINE	10
51fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_ONLINING	11
52fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_OFFLINING	12
53fcf3ce44SJohn Forte #define	STMF_SERVICE_STATE_UNKNOWN	13
54fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_NONE		14
55fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_INIT		15
56fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_INIT_DONE	16
57fcf3ce44SJohn Forte #define	STMF_CONFIG_STATE_UNKNOWN	17
58fcf3ce44SJohn Forte 
59fcf3ce44SJohn Forte #define	STMF_IDENT_LENGTH   255
60fcf3ce44SJohn Forte 
61fcf3ce44SJohn Forte /* API status return values */
62fcf3ce44SJohn Forte #define	STMF_STATUS_SUCCESS	    0x0000
63fcf3ce44SJohn Forte #define	STMF_STATUS_ERROR	    0x8000
64fcf3ce44SJohn Forte #define	STMF_ERROR_BUSY			(STMF_STATUS_ERROR | 0x01)
65fcf3ce44SJohn Forte #define	STMF_ERROR_NOT_FOUND		(STMF_STATUS_ERROR | 0x02)
66fcf3ce44SJohn Forte #define	STMF_ERROR_MEMBER_NOT_FOUND	(STMF_STATUS_ERROR | 0x03)
67fcf3ce44SJohn Forte #define	STMF_ERROR_GROUP_NOT_FOUND	(STMF_STATUS_ERROR | 0x04)
68fcf3ce44SJohn Forte #define	STMF_ERROR_PERM			(STMF_STATUS_ERROR | 0x05)
69fcf3ce44SJohn Forte #define	STMF_ERROR_NOMEM		(STMF_STATUS_ERROR | 0x06)
70fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_ARG		(STMF_STATUS_ERROR | 0x07)
71fcf3ce44SJohn Forte #define	STMF_ERROR_EXISTS		(STMF_STATUS_ERROR | 0x08)
72fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_NOT_FOUND	(STMF_STATUS_ERROR | 0x09)
73fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_ONLINE	(STMF_STATUS_ERROR | 0x0a)
74fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_OFFLINE	(STMF_STATUS_ERROR | 0x0b)
75fcf3ce44SJohn Forte #define	STMF_ERROR_GROUP_IN_USE		(STMF_STATUS_ERROR | 0x0c)
76fcf3ce44SJohn Forte #define	STMF_ERROR_LUN_IN_USE		(STMF_STATUS_ERROR | 0x0d)
77fcf3ce44SJohn Forte #define	STMF_ERROR_VE_CONFLICT		(STMF_STATUS_ERROR | 0x0e)
78fcf3ce44SJohn Forte #define	STMF_ERROR_CONFIG_NONE		(STMF_STATUS_ERROR | 0x0f)
79fcf3ce44SJohn Forte #define	STMF_ERROR_SERVICE_DATA_VERSION (STMF_STATUS_ERROR | 0x10)
80fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_HG		(STMF_STATUS_ERROR | 0x11)
81fcf3ce44SJohn Forte #define	STMF_ERROR_INVALID_TG		(STMF_STATUS_ERROR | 0x12)
82fcf3ce44SJohn Forte #define	STMF_ERROR_PROV_DATA_STALE	(STMF_STATUS_ERROR | 0x13)
838fe96085Stim szeto #define	STMF_ERROR_NO_PROP		(STMF_STATUS_ERROR | 0x14)
848fe96085Stim szeto #define	STMF_ERROR_NO_PROP_VAL		(STMF_STATUS_ERROR | 0x15)
858fe96085Stim szeto #define	STMF_ERROR_MISSING_PROP_VAL	(STMF_STATUS_ERROR | 0x16)
868fe96085Stim szeto #define	STMF_ERROR_INVALID_BLOCKSIZE	(STMF_STATUS_ERROR | 0x17)
878fe96085Stim szeto #define	STMF_ERROR_FILE_ALREADY		(STMF_STATUS_ERROR | 0x18)
888fe96085Stim szeto #define	STMF_ERROR_INVALID_PROPSIZE	(STMF_STATUS_ERROR | 0x19)
898fe96085Stim szeto #define	STMF_ERROR_INVALID_PROP		(STMF_STATUS_ERROR | 0x20)
908fe96085Stim szeto #define	STMF_ERROR_PERSIST_TYPE		(STMF_STATUS_ERROR | 0x21)
915c8cac22Stim szeto #define	STMF_ERROR_TG_ONLINE		(STMF_STATUS_ERROR | 0x22)
92*45039663SJohn Forte #define	STMF_ERROR_ACCESS_STATE_SET	(STMF_STATUS_ERROR | 0x23)
93*45039663SJohn Forte #define	STMF_ERROR_NO_PROP_STANDBY	(STMF_STATUS_ERROR | 0x24)
94*45039663SJohn Forte #define	STMF_ERROR_POST_MSG_FAILED	(STMF_STATUS_ERROR | 0x25)
95*45039663SJohn Forte #define	STMF_ERROR_DOOR_INSTALLED	(STMF_STATUS_ERROR | 0x26)
968fe96085Stim szeto 
978fe96085Stim szeto /* Failures for stmfCreateLu */
988fe96085Stim szeto #define	STMF_ERROR_FILE_IN_USE		(STMF_STATUS_ERROR | 0x100)
998fe96085Stim szeto #define	STMF_ERROR_INVALID_BLKSIZE	(STMF_STATUS_ERROR | 0x101)
1008fe96085Stim szeto #define	STMF_ERROR_GUID_IN_USE		(STMF_STATUS_ERROR | 0x102)
1018fe96085Stim szeto #define	STMF_ERROR_META_FILE_NAME	(STMF_STATUS_ERROR | 0x103)
1028fe96085Stim szeto #define	STMF_ERROR_DATA_FILE_NAME	(STMF_STATUS_ERROR | 0x104)
1038fe96085Stim szeto #define	STMF_ERROR_SIZE_OUT_OF_RANGE	(STMF_STATUS_ERROR | 0x105)
1048fe96085Stim szeto #define	STMF_ERROR_LU_BUSY		(STMF_STATUS_ERROR | 0x106)
1058fe96085Stim szeto #define	STMF_ERROR_META_CREATION	(STMF_STATUS_ERROR | 0x107)
1068fe96085Stim szeto #define	STMF_ERROR_FILE_SIZE_INVALID	(STMF_STATUS_ERROR | 0x108)
1078fe96085Stim szeto #define	STMF_ERROR_WRITE_CACHE_SET	(STMF_STATUS_ERROR | 0x109)
108fcf3ce44SJohn Forte 
109fcf3ce44SJohn Forte /* Initiator Name Types */
110fcf3ce44SJohn Forte #define	STMF_FC_PORT_WWN	    1
111fcf3ce44SJohn Forte #define	STMF_ISCSI_NAME		    2
112fcf3ce44SJohn Forte 
113fcf3ce44SJohn Forte 
114fcf3ce44SJohn Forte /* provider types */
115fcf3ce44SJohn Forte #define	STMF_LU_PROVIDER_TYPE	1
116fcf3ce44SJohn Forte #define	STMF_PORT_PROVIDER_TYPE	2
117fcf3ce44SJohn Forte 
1188fe96085Stim szeto /* LU Resource types */
1198fe96085Stim szeto #define	STMF_DISK   0
1208fe96085Stim szeto 
1218fe96085Stim szeto /* Persistence methods */
1228fe96085Stim szeto #define	STMF_PERSIST_SMF	1
1238fe96085Stim szeto #define	STMF_PERSIST_NONE	2
1248fe96085Stim szeto 
125*45039663SJohn Forte /* Logical unit access states */
126*45039663SJohn Forte #define	STMF_ACCESS_ACTIVE		"0"
127*45039663SJohn Forte #define	STMF_ACCESS_ACTIVE_TO_STANDBY   "1"
128*45039663SJohn Forte #define	STMF_ACCESS_STANDBY		"2"
129*45039663SJohn Forte #define	STMF_ACCESS_STANDBY_TO_ACTIVE	"3"
130*45039663SJohn Forte 
1318fe96085Stim szeto /*
1328fe96085Stim szeto  * LU Disk Properties
1338fe96085Stim szeto  */
1348fe96085Stim szeto 
1358fe96085Stim szeto enum {
1368fe96085Stim szeto 	STMF_LU_PROP_ALIAS = 1,
1378fe96085Stim szeto 	STMF_LU_PROP_BLOCK_SIZE,
1388fe96085Stim szeto 	STMF_LU_PROP_COMPANY_ID,
1398fe96085Stim szeto 	STMF_LU_PROP_FILENAME,
1408fe96085Stim szeto 	STMF_LU_PROP_GUID,
1418fe96085Stim szeto 	STMF_LU_PROP_META_FILENAME,
1422f624233SNattuvetty Bhavyan 	STMF_LU_PROP_MGMT_URL,
1438fe96085Stim szeto 	STMF_LU_PROP_NEW,
1448fe96085Stim szeto 	STMF_LU_PROP_SIZE,
1458fe96085Stim szeto 	STMF_LU_PROP_WRITE_PROTECT,
1468fe96085Stim szeto 	STMF_LU_PROP_WRITE_CACHE_DISABLE,
1478fe96085Stim szeto 	STMF_LU_PROP_VID,
1488fe96085Stim szeto 	STMF_LU_PROP_PID,
149*45039663SJohn Forte 	STMF_LU_PROP_SERIAL_NUM,
150*45039663SJohn Forte 	STMF_LU_PROP_ACCESS_STATE
1518fe96085Stim szeto };
1528fe96085Stim szeto 
153fcf3ce44SJohn Forte 
154fcf3ce44SJohn Forte /* devid code set and name types */
155fcf3ce44SJohn Forte #define	EUI_64_TYPE	2
156fcf3ce44SJohn Forte #define	NAA_TYPE	3
157fcf3ce44SJohn Forte #define	SCSI_NAME_TYPE	8
158fcf3ce44SJohn Forte 
159fcf3ce44SJohn Forte #define	BINARY_CODE_SET	1
160fcf3ce44SJohn Forte #define	ASCII_CODE_SET	2
161fcf3ce44SJohn Forte #define	UTF_8_CODE_SET	3
162fcf3ce44SJohn Forte 
163fcf3ce44SJohn Forte typedef enum _stmfProtocol
164fcf3ce44SJohn Forte {
165fcf3ce44SJohn Forte 	STMF_PROTOCOL_FIBRE_CHANNEL =	0,
166*45039663SJohn Forte 	STMF_PROTOCOL_SCSI =		1,
167*45039663SJohn Forte 	STMF_PROTOCOL_SSA =		2,
168*45039663SJohn Forte 	STMF_PROTOCOL_IEEE_1394 =	3,
169*45039663SJohn Forte 	STMF_PROTOCOL_SRP =		4,
170*45039663SJohn Forte 	STMF_PROTOCOL_ISCSI =		5,
171*45039663SJohn Forte 	STMF_PROTOCOL_SAS =		6
172fcf3ce44SJohn Forte } stmfProtocol;
173fcf3ce44SJohn Forte 
174fcf3ce44SJohn Forte 
175fcf3ce44SJohn Forte typedef struct _stmfGuid
176fcf3ce44SJohn Forte {
177fcf3ce44SJohn Forte 	uchar_t	guid[16];
178fcf3ce44SJohn Forte } stmfGuid;
179fcf3ce44SJohn Forte 
180fcf3ce44SJohn Forte typedef struct _stmfGuidList
181fcf3ce44SJohn Forte {
182fcf3ce44SJohn Forte 	uint32_t cnt;
183fcf3ce44SJohn Forte 	stmfGuid guid[1];
184fcf3ce44SJohn Forte } stmfGuidList;
185fcf3ce44SJohn Forte 
186fcf3ce44SJohn Forte typedef struct _stmfState
187fcf3ce44SJohn Forte {
188fcf3ce44SJohn Forte 	int operationalState;
189fcf3ce44SJohn Forte 	int configState;
190fcf3ce44SJohn Forte } stmfState;
191fcf3ce44SJohn Forte 
192fcf3ce44SJohn Forte typedef struct _stmfDevid
193fcf3ce44SJohn Forte {
194fcf3ce44SJohn Forte 	uint8_t identLength;	/* length of ident */
195fcf3ce44SJohn Forte 	uint8_t	ident[STMF_IDENT_LENGTH]; /* SCSI name string ident */
196fcf3ce44SJohn Forte } stmfDevid;
197fcf3ce44SJohn Forte 
198fcf3ce44SJohn Forte typedef struct _stmfDevidList
199fcf3ce44SJohn Forte {
200fcf3ce44SJohn Forte 	uint32_t cnt;
201fcf3ce44SJohn Forte 	stmfDevid devid[1];
202fcf3ce44SJohn Forte } stmfDevidList;
203fcf3ce44SJohn Forte 
204fcf3ce44SJohn Forte typedef char stmfGroupName[256];
205fcf3ce44SJohn Forte typedef char stmfProviderName[256];
206fcf3ce44SJohn Forte 
207fcf3ce44SJohn Forte typedef struct _stmfGroupList
208fcf3ce44SJohn Forte {
209fcf3ce44SJohn Forte 	uint32_t cnt;
210fcf3ce44SJohn Forte 	stmfGroupName name[1];
211fcf3ce44SJohn Forte } stmfGroupList;
212fcf3ce44SJohn Forte 
213fcf3ce44SJohn Forte typedef struct _stmfProvider
214fcf3ce44SJohn Forte {
215fcf3ce44SJohn Forte 	int providerType;
216fcf3ce44SJohn Forte 	stmfProviderName name;
217fcf3ce44SJohn Forte } stmfProvider;
218fcf3ce44SJohn Forte 
219fcf3ce44SJohn Forte typedef struct _stmfProviderList
220fcf3ce44SJohn Forte {
221fcf3ce44SJohn Forte 	uint32_t cnt;
222fcf3ce44SJohn Forte 	stmfProvider provider[1];
223fcf3ce44SJohn Forte } stmfProviderList;
224fcf3ce44SJohn Forte 
225fcf3ce44SJohn Forte typedef struct _stmfSession
226fcf3ce44SJohn Forte {
227fcf3ce44SJohn Forte 	stmfDevid initiator;
228fcf3ce44SJohn Forte 	char alias[256];
229fcf3ce44SJohn Forte 	time_t creationTime;
230fcf3ce44SJohn Forte } stmfSession;
231fcf3ce44SJohn Forte 
232fcf3ce44SJohn Forte typedef struct _stmfSessionList
233fcf3ce44SJohn Forte {
234fcf3ce44SJohn Forte 	uint32_t cnt;
235fcf3ce44SJohn Forte 	stmfSession session[1];
236fcf3ce44SJohn Forte } stmfSessionList;
237fcf3ce44SJohn Forte 
238fcf3ce44SJohn Forte 
239fcf3ce44SJohn Forte typedef struct _stmfViewEntry
240fcf3ce44SJohn Forte {
241fcf3ce44SJohn Forte 	boolean_t	veIndexValid;	/* if B_TRUE, veIndex is valid value */
242fcf3ce44SJohn Forte 	uint32_t	veIndex;	/* View Entry index */
243fcf3ce44SJohn Forte 	boolean_t	allHosts;	/* all initiator ports */
244fcf3ce44SJohn Forte 	stmfGroupName   hostGroup;	/* Host Group Name */
245fcf3ce44SJohn Forte 	boolean_t	allTargets;	/* B_TRUE = targetGroup is invalid */
246fcf3ce44SJohn Forte 	stmfGroupName	targetGroup;	/* Target Group Name */
247fcf3ce44SJohn Forte 	boolean_t	luNbrValid;	/* if B_TRUE, luNbr is a valid value */
248fcf3ce44SJohn Forte 	uchar_t		luNbr[8];	/* LU number for this view entry */
249fcf3ce44SJohn Forte } stmfViewEntry;
250fcf3ce44SJohn Forte 
251fcf3ce44SJohn Forte typedef struct _stmfViewEntryList
252fcf3ce44SJohn Forte {
253fcf3ce44SJohn Forte 	uint32_t cnt;
254fcf3ce44SJohn Forte 	stmfViewEntry ve[1];
255fcf3ce44SJohn Forte } stmfViewEntryList;
256fcf3ce44SJohn Forte 
257fcf3ce44SJohn Forte typedef struct _stmfViewEntryProperties
258fcf3ce44SJohn Forte {
259fcf3ce44SJohn Forte 	stmfGuid	associatedLogicalUnitGuid;
260fcf3ce44SJohn Forte 	stmfViewEntry	viewEntry;
261fcf3ce44SJohn Forte } stmfViewEntryProperties;
262fcf3ce44SJohn Forte 
263fcf3ce44SJohn Forte typedef struct _stmfGroupProperties
264fcf3ce44SJohn Forte {
265fcf3ce44SJohn Forte 	uint32_t	cnt;
266fcf3ce44SJohn Forte 	stmfDevid	name[1];
267fcf3ce44SJohn Forte } stmfGroupProperties;
268fcf3ce44SJohn Forte 
269fcf3ce44SJohn Forte typedef struct _stmfTargetProperties
270fcf3ce44SJohn Forte {
271fcf3ce44SJohn Forte 	stmfProviderName providerName;
272fcf3ce44SJohn Forte 	char		 alias[256];
273fcf3ce44SJohn Forte 	uint16_t	 status;
274fcf3ce44SJohn Forte 	stmfProtocol	 protocol;
275fcf3ce44SJohn Forte 	stmfDevid	 devid;
276fcf3ce44SJohn Forte } stmfTargetProperties;
277fcf3ce44SJohn Forte 
278fcf3ce44SJohn Forte typedef struct _stmfLogicalUnitProperties
279fcf3ce44SJohn Forte {
280fcf3ce44SJohn Forte 	char	    alias[256];
281fcf3ce44SJohn Forte 	uchar_t	    vendor[8];
282fcf3ce44SJohn Forte 	uchar_t	    product[16];
283fcf3ce44SJohn Forte 	uchar_t	    revision[4];
284fcf3ce44SJohn Forte 	uint32_t    status;
285fcf3ce44SJohn Forte 	char	    providerName[256];
286fcf3ce44SJohn Forte 	stmfGuid    luid;
287fcf3ce44SJohn Forte } stmfLogicalUnitProperties;
288fcf3ce44SJohn Forte 
2898fe96085Stim szeto typedef void * luResource;
2908fe96085Stim szeto 
291fcf3ce44SJohn Forte typedef struct _stmfLogicalUnitProviderProperties
292fcf3ce44SJohn Forte {
293fcf3ce44SJohn Forte 	char	    providerName[MAXPATHLEN];
294fcf3ce44SJohn Forte 	uint32_t    instance;
295fcf3ce44SJohn Forte 	uint32_t    status;
296fcf3ce44SJohn Forte 	uchar_t	    rsvd[64];
297fcf3ce44SJohn Forte } stmfLogicalUnitProviderProperties;
298fcf3ce44SJohn Forte 
299fcf3ce44SJohn Forte typedef struct _stmfLocalPortProviderProperties
300fcf3ce44SJohn Forte {
301fcf3ce44SJohn Forte 	char	    providerName[MAXPATHLEN];
302fcf3ce44SJohn Forte 	uint32_t    instance;
303fcf3ce44SJohn Forte 	uint32_t    status;
304fcf3ce44SJohn Forte 	uchar_t	    rsvd[64];
305fcf3ce44SJohn Forte } stmfLocalPortProviderProperties;
306fcf3ce44SJohn Forte 
307fcf3ce44SJohn Forte /* API prototypes */
308fcf3ce44SJohn Forte int stmfAddToHostGroup(stmfGroupName *hostGroupName, stmfDevid *name);
309fcf3ce44SJohn Forte int stmfAddToTargetGroup(stmfGroupName *targetGroupName, stmfDevid *targetName);
310fcf3ce44SJohn Forte int stmfAddViewEntry(stmfGuid *lu, stmfViewEntry *viewEntry);
311fcf3ce44SJohn Forte int stmfClearProviderData(char *providerName, int providerType);
312fcf3ce44SJohn Forte int stmfCreateHostGroup(stmfGroupName *hostGroupName);
3138fe96085Stim szeto int stmfCreateLu(luResource hdl, stmfGuid *luGuid);
3148fe96085Stim szeto int stmfCreateLuResource(uint16_t dType, luResource *hdl);
315fcf3ce44SJohn Forte int stmfCreateTargetGroup(stmfGroupName *targetGroupName);
316fcf3ce44SJohn Forte int stmfDeleteHostGroup(stmfGroupName *hostGroupName);
3178fe96085Stim szeto int stmfDeleteLu(stmfGuid *luGuid);
318fcf3ce44SJohn Forte int stmfDeleteTargetGroup(stmfGroupName *targetGroupName);
319*45039663SJohn Forte void stmfDestroyProxyDoor(int hdl);
320fcf3ce44SJohn Forte int stmfDevidFromIscsiName(char *iscsiName, stmfDevid *devid);
321fcf3ce44SJohn Forte int stmfDevidFromWwn(uchar_t wwn[8], stmfDevid *devid);
3228fe96085Stim szeto int stmfFreeLuResource(luResource hdl);
323fcf3ce44SJohn Forte void stmfFreeMemory(void *);
324*45039663SJohn Forte int stmfGetAluaState(boolean_t *enabled, uint32_t *node);
325fcf3ce44SJohn Forte int stmfGetHostGroupList(stmfGroupList **initiatorGroupList);
326fcf3ce44SJohn Forte int stmfGetHostGroupMembers(stmfGroupName *hostGroupName,
327fcf3ce44SJohn Forte     stmfGroupProperties **groupProperties);
328fcf3ce44SJohn Forte int stmfGetLocalPortProviderList(stmfProviderList **localPortProviderList);
329fcf3ce44SJohn Forte int stmfGetLocalPortProviderProperties(stmfProviderName *providerName,
330fcf3ce44SJohn Forte     stmfLocalPortProviderProperties *providerProperties);
331fcf3ce44SJohn Forte int stmfGetLogicalUnitList(stmfGuidList **logicalUnitList);
332fcf3ce44SJohn Forte int stmfGetLogicalUnitProperties(stmfGuid *logicalUnit,
333fcf3ce44SJohn Forte     stmfLogicalUnitProperties *logicalUnitProps);
334fcf3ce44SJohn Forte int stmfGetLogicalUnitProviderList(stmfProviderList **logicalUnitProviderList);
335fcf3ce44SJohn Forte int stmfGetLogicalUnitProviderProperties(stmfProviderName *providerName,
336fcf3ce44SJohn Forte     stmfLogicalUnitProviderProperties *providerProperties);
3378fe96085Stim szeto int stmfGetLuProp(luResource hdl, uint32_t propType, char *prop,
3388fe96085Stim szeto     size_t *propLen);
3398fe96085Stim szeto int stmfGetLuResource(stmfGuid *luGuid, luResource *hdl);
3408fe96085Stim szeto int stmfGetPersistMethod(uint8_t *persistType, boolean_t serviceState);
341fcf3ce44SJohn Forte int stmfGetProviderData(char *providerName, nvlist_t **nvl, int providerType);
342fcf3ce44SJohn Forte int stmfGetProviderDataProt(char *providerName, nvlist_t **nvl,
343fcf3ce44SJohn Forte     int providerType, uint64_t *setToken);
344fcf3ce44SJohn Forte int stmfGetSessionList(stmfDevid *target, stmfSessionList **sessionList);
345fcf3ce44SJohn Forte int stmfGetState(stmfState *);
346fcf3ce44SJohn Forte int stmfGetTargetGroupList(stmfGroupList **targetGroupList);
347fcf3ce44SJohn Forte int stmfGetTargetGroupMembers(stmfGroupName *targetGroupName,
348fcf3ce44SJohn Forte     stmfGroupProperties **groupProperties);
349fcf3ce44SJohn Forte int stmfGetTargetList(stmfDevidList **targetList);
350fcf3ce44SJohn Forte int stmfGetTargetProperties(stmfDevid *target,
351fcf3ce44SJohn Forte     stmfTargetProperties *targetProps);
352fcf3ce44SJohn Forte int stmfGetViewEntryList(stmfGuid *lu, stmfViewEntryList **viewEntryList);
3538fe96085Stim szeto int stmfImportLu(uint16_t dType, char *fname, stmfGuid *luGuid);
354*45039663SJohn Forte int stmfInitProxyDoor(int *hdl, int fd);
355fcf3ce44SJohn Forte int stmfLoadConfig(void);
356*45039663SJohn Forte int stmfLuStandby(stmfGuid *luGuid);
3578fe96085Stim szeto int stmfModifyLu(stmfGuid *luGuid, uint32_t prop, const char *propVal);
3588fe96085Stim szeto int stmfModifyLuByFname(uint16_t dType, const char *fname, uint32_t prop,
3598fe96085Stim szeto     const char *propVal);
360fcf3ce44SJohn Forte int stmfOffline(void);
361fcf3ce44SJohn Forte int stmfOfflineTarget(stmfDevid *devid);
362fcf3ce44SJohn Forte int stmfOfflineLogicalUnit(stmfGuid *logicalUnit);
363fcf3ce44SJohn Forte int stmfOnline(void);
364fcf3ce44SJohn Forte int stmfOnlineTarget(stmfDevid *devid);
365fcf3ce44SJohn Forte int stmfOnlineLogicalUnit(stmfGuid *logicalUnit);
366*45039663SJohn Forte int stmfPostProxyMsg(int hdl, void *buf, uint32_t buflen);
367fcf3ce44SJohn Forte int stmfRemoveFromHostGroup(stmfGroupName *hostGroupName,
368fcf3ce44SJohn Forte     stmfDevid *initiatorName);
369fcf3ce44SJohn Forte int stmfRemoveFromTargetGroup(stmfGroupName *targetGroupName,
370fcf3ce44SJohn Forte     stmfDevid *targetName);
371fcf3ce44SJohn Forte int stmfRemoveViewEntry(stmfGuid *lu, uint32_t viewEntryIndex);
372*45039663SJohn Forte int stmfSetAluaState(boolean_t enabled, uint32_t node);
3738fe96085Stim szeto int stmfSetLuProp(luResource hdl, uint32_t propType, const char *propVal);
3748fe96085Stim szeto int stmfSetPersistMethod(uint8_t persistType, boolean_t serviceSet);
375fcf3ce44SJohn Forte int stmfSetProviderData(char *providerName, nvlist_t *nvl, int providerType);
376fcf3ce44SJohn Forte int stmfSetProviderDataProt(char *providerName, nvlist_t *nvl,
377fcf3ce44SJohn Forte     int providerType, uint64_t *setToken);
37863ed874aStim szeto int stmfValidateView(stmfViewEntry *viewEntry);
379fcf3ce44SJohn Forte 
380fcf3ce44SJohn Forte #ifdef	__cplusplus
381fcf3ce44SJohn Forte }
382fcf3ce44SJohn Forte #endif
383fcf3ce44SJohn Forte 
384fcf3ce44SJohn Forte #endif	/* _LIBSTMF_H */
385