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
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]
23 * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 #include "ns_internal.h"
34 __s_api_getLDAPconn(int flags
)
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
));
53 int _ns_ldap_abandon(char *service
, int flags
,
56 LDAP
*ld
= __s_api_getLDAPconn(flags
);
58 return (ldap_abandon(ld
, msgid
));
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
));
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
));
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
));
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
));
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
));
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
));
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
));
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
));
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
));
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
));
170 int _ns_ldap_delete(char *service
, int flags
,
173 LDAP
*ld
= __s_api_getLDAPconn(flags
);
175 return (ldap_delete(ld
, dn
));
179 int _ns_ldap_delete_s(char *service
, int flags
,
182 LDAP
*ld
= __s_api_getLDAPconn(flags
);
184 return (ldap_delete_s(ld
, dn
));
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
));
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
));
212 int _ns_ldap_modify(char *service
, int flags
,
213 char *dn
, LDAPMod
**mods
)
216 LDAP
*ld
= __s_api_getLDAPconn(flags
);
218 return (ldap_modify(ld
, dn
, mods
));
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
));
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
));
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
));
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
));
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
));
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
));
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
));
302 int _ns_ldap_result(char *service
, int flags
,
304 struct timeval
*timeout
, LDAPMessage
**result
)
306 LDAP
*ld
= __s_api_getLDAPconn(flags
);
308 return (ldap_result(ld
, msgid
, all
, timeout
, result
));
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
));
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
,
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
));
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
));
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
));
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
));