xref: /titanic_50/usr/src/lib/libldap5/sources/ldap/common/llib-lldap (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate/* LINTLIBRARY */
2*7c478bd9Sstevel@tonic-gate/* PROTOLIB1 */
3*7c478bd9Sstevel@tonic-gate
4*7c478bd9Sstevel@tonic-gate/*
5*7c478bd9Sstevel@tonic-gate * Copyright 2001, 2003 Sun Microsystems, Inc.  All rights reserved.
6*7c478bd9Sstevel@tonic-gate * Use is subject to license terms.
7*7c478bd9Sstevel@tonic-gate */
8*7c478bd9Sstevel@tonic-gate
9*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
10*7c478bd9Sstevel@tonic-gate
11*7c478bd9Sstevel@tonic-gate#include <stdio.h>
12*7c478bd9Sstevel@tonic-gate#include <sys/types.h>
13*7c478bd9Sstevel@tonic-gate#include <lber.h>
14*7c478bd9Sstevel@tonic-gate#include <ldap.h>
15*7c478bd9Sstevel@tonic-gate
16*7c478bd9Sstevel@tonic-gate
17*7c478bd9Sstevel@tonic-gate/*
18*7c478bd9Sstevel@tonic-gate * in abandon.c:
19*7c478bd9Sstevel@tonic-gate */
20*7c478bd9Sstevel@tonic-gateint ldap_abandon_ext(LDAP *ld, int msgid, LDAPControl **serverctrls, LDAPControl ** clientctrls);
21*7c478bd9Sstevel@tonic-gate
22*7c478bd9Sstevel@tonic-gateint ldap_abandon( LDAP *ld, int msgid );
23*7c478bd9Sstevel@tonic-gate
24*7c478bd9Sstevel@tonic-gate/*
25*7c478bd9Sstevel@tonic-gate * in add.c:
26*7c478bd9Sstevel@tonic-gate */
27*7c478bd9Sstevel@tonic-gateint ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs, LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp);
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gateint ldap_add_ext_s( LDAP *ld, const char *dn, LDAPMod **attrs, LDAPControl ** serverctrls, LDAPControl **clientctrls);
30*7c478bd9Sstevel@tonic-gate
31*7c478bd9Sstevel@tonic-gateint ldap_add( LDAP *ld, const char *dn, LDAPMod **attrs );
32*7c478bd9Sstevel@tonic-gateint ldap_add_s( LDAP *ld, const char *dn, LDAPMod **attrs );
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gate/*
35*7c478bd9Sstevel@tonic-gate * in bind.c:
36*7c478bd9Sstevel@tonic-gate */
37*7c478bd9Sstevel@tonic-gateint ldap_bind(LDAP *ld, const char *dn, const char *passwd, int authmethod);
38*7c478bd9Sstevel@tonic-gateint ldap_bind_s(LDAP *ld, const char *dn, const char *passwd, int authmethod);
39*7c478bd9Sstevel@tonic-gatevoid ldap_set_rebind_proc(LDAP *ld, LDAP_REBINDPROC_CALLBACK *rebindproc, void *arg);
40*7c478bd9Sstevel@tonic-gate
41*7c478bd9Sstevel@tonic-gate/*
42*7c478bd9Sstevel@tonic-gate * in sbind.c:
43*7c478bd9Sstevel@tonic-gate */
44*7c478bd9Sstevel@tonic-gateint ldap_simple_bind( LDAP *ld, const char *dn, const char *passwd );
45*7c478bd9Sstevel@tonic-gateint ldap_simple_bind_s( LDAP *ld, const char *dn, const char *passwd );
46*7c478bd9Sstevel@tonic-gate
47*7c478bd9Sstevel@tonic-gate/*
48*7c478bd9Sstevel@tonic-gate * in saslbind.c:
49*7c478bd9Sstevel@tonic-gate */
50*7c478bd9Sstevel@tonic-gateint ldap_sasl_bind(LDAP *ld, const char *dn, const char *mechanism, const struct berval *cred, LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp);
51*7c478bd9Sstevel@tonic-gate
52*7c478bd9Sstevel@tonic-gateint ldap_sasl_bind_s(LDAP *ld, const char *dn, const char *mechanism, const struct berval *cred, LDAPControl **serverctrls, LDAPControl **clientctrls, struct berval **servercredp);
53*7c478bd9Sstevel@tonic-gate
54*7c478bd9Sstevel@tonic-gate/*
55*7c478bd9Sstevel@tonic-gate * in kbind.c:
56*7c478bd9Sstevel@tonic-gate */
57*7c478bd9Sstevel@tonic-gate
58*7c478bd9Sstevel@tonic-gate/*
59*7c478bd9Sstevel@tonic-gate * in cache.c
60*7c478bd9Sstevel@tonic-gate */
61*7c478bd9Sstevel@tonic-gate
62*7c478bd9Sstevel@tonic-gate/*
63*7c478bd9Sstevel@tonic-gate * in compare.c:
64*7c478bd9Sstevel@tonic-gate */
65*7c478bd9Sstevel@tonic-gateint ldap_compare_ext(LDAP *ld, const char *dn, const char *attr, const struct berval *bvalue, LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp);
66*7c478bd9Sstevel@tonic-gate
67*7c478bd9Sstevel@tonic-gateint ldap_compare_ext_s(LDAP *ld, const char *dn, const char *attr, const struct berval *bvalue, LDAPControl ** serverctrls, LDAPControl **clientctrls) ;
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gateint ldap_compare( LDAP *ld, const char *dn, const char *attr, const char *value );
70*7c478bd9Sstevel@tonic-gate
71*7c478bd9Sstevel@tonic-gateint ldap_compare_s( LDAP *ld, const char *dn, const char *attr, const char *value );
72*7c478bd9Sstevel@tonic-gate
73*7c478bd9Sstevel@tonic-gate/*
74*7c478bd9Sstevel@tonic-gate * in delete.c:
75*7c478bd9Sstevel@tonic-gate */
76*7c478bd9Sstevel@tonic-gateint ldap_delete_ext(LDAP *ld, const char *dn, LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp);
77*7c478bd9Sstevel@tonic-gate
78*7c478bd9Sstevel@tonic-gateint ldap_delete_ext_s(LDAP *ld, const char *dn, LDAPControl **serverctrls, LDAPControl **clientctrls);
79*7c478bd9Sstevel@tonic-gate
80*7c478bd9Sstevel@tonic-gateint ldap_delete( LDAP *ld, const char *dn );
81*7c478bd9Sstevel@tonic-gateint ldap_delete_s( LDAP *ld, const char *dn );
82*7c478bd9Sstevel@tonic-gate
83*7c478bd9Sstevel@tonic-gate/*
84*7c478bd9Sstevel@tonic-gate * in error.c:
85*7c478bd9Sstevel@tonic-gate */
86*7c478bd9Sstevel@tonic-gatechar *ldap_err2string( int err );
87*7c478bd9Sstevel@tonic-gatevoid ldap_perror(LDAP *ld, const char *s);
88*7c478bd9Sstevel@tonic-gateint ldap_result2error(LDAP *ld, LDAPMessage *r, int freeit);
89*7c478bd9Sstevel@tonic-gateint ldap_get_lderrno(LDAP *ld, char **m, char **s);
90*7c478bd9Sstevel@tonic-gateint ldap_set_lderrno(LDAP *ld, int e, char *m, char *s);
91*7c478bd9Sstevel@tonic-gate
92*7c478bd9Sstevel@tonic-gate/*
93*7c478bd9Sstevel@tonic-gate * in modify.c:
94*7c478bd9Sstevel@tonic-gate */
95*7c478bd9Sstevel@tonic-gateint ldap_modify_ext(LDAP *ld, const char *dn, LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp);
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gateint ldap_modify_ext_s(LDAP *ld, const char *dn, LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls) ;
98*7c478bd9Sstevel@tonic-gate
99*7c478bd9Sstevel@tonic-gateint ldap_modify( LDAP *ld, const char *dn, LDAPMod **mods );
100*7c478bd9Sstevel@tonic-gateint ldtap_modify_s( LDAP *ld, const char *dn, LDAPMod **mods );
101*7c478bd9Sstevel@tonic-gate
102*7c478bd9Sstevel@tonic-gate/*
103*7c478bd9Sstevel@tonic-gate * in modrdn.c:
104*7c478bd9Sstevel@tonic-gate */
105*7c478bd9Sstevel@tonic-gate
106*7c478bd9Sstevel@tonic-gate/*
107*7c478bd9Sstevel@tonic-gate * in rename.c:
108*7c478bd9Sstevel@tonic-gate */
109*7c478bd9Sstevel@tonic-gateint ldap_rename(LDAP *ld, const char *dn, const char *newrdn, const char *newparent, int deleteoldrdn, LDAPControl ** serverctrls, LDAPControl **clientctrls, int *msgidp);
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gateint ldap_rename_s(LDAP *ld, const char *dn, const char *newrdn, const char *newparent, int deleteoldrdn, LDAPControl ** serverctrls, LDAPControl **clientctrls);
112*7c478bd9Sstevel@tonic-gate
113*7c478bd9Sstevel@tonic-gateint ldap_modrdn(LDAP *ld, const char *dn, const char *newrdn);
114*7c478bd9Sstevel@tonic-gateint ldap_modrdn_s(LDAP *ld, const char *dn, const char *newrdn);
115*7c478bd9Sstevel@tonic-gateint ldap_modrdn2(LDAP *ld, const char *dn, const char *newrdn, int deleteoldrdn);
116*7c478bd9Sstevel@tonic-gate
117*7c478bd9Sstevel@tonic-gateint ldap_modrdn2_s(LDAP *ld, const char *dn, const char *newrdn, int deleteoldrdn);
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gate/*
120*7c478bd9Sstevel@tonic-gate * in open.c:
121*7c478bd9Sstevel@tonic-gate */
122*7c478bd9Sstevel@tonic-gateLDAP *ldap_init( const char *defhost, int defport );
123*7c478bd9Sstevel@tonic-gateLDAP *ldap_open(const char *host, int port);
124*7c478bd9Sstevel@tonic-gateint ldap_version(LDAPVersion *ver);
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gate/*
127*7c478bd9Sstevel@tonic-gate * in getentry.c:
128*7c478bd9Sstevel@tonic-gate */
129*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_first_entry( LDAP *ld, LDAPMessage *res );
130*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_next_entry( LDAP *ld, LDAPMessage *entry );
131*7c478bd9Sstevel@tonic-gateint ldap_count_entries( LDAP *ld, LDAPMessage *res );
132*7c478bd9Sstevel@tonic-gateint ldap_get_entry_controls(LDAP *ld, LDAPMessage *entry, LDAPControl ***serverctrlsp);
133*7c478bd9Sstevel@tonic-gate
134*7c478bd9Sstevel@tonic-gate/*
135*7c478bd9Sstevel@tonic-gate * in getmsg.c:
136*7c478bd9Sstevel@tonic-gate */
137*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_first_message( LDAP *ld, LDAPMessage *res );
138*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_next_message( LDAP *ld, LDAPMessage *msg );
139*7c478bd9Sstevel@tonic-gateint ldap_count_messages( LDAP *ld, LDAPMessage *res );
140*7c478bd9Sstevel@tonic-gate
141*7c478bd9Sstevel@tonic-gate/*
142*7c478bd9Sstevel@tonic-gate * in getref.c:
143*7c478bd9Sstevel@tonic-gate */
144*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_first_reference( LDAP *ld, LDAPMessage *res );
145*7c478bd9Sstevel@tonic-gateLDAPMessage *ldap_next_reference( LDAP *ld, LDAPMessage *entry );
146*7c478bd9Sstevel@tonic-gateint ldap_count_references( LDAP *ld, LDAPMessage *res );
147*7c478bd9Sstevel@tonic-gate
148*7c478bd9Sstevel@tonic-gate/*
149*7c478bd9Sstevel@tonic-gate * in getdn.c
150*7c478bd9Sstevel@tonic-gate */
151*7c478bd9Sstevel@tonic-gatechar *ldap_get_dn( LDAP *ld, LDAPMessage *entry );
152*7c478bd9Sstevel@tonic-gatechar **ldap_explode_dn( const char *dn, const int notypes );
153*7c478bd9Sstevel@tonic-gatechar ** ldap_explode_rdn( const char *rdn, const int notypes );
154*7c478bd9Sstevel@tonic-gatechar *ldap_dn2ufn( const char *dn );
155*7c478bd9Sstevel@tonic-gatechar **ldap_explode_dns( const char *dn );
156*7c478bd9Sstevel@tonic-gateint ldap_is_dns_dn( const char *dn );
157*7c478bd9Sstevel@tonic-gatechar *ldap_dns_to_dn(char *dns_name, int *nameparts);
158*7c478bd9Sstevel@tonic-gate
159*7c478bd9Sstevel@tonic-gate/*
160*7c478bd9Sstevel@tonic-gate * in getattr.c
161*7c478bd9Sstevel@tonic-gate */
162*7c478bd9Sstevel@tonic-gatechar *ldap_first_attribute( LDAP *ld, LDAPMessage *entry,
163*7c478bd9Sstevel@tonic-gate	BerElement **ber );
164*7c478bd9Sstevel@tonic-gate
165*7c478bd9Sstevel@tonic-gatechar *ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
166*7c478bd9Sstevel@tonic-gate	BerElement *ber );
167*7c478bd9Sstevel@tonic-gate
168*7c478bd9Sstevel@tonic-gatevoid ldap_memfree(void *p);
169*7c478bd9Sstevel@tonic-gate
170*7c478bd9Sstevel@tonic-gate/*
171*7c478bd9Sstevel@tonic-gate * in getvalues.c
172*7c478bd9Sstevel@tonic-gate */
173*7c478bd9Sstevel@tonic-gatechar **ldap_get_values( LDAP *ld, LDAPMessage *entry, const char *target );
174*7c478bd9Sstevel@tonic-gateint ldap_count_values( char **vals );
175*7c478bd9Sstevel@tonic-gateint ldap_count_values_len( struct berval **vals );
176*7c478bd9Sstevel@tonic-gatevoid ldap_value_free( char **vals );
177*7c478bd9Sstevel@tonic-gatevoid ldap_value_free_len( struct berval **vals );
178*7c478bd9Sstevel@tonic-gate
179*7c478bd9Sstevel@tonic-gatestruct berval **ldap_get_values_len(LDAP *ld, LDAPMessage *entry, const char *target);
180*7c478bd9Sstevel@tonic-gate
181*7c478bd9Sstevel@tonic-gatechar **ldap_get_lang_values(LDAP *ld, LDAPMessage *entry, const char *target, char **type);
182*7c478bd9Sstevel@tonic-gate
183*7c478bd9Sstevel@tonic-gatestruct berval **ldap_get_lang_values_len(LDAP *ld, LDAPMessage *entry, const char *target, char **type);
184*7c478bd9Sstevel@tonic-gate
185*7c478bd9Sstevel@tonic-gate/*
186*7c478bd9Sstevel@tonic-gate * in referral.c:
187*7c478bd9Sstevel@tonic-gate */
188*7c478bd9Sstevel@tonic-gateint ldap_parse_reference(LDAP *ld, LDAPMessage *ref,
189*7c478bd9Sstevel@tonic-gate        char ***referralsp, LDAPControl ***serverctrlsp, int freeit);
190*7c478bd9Sstevel@tonic-gatechar ** ldap_get_reference_urls(LDAP *ld, LDAPMessage *res);
191*7c478bd9Sstevel@tonic-gate
192*7c478bd9Sstevel@tonic-gate/*
193*7c478bd9Sstevel@tonic-gate * in result.c:
194*7c478bd9Sstevel@tonic-gate */
195*7c478bd9Sstevel@tonic-gateint ldap_result( LDAP *ld, int msgid, int all,
196*7c478bd9Sstevel@tonic-gate	struct timeval *timeout, LDAPMessage **result );
197*7c478bd9Sstevel@tonic-gate
198*7c478bd9Sstevel@tonic-gateint ldap_msgfree( LDAPMessage *lm );
199*7c478bd9Sstevel@tonic-gateint ldap_msgtype( LDAPMessage *res );
200*7c478bd9Sstevel@tonic-gateint ldap_msgid( LDAPMessage *res );
201*7c478bd9Sstevel@tonic-gateint ldap_parse_result(LDAP *ld, LDAPMessage *res, int *errcodep, char **matcheddnp, char **errmsgp, char ***referralsp, LDAPControl ***serverctrlsp, int freeit) ;
202*7c478bd9Sstevel@tonic-gate
203*7c478bd9Sstevel@tonic-gateint ldap_parse_sasl_bind_result(LDAP *ld, LDAPMessage *res, struct berval **servercredp, int freeit);
204*7c478bd9Sstevel@tonic-gate
205*7c478bd9Sstevel@tonic-gateint ldap_parse_extended_result(LDAP *ld, LDAPMessage *res, char **resultoidp, struct berval **resultdata, int freeit);
206*7c478bd9Sstevel@tonic-gate
207*7c478bd9Sstevel@tonic-gate/*
208*7c478bd9Sstevel@tonic-gate * in search.c:
209*7c478bd9Sstevel@tonic-gate */
210*7c478bd9Sstevel@tonic-gateint ldap_search_ext(LDAP *ld, const char *base, int scope, const char *filter, char **attrs, int attrsonly, LDAPControl **serverctrls, LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit, int *msgidp);
211*7c478bd9Sstevel@tonic-gate
212*7c478bd9Sstevel@tonic-gateint ldap_search_ext_s(LDAP *ld, const char *base, int scope, const char *filter, char **attrs, int attrsonly, LDAPControl **serverctrls, LDAPControl **clientctrls, struct timeval *timeoutp, int sizelimit, LDAPMessage **res);
213*7c478bd9Sstevel@tonic-gate
214*7c478bd9Sstevel@tonic-gateint ldap_search( LDAP *ld, const char *base, int scope, const char *filter,
215*7c478bd9Sstevel@tonic-gate	char **attrs, int attrsonly );
216*7c478bd9Sstevel@tonic-gate
217*7c478bd9Sstevel@tonic-gateint ldap_search_s( LDAP *ld, const char *base, int scope, const char *filter,
218*7c478bd9Sstevel@tonic-gate	char **attrs, int attrsonly, LDAPMessage **res );
219*7c478bd9Sstevel@tonic-gate
220*7c478bd9Sstevel@tonic-gateint ldap_search_st( LDAP *ld, const char *base, int scope, const char *filter,
221*7c478bd9Sstevel@tonic-gate    char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res );
222*7c478bd9Sstevel@tonic-gate
223*7c478bd9Sstevel@tonic-gate/*
224*7c478bd9Sstevel@tonic-gate * in ufn.c
225*7c478bd9Sstevel@tonic-gate */
226*7c478bd9Sstevel@tonic-gateint ldap_ufn_search_c( LDAP *ld, char *ufn, char **attrs,
227*7c478bd9Sstevel@tonic-gate	int attrsonly, LDAPMessage **res, LDAP_CANCELPROC_CALLBACK cancelproc,
228*7c478bd9Sstevel@tonic-gate	void *cancelparm );
229*7c478bd9Sstevel@tonic-gate
230*7c478bd9Sstevel@tonic-gateint ldap_ufn_search_ct( LDAP *ld, char *ufn, char **attrs,
231*7c478bd9Sstevel@tonic-gate	int attrsonly, LDAPMessage **res, LDAP_CANCELPROC_CALLBACK cancelproc,
232*7c478bd9Sstevel@tonic-gate	void *cancelparm, char *tag1, char *tag2, char *tag3 );
233*7c478bd9Sstevel@tonic-gate
234*7c478bd9Sstevel@tonic-gateint ldap_ufn_search_s( LDAP *ld, char *ufn, char **attrs,
235*7c478bd9Sstevel@tonic-gate	int attrsonly, LDAPMessage **res );
236*7c478bd9Sstevel@tonic-gate
237*7c478bd9Sstevel@tonic-gateLDAPFiltDesc *ldap_ufn_setfilter( LDAP *ld, char *fname );
238*7c478bd9Sstevel@tonic-gatevoid ldap_ufn_setprefix( LDAP *ld, char *prefix );
239*7c478bd9Sstevel@tonic-gateint ldap_ufn_timeout( void *tvparam );
240*7c478bd9Sstevel@tonic-gate
241*7c478bd9Sstevel@tonic-gate
242*7c478bd9Sstevel@tonic-gate/*
243*7c478bd9Sstevel@tonic-gate * in unbind.c
244*7c478bd9Sstevel@tonic-gate */
245*7c478bd9Sstevel@tonic-gateint ldap_unbind( LDAP *ld );
246*7c478bd9Sstevel@tonic-gateint ldap_unbind_s( LDAP *ld );
247*7c478bd9Sstevel@tonic-gateint ldap_unbind_ext(LDAP *ld, LDAPControl **serverctrls, LDAPControl **clientctrls);
248*7c478bd9Sstevel@tonic-gate
249*7c478bd9Sstevel@tonic-gate
250*7c478bd9Sstevel@tonic-gate/*
251*7c478bd9Sstevel@tonic-gate * in getfilter.c
252*7c478bd9Sstevel@tonic-gate */
253*7c478bd9Sstevel@tonic-gateLDAPFiltDesc *ldap_init_getfilter( char *fname );
254*7c478bd9Sstevel@tonic-gateLDAPFiltDesc *ldap_init_getfilter_buf( char *buf, ssize_t buflen );
255*7c478bd9Sstevel@tonic-gateLDAPFiltInfo *ldap_getfirstfilter( LDAPFiltDesc *lfdp, char *tagpat,
256*7c478bd9Sstevel@tonic-gate	char *value );
257*7c478bd9Sstevel@tonic-gate
258*7c478bd9Sstevel@tonic-gateLDAPFiltInfo *ldap_getnextfilter( LDAPFiltDesc *lfdp );
259*7c478bd9Sstevel@tonic-gatevoid ldap_setfilteraffixes( LDAPFiltDesc *lfdp, char *prefix, char *suffix );
260*7c478bd9Sstevel@tonic-gatevoid ldap_build_filter( char *filtbuf, size_t buflen,
261*7c478bd9Sstevel@tonic-gate	char *pattern, char *prefix, char *suffix, char *attr,
262*7c478bd9Sstevel@tonic-gate	char *value, char **valwords );
263*7c478bd9Sstevel@tonic-gate
264*7c478bd9Sstevel@tonic-gateint ldap_create_filter(char *buf, unsigned long buflen, char *pattern, char *prefix, char *suffix, char *attr, char *value, char **valwords);
265*7c478bd9Sstevel@tonic-gate
266*7c478bd9Sstevel@tonic-gate/*
267*7c478bd9Sstevel@tonic-gate * in free.c
268*7c478bd9Sstevel@tonic-gate */
269*7c478bd9Sstevel@tonic-gatevoid ldap_getfilter_free( LDAPFiltDesc *lfdp );
270*7c478bd9Sstevel@tonic-gatevoid ldap_mods_free( LDAPMod **mods, int freemods );
271*7c478bd9Sstevel@tonic-gatevoid ldap_ber_free(BerElement *ber, int freebuf);
272*7c478bd9Sstevel@tonic-gate
273*7c478bd9Sstevel@tonic-gate/*
274*7c478bd9Sstevel@tonic-gate * in friendly.c
275*7c478bd9Sstevel@tonic-gate */
276*7c478bd9Sstevel@tonic-gatechar *ldap_friendly_name( char *filename, char *uname,
277*7c478bd9Sstevel@tonic-gate	FriendlyMap *map );
278*7c478bd9Sstevel@tonic-gate
279*7c478bd9Sstevel@tonic-gatevoid ldap_free_friendlymap( FriendlyMap *map );
280*7c478bd9Sstevel@tonic-gate
281*7c478bd9Sstevel@tonic-gate
282*7c478bd9Sstevel@tonic-gate/*
283*7c478bd9Sstevel@tonic-gate * in cldap.c
284*7c478bd9Sstevel@tonic-gate */
285*7c478bd9Sstevel@tonic-gate
286*7c478bd9Sstevel@tonic-gate
287*7c478bd9Sstevel@tonic-gate/*
288*7c478bd9Sstevel@tonic-gate * in sort.c
289*7c478bd9Sstevel@tonic-gate */
290*7c478bd9Sstevel@tonic-gateint ldap_sort_entries( LDAP *ld, LDAPMessage **chain, char *attr,
291*7c478bd9Sstevel@tonic-gate	int (*cmp)() );
292*7c478bd9Sstevel@tonic-gate
293*7c478bd9Sstevel@tonic-gateint ldap_sort_values( LDAP *ld, char **vals, int (*cmp)() );
294*7c478bd9Sstevel@tonic-gateint ldap_sort_strcasecmp( const char **a, const char **b );
295*7c478bd9Sstevel@tonic-gateint ldap_multisort_entries(LDAP *ld, LDAPMessage **chain, char **attr, LDAP_CMP_CALLBACK *cmp);
296*7c478bd9Sstevel@tonic-gate
297*7c478bd9Sstevel@tonic-gate
298*7c478bd9Sstevel@tonic-gate/*
299*7c478bd9Sstevel@tonic-gate * in url.c
300*7c478bd9Sstevel@tonic-gate */
301*7c478bd9Sstevel@tonic-gateint ldap_is_ldap_url( const char *url );
302*7c478bd9Sstevel@tonic-gateint ldap_url_parse( const char *url, LDAPURLDesc **ludpp );
303*7c478bd9Sstevel@tonic-gateint ldap_url_parse_nodn(const char *url, LDAPURLDesc **ludpp);
304*7c478bd9Sstevel@tonic-gatevoid ldap_free_urldesc( LDAPURLDesc *ludp );
305*7c478bd9Sstevel@tonic-gateint ldap_url_search( LDAP *ld, const char *url, int attrsonly );
306*7c478bd9Sstevel@tonic-gateint ldap_url_search_s( LDAP *ld, const char *url, int attrsonly,
307*7c478bd9Sstevel@tonic-gate	LDAPMessage **res );
308*7c478bd9Sstevel@tonic-gate
309*7c478bd9Sstevel@tonic-gateint ldap_url_search_st( LDAP *ld, const char *url, int attrsonly,
310*7c478bd9Sstevel@tonic-gate	struct timeval *timeout, LDAPMessage **res );
311*7c478bd9Sstevel@tonic-gate
312*7c478bd9Sstevel@tonic-gatechar *ldap_dns_to_url(LDAP *ld, char *dns_name, char *attrs,
313*7c478bd9Sstevel@tonic-gatechar *scope, char *filter);
314*7c478bd9Sstevel@tonic-gatechar *ldap_dn_to_url(LDAP *ld, char *dn, int nameparts);
315*7c478bd9Sstevel@tonic-gate
316*7c478bd9Sstevel@tonic-gate
317*7c478bd9Sstevel@tonic-gate/*
318*7c478bd9Sstevel@tonic-gate * in charset.c
319*7c478bd9Sstevel@tonic-gate */
320*7c478bd9Sstevel@tonic-gatevoid ldap_set_string_translators( LDAP *ld,
321*7c478bd9Sstevel@tonic-gate	BERTranslateProc encode_proc, BERTranslateProc decode_proc );
322*7c478bd9Sstevel@tonic-gate
323*7c478bd9Sstevel@tonic-gateint ldap_translate_from_t61( LDAP *ld, char **bufp,
324*7c478bd9Sstevel@tonic-gate	unsigned int *lenp, int free_input );
325*7c478bd9Sstevel@tonic-gate
326*7c478bd9Sstevel@tonic-gateint ldap_translate_to_t61( LDAP *ld, char **bufp,
327*7c478bd9Sstevel@tonic-gate	unsigned int *lenp, int free_input );
328*7c478bd9Sstevel@tonic-gate
329*7c478bd9Sstevel@tonic-gatevoid ldap_enable_translation( LDAP *ld, LDAPMessage *entry,
330*7c478bd9Sstevel@tonic-gate	int enable );
331*7c478bd9Sstevel@tonic-gate
332*7c478bd9Sstevel@tonic-gateint ldap_t61_to_8859(char **bufp, unsigned long *buflenp,
333*7c478bd9Sstevel@tonic-gate        int free_input);
334*7c478bd9Sstevel@tonic-gate
335*7c478bd9Sstevel@tonic-gateint ldap_8859_to_t61(char **bufp, unsigned long *buflenp,
336*7c478bd9Sstevel@tonic-gate        int free_input);
337*7c478bd9Sstevel@tonic-gate
338*7c478bd9Sstevel@tonic-gate
339*7c478bd9Sstevel@tonic-gate/*
340*7c478bd9Sstevel@tonic-gate * in io.c
341*7c478bd9Sstevel@tonic-gate */
342*7c478bd9Sstevel@tonic-gateBerElement *ber_alloc_t(int options);
343*7c478bd9Sstevel@tonic-gateint ber_flatten(BerElement *ber, struct berval **bvPtr);
344*7c478bd9Sstevel@tonic-gatevoid ber_free(BerElement *ber, int freebuf);
345*7c478bd9Sstevel@tonic-gateBerElement *ber_alloc(void);
346*7c478bd9Sstevel@tonic-gateBerElement *ber_init(const struct berval *bv);
347*7c478bd9Sstevel@tonic-gate
348*7c478bd9Sstevel@tonic-gate/*
349*7c478bd9Sstevel@tonic-gate * in decode.c
350*7c478bd9Sstevel@tonic-gate */
351*7c478bd9Sstevel@tonic-gatestruct berval *ber_bvdup(const struct berval *bv);
352*7c478bd9Sstevel@tonic-gatevoid ber_bvecfree(struct berval **bv);
353*7c478bd9Sstevel@tonic-gatevoid ber_bvfree(struct berval *bv);
354*7c478bd9Sstevel@tonic-gateber_tag_t ber_first_element(BerElement *ber, unsigned int *len, char **last);
355*7c478bd9Sstevel@tonic-gateber_tag_t ber_next_element(BerElement *ber, ber_tag_t *len, char *last);
356*7c478bd9Sstevel@tonic-gateber_tag_t ber_peek_tag(BerElement *ber, ber_tag_t *len);
357*7c478bd9Sstevel@tonic-gateber_tag_t ber_scanf(BerElement *ber, const char *fmt, ...);
358*7c478bd9Sstevel@tonic-gateber_tag_t ber_skip_tag(BerElement *ber, ber_tag_t *len);
359*7c478bd9Sstevel@tonic-gateber_tag_t ber_get_int(BerElement *ber, ber_int_t *num);
360*7c478bd9Sstevel@tonic-gate
361*7c478bd9Sstevel@tonic-gate/*
362*7c478bd9Sstevel@tonic-gate * in encode.c
363*7c478bd9Sstevel@tonic-gate */
364*7c478bd9Sstevel@tonic-gateint ber_printf(BerElement *ber, const char *fmt, ...);
365*7c478bd9Sstevel@tonic-gate
366*7c478bd9Sstevel@tonic-gate/*
367*7c478bd9Sstevel@tonic-gate * in control.c
368*7c478bd9Sstevel@tonic-gate */
369*7c478bd9Sstevel@tonic-gatevoid ldap_control_free (LDAPControl *ctrl);
370*7c478bd9Sstevel@tonic-gatevoid ldap_controls_free (LDAPControl **ctrls);
371*7c478bd9Sstevel@tonic-gate
372*7c478bd9Sstevel@tonic-gate/*
373*7c478bd9Sstevel@tonic-gate * in spagectrl.c
374*7c478bd9Sstevel@tonic-gate */
375*7c478bd9Sstevel@tonic-gateint ldap_create_page_control(LDAP *ld, unsigned int pagesize, struct berval *cookie, char isCritical, LDAPControl **output);
376*7c478bd9Sstevel@tonic-gate
377*7c478bd9Sstevel@tonic-gateint ldap_parse_page_control(LDAP *ld, LDAPControl **controls, unsigned int *totalcount, struct berval **cookie);
378*7c478bd9Sstevel@tonic-gate
379*7c478bd9Sstevel@tonic-gate/*
380*7c478bd9Sstevel@tonic-gate * in tmplout.c
381*7c478bd9Sstevel@tonic-gate */
382*7c478bd9Sstevel@tonic-gateint ldap_entry2html(LDAP *ld, char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts, char *urlprefix, char *base);
383*7c478bd9Sstevel@tonic-gate
384*7c478bd9Sstevel@tonic-gateint ldap_entry2html_search(LDAP *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl*tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol,int rdncount, unsigned long opts, char *urlprefix);
385*7c478bd9Sstevel@tonic-gate
386*7c478bd9Sstevel@tonic-gateint ldap_entry2text(LDAP *ld, char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, unsigned long opts);
387*7c478bd9Sstevel@tonic-gate
388*7c478bd9Sstevel@tonic-gateint ldap_entry2text_search(LDAP *ld,char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl*tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol,int rdncount, unsigned long opts);
389*7c478bd9Sstevel@tonic-gate
390*7c478bd9Sstevel@tonic-gateint ldap_vals2html(LDAP *ld, char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, char *eol, int rdncount, char *urlprefix);
391*7c478bd9Sstevel@tonic-gate
392*7c478bd9Sstevel@tonic-gateint ldap_vals2text(LDAP *ld, char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, char *eol, int rdncount);
393*7c478bd9Sstevel@tonic-gate
394*7c478bd9Sstevel@tonic-gate/*
395*7c478bd9Sstevel@tonic-gate * in extendop.c
396*7c478bd9Sstevel@tonic-gate */
397*7c478bd9Sstevel@tonic-gateint ldap_extended_operation(LDAP *ld, const char *requestoid, const struct berval *requestdata, LDAPControl **serverctrls, LDAPControl**clientctrls, int *msgidp);
398*7c478bd9Sstevel@tonic-gate
399*7c478bd9Sstevel@tonic-gateint ldap_extended_operation_s(LDAP *ld, const char *requestoid, const struct berval *requestdata, LDAPControl **serverctrls, LDAPControl **clientctrls, char **retoidp, struct berval **retdatap);
400*7c478bd9Sstevel@tonic-gate
401*7c478bd9Sstevel@tonic-gate/*
402*7c478bd9Sstevel@tonic-gate * in disptmpl.c
403*7c478bd9Sstevel@tonic-gate */
404*7c478bd9Sstevel@tonic-gatestruct ldap_disptmpl *ldap_first_disptmpl(struct ldap_disptmpl *tmpllist);
405*7c478bd9Sstevel@tonic-gatestruct ldap_tmplitem *ldap_first_tmplcol(struct ldap_disptmpl *tmpl,struct ldap_tmplitem *row);
406*7c478bd9Sstevel@tonic-gate
407*7c478bd9Sstevel@tonic-gatestruct ldap_tmplitem *ldap_first_tmplrow(struct ldap_disptmpl *tmpl);
408*7c478bd9Sstevel@tonic-gatevoid ldap_free_templates(struct ldap_disptmpl *tmpllist);
409*7c478bd9Sstevel@tonic-gateint ldap_init_templates(char *file, struct ldap_disptmpl **tmpllistp);
410*7c478bd9Sstevel@tonic-gate
411*7c478bd9Sstevel@tonic-gateint ldap_init_templates_buf(char *buf, long buflen, struct ldap_disptmpl **tmpllistp);
412*7c478bd9Sstevel@tonic-gate
413*7c478bd9Sstevel@tonic-gatestruct ldap_disptmpl *ldap_next_disptmpl(struct ldap_disptmpl *tmpllist, struct ldap_disptmpl *tmpl);
414*7c478bd9Sstevel@tonic-gate
415*7c478bd9Sstevel@tonic-gatestruct ldap_tmplitem *ldap_next_tmplcol(struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row, struct ldap_tmplitem *col);
416*7c478bd9Sstevel@tonic-gate
417*7c478bd9Sstevel@tonic-gatestruct ldap_tmplitem *ldap_next_tmplrow(struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row);
418*7c478bd9Sstevel@tonic-gate
419*7c478bd9Sstevel@tonic-gatestruct ldap_disptmpl *ldap_oc2template(char **oclist, struct ldap_disptmpl *tmpllist);
420*7c478bd9Sstevel@tonic-gate
421*7c478bd9Sstevel@tonic-gatechar **ldap_tmplattrs(struct ldap_disptmpl *tmpl, char **includeattrs, int exclude, unsigned long syntaxmask);
422*7c478bd9Sstevel@tonic-gate
423*7c478bd9Sstevel@tonic-gatestruct ldap_disptmpl *ldap_name2template(char *name, struct ldap_disptmpl *tmpllist);
424*7c478bd9Sstevel@tonic-gate
425*7c478bd9Sstevel@tonic-gate/*
426*7c478bd9Sstevel@tonic-gate * in cram_md5.c
427*7c478bd9Sstevel@tonic-gate */
428*7c478bd9Sstevel@tonic-gateint ldap_sasl_cram_md5_bind_s(LDAP *ld, char *dn, struct berval *cred, LDAPControl **serverctrls, LDAPControl **clientctrls);
429*7c478bd9Sstevel@tonic-gate
430*7c478bd9Sstevel@tonic-gate/*
431*7c478bd9Sstevel@tonic-gate * in setoption.c
432*7c478bd9Sstevel@tonic-gate */
433*7c478bd9Sstevel@tonic-gateint ldap_set_option (LDAP *ld, int option, const void *optdata);
434*7c478bd9Sstevel@tonic-gate
435*7c478bd9Sstevel@tonic-gate/*
436*7c478bd9Sstevel@tonic-gate * in log.c
437*7c478bd9Sstevel@tonic-gate */
438*7c478bd9Sstevel@tonic-gatevoid ldaplogconfigf(FILE *fd);
439*7c478bd9Sstevel@tonic-gate
440*7c478bd9Sstevel@tonic-gate/*
441*7c478bd9Sstevel@tonic-gate * in line64.c
442*7c478bd9Sstevel@tonic-gate */
443*7c478bd9Sstevel@tonic-gatechar *ldif_type_and_value(char *type, char *val, int vlen);
444*7c478bd9Sstevel@tonic-gatechar *str_getline(char **next);
445*7c478bd9Sstevel@tonic-gateint str_parse_line(char *line, char **type, char **value, int *vlen);
446*7c478bd9Sstevel@tonic-gate
447*7c478bd9Sstevel@tonic-gate/*
448*7c478bd9Sstevel@tonic-gate * in sortctrl.c
449*7c478bd9Sstevel@tonic-gate */
450*7c478bd9Sstevel@tonic-gateint ldap_create_sort_control (LDAP *ld, LDAPsortkey **sortKeyList, const char ctl_iscritical, LDAPControl **ctrlp);
451*7c478bd9Sstevel@tonic-gate
452*7c478bd9Sstevel@tonic-gateint ldap_parse_sort_control(LDAP *ld, LDAPControl **ctrlp, unsigned long *result, char **attribute);
453*7c478bd9Sstevel@tonic-gate
454*7c478bd9Sstevel@tonic-gateint ldap_create_sort_keylist(LDAPsortkey ***sortKeyList, const char *string_rep);
455*7c478bd9Sstevel@tonic-gate
456*7c478bd9Sstevel@tonic-gatevoid ldap_free_sort_keylist(LDAPsortkey **sortKeyList);
457*7c478bd9Sstevel@tonic-gate
458*7c478bd9Sstevel@tonic-gate/*
459*7c478bd9Sstevel@tonic-gate * in vlistctrl.c
460*7c478bd9Sstevel@tonic-gate */
461*7c478bd9Sstevel@tonic-gateint ldap_create_virtuallist_control(LDAP *ld, LDAPVirtualList *ldvlistp, LDAPControl **ctrlp);
462*7c478bd9Sstevel@tonic-gate
463*7c478bd9Sstevel@tonic-gateint ldap_parse_virtuallist_control(LDAP *ld, LDAPControl **ctrls, unsigned long *target_posp, unsigned long *list_sizep, int *errcodep);
464*7c478bd9Sstevel@tonic-gate
465*7c478bd9Sstevel@tonic-gate/*
466*7c478bd9Sstevel@tonic-gate * in ldapsinit.c
467*7c478bd9Sstevel@tonic-gate */
468*7c478bd9Sstevel@tonic-gateLDAP * ldapssl_init( const char *defhost, int defport, int defsecure );
469*7c478bd9Sstevel@tonic-gateint ldapssl_install_routines( LDAP *ld );
470*7c478bd9Sstevel@tonic-gateint ldapssl_enable_clientauth( LDAP *ld, char *keynickname, char *keypasswd, char *certnickname );
471*7c478bd9Sstevel@tonic-gate
472*7c478bd9Sstevel@tonic-gate/*
473*7c478bd9Sstevel@tonic-gate * in clientinit.c
474*7c478bd9Sstevel@tonic-gate */
475*7c478bd9Sstevel@tonic-gateint ldapssl_client_init( const char *certdbpath, void *certdbhandle);
476*7c478bd9Sstevel@tonic-gateint ldapssl_clientauth_init(const char *certdbpath, void *certdbhandle, const int needkeydb, const char *keydbpath, void *keydbhandle);
477*7c478bd9Sstevel@tonic-gate
478*7c478bd9Sstevel@tonic-gateint ldapssl_advclientauth_init( const char *certdbpath, void *certdbhandle, const int needkeydb, const char *keydbpath, void *keydbhandle, const int needsecmoddb, const char *secmoddbpath, const int sslstrength );
479*7c478bd9Sstevel@tonic-gate
480*7c478bd9Sstevel@tonic-gateint ldapssl_pkcs_init( const struct ldapssl_pkcs_fns *pfns);
481*7c478bd9Sstevel@tonic-gate
482*7c478bd9Sstevel@tonic-gate/*
483*7c478bd9Sstevel@tonic-gate * in errormap.c
484*7c478bd9Sstevel@tonic-gate */
485*7c478bd9Sstevel@tonic-gateconst char * ldapssl_err2string( const int prerrno );
486*7c478bd9Sstevel@tonic-gate
487*7c478bd9Sstevel@tonic-gate/*
488*7c478bd9Sstevel@tonic-gate * in psearch.c
489*7c478bd9Sstevel@tonic-gate */
490*7c478bd9Sstevel@tonic-gateint ldap_create_persistentsearch_control(LDAP *ld, int changetypes, int changesonly, int return_echg_ctls, char ctl_iscritical, LDAPControl **ctrlp);
491*7c478bd9Sstevel@tonic-gate
492*7c478bd9Sstevel@tonic-gateint ldap_parse_entrychange_control(LDAP *ld, LDAPControl **ctrls, int *chgtypep, char **prevdnp, int *chgnumpresentp, ber_int_t *chgnump);
493*7c478bd9Sstevel@tonic-gate
494*7c478bd9Sstevel@tonic-gate/*
495*7c478bd9Sstevel@tonic-gate * in proxyauthctrl.c
496*7c478bd9Sstevel@tonic-gate */
497*7c478bd9Sstevel@tonic-gateint ldap_create_proxyauth_control(LDAP *ld, const char *dn, const char ctl_iscritical, LDAPControl **ctrlp);
498*7c478bd9Sstevel@tonic-gate
499*7c478bd9Sstevel@tonic-gateint ldap_create_proxiedauth_control(LDAP *ld, const char *authzid, LDAPControl **ctrlp);
500*7c478bd9Sstevel@tonic-gate
501*7c478bd9Sstevel@tonic-gate/*
502*7c478bd9Sstevel@tonic-gate * in srchpref.c
503*7c478bd9Sstevel@tonic-gate */
504*7c478bd9Sstevel@tonic-gatestruct ldap_searchobj *ldap_first_searchobj(struct ldap_searchobj *solist);
505*7c478bd9Sstevel@tonic-gatevoid ldap_free_searchprefs(struct ldap_searchobj *solist);
506*7c478bd9Sstevel@tonic-gateint ldap_init_searchprefs(char *file, struct ldap_searchobj **solistp);
507*7c478bd9Sstevel@tonic-gateint ldap_init_searchprefs_buf(char *buf, long buflen, struct ldap_searchobj **solistp);
508*7c478bd9Sstevel@tonic-gate
509*7c478bd9Sstevel@tonic-gatestruct ldap_searchobj *ldap_next_searchobj(struct ldap_searchobj *solist, struct ldap_searchobj *so);
510*7c478bd9Sstevel@tonic-gate
511*7c478bd9Sstevel@tonic-gate/*
512*7c478bd9Sstevel@tonic-gate * in getoption.c
513*7c478bd9Sstevel@tonic-gate */
514*7c478bd9Sstevel@tonic-gateint ldap_get_option (LDAP *ld, int option, void *outvalue);
515*7c478bd9Sstevel@tonic-gate
516*7c478bd9Sstevel@tonic-gate/*
517*7c478bd9Sstevel@tonic-gate * in memcache.c
518*7c478bd9Sstevel@tonic-gate */
519*7c478bd9Sstevel@tonic-gateint ldap_memcache_init(unsigned long ttl, unsigned long size, char **baseDNs, struct ldap_thread_fns *thread_fns, LDAPMemCache **cachep);
520*7c478bd9Sstevel@tonic-gate
521*7c478bd9Sstevel@tonic-gateint ldap_memcache_set(LDAP *ld, LDAPMemCache *cache);
522*7c478bd9Sstevel@tonic-gateint ldap_memcache_get(LDAP *ld, LDAPMemCache **cachep);
523*7c478bd9Sstevel@tonic-gatevoid ldap_memcache_flush(LDAPMemCache *cache, char *dn, int scope);
524*7c478bd9Sstevel@tonic-gatevoid ldap_memcache_destroy(LDAPMemCache *cache);
525*7c478bd9Sstevel@tonic-gatevoid ldap_memcache_update(LDAPMemCache *cache);
526*7c478bd9Sstevel@tonic-gate
527*7c478bd9Sstevel@tonic-gate/*
528*7c478bd9Sstevel@tonic-gate * in digest_md5.c
529*7c478bd9Sstevel@tonic-gate */
530*7c478bd9Sstevel@tonic-gateint ldap_x_sasl_digest_md5_bind_s(LDAP *ld, char *dn, struct berval *cred, LDAPControl **serverctrls, LDAPControl **clientctrls);
531