2 * Copyright (c) 2000-2001,2011,2014 Apple Inc. All Rights Reserved.
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
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.
22 Contains: Module Directory Services Data Types and API.
24 Copyright (c) 1999-2000,2011,2014 Apple Inc. All Rights Reserved.
30 #include <Security/cssmtype.h>
36 typedef CSSM_DL_HANDLE MDS_HANDLE
;
38 typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE
;
40 typedef struct mds_funcs
{
41 CSSM_RETURN (CSSMAPI
*DbOpen
)
42 (MDS_HANDLE MdsHandle
,
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
);
50 CSSM_RETURN (CSSMAPI
*DbClose
)
51 (MDS_DB_HANDLE MdsDbHandle
);
53 CSSM_RETURN (CSSMAPI
*GetDbNames
)
54 (MDS_HANDLE MdsHandle
,
55 CSSM_NAME_LIST_PTR
*NameList
);
57 CSSM_RETURN (CSSMAPI
*GetDbNameFromHandle
)
58 (MDS_DB_HANDLE MdsDbHandle
,
61 CSSM_RETURN (CSSMAPI
*FreeNameList
)
62 (MDS_HANDLE MdsHandle
,
63 CSSM_NAME_LIST_PTR NameList
);
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
);
72 CSSM_RETURN (CSSMAPI
*DataDelete
)
73 (MDS_DB_HANDLE MdsDbHandle
,
74 const CSSM_DB_UNIQUE_RECORD
*UniqueRecordIdentifier
);
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
);
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
,
90 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
);
92 CSSM_RETURN (CSSMAPI
*DataGetNext
)
93 (MDS_DB_HANDLE MdsDbHandle
,
94 CSSM_HANDLE ResultsHandle
,
95 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
97 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
);
99 CSSM_RETURN (CSSMAPI
*DataAbortQuery
)
100 (MDS_DB_HANDLE MdsDbHandle
,
101 CSSM_HANDLE ResultsHandle
);
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
,
109 CSSM_RETURN (CSSMAPI
*FreeUniqueRecord
)
110 (MDS_DB_HANDLE MdsDbHandle
,
111 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord
);
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
);
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
;
128 /* MDS Context APIs */
131 MDS_Initialize (const CSSM_GUID
*pCallerGuid
,
132 const CSSM_MEMORY_FUNCS
*pMemoryFunctions
,
133 MDS_FUNCS_PTR pDlFunctions
,
135 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
138 MDS_Terminate (MDS_HANDLE MdsHandle
)
139 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
142 MDS_Install (MDS_HANDLE MdsHandle
)
143 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
146 MDS_Uninstall (MDS_HANDLE MdsHandle
)
147 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;