]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cdsa_plugin/lib/DLabstractsession.cpp
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_cdsa_plugin / lib / DLabstractsession.cpp
1 //
2 // DL plugin transition layer.
3 // This file was automatically generated. Do not edit on penalty of futility!
4 //
5 #include <security_cdsa_plugin/DLsession.h>
6 #include <security_cdsa_plugin/cssmplugin.h>
7 #include <security_cdsa_utilities/cssmbridge.h>
8 #include <Security/cssmdli.h>
9
10
11 DLAbstractPluginSession::~DLAbstractPluginSession()
12 { /* virtual */ }
13
14 static CSSM_RETURN CSSMDLI cssm_DataGetFirst(CSSM_DL_DB_HANDLE DLDBHandle,
15 const CSSM_QUERY *Query,
16 CSSM_HANDLE_PTR ResultsHandle,
17 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
18 CSSM_DATA_PTR Data,
19 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
20 {
21 BEGIN_API
22 if ((Required(ResultsHandle) = findSession<DLPluginSession>(DLDBHandle.DLHandle).DataGetFirst(DLDBHandle.DBHandle,
23 CssmQuery::optional(Query),
24 Attributes,
25 CssmData::optional(Data),
26 Required(UniqueId))) == CSSM_INVALID_HANDLE)
27 return CSSMERR_DL_ENDOFDATA;
28 END_API(DL)
29 }
30
31 static CSSM_RETURN CSSMDLI cssm_GetDbNames(CSSM_DL_HANDLE DLHandle,
32 CSSM_NAME_LIST_PTR *NameList)
33 {
34 BEGIN_API
35 findSession<DLPluginSession>(DLHandle).GetDbNames(Required(NameList));
36 END_API(DL)
37 }
38
39 static CSSM_RETURN CSSMDLI cssm_DbClose(CSSM_DL_DB_HANDLE DLDBHandle)
40 {
41 BEGIN_API
42 findSession<DLPluginSession>(DLDBHandle.DLHandle).DbClose(DLDBHandle.DBHandle);
43 END_API(DL)
44 }
45
46 static CSSM_RETURN CSSMDLI cssm_DataInsert(CSSM_DL_DB_HANDLE DLDBHandle,
47 CSSM_DB_RECORDTYPE RecordType,
48 const CSSM_DB_RECORD_ATTRIBUTE_DATA *Attributes,
49 const CSSM_DATA *Data,
50 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
51 {
52 BEGIN_API
53 findSession<DLPluginSession>(DLDBHandle.DLHandle).DataInsert(DLDBHandle.DBHandle,
54 RecordType,
55 Attributes,
56 CssmData::optional(Data),
57 Required(UniqueId));
58 END_API(DL)
59 }
60
61 static CSSM_RETURN CSSMDLI cssm_GetDbNameFromHandle(CSSM_DL_DB_HANDLE DLDBHandle,
62 char **DbName)
63 {
64 BEGIN_API
65 findSession<DLPluginSession>(DLDBHandle.DLHandle).GetDbNameFromHandle(DLDBHandle.DBHandle,
66 DbName);
67 END_API(DL)
68 }
69
70 static CSSM_RETURN CSSMDLI cssm_ChangeDbAcl(CSSM_DL_DB_HANDLE DLDBHandle,
71 const CSSM_ACCESS_CREDENTIALS *AccessCred,
72 const CSSM_ACL_EDIT *AclEdit)
73 {
74 BEGIN_API
75 findSession<DLPluginSession>(DLDBHandle.DLHandle).ChangeDbAcl(DLDBHandle.DBHandle,
76 AccessCredentials::required(AccessCred),
77 Required(AclEdit));
78 END_API(DL)
79 }
80
81 static CSSM_RETURN CSSMDLI cssm_FreeNameList(CSSM_DL_HANDLE DLHandle,
82 CSSM_NAME_LIST_PTR NameList)
83 {
84 BEGIN_API
85 findSession<DLPluginSession>(DLHandle).FreeNameList(Required(NameList));
86 END_API(DL)
87 }
88
89 static CSSM_RETURN CSSMDLI cssm_CreateRelation(CSSM_DL_DB_HANDLE DLDBHandle,
90 CSSM_DB_RECORDTYPE RelationID,
91 const char *RelationName,
92 uint32 NumberOfAttributes,
93 const CSSM_DB_SCHEMA_ATTRIBUTE_INFO *pAttributeInfo,
94 uint32 NumberOfIndexes,
95 const CSSM_DB_SCHEMA_INDEX_INFO *pIndexInfo)
96 {
97 BEGIN_API
98 findSession<DLPluginSession>(DLDBHandle.DLHandle).CreateRelation(DLDBHandle.DBHandle,
99 RelationID,
100 RelationName,
101 NumberOfAttributes,
102 pAttributeInfo,
103 NumberOfIndexes,
104 Required(pIndexInfo));
105 END_API(DL)
106 }
107
108 static CSSM_RETURN CSSMDLI cssm_DataAbortQuery(CSSM_DL_DB_HANDLE DLDBHandle,
109 CSSM_HANDLE ResultsHandle)
110 {
111 BEGIN_API
112 findSession<DLPluginSession>(DLDBHandle.DLHandle).DataAbortQuery(DLDBHandle.DBHandle,
113 ResultsHandle);
114 END_API(DL)
115 }
116
117 static CSSM_RETURN CSSMDLI cssm_DataModify(CSSM_DL_DB_HANDLE DLDBHandle,
118 CSSM_DB_RECORDTYPE RecordType,
119 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecordIdentifier,
120 const CSSM_DB_RECORD_ATTRIBUTE_DATA *AttributesToBeModified,
121 const CSSM_DATA *DataToBeModified,
122 CSSM_DB_MODIFY_MODE ModifyMode)
123 {
124 BEGIN_API
125 findSession<DLPluginSession>(DLDBHandle.DLHandle).DataModify(DLDBHandle.DBHandle,
126 RecordType,
127 Required(UniqueRecordIdentifier),
128 AttributesToBeModified,
129 CssmData::optional(DataToBeModified),
130 ModifyMode);
131 END_API(DL)
132 }
133
134 static CSSM_RETURN CSSMDLI cssm_DestroyRelation(CSSM_DL_DB_HANDLE DLDBHandle,
135 CSSM_DB_RECORDTYPE RelationID)
136 {
137 BEGIN_API
138 findSession<DLPluginSession>(DLDBHandle.DLHandle).DestroyRelation(DLDBHandle.DBHandle,
139 RelationID);
140 END_API(DL)
141 }
142
143 static CSSM_RETURN CSSMDLI cssm_DbCreate(CSSM_DL_HANDLE DLHandle,
144 const char *DbName,
145 const CSSM_NET_ADDRESS *DbLocation,
146 const CSSM_DBINFO *DBInfo,
147 CSSM_DB_ACCESS_TYPE AccessRequest,
148 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
149 const void *OpenParameters,
150 CSSM_DB_HANDLE *DbHandle)
151 {
152 BEGIN_API
153 findSession<DLPluginSession>(DLHandle).DbCreate(DbName,
154 DbLocation,
155 Required(DBInfo),
156 AccessRequest,
157 CredAndAclEntry,
158 OpenParameters,
159 Required(DbHandle));
160 END_API(DL)
161 }
162
163 static CSSM_RETURN CSSMDLI cssm_DbOpen(CSSM_DL_HANDLE DLHandle,
164 const char *DbName,
165 const CSSM_NET_ADDRESS *DbLocation,
166 CSSM_DB_ACCESS_TYPE AccessRequest,
167 const CSSM_ACCESS_CREDENTIALS *AccessCred,
168 const void *OpenParameters,
169 CSSM_DB_HANDLE *DbHandle)
170 {
171 BEGIN_API
172 findSession<DLPluginSession>(DLHandle).DbOpen(DbName,
173 DbLocation,
174 AccessRequest,
175 AccessCredentials::optional(AccessCred),
176 OpenParameters,
177 Required(DbHandle));
178 END_API(DL)
179 }
180
181 static CSSM_RETURN CSSMDLI cssm_DataGetNext(CSSM_DL_DB_HANDLE DLDBHandle,
182 CSSM_HANDLE ResultsHandle,
183 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
184 CSSM_DATA_PTR Data,
185 CSSM_DB_UNIQUE_RECORD_PTR *UniqueId)
186 {
187 BEGIN_API
188 if (!findSession<DLPluginSession>(DLDBHandle.DLHandle).DataGetNext(DLDBHandle.DBHandle,
189 ResultsHandle,
190 Attributes,
191 CssmData::optional(Data),
192 Required(UniqueId)))
193 return CSSMERR_DL_ENDOFDATA;
194 END_API(DL)
195 }
196
197 static CSSM_RETURN CSSMDLI cssm_FreeUniqueRecord(CSSM_DL_DB_HANDLE DLDBHandle,
198 CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord)
199 {
200 BEGIN_API
201 findSession<DLPluginSession>(DLDBHandle.DLHandle).FreeUniqueRecord(DLDBHandle.DBHandle,
202 Required(UniqueRecord));
203 END_API(DL)
204 }
205
206 static CSSM_RETURN CSSMDLI cssm_ChangeDbOwner(CSSM_DL_DB_HANDLE DLDBHandle,
207 const CSSM_ACCESS_CREDENTIALS *AccessCred,
208 const CSSM_ACL_OWNER_PROTOTYPE *NewOwner)
209 {
210 BEGIN_API
211 findSession<DLPluginSession>(DLDBHandle.DLHandle).ChangeDbOwner(DLDBHandle.DBHandle,
212 AccessCredentials::required(AccessCred),
213 Required(NewOwner));
214 END_API(DL)
215 }
216
217 static CSSM_RETURN CSSMDLI cssm_DbDelete(CSSM_DL_HANDLE DLHandle,
218 const char *DbName,
219 const CSSM_NET_ADDRESS *DbLocation,
220 const CSSM_ACCESS_CREDENTIALS *AccessCred)
221 {
222 BEGIN_API
223 findSession<DLPluginSession>(DLHandle).DbDelete(DbName,
224 DbLocation,
225 AccessCredentials::optional(AccessCred));
226 END_API(DL)
227 }
228
229 static CSSM_RETURN CSSMDLI cssm_Authenticate(CSSM_DL_DB_HANDLE DLDBHandle,
230 CSSM_DB_ACCESS_TYPE AccessRequest,
231 const CSSM_ACCESS_CREDENTIALS *AccessCred)
232 {
233 BEGIN_API
234 findSession<DLPluginSession>(DLDBHandle.DLHandle).Authenticate(DLDBHandle.DBHandle,
235 AccessRequest,
236 AccessCredentials::required(AccessCred));
237 END_API(DL)
238 }
239
240 static CSSM_RETURN CSSMDLI cssm_DataDelete(CSSM_DL_DB_HANDLE DLDBHandle,
241 const CSSM_DB_UNIQUE_RECORD *UniqueRecordIdentifier)
242 {
243 BEGIN_API
244 findSession<DLPluginSession>(DLDBHandle.DLHandle).DataDelete(DLDBHandle.DBHandle,
245 Required(UniqueRecordIdentifier));
246 END_API(DL)
247 }
248
249 static CSSM_RETURN CSSMDLI cssm_GetDbOwner(CSSM_DL_DB_HANDLE DLDBHandle,
250 CSSM_ACL_OWNER_PROTOTYPE_PTR Owner)
251 {
252 BEGIN_API
253 findSession<DLPluginSession>(DLDBHandle.DLHandle).GetDbOwner(DLDBHandle.DBHandle,
254 Required(Owner));
255 END_API(DL)
256 }
257
258 static CSSM_RETURN CSSMDLI cssm_PassThrough(CSSM_DL_DB_HANDLE DLDBHandle,
259 uint32 PassThroughId,
260 const void *InputParams,
261 void **OutputParams)
262 {
263 BEGIN_API
264 findSession<DLPluginSession>(DLDBHandle.DLHandle).PassThrough(DLDBHandle.DBHandle,
265 PassThroughId,
266 InputParams,
267 OutputParams);
268 END_API(DL)
269 }
270
271 static CSSM_RETURN CSSMDLI cssm_GetDbAcl(CSSM_DL_DB_HANDLE DLDBHandle,
272 const CSSM_STRING *SelectionTag,
273 uint32 *NumberOfAclInfos,
274 CSSM_ACL_ENTRY_INFO_PTR *AclInfos)
275 {
276 BEGIN_API
277 findSession<DLPluginSession>(DLDBHandle.DLHandle).GetDbAcl(DLDBHandle.DBHandle,
278 SelectionTag,
279 Required(NumberOfAclInfos),
280 Required(AclInfos));
281 END_API(DL)
282 }
283
284 static CSSM_RETURN CSSMDLI cssm_DataGetFromUniqueRecordId(CSSM_DL_DB_HANDLE DLDBHandle,
285 const CSSM_DB_UNIQUE_RECORD *UniqueRecord,
286 CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
287 CSSM_DATA_PTR Data)
288 {
289 BEGIN_API
290 findSession<DLPluginSession>(DLDBHandle.DLHandle).DataGetFromUniqueRecordId(DLDBHandle.DBHandle,
291 Required(UniqueRecord),
292 Attributes,
293 CssmData::optional(Data));
294 END_API(DL)
295 }
296
297
298 static const CSSM_SPI_DL_FUNCS DLFunctionStruct = {
299 cssm_DbOpen,
300 cssm_DbClose,
301 cssm_DbCreate,
302 cssm_DbDelete,
303 cssm_CreateRelation,
304 cssm_DestroyRelation,
305 cssm_Authenticate,
306 cssm_GetDbAcl,
307 cssm_ChangeDbAcl,
308 cssm_GetDbOwner,
309 cssm_ChangeDbOwner,
310 cssm_GetDbNames,
311 cssm_GetDbNameFromHandle,
312 cssm_FreeNameList,
313 cssm_DataInsert,
314 cssm_DataDelete,
315 cssm_DataModify,
316 cssm_DataGetFirst,
317 cssm_DataGetNext,
318 cssm_DataAbortQuery,
319 cssm_DataGetFromUniqueRecordId,
320 cssm_FreeUniqueRecord,
321 cssm_PassThrough,
322 };
323
324 static CSSM_MODULE_FUNCS DLFunctionTable = {
325 CSSM_SERVICE_DL, // service type
326 23, // number of functions
327 (const CSSM_PROC_ADDR *)&DLFunctionStruct
328 };
329
330 CSSM_MODULE_FUNCS_PTR DLPluginSession::construct()
331 {
332 return &DLFunctionTable;
333 }