]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmdli.h
Security-58286.1.32.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / cssmdli.h
1 /*
2 * Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 *
23 * cssmdli.h -- Service Provider Interface for Data Store Modules
24 */
25
26 #ifndef _CSSMDLI_H_
27 #define _CSSMDLI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
37
38 typedef struct cssm_spi_dl_funcs {
39 CSSM_RETURN (CSSMDLI *DbOpen)
40 (CSSM_DL_HANDLE DLHandle,
41 const char *DbName,
42 const CSSM_NET_ADDRESS *DbLocation,
43 CSSM_DB_ACCESS_TYPE AccessRequest,
44 const CSSM_ACCESS_CREDENTIALS *AccessCred,
45 const void *OpenParameters,
46 CSSM_DB_HANDLE *DbHandle);
47 CSSM_RETURN (CSSMDLI *DbClose)
48 (CSSM_DL_DB_HANDLE DLDBHandle);
49 CSSM_RETURN (CSSMDLI *DbCreate)
50 (CSSM_DL_HANDLE DLHandle,
51 const char *DbName,
52 const CSSM_NET_ADDRESS *DbLocation,
53 const CSSM_DBINFO *DBInfo,
54 CSSM_DB_ACCESS_TYPE AccessRequest,
55 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
56 const void *OpenParameters,
57 CSSM_DB_HANDLE *DbHandle);
58 CSSM_RETURN (CSSMDLI *DbDelete)
59 (CSSM_DL_HANDLE DLHandle,
60 const char *DbName,
61 const CSSM_NET_ADDRESS *DbLocation,
62 const CSSM_ACCESS_CREDENTIALS *AccessCred);
63 CSSM_RETURN (CSSMDLI *CreateRelation)
64 (CSSM_DL_DB_HANDLE DLDBHandle,
65 CSSM_DB_RECORDTYPE RelationID,
66 const char *RelationName,
67 uint32 NumberOfAttributes,
68 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
69 uint32 NumberOfIndexes,
70 const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo);
71 CSSM_RETURN (CSSMDLI *DestroyRelation)
72 (CSSM_DL_DB_HANDLE DLDBHandle,
73 CSSM_DB_RECORDTYPE RelationID);
74 CSSM_RETURN (CSSMDLI *Authenticate)
75 (CSSM_DL_DB_HANDLE DLDBHandle,
76 CSSM_DB_ACCESS_TYPE AccessRequest,
77 const CSSM_ACCESS_CREDENTIALS *AccessCred);
78 CSSM_RETURN (CSSMDLI *GetDbAcl)
79 (CSSM_DL_DB_HANDLE DLDBHandle,
80 const CSSM_STRING *SelectionTag,
81 uint32 *NumberOfAclInfos,
82 CSSM_ACL_ENTRY_INFO_PTR *AclInfos);
83 CSSM_RETURN (CSSMDLI *ChangeDbAcl)
84 (CSSM_DL_DB_HANDLE DLDBHandle,
85 const CSSM_ACCESS_CREDENTIALS *AccessCred,
86 const CSSM_ACL_EDIT *AclEdit);
87 CSSM_RETURN (CSSMDLI *GetDbOwner)
88 (CSSM_DL_DB_HANDLE DLDBHandle,
89 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner);
90 CSSM_RETURN (CSSMDLI *ChangeDbOwner)
91 (CSSM_DL_DB_HANDLE DLDBHandle,
92 const CSSM_ACCESS_CREDENTIALS *AccessCred,
93 const CSSM_ACL_OWNER_PROTOTYPE *NewOwner);
94 CSSM_RETURN (CSSMDLI *GetDbNames)
95 (CSSM_DL_HANDLE DLHandle,
96 CSSM_NAME_LIST_PTR *NameList);
97 CSSM_RETURN (CSSMDLI *GetDbNameFromHandle)
98 (CSSM_DL_DB_HANDLE DLDBHandle,
99 char **DbName);
100 CSSM_RETURN (CSSMDLI *FreeNameList)
101 (CSSM_DL_HANDLE DLHandle,
102 CSSM_NAME_LIST_PTR NameList);
103 CSSM_RETURN (CSSMDLI *DataInsert)
104 (CSSM_DL_DB_HANDLE DLDBHandle,
105 CSSM_DB_RECORDTYPE RecordType,
106 const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
107 const CSSM_DATA *Data,
108 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
109 CSSM_RETURN (CSSMDLI *DataDelete)
110 (CSSM_DL_DB_HANDLE DLDBHandle,
111 const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier);
112 CSSM_RETURN (CSSMDLI *DataModify)
113 (CSSM_DL_DB_HANDLE DLDBHandle,
114 CSSM_DB_RECORDTYPE RecordType,
115 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
116 const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
117 const CSSM_DATA *DataToBeModified,
118 CSSM_DB_MODIFY_MODE ModifyMode);
119 CSSM_RETURN (CSSMDLI *DataGetFirst)
120 (CSSM_DL_DB_HANDLE DLDBHandle,
121 const CSSM_QUERY *Query,
122 CSSM_HANDLE_PTR ResultsHandle,
123 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
124 CSSM_DATA_PTR Data,
125 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
126 CSSM_RETURN (CSSMDLI *DataGetNext)
127 (CSSM_DL_DB_HANDLE DLDBHandle,
128 CSSM_HANDLE ResultsHandle,
129 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
130 CSSM_DATA_PTR Data,
131 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId);
132 CSSM_RETURN (CSSMDLI *DataAbortQuery)
133 (CSSM_DL_DB_HANDLE DLDBHandle,
134 CSSM_HANDLE ResultsHandle);
135 CSSM_RETURN (CSSMDLI *DataGetFromUniqueRecordId)
136 (CSSM_DL_DB_HANDLE DLDBHandle,
137 const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
138 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
139 CSSM_DATA_PTR Data);
140 CSSM_RETURN (CSSMDLI *FreeUniqueRecord)
141 (CSSM_DL_DB_HANDLE DLDBHandle,
142 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord);
143 CSSM_RETURN (CSSMDLI *PassThrough)
144 (CSSM_DL_DB_HANDLE DLDBHandle,
145 uint32 PassThroughId,
146 const void *InputParams,
147 void **OutputParams);
148 } CSSM_SPI_DL_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_DL_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
149
150 #pragma clang diagnostic pop
151
152 #ifdef __cplusplus
153 }
154 #endif
155
156 #endif /* _CSSMDLI_H_ */