xref: /titanic_44/usr/src/lib/libstmf/common/store.h (revision 2b24ab6b3865caeede9eeb9db6b83e1d89dcd1ea)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 #ifndef	_STORE_H
26 #define	_STORE_H
27 
28 #ifdef	__cplusplus
29 extern "C" {
30 #endif
31 
32 #include <libnvpair.h>
33 
34 /*
35  * Error defines
36  */
37 #define	STMF_PS_SUCCESS			0
38 #define	STMF_PS_ERROR			1
39 #define	STMF_PS_ERROR_MEMBER_NOT_FOUND	2
40 #define	STMF_PS_ERROR_GROUP_NOT_FOUND	3
41 #define	STMF_PS_ERROR_NOT_FOUND		4
42 #define	STMF_PS_ERROR_EXISTS		5
43 #define	STMF_PS_ERROR_NOMEM		6
44 #define	STMF_PS_ERROR_RETRY		7
45 #define	STMF_PS_ERROR_BUSY		8
46 #define	STMF_PS_ERROR_SERVICE_NOT_FOUND 9
47 #define	STMF_PS_ERROR_INVALID_ARG	10
48 #define	STMF_PS_ERROR_VERSION_MISMATCH	11
49 #define	STMF_PS_ERROR_PROV_DATA_STALE	12
50 
51 int psAddHostGroupMember(char *groupName, char *memberName);
52 int psAddTargetGroupMember(char *groupName, char *memberName);
53 int psAddViewEntry(stmfGuid *lu, stmfViewEntry *viewEntry);
54 int psCreateHostGroup(char *groupName);
55 int psDeleteHostGroup(char *groupName);
56 int psCreateTargetGroup(char *groupName);
57 int psDeleteTargetGroup(char *groupName);
58 int psGetViewEntry(stmfGuid *lu, uint32_t viewEntryIndex, stmfViewEntry *ve);
59 int psGetLogicalUnitList(stmfGuidList **guidList);
60 int psRemoveHostGroupMember(char *groupName, char *memberName);
61 int psRemoveTargetGroupMember(char *groupName, char *memberName);
62 int psRemoveViewEntry(stmfGuid *lu, uint32_t viewEntryIndex);
63 int psGetHostGroupList(stmfGroupList **groupList);
64 int psGetTargetGroupList(stmfGroupList **groupList);
65 int psGetHostGroupMemberList(char *groupName, stmfGroupProperties **groupList);
66 int psGetTargetGroupMemberList(char *groupName,
67     stmfGroupProperties **groupList);
68 int psGetViewEntryList(stmfGuid *lu, stmfViewEntryList **viewEntryList);
69 int psCheckService();
70 int psSetProviderData(char *providerName, nvlist_t *nvl, int providerType,
71     uint64_t *setHandle);
72 int psGetProviderData(char *providerName, nvlist_t **nvl, int providerType,
73     uint64_t *setHandle);
74 int psGetProviderDataList(stmfProviderList **providerList);
75 int psClearProviderData(char *providerName, int providerType);
76 int psSetServicePersist(uint8_t persistType);
77 int psGetServicePersist(uint8_t *persistType);
78 
79 #ifdef	__cplusplus
80 }
81 #endif
82 
83 #endif	/* _STORE_H */
84