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 #pragma clang diagnostic push
37 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
39 typedef CSSM_DL_HANDLE MDS_HANDLE
;
41 typedef CSSM_DL_DB_HANDLE MDS_DB_HANDLE
;
43 typedef struct mds_funcs
{
44 CSSM_RETURN (CSSMAPI
*DbOpen
)
45 (MDS_HANDLE MdsHandle
,
47 const CSSM_NET_ADDRESS
*DbLocation
,
48 CSSM_DB_ACCESS_TYPE AccessRequest
,
49 const CSSM_ACCESS_CREDENTIALS
*AccessCred
,
50 const void *OpenParameters
,
51 CSSM_DB_HANDLE
*hMds
);
53 CSSM_RETURN (CSSMAPI
*DbClose
)
54 (MDS_DB_HANDLE MdsDbHandle
);
56 CSSM_RETURN (CSSMAPI
*GetDbNames
)
57 (MDS_HANDLE MdsHandle
,
58 CSSM_NAME_LIST_PTR
*NameList
);
60 CSSM_RETURN (CSSMAPI
*GetDbNameFromHandle
)
61 (MDS_DB_HANDLE MdsDbHandle
,
64 CSSM_RETURN (CSSMAPI
*FreeNameList
)
65 (MDS_HANDLE MdsHandle
,
66 CSSM_NAME_LIST_PTR NameList
);
68 CSSM_RETURN (CSSMAPI
*DataInsert
)
69 (MDS_DB_HANDLE MdsDbHandle
,
70 CSSM_DB_RECORDTYPE RecordType
,
71 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*Attributes
,
72 const CSSM_DATA
*Data
,
73 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
);
75 CSSM_RETURN (CSSMAPI
*DataDelete
)
76 (MDS_DB_HANDLE MdsDbHandle
,
77 const CSSM_DB_UNIQUE_RECORD
*UniqueRecordIdentifier
);
79 CSSM_RETURN (CSSMAPI
*DataModify
)
80 (MDS_DB_HANDLE MdsDbHandle
,
81 CSSM_DB_RECORDTYPE RecordType
,
82 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier
,
83 const CSSM_DB_RECORD_ATTRIBUTE_DATA
*AttributesToBeModified
,
84 const CSSM_DATA
*DataToBeModified
,
85 CSSM_DB_MODIFY_MODE ModifyMode
);
87 CSSM_RETURN (CSSMAPI
*DataGetFirst
)
88 (MDS_DB_HANDLE MdsDbHandle
,
89 const CSSM_QUERY
*Query
,
90 CSSM_HANDLE_PTR ResultsHandle
,
91 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
93 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
);
95 CSSM_RETURN (CSSMAPI
*DataGetNext
)
96 (MDS_DB_HANDLE MdsDbHandle
,
97 CSSM_HANDLE ResultsHandle
,
98 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
100 CSSM_DB_UNIQUE_RECORD_PTR
*UniqueId
);
102 CSSM_RETURN (CSSMAPI
*DataAbortQuery
)
103 (MDS_DB_HANDLE MdsDbHandle
,
104 CSSM_HANDLE ResultsHandle
);
106 CSSM_RETURN (CSSMAPI
*DataGetFromUniqueRecordId
)
107 (MDS_DB_HANDLE MdsDbHandle
,
108 const CSSM_DB_UNIQUE_RECORD
*UniqueRecord
,
109 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes
,
112 CSSM_RETURN (CSSMAPI
*FreeUniqueRecord
)
113 (MDS_DB_HANDLE MdsDbHandle
,
114 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord
);
116 CSSM_RETURN (CSSMAPI
*CreateRelation
)
117 (MDS_DB_HANDLE MdsDbHandle
,
118 CSSM_DB_RECORDTYPE RelationID
,
119 const char *RelationName
,
120 uint32 NumberOfAttributes
,
121 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO
*pAttributeInfo
,
122 uint32 NumberOfIndexes
,
123 const CSSM_DB_SCHEMA_INDEX_INFO
*pIndexInfo
);
125 CSSM_RETURN (CSSMAPI
*DestroyRelation
)
126 (MDS_DB_HANDLE MdsDbHandle
,
127 CSSM_DB_RECORDTYPE RelationID
);
128 } 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
;
131 /* MDS Context APIs */
134 MDS_Initialize (const CSSM_GUID
*pCallerGuid
,
135 const CSSM_MEMORY_FUNCS
*pMemoryFunctions
,
136 MDS_FUNCS_PTR pDlFunctions
,
138 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
141 MDS_Terminate (MDS_HANDLE MdsHandle
)
142 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
145 MDS_Install (MDS_HANDLE MdsHandle
)
146 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
149 MDS_Uninstall (MDS_HANDLE MdsHandle
)
150 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
152 #pragma clang diagnostic pop