]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_mds/lib/mds.h
Security-57031.40.6.tar.gz
[apple/security.git] / Security / libsecurity_mds / lib / mds.h
1 /*
2 * Copyright (c) 2000-2001,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 File: mds.h
21
22 Contains: Module Directory Services Data Types and API.
23
24 Copyright (c) 1999-2000,2011,2014 Apple Inc. All Rights Reserved.
25 */
26
27 #ifndef _MDS_H_
28 #define _MDS_H_ 1
29
30 #include <Security/cssmtype.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 typedef CSSM_DL_HANDLE MDS_HANDLE;
37
38 typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE;
39
40 typedef struct mds_funcs {
41 CSSM_RETURN (CSSMAPI *DbOpen)
42 (MDS_HANDLE MdsHandle,
43 const char *DbName,
44 const CSSM_NET_ADDRESS *DbLocation,
45 CSSM_DB_ACCESS_TYPE AccessRequest,
46 const CSSM_ACCESS_CREDENTIALS *AccessCred,
47 const void *OpenParameters,
48 CSSM_DB_HANDLE *hMds);
49
50 CSSM_RETURN (CSSMAPI *DbClose)
51 (MDS_DB_HANDLE MdsDbHandle);
52
53 CSSM_RETURN (CSSMAPI *GetDbNames)
54 (MDS_HANDLE MdsHandle,
55 CSSM_NAME_LIST_PTR *NameList);
56
57 CSSM_RETURN (CSSMAPI *GetDbNameFromHandle)
58 (MDS_DB_HANDLE MdsDbHandle,
59 char **DbName);
60
61 CSSM_RETURN (CSSMAPI *FreeNameList)
62 (MDS_HANDLE MdsHandle,
63 CSSM_NAME_LIST_PTR NameList);
64
65 CSSM_RETURN (CSSMAPI *DataInsert)
66 (MDS_DB_HANDLE MdsDbHandle,
67 CSSM_DB_RECORDTYPE RecordType,
68 const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
69 const CSSM_DATA *Data,
70 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
71
72 CSSM_RETURN (CSSMAPI *DataDelete)
73 (MDS_DB_HANDLE MdsDbHandle,
74 const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
75
76 CSSM_RETURN (CSSMAPI *DataModify)
77 (MDS_DB_HANDLE MdsDbHandle,
78 CSSM_DB_RECORDTYPE RecordType,
79 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
80 const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
81 const CSSM_DATA *DataToBeModified,
82 CSSM_DB_MODIFY_MODE ModifyMode);
83
84 CSSM_RETURN (CSSMAPI *DataGetFirst)
85 (MDS_DB_HANDLE MdsDbHandle,
86 const CSSM_QUERY *Query,
87 CSSM_HANDLE_PTR ResultsHandle,
88 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
89 CSSM_DATA_PTR Data,
90 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
91
92 CSSM_RETURN (CSSMAPI *DataGetNext)
93 (MDS_DB_HANDLE MdsDbHandle,
94 CSSM_HANDLE ResultsHandle,
95 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
96 CSSM_DATA_PTR Data,
97 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
98
99 CSSM_RETURN (CSSMAPI *DataAbortQuery)
100 (MDS_DB_HANDLE MdsDbHandle,
101 CSSM_HANDLE ResultsHandle);
102
103 CSSM_RETURN (CSSMAPI *DataGetFromUniqueRecordId)
104 (MDS_DB_HANDLE MdsDbHandle,
105 const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
106 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
107 CSSM_DATA_PTR Data);
108
109 CSSM_RETURN (CSSMAPI *FreeUniqueRecord)
110 (MDS_DB_HANDLE MdsDbHandle,
111 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
112
113 CSSM_RETURN (CSSMAPI *CreateRelation)
114 (MDS_DB_HANDLE MdsDbHandle,
115 CSSM_DB_RECORDTYPE RelationID,
116 const char *RelationName,
117 uint32 NumberOfAttributes,
118 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
119 uint32 NumberOfIndexes,
120 const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
121
122 CSSM_RETURN (CSSMAPI *DestroyRelation)
123 (MDS_DB_HANDLE MdsDbHandle,
124 CSSM_DB_RECORDTYPE RelationID);
125 } MDS_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *MDS_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
126
127
128 /* MDS Context APIs */
129
130 CSSM_RETURN CSSMAPI
131 MDS_Initialize (const CSSM_GUID *pCallerGuid,
132 const CSSM_MEMORY_FUNCS *pMemoryFunctions,
133 MDS_FUNCS_PTR pDlFunctions,
134 MDS_HANDLE *hMds)
135 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
136
137 CSSM_RETURN CSSMAPI
138 MDS_Terminate (MDS_HANDLE MdsHandle)
139 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
140
141 CSSM_RETURN CSSMAPI
142 MDS_Install (MDS_HANDLE MdsHandle)
143 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
144
145 CSSM_RETURN CSSMAPI
146 MDS_Uninstall (MDS_HANDLE MdsHandle)
147 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
148
149 #ifdef __cplusplus
150 }
151 #endif
152
153 #endif /* _MDS_H_ */