xref: /illumos-gate/usr/src/lib/libsldap/common/ns_wrapper.c (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #include "ns_sldap.h"
28*7c478bd9Sstevel@tonic-gate #include "ns_internal.h"
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
31*7c478bd9Sstevel@tonic-gate static LDAP *
__s_api_getLDAPconn(int flags)32*7c478bd9Sstevel@tonic-gate __s_api_getLDAPconn(int flags)
33*7c478bd9Sstevel@tonic-gate {
34*7c478bd9Sstevel@tonic-gate 	return (NULL);
35*7c478bd9Sstevel@tonic-gate }
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate /*
38*7c478bd9Sstevel@tonic-gate  * Abandon functions
39*7c478bd9Sstevel@tonic-gate  */
40*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_abandon_ext(char * service,int flags,int msgid,LDAPControl ** serverctrls,LDAPControl ** clientctrls)41*7c478bd9Sstevel@tonic-gate int _ns_ldap_abandon_ext(char *service, int flags,
42*7c478bd9Sstevel@tonic-gate 	int msgid, LDAPControl **serverctrls,
43*7c478bd9Sstevel@tonic-gate 	LDAPControl ** clientctrls)
44*7c478bd9Sstevel@tonic-gate {
45*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate 	return (ldap_abandon_ext(ld, msgid, serverctrls, clientctrls));
48*7c478bd9Sstevel@tonic-gate }
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_abandon(char * service,int flags,int msgid)51*7c478bd9Sstevel@tonic-gate int _ns_ldap_abandon(char *service, int flags,
52*7c478bd9Sstevel@tonic-gate 	int msgid)
53*7c478bd9Sstevel@tonic-gate {
54*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
55*7c478bd9Sstevel@tonic-gate 
56*7c478bd9Sstevel@tonic-gate 	return (ldap_abandon(ld, msgid));
57*7c478bd9Sstevel@tonic-gate }
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate /*
60*7c478bd9Sstevel@tonic-gate  * Add functions
61*7c478bd9Sstevel@tonic-gate  */
62*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_add_ext(char * service,int flags,char * dn,LDAPMod ** attrs,LDAPControl ** serverctrls,LDAPControl ** clientctrls,int * msgidp)63*7c478bd9Sstevel@tonic-gate int _ns_ldap_add_ext(char *service, int flags,
64*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **attrs,
65*7c478bd9Sstevel@tonic-gate 	LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp)
66*7c478bd9Sstevel@tonic-gate {
67*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
68*7c478bd9Sstevel@tonic-gate 
69*7c478bd9Sstevel@tonic-gate 	return (ldap_add_ext(ld, dn, attrs,
70*7c478bd9Sstevel@tonic-gate 				serverctrls, clientctrls, msgidp));
71*7c478bd9Sstevel@tonic-gate }
72*7c478bd9Sstevel@tonic-gate 
73*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_add_ext_s(char * service,int flags,char * dn,LDAPMod ** attrs,LDAPControl ** serverctrls,LDAPControl ** clientctrls)74*7c478bd9Sstevel@tonic-gate int _ns_ldap_add_ext_s(char *service, int flags,
75*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **attrs,
76*7c478bd9Sstevel@tonic-gate 	LDAPControl ** serverctrls, LDAPControl **clientctrls)
77*7c478bd9Sstevel@tonic-gate {
78*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate 	return (ldap_add_ext_s(ld, dn, attrs, serverctrls, clientctrls));
81*7c478bd9Sstevel@tonic-gate }
82*7c478bd9Sstevel@tonic-gate 
83*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_add(char * service,int flags,char * dn,LDAPMod ** attrs)84*7c478bd9Sstevel@tonic-gate int _ns_ldap_add(char *service, int flags,
85*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **attrs)
86*7c478bd9Sstevel@tonic-gate {
87*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate 	return (ldap_add(ld, dn, attrs));
90*7c478bd9Sstevel@tonic-gate }
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_add_s(char * service,int flags,char * dn,LDAPMod ** attrs)93*7c478bd9Sstevel@tonic-gate int _ns_ldap_add_s(char *service, int flags,
94*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **attrs)
95*7c478bd9Sstevel@tonic-gate {
96*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
97*7c478bd9Sstevel@tonic-gate 
98*7c478bd9Sstevel@tonic-gate 	return (ldap_add_s(ld, dn, attrs));
99*7c478bd9Sstevel@tonic-gate }
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate /*
102*7c478bd9Sstevel@tonic-gate  * Compare functions
103*7c478bd9Sstevel@tonic-gate  */
104*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_compare_ext(char * service,int flags,char * dn,char * attr,struct berval * bvalue,LDAPControl ** serverctrls,LDAPControl ** clientctrls,int * msgidp)105*7c478bd9Sstevel@tonic-gate int _ns_ldap_compare_ext(char *service, int flags,
106*7c478bd9Sstevel@tonic-gate 	char *dn, char *attr, struct berval *bvalue,
107*7c478bd9Sstevel@tonic-gate 	LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp)
108*7c478bd9Sstevel@tonic-gate {
109*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate 	return (ldap_compare_ext(ld, dn, attr, bvalue,
112*7c478bd9Sstevel@tonic-gate 				    serverctrls, clientctrls, msgidp));
113*7c478bd9Sstevel@tonic-gate }
114*7c478bd9Sstevel@tonic-gate 
115*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_compare_ext_s(char * service,int flags,char * dn,char * attr,struct berval * bvalue,LDAPControl ** serverctrls,LDAPControl ** clientctrls)116*7c478bd9Sstevel@tonic-gate int _ns_ldap_compare_ext_s(char *service, int flags,
117*7c478bd9Sstevel@tonic-gate 	char *dn, char *attr, struct berval *bvalue,
118*7c478bd9Sstevel@tonic-gate 	LDAPControl ** serverctrls, LDAPControl **clientctrls)
119*7c478bd9Sstevel@tonic-gate {
120*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate 	return (ldap_compare_ext_s(ld, dn, attr, bvalue,
123*7c478bd9Sstevel@tonic-gate 		serverctrls, clientctrls));
124*7c478bd9Sstevel@tonic-gate }
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_compare(char * service,int flags,char * dn,char * attr,char * value)127*7c478bd9Sstevel@tonic-gate int _ns_ldap_compare(char *service, int flags,
128*7c478bd9Sstevel@tonic-gate 	char *dn, char *attr, char *value)
129*7c478bd9Sstevel@tonic-gate {
130*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate 	return (ldap_compare(ld, dn, attr, value));
133*7c478bd9Sstevel@tonic-gate }
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_compare_s(char * service,int flags,char * dn,char * attr,char * value)136*7c478bd9Sstevel@tonic-gate int _ns_ldap_compare_s(char *service, int flags,
137*7c478bd9Sstevel@tonic-gate 	char *dn, char *attr, char *value)
138*7c478bd9Sstevel@tonic-gate {
139*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
140*7c478bd9Sstevel@tonic-gate 
141*7c478bd9Sstevel@tonic-gate 	return (ldap_compare_s(ld, dn, attr, value));
142*7c478bd9Sstevel@tonic-gate }
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate /*
145*7c478bd9Sstevel@tonic-gate  * Delete functions
146*7c478bd9Sstevel@tonic-gate  */
147*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_delete_ext(char * service,int flags,char * dn,LDAPControl ** serverctrls,LDAPControl ** clientctrls,int * msgidp)148*7c478bd9Sstevel@tonic-gate int _ns_ldap_delete_ext(char *service, int flags,
149*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPControl **serverctrls,
150*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls, int *msgidp)
151*7c478bd9Sstevel@tonic-gate {
152*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
153*7c478bd9Sstevel@tonic-gate 
154*7c478bd9Sstevel@tonic-gate 	return (ldap_delete_ext(ld, dn, serverctrls, clientctrls, msgidp));
155*7c478bd9Sstevel@tonic-gate }
156*7c478bd9Sstevel@tonic-gate 
157*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_delete_ext_s(char * service,int flags,char * dn,LDAPControl ** serverctrls,LDAPControl ** clientctrls)158*7c478bd9Sstevel@tonic-gate int _ns_ldap_delete_ext_s(char *service, int flags,
159*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPControl **serverctrls,
160*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls)
161*7c478bd9Sstevel@tonic-gate {
162*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate 	return (ldap_delete_ext_s(ld, dn, serverctrls, clientctrls));
165*7c478bd9Sstevel@tonic-gate }
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_delete(char * service,int flags,char * dn)168*7c478bd9Sstevel@tonic-gate int _ns_ldap_delete(char *service, int flags,
169*7c478bd9Sstevel@tonic-gate 	char *dn)
170*7c478bd9Sstevel@tonic-gate {
171*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
172*7c478bd9Sstevel@tonic-gate 
173*7c478bd9Sstevel@tonic-gate 	return (ldap_delete(ld, dn));
174*7c478bd9Sstevel@tonic-gate }
175*7c478bd9Sstevel@tonic-gate 
176*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_delete_s(char * service,int flags,char * dn)177*7c478bd9Sstevel@tonic-gate int _ns_ldap_delete_s(char *service, int flags,
178*7c478bd9Sstevel@tonic-gate 	char *dn)
179*7c478bd9Sstevel@tonic-gate {
180*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
181*7c478bd9Sstevel@tonic-gate 
182*7c478bd9Sstevel@tonic-gate 	return (ldap_delete_s(ld, dn));
183*7c478bd9Sstevel@tonic-gate }
184*7c478bd9Sstevel@tonic-gate 
185*7c478bd9Sstevel@tonic-gate /*
186*7c478bd9Sstevel@tonic-gate  * Modify functions
187*7c478bd9Sstevel@tonic-gate  */
188*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modify_ext(char * service,int flags,char * dn,LDAPMod ** mods,LDAPControl ** serverctrls,LDAPControl ** clientctrls,int * msgidp)189*7c478bd9Sstevel@tonic-gate int _ns_ldap_modify_ext(char *service, int flags,
190*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **mods,
191*7c478bd9Sstevel@tonic-gate 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp)
192*7c478bd9Sstevel@tonic-gate {
193*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
194*7c478bd9Sstevel@tonic-gate 
195*7c478bd9Sstevel@tonic-gate 	return (ldap_modify_ext(ld, dn, mods, serverctrls,
196*7c478bd9Sstevel@tonic-gate 		clientctrls, msgidp));
197*7c478bd9Sstevel@tonic-gate }
198*7c478bd9Sstevel@tonic-gate 
199*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modify_ext_s(char * service,int flags,char * dn,LDAPMod ** mods,LDAPControl ** serverctrls,LDAPControl ** clientctrls)200*7c478bd9Sstevel@tonic-gate int _ns_ldap_modify_ext_s(char *service, int flags,
201*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **mods,
202*7c478bd9Sstevel@tonic-gate 	LDAPControl **serverctrls, LDAPControl **clientctrls)
203*7c478bd9Sstevel@tonic-gate {
204*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
205*7c478bd9Sstevel@tonic-gate 
206*7c478bd9Sstevel@tonic-gate 	return (ldap_modify_ext_s(ld, dn, mods, serverctrls, clientctrls));
207*7c478bd9Sstevel@tonic-gate }
208*7c478bd9Sstevel@tonic-gate 
209*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modify(char * service,int flags,char * dn,LDAPMod ** mods)210*7c478bd9Sstevel@tonic-gate int _ns_ldap_modify(char *service, int flags,
211*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **mods)
212*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
213*7c478bd9Sstevel@tonic-gate {
214*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
215*7c478bd9Sstevel@tonic-gate 
216*7c478bd9Sstevel@tonic-gate 	return (ldap_modify(ld, dn, mods));
217*7c478bd9Sstevel@tonic-gate }
218*7c478bd9Sstevel@tonic-gate 
219*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modify_s(char * service,int flags,char * dn,LDAPMod ** mods)220*7c478bd9Sstevel@tonic-gate int _ns_ldap_modify_s(char *service, int flags,
221*7c478bd9Sstevel@tonic-gate 	char *dn, LDAPMod **mods)
222*7c478bd9Sstevel@tonic-gate {
223*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
224*7c478bd9Sstevel@tonic-gate 
225*7c478bd9Sstevel@tonic-gate 	return (ldap_modify_s(ld, dn, mods));
226*7c478bd9Sstevel@tonic-gate }
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate /*
229*7c478bd9Sstevel@tonic-gate  * Modrdn functions
230*7c478bd9Sstevel@tonic-gate  */
231*7c478bd9Sstevel@tonic-gate 
232*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modrdn(char * service,int flags,char * dn,char * newrdn,int deleteoldrdn)233*7c478bd9Sstevel@tonic-gate int _ns_ldap_modrdn(char *service, int flags,
234*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, int deleteoldrdn)
235*7c478bd9Sstevel@tonic-gate {
236*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
237*7c478bd9Sstevel@tonic-gate 
238*7c478bd9Sstevel@tonic-gate 	return (ldap_modrdn(ld, dn, newrdn));
239*7c478bd9Sstevel@tonic-gate }
240*7c478bd9Sstevel@tonic-gate 
241*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modrdn_s(char * service,int flags,char * dn,char * newrdn,int deleteoldrdn)242*7c478bd9Sstevel@tonic-gate int _ns_ldap_modrdn_s(char *service, int flags,
243*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, int deleteoldrdn)
244*7c478bd9Sstevel@tonic-gate {
245*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
246*7c478bd9Sstevel@tonic-gate 
247*7c478bd9Sstevel@tonic-gate 	return (ldap_modrdn_s(ld, dn, newrdn));
248*7c478bd9Sstevel@tonic-gate }
249*7c478bd9Sstevel@tonic-gate 
250*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modrdn2(char * service,int flags,char * dn,char * newrdn,int deleteoldrdn)251*7c478bd9Sstevel@tonic-gate int _ns_ldap_modrdn2(char *service, int flags,
252*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, int deleteoldrdn)
253*7c478bd9Sstevel@tonic-gate {
254*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
255*7c478bd9Sstevel@tonic-gate 
256*7c478bd9Sstevel@tonic-gate 	return (ldap_modrdn2(ld, dn, newrdn, deleteoldrdn));
257*7c478bd9Sstevel@tonic-gate }
258*7c478bd9Sstevel@tonic-gate 
259*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_modrdn2_s(char * service,int flags,char * dn,char * newrdn,int deleteoldrdn)260*7c478bd9Sstevel@tonic-gate int _ns_ldap_modrdn2_s(char *service, int flags,
261*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, int deleteoldrdn)
262*7c478bd9Sstevel@tonic-gate {
263*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
264*7c478bd9Sstevel@tonic-gate 
265*7c478bd9Sstevel@tonic-gate 	return (ldap_modrdn2_s(ld, dn, newrdn, deleteoldrdn));
266*7c478bd9Sstevel@tonic-gate }
267*7c478bd9Sstevel@tonic-gate 
268*7c478bd9Sstevel@tonic-gate /*
269*7c478bd9Sstevel@tonic-gate  * Rename functions
270*7c478bd9Sstevel@tonic-gate  */
271*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_rename(char * service,int flags,char * dn,char * newrdn,char * newparent,int deleteoldrdn,LDAPControl ** serverctrls,LDAPControl ** clientctrls,int * msgidp)272*7c478bd9Sstevel@tonic-gate int _ns_ldap_rename(char *service, int flags,
273*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, char *newparent,
274*7c478bd9Sstevel@tonic-gate 	int deleteoldrdn, LDAPControl ** serverctrls,
275*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls, int *msgidp)
276*7c478bd9Sstevel@tonic-gate {
277*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
278*7c478bd9Sstevel@tonic-gate 
279*7c478bd9Sstevel@tonic-gate 	return (ldap_rename(ld, dn, newrdn, newparent,
280*7c478bd9Sstevel@tonic-gate 				deleteoldrdn, serverctrls,
281*7c478bd9Sstevel@tonic-gate 				clientctrls, msgidp));
282*7c478bd9Sstevel@tonic-gate }
283*7c478bd9Sstevel@tonic-gate 
284*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_rename_s(char * service,int flags,char * dn,char * newrdn,char * newparent,int deleteoldrdn,LDAPControl ** serverctrls,LDAPControl ** clientctrls)285*7c478bd9Sstevel@tonic-gate int _ns_ldap_rename_s(char *service, int flags,
286*7c478bd9Sstevel@tonic-gate 	char *dn, char *newrdn, char *newparent,
287*7c478bd9Sstevel@tonic-gate 	int deleteoldrdn, LDAPControl ** serverctrls,
288*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls)
289*7c478bd9Sstevel@tonic-gate {
290*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
291*7c478bd9Sstevel@tonic-gate 
292*7c478bd9Sstevel@tonic-gate 	return (ldap_rename_s(ld, dn, newrdn, newparent,
293*7c478bd9Sstevel@tonic-gate 		deleteoldrdn, serverctrls, clientctrls));
294*7c478bd9Sstevel@tonic-gate }
295*7c478bd9Sstevel@tonic-gate 
296*7c478bd9Sstevel@tonic-gate /*
297*7c478bd9Sstevel@tonic-gate  * Result functions
298*7c478bd9Sstevel@tonic-gate  */
299*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_result(char * service,int flags,int msgid,int all,struct timeval * timeout,LDAPMessage ** result)300*7c478bd9Sstevel@tonic-gate int _ns_ldap_result(char *service, int flags,
301*7c478bd9Sstevel@tonic-gate 	int msgid, int all,
302*7c478bd9Sstevel@tonic-gate 	struct timeval *timeout, LDAPMessage **result)
303*7c478bd9Sstevel@tonic-gate {
304*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
305*7c478bd9Sstevel@tonic-gate 
306*7c478bd9Sstevel@tonic-gate 	return (ldap_result(ld, msgid, all, timeout, result));
307*7c478bd9Sstevel@tonic-gate }
308*7c478bd9Sstevel@tonic-gate 
309*7c478bd9Sstevel@tonic-gate /*
310*7c478bd9Sstevel@tonic-gate  * Search functions
311*7c478bd9Sstevel@tonic-gate  */
312*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_search_ext(char * service,int flags,char * base,int scope,char * filter,char ** attrs,int attrsonly,LDAPControl ** serverctrls,LDAPControl ** clientctrls,struct timeval * timeoutp,int sizelimit,int * msgidp)313*7c478bd9Sstevel@tonic-gate int _ns_ldap_search_ext(char *service, int flags,
314*7c478bd9Sstevel@tonic-gate 	char *base, int scope, char *filter,
315*7c478bd9Sstevel@tonic-gate 	char **attrs, int attrsonly, LDAPControl **serverctrls,
316*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls, struct timeval *timeoutp,
317*7c478bd9Sstevel@tonic-gate 	int sizelimit, int *msgidp)
318*7c478bd9Sstevel@tonic-gate {
319*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
320*7c478bd9Sstevel@tonic-gate 
321*7c478bd9Sstevel@tonic-gate 	return (ldap_search_ext(ld, base, scope, filter,
322*7c478bd9Sstevel@tonic-gate 		attrs, attrsonly, serverctrls,
323*7c478bd9Sstevel@tonic-gate 		clientctrls, timeoutp, sizelimit, msgidp));
324*7c478bd9Sstevel@tonic-gate }
325*7c478bd9Sstevel@tonic-gate 
326*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_search_ext_s(char * service,int flags,char * base,int scope,char * filter,char ** attrs,int attrsonly,LDAPControl ** serverctrls,LDAPControl ** clientctrls,struct timeval * timeoutp,int sizelimit,LDAPMessage ** res)327*7c478bd9Sstevel@tonic-gate int _ns_ldap_search_ext_s(char *service, int flags,
328*7c478bd9Sstevel@tonic-gate 	char *base, int scope, char *filter,
329*7c478bd9Sstevel@tonic-gate 	char **attrs, int attrsonly, LDAPControl **serverctrls,
330*7c478bd9Sstevel@tonic-gate 	LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit,
331*7c478bd9Sstevel@tonic-gate 	LDAPMessage **res)
332*7c478bd9Sstevel@tonic-gate {
333*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
334*7c478bd9Sstevel@tonic-gate 
335*7c478bd9Sstevel@tonic-gate 	return (ldap_search_ext_s(ld, base, scope, filter,
336*7c478bd9Sstevel@tonic-gate 		attrs, attrsonly, serverctrls,
337*7c478bd9Sstevel@tonic-gate 		clientctrls, timeoutp, sizelimit, res));
338*7c478bd9Sstevel@tonic-gate }
339*7c478bd9Sstevel@tonic-gate 
340*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_search(char * service,int flags,char * base,int scope,char * filter,char ** attrs,int attrsonly)341*7c478bd9Sstevel@tonic-gate int _ns_ldap_search(char *service, int flags,
342*7c478bd9Sstevel@tonic-gate 	char *base, int scope, char *filter,
343*7c478bd9Sstevel@tonic-gate 	char **attrs, int attrsonly)
344*7c478bd9Sstevel@tonic-gate {
345*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
346*7c478bd9Sstevel@tonic-gate 
347*7c478bd9Sstevel@tonic-gate 	return (ldap_search(ld, base, scope, filter, attrs, attrsonly));
348*7c478bd9Sstevel@tonic-gate }
349*7c478bd9Sstevel@tonic-gate 
350*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_search_s(char * service,int flags,char * base,int scope,char * filter,char ** attrs,int attrsonly,LDAPMessage ** res)351*7c478bd9Sstevel@tonic-gate int _ns_ldap_search_s(char *service, int flags,
352*7c478bd9Sstevel@tonic-gate 	char *base, int scope, char *filter,
353*7c478bd9Sstevel@tonic-gate 	char **attrs, int attrsonly, LDAPMessage **res)
354*7c478bd9Sstevel@tonic-gate {
355*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
356*7c478bd9Sstevel@tonic-gate 
357*7c478bd9Sstevel@tonic-gate 	return (ldap_search_s(ld, base, scope, filter,
358*7c478bd9Sstevel@tonic-gate 		attrs, attrsonly, res));
359*7c478bd9Sstevel@tonic-gate }
360*7c478bd9Sstevel@tonic-gate 
361*7c478bd9Sstevel@tonic-gate /* ARGSUSED */
_ns_ldap_search_st(char * service,int flags,char * base,int scope,char * filter,char ** attrs,int attrsonly,struct timeval * timeout,LDAPMessage ** res)362*7c478bd9Sstevel@tonic-gate int _ns_ldap_search_st(char *service, int flags,
363*7c478bd9Sstevel@tonic-gate 	char *base, int scope, char *filter,
364*7c478bd9Sstevel@tonic-gate 	char **attrs, int attrsonly,
365*7c478bd9Sstevel@tonic-gate 	struct timeval *timeout, LDAPMessage **res)
366*7c478bd9Sstevel@tonic-gate {
367*7c478bd9Sstevel@tonic-gate 	LDAP *ld = __s_api_getLDAPconn(flags);
368*7c478bd9Sstevel@tonic-gate 
369*7c478bd9Sstevel@tonic-gate 	return (ldap_search_st(ld, base, scope, filter,
370*7c478bd9Sstevel@tonic-gate 		attrs, attrsonly, timeout, res));
371*7c478bd9Sstevel@tonic-gate }
372