xref: /titanic_44/usr/src/lib/libstmf/common/store.h (revision 744947dc83c634d985ed3ad79ac9c5e28d1865fd)
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 (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 #ifndef	_STORE_H
25 #define	_STORE_H
26 
27 #ifdef	__cplusplus
28 extern "C" {
29 #endif
30 
31 #include <libnvpair.h>
32 
33 /*
34  * Error defines
35  */
36 #define	STMF_PS_SUCCESS			0
37 #define	STMF_PS_ERROR			1
38 #define	STMF_PS_ERROR_MEMBER_NOT_FOUND	2
39 #define	STMF_PS_ERROR_GROUP_NOT_FOUND	3
40 #define	STMF_PS_ERROR_NOT_FOUND		4
41 #define	STMF_PS_ERROR_EXISTS		5
42 #define	STMF_PS_ERROR_NOMEM		6
43 #define	STMF_PS_ERROR_RETRY		7
44 #define	STMF_PS_ERROR_BUSY		8
45 #define	STMF_PS_ERROR_SERVICE_NOT_FOUND 9
46 #define	STMF_PS_ERROR_INVALID_ARG	10
47 #define	STMF_PS_ERROR_VERSION_MISMATCH	11
48 #define	STMF_PS_ERROR_PROV_DATA_STALE	12
49 
50 int psAddHostGroupMember(char *groupName, char *memberName);
51 int psAddTargetGroupMember(char *groupName, char *memberName);
52 int psAddViewEntry(stmfGuid *lu, stmfViewEntry *viewEntry);
53 int psCreateHostGroup(char *groupName);
54 int psDeleteHostGroup(char *groupName);
55 int psCreateTargetGroup(char *groupName);
56 int psDeleteTargetGroup(char *groupName);
57 int psGetViewEntry(stmfGuid *lu, uint32_t viewEntryIndex, stmfViewEntry *ve);
58 int psGetLogicalUnitList(stmfGuidList **guidList);
59 int psRemoveHostGroupMember(char *groupName, char *memberName);
60 int psRemoveTargetGroupMember(char *groupName, char *memberName);
61 int psRemoveViewEntry(stmfGuid *lu, uint32_t viewEntryIndex);
62 int psGetHostGroupList(stmfGroupList **groupList);
63 int psGetTargetGroupList(stmfGroupList **groupList);
64 int psGetHostGroupMemberList(char *groupName, stmfGroupProperties **groupList);
65 int psGetTargetGroupMemberList(char *groupName,
66     stmfGroupProperties **groupList);
67 int psGetViewEntryList(stmfGuid *lu, stmfViewEntryList **viewEntryList);
68 int psCheckService();
69 int psSetProviderData(char *providerName, nvlist_t *nvl, int providerType,
70     uint64_t *setHandle);
71 int psGetProviderData(char *providerName, nvlist_t **nvl, int providerType,
72     uint64_t *setHandle);
73 int psGetProviderDataList(stmfProviderList **providerList);
74 int psClearProviderData(char *providerName, int providerType);
75 int psSetServicePersist(uint8_t persistType);
76 int psGetServicePersist(uint8_t *persistType);
77 int psSetStmfProp(int propType, char *propVal);
78 int psGetStmfProp(int propType, char *propVal);
79 
80 #ifdef	__cplusplus
81 }
82 #endif
83 
84 #endif	/* _STORE_H */
85