dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libsldap / common / ns_wrapper.c
blobcefbe916e45d0f1845ad832c00fdc31585fdbcb2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include "ns_sldap.h"
30 #include "ns_internal.h"
32 /* ARGSUSED */
33 static LDAP *
34 __s_api_getLDAPconn(int flags)
36 return (NULL);
40 * Abandon functions
42 /* ARGSUSED */
43 int _ns_ldap_abandon_ext(char *service, int flags,
44 int msgid, LDAPControl **serverctrls,
45 LDAPControl ** clientctrls)
47 LDAP *ld = __s_api_getLDAPconn(flags);
49 return (ldap_abandon_ext(ld, msgid, serverctrls, clientctrls));
52 /* ARGSUSED */
53 int _ns_ldap_abandon(char *service, int flags,
54 int msgid)
56 LDAP *ld = __s_api_getLDAPconn(flags);
58 return (ldap_abandon(ld, msgid));
62 * Add functions
64 /* ARGSUSED */
65 int _ns_ldap_add_ext(char *service, int flags,
66 char *dn, LDAPMod **attrs,
67 LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp)
69 LDAP *ld = __s_api_getLDAPconn(flags);
71 return (ldap_add_ext(ld, dn, attrs,
72 serverctrls, clientctrls, msgidp));
75 /* ARGSUSED */
76 int _ns_ldap_add_ext_s(char *service, int flags,
77 char *dn, LDAPMod **attrs,
78 LDAPControl ** serverctrls, LDAPControl **clientctrls)
80 LDAP *ld = __s_api_getLDAPconn(flags);
82 return (ldap_add_ext_s(ld, dn, attrs, serverctrls, clientctrls));
85 /* ARGSUSED */
86 int _ns_ldap_add(char *service, int flags,
87 char *dn, LDAPMod **attrs)
89 LDAP *ld = __s_api_getLDAPconn(flags);
91 return (ldap_add(ld, dn, attrs));
94 /* ARGSUSED */
95 int _ns_ldap_add_s(char *service, int flags,
96 char *dn, LDAPMod **attrs)
98 LDAP *ld = __s_api_getLDAPconn(flags);
100 return (ldap_add_s(ld, dn, attrs));
104 * Compare functions
106 /* ARGSUSED */
107 int _ns_ldap_compare_ext(char *service, int flags,
108 char *dn, char *attr, struct berval *bvalue,
109 LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp)
111 LDAP *ld = __s_api_getLDAPconn(flags);
113 return (ldap_compare_ext(ld, dn, attr, bvalue,
114 serverctrls, clientctrls, msgidp));
117 /* ARGSUSED */
118 int _ns_ldap_compare_ext_s(char *service, int flags,
119 char *dn, char *attr, struct berval *bvalue,
120 LDAPControl ** serverctrls, LDAPControl **clientctrls)
122 LDAP *ld = __s_api_getLDAPconn(flags);
124 return (ldap_compare_ext_s(ld, dn, attr, bvalue,
125 serverctrls, clientctrls));
128 /* ARGSUSED */
129 int _ns_ldap_compare(char *service, int flags,
130 char *dn, char *attr, char *value)
132 LDAP *ld = __s_api_getLDAPconn(flags);
134 return (ldap_compare(ld, dn, attr, value));
137 /* ARGSUSED */
138 int _ns_ldap_compare_s(char *service, int flags,
139 char *dn, char *attr, char *value)
141 LDAP *ld = __s_api_getLDAPconn(flags);
143 return (ldap_compare_s(ld, dn, attr, value));
147 * Delete functions
149 /* ARGSUSED */
150 int _ns_ldap_delete_ext(char *service, int flags,
151 char *dn, LDAPControl **serverctrls,
152 LDAPControl **clientctrls, int *msgidp)
154 LDAP *ld = __s_api_getLDAPconn(flags);
156 return (ldap_delete_ext(ld, dn, serverctrls, clientctrls, msgidp));
159 /* ARGSUSED */
160 int _ns_ldap_delete_ext_s(char *service, int flags,
161 char *dn, LDAPControl **serverctrls,
162 LDAPControl **clientctrls)
164 LDAP *ld = __s_api_getLDAPconn(flags);
166 return (ldap_delete_ext_s(ld, dn, serverctrls, clientctrls));
169 /* ARGSUSED */
170 int _ns_ldap_delete(char *service, int flags,
171 char *dn)
173 LDAP *ld = __s_api_getLDAPconn(flags);
175 return (ldap_delete(ld, dn));
178 /* ARGSUSED */
179 int _ns_ldap_delete_s(char *service, int flags,
180 char *dn)
182 LDAP *ld = __s_api_getLDAPconn(flags);
184 return (ldap_delete_s(ld, dn));
188 * Modify functions
190 /* ARGSUSED */
191 int _ns_ldap_modify_ext(char *service, int flags,
192 char *dn, LDAPMod **mods,
193 LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp)
195 LDAP *ld = __s_api_getLDAPconn(flags);
197 return (ldap_modify_ext(ld, dn, mods, serverctrls,
198 clientctrls, msgidp));
201 /* ARGSUSED */
202 int _ns_ldap_modify_ext_s(char *service, int flags,
203 char *dn, LDAPMod **mods,
204 LDAPControl **serverctrls, LDAPControl **clientctrls)
206 LDAP *ld = __s_api_getLDAPconn(flags);
208 return (ldap_modify_ext_s(ld, dn, mods, serverctrls, clientctrls));
211 /* ARGSUSED */
212 int _ns_ldap_modify(char *service, int flags,
213 char *dn, LDAPMod **mods)
214 /* ARGSUSED */
216 LDAP *ld = __s_api_getLDAPconn(flags);
218 return (ldap_modify(ld, dn, mods));
221 /* ARGSUSED */
222 int _ns_ldap_modify_s(char *service, int flags,
223 char *dn, LDAPMod **mods)
225 LDAP *ld = __s_api_getLDAPconn(flags);
227 return (ldap_modify_s(ld, dn, mods));
231 * Modrdn functions
234 /* ARGSUSED */
235 int _ns_ldap_modrdn(char *service, int flags,
236 char *dn, char *newrdn, int deleteoldrdn)
238 LDAP *ld = __s_api_getLDAPconn(flags);
240 return (ldap_modrdn(ld, dn, newrdn));
243 /* ARGSUSED */
244 int _ns_ldap_modrdn_s(char *service, int flags,
245 char *dn, char *newrdn, int deleteoldrdn)
247 LDAP *ld = __s_api_getLDAPconn(flags);
249 return (ldap_modrdn_s(ld, dn, newrdn));
252 /* ARGSUSED */
253 int _ns_ldap_modrdn2(char *service, int flags,
254 char *dn, char *newrdn, int deleteoldrdn)
256 LDAP *ld = __s_api_getLDAPconn(flags);
258 return (ldap_modrdn2(ld, dn, newrdn, deleteoldrdn));
261 /* ARGSUSED */
262 int _ns_ldap_modrdn2_s(char *service, int flags,
263 char *dn, char *newrdn, int deleteoldrdn)
265 LDAP *ld = __s_api_getLDAPconn(flags);
267 return (ldap_modrdn2_s(ld, dn, newrdn, deleteoldrdn));
271 * Rename functions
273 /* ARGSUSED */
274 int _ns_ldap_rename(char *service, int flags,
275 char *dn, char *newrdn, char *newparent,
276 int deleteoldrdn, LDAPControl ** serverctrls,
277 LDAPControl **clientctrls, int *msgidp)
279 LDAP *ld = __s_api_getLDAPconn(flags);
281 return (ldap_rename(ld, dn, newrdn, newparent,
282 deleteoldrdn, serverctrls,
283 clientctrls, msgidp));
286 /* ARGSUSED */
287 int _ns_ldap_rename_s(char *service, int flags,
288 char *dn, char *newrdn, char *newparent,
289 int deleteoldrdn, LDAPControl ** serverctrls,
290 LDAPControl **clientctrls)
292 LDAP *ld = __s_api_getLDAPconn(flags);
294 return (ldap_rename_s(ld, dn, newrdn, newparent,
295 deleteoldrdn, serverctrls, clientctrls));
299 * Result functions
301 /* ARGSUSED */
302 int _ns_ldap_result(char *service, int flags,
303 int msgid, int all,
304 struct timeval *timeout, LDAPMessage **result)
306 LDAP *ld = __s_api_getLDAPconn(flags);
308 return (ldap_result(ld, msgid, all, timeout, result));
312 * Search functions
314 /* ARGSUSED */
315 int _ns_ldap_search_ext(char *service, int flags,
316 char *base, int scope, char *filter,
317 char **attrs, int attrsonly, LDAPControl **serverctrls,
318 LDAPControl **clientctrls, struct timeval *timeoutp,
319 int sizelimit, int *msgidp)
321 LDAP *ld = __s_api_getLDAPconn(flags);
323 return (ldap_search_ext(ld, base, scope, filter,
324 attrs, attrsonly, serverctrls,
325 clientctrls, timeoutp, sizelimit, msgidp));
328 /* ARGSUSED */
329 int _ns_ldap_search_ext_s(char *service, int flags,
330 char *base, int scope, char *filter,
331 char **attrs, int attrsonly, LDAPControl **serverctrls,
332 LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit,
333 LDAPMessage **res)
335 LDAP *ld = __s_api_getLDAPconn(flags);
337 return (ldap_search_ext_s(ld, base, scope, filter,
338 attrs, attrsonly, serverctrls,
339 clientctrls, timeoutp, sizelimit, res));
342 /* ARGSUSED */
343 int _ns_ldap_search(char *service, int flags,
344 char *base, int scope, char *filter,
345 char **attrs, int attrsonly)
347 LDAP *ld = __s_api_getLDAPconn(flags);
349 return (ldap_search(ld, base, scope, filter, attrs, attrsonly));
352 /* ARGSUSED */
353 int _ns_ldap_search_s(char *service, int flags,
354 char *base, int scope, char *filter,
355 char **attrs, int attrsonly, LDAPMessage **res)
357 LDAP *ld = __s_api_getLDAPconn(flags);
359 return (ldap_search_s(ld, base, scope, filter,
360 attrs, attrsonly, res));
363 /* ARGSUSED */
364 int _ns_ldap_search_st(char *service, int flags,
365 char *base, int scope, char *filter,
366 char **attrs, int attrsonly,
367 struct timeval *timeout, LDAPMessage **res)
369 LDAP *ld = __s_api_getLDAPconn(flags);
371 return (ldap_search_st(ld, base, scope, filter,
372 attrs, attrsonly, timeout, res));