1 /* This file is a template.  The generated file is ldap-standard.h>
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is Mozilla Communicator client code, released
16  * March 31, 1998.
17  *
18  * The Initial Developer of the Original Code is
19  * Netscape Communications Corporation.
20  * Portions created by the Initial Developer are Copyright (C) 1998-1999
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either of the GNU General Public License Version 2 or later (the "GPL"),
27  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38 
39 /* ldap-standard.h - standards base header file for libldap */
40 /* This file contain the defines and function prototypes matching */
41 /* very closely to the latest LDAP C API draft */
42 
43 #ifndef _LDAP_STANDARD_H
44 #define _LDAP_STANDARD_H
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include "ldap-platform.h"
51 
52 #include "lber.h"
53 
54 #define LDAP_PORT       	389
55 #define LDAPS_PORT      	636
56 #define LDAP_VERSION2   	2
57 #define LDAP_VERSION3   	3
58 #define LDAP_VERSION_MIN	LDAP_VERSION1
59 #define LDAP_VERSION_MAX	LDAP_VERSION3
60 
61 #define LDAP_VENDOR_VERSION	{{LDAP_VENDOR_VERSION}}	/* version # * 100 */
62 #define LDAP_VENDOR_NAME	"{{LDAP_VENDOR_NAME}}"
63 /*
64  * The following will be an RFC number once the LDAP C API Internet Draft
65  * is published as a Proposed Standard RFC.  For now we use 2000 + the
66  * draft revision number (currently 5) since we are close to compliance
67  * with revision 5 of the draft.
68  */
69 #define LDAP_API_VERSION	2005
70 
71 /* special values that may appear in the attributes field of a SearchRequest.
72  */
73 #define LDAP_NO_ATTRS		"1.1"
74 #define LDAP_ALL_USER_ATTRS	"*"
75 
76 /*
77  * Standard options (used with ldap_set_option() and ldap_get_option):
78  */
79 #define LDAP_OPT_API_INFO               0x00	/*  0 */
80 #define LDAP_OPT_DEREF                  0x02	/*  2 */
81 #define LDAP_OPT_SIZELIMIT              0x03	/*  3 */
82 #define LDAP_OPT_TIMELIMIT              0x04	/*  4 */
83 #define LDAP_OPT_REFERRALS              0x08	/*  8 */
84 #define LDAP_OPT_RESTART                0x09	/*  9 */
85 #define LDAP_OPT_PROTOCOL_VERSION	0x11	/* 17 */
86 #define LDAP_OPT_SERVER_CONTROLS	0x12	/* 18 */
87 #define LDAP_OPT_CLIENT_CONTROLS	0x13	/* 19 */
88 #define LDAP_OPT_API_FEATURE_INFO	0x15	/* 21 */
89 #define LDAP_OPT_HOST_NAME		0x30	/* 48 */
90 #define LDAP_OPT_ERROR_NUMBER		0x31	/* 49 */
91 #define LDAP_OPT_ERROR_STRING		0x32	/* 50 */
92 #define LDAP_OPT_MATCHED_DN		0x33	/* 51 */
93 
94 /*
95  * Well-behaved private and experimental extensions will use option values
96  * between 0x4000 (16384) and 0x7FFF (32767) inclusive.
97  */
98 #define LDAP_OPT_PRIVATE_EXTENSION_BASE	0x4000	/* to 0x7FFF inclusive */
99 
100 /* for on/off options */
101 #define LDAP_OPT_ON     ((void *)1)
102 #define LDAP_OPT_OFF    ((void *)0)
103 
104 typedef struct ldap     LDAP;           /* opaque connection handle */
105 typedef struct ldapmsg  LDAPMessage;    /* opaque result/entry handle */
106 
107 /* structure representing an LDAP modification */
108 typedef struct ldapmod {
109 	int             mod_op;         /* kind of mod + form of values*/
110 #define LDAP_MOD_ADD            0x00
111 #define LDAP_MOD_DELETE         0x01
112 #define LDAP_MOD_REPLACE        0x02
113 #define LDAP_MOD_BVALUES        0x80
114 	char            *mod_type;      /* attribute name to modify */
115 	union mod_vals_u {
116 		char            **modv_strvals;
117 		struct berval   **modv_bvals;
118 	} mod_vals;                     /* values to add/delete/replace */
119 #define mod_values      mod_vals.modv_strvals
120 #define mod_bvalues     mod_vals.modv_bvals
121 } LDAPMod;
122 
123 
124 /*
125  * structure for holding ldapv3 controls
126  */
127 typedef struct ldapcontrol {
128     char            *ldctl_oid;
129     struct berval   ldctl_value;
130     char            ldctl_iscritical;
131 } LDAPControl;
132 
133 
134 /*
135  * LDAP API information.  Can be retrieved by using a sequence like:
136  *
137  *    LDAPAPIInfo ldai;
138  *    ldai.ldapai_info_version = LDAP_API_INFO_VERSION;
139  *    if ( ldap_get_option( NULL, LDAP_OPT_API_INFO, &ldia ) == 0 ) ...
140  */
141 #define LDAP_API_INFO_VERSION		1
142 typedef struct ldapapiinfo {
143     int  ldapai_info_version;     /* version of this struct (1) */
144     int  ldapai_api_version;      /* revision of API supported */
145     int  ldapai_protocol_version; /* highest LDAP version supported */
146     char **ldapai_extensions;     /* names of API extensions */
147     char *ldapai_vendor_name;     /* name of supplier */
148     int  ldapai_vendor_version;   /* supplier-specific version times 100 */
149 } LDAPAPIInfo;
150 
151 
152 /*
153  * LDAP API extended features info.  Can be retrieved by using a sequence like:
154  *
155  *    LDAPAPIFeatureInfo ldfi;
156  *    ldfi.ldapaif_info_version = LDAP_FEATURE_INFO_VERSION;
157  *    ldfi.ldapaif_name = "VIRTUAL_LIST_VIEW";
158  *    if ( ldap_get_option( NULL, LDAP_OPT_API_FEATURE_INFO, &ldfi ) == 0 ) ...
159  */
160 #define LDAP_FEATURE_INFO_VERSION	1
161 typedef struct ldap_apifeature_info {
162     int   ldapaif_info_version;	/* version of this struct (1) */
163     char  *ldapaif_name;	/* name of supported feature */
164     int   ldapaif_version;	/* revision of supported feature */
165 } LDAPAPIFeatureInfo;
166 
167 
168 /* possible result types a server can return */
169 #define LDAP_RES_BIND                   0x61L	/* 97 */
170 #define LDAP_RES_SEARCH_ENTRY           0x64L	/* 100 */
171 #define LDAP_RES_SEARCH_RESULT          0x65L	/* 101 */
172 #define LDAP_RES_MODIFY                 0x67L	/* 103 */
173 #define LDAP_RES_ADD                    0x69L	/* 105 */
174 #define LDAP_RES_DELETE                 0x6BL	/* 107 */
175 #define LDAP_RES_MODDN			0x6DL	/* 109 */
176 #define LDAP_RES_COMPARE                0x6FL	/* 111 */
177 #define LDAP_RES_SEARCH_REFERENCE       0x73L	/* 115 */
178 #define LDAP_RES_EXTENDED               0x78L	/* 120 */
179 
180 /* Special values for ldap_result() "msgid" parameter */
181 #define LDAP_RES_ANY                (-1)
182 #define LDAP_RES_UNSOLICITED		0
183 
184 /* built-in SASL methods */
185 #define LDAP_SASL_SIMPLE	0	/* special value used for simple bind */
186 
187 /* search scopes */
188 #define LDAP_SCOPE_BASE         0x00
189 #define LDAP_SCOPE_ONELEVEL     0x01
190 #define LDAP_SCOPE_SUBTREE      0x02
191 
192 /* alias dereferencing */
193 #define LDAP_DEREF_NEVER        0x00
194 #define LDAP_DEREF_SEARCHING    0x01
195 #define LDAP_DEREF_FINDING      0x02
196 #define LDAP_DEREF_ALWAYS       0x03
197 
198 /* predefined size/time limits */
199 #define LDAP_NO_LIMIT           0
200 
201 /* allowed values for "all" ldap_result() parameter */
202 #define LDAP_MSG_ONE		0x00
203 #define LDAP_MSG_ALL		0x01
204 #define LDAP_MSG_RECEIVED	0x02
205 
206 /* possible error codes we can be returned */
207 #define LDAP_SUCCESS                    0x00	/* 0 */
208 #define LDAP_OPERATIONS_ERROR           0x01	/* 1 */
209 #define LDAP_PROTOCOL_ERROR             0x02	/* 2 */
210 #define LDAP_TIMELIMIT_EXCEEDED         0x03	/* 3 */
211 #define LDAP_SIZELIMIT_EXCEEDED         0x04	/* 4 */
212 #define LDAP_COMPARE_FALSE              0x05	/* 5 */
213 #define LDAP_COMPARE_TRUE               0x06	/* 6 */
214 #define LDAP_STRONG_AUTH_NOT_SUPPORTED  0x07	/* 7 */
215 #define LDAP_STRONG_AUTH_REQUIRED       0x08	/* 8 */
216 #define LDAP_REFERRAL                   0x0a	/* 10 - LDAPv3 */
217 #define LDAP_ADMINLIMIT_EXCEEDED	0x0b	/* 11 - LDAPv3 */
218 #define LDAP_UNAVAILABLE_CRITICAL_EXTENSION  0x0c /* 12 - LDAPv3 */
219 #define LDAP_CONFIDENTIALITY_REQUIRED	0x0d	/* 13 */
220 #define LDAP_SASL_BIND_IN_PROGRESS	0x0e	/* 14 - LDAPv3 */
221 
222 #define LDAP_NO_SUCH_ATTRIBUTE          0x10	/* 16 */
223 #define LDAP_UNDEFINED_TYPE             0x11	/* 17 */
224 #define LDAP_INAPPROPRIATE_MATCHING     0x12	/* 18 */
225 #define LDAP_CONSTRAINT_VIOLATION       0x13	/* 19 */
226 #define LDAP_TYPE_OR_VALUE_EXISTS       0x14	/* 20 */
227 #define LDAP_INVALID_SYNTAX             0x15	/* 21 */
228 
229 #define LDAP_NO_SUCH_OBJECT             0x20	/* 32 */
230 #define LDAP_ALIAS_PROBLEM              0x21	/* 33 */
231 #define LDAP_INVALID_DN_SYNTAX          0x22	/* 34 */
232 #define LDAP_IS_LEAF                    0x23	/* 35 (not used in LDAPv3) */
233 #define LDAP_ALIAS_DEREF_PROBLEM        0x24	/* 36 */
234 
235 #define LDAP_INAPPROPRIATE_AUTH         0x30	/* 48 */
236 #define LDAP_INVALID_CREDENTIALS        0x31	/* 49 */
237 #define LDAP_INSUFFICIENT_ACCESS        0x32	/* 50 */
238 #define LDAP_BUSY                       0x33	/* 51 */
239 #define LDAP_UNAVAILABLE                0x34	/* 52 */
240 #define LDAP_UNWILLING_TO_PERFORM       0x35	/* 53 */
241 #define LDAP_LOOP_DETECT                0x36	/* 54 */
242 
243 #define LDAP_NAMING_VIOLATION           0x40	/* 64 */
244 #define LDAP_OBJECT_CLASS_VIOLATION     0x41	/* 65 */
245 #define LDAP_NOT_ALLOWED_ON_NONLEAF     0x42	/* 66 */
246 #define LDAP_NOT_ALLOWED_ON_RDN         0x43	/* 67 */
247 #define LDAP_ALREADY_EXISTS             0x44	/* 68 */
248 #define LDAP_NO_OBJECT_CLASS_MODS       0x45	/* 69 */
249 #define LDAP_RESULTS_TOO_LARGE          0x46	/* 70 - CLDAP */
250 #define LDAP_AFFECTS_MULTIPLE_DSAS      0x47	/* 71 */
251 
252 #define LDAP_OTHER                      0x50	/* 80 */
253 #define LDAP_SERVER_DOWN                0x51	/* 81 */
254 #define LDAP_LOCAL_ERROR                0x52	/* 82 */
255 #define LDAP_ENCODING_ERROR             0x53	/* 83 */
256 #define LDAP_DECODING_ERROR             0x54	/* 84 */
257 #define LDAP_TIMEOUT                    0x55	/* 85 */
258 #define LDAP_AUTH_UNKNOWN               0x56	/* 86 */
259 #define LDAP_FILTER_ERROR               0x57	/* 87 */
260 #define LDAP_USER_CANCELLED             0x58	/* 88 */
261 #define LDAP_PARAM_ERROR                0x59	/* 89 */
262 #define LDAP_NO_MEMORY                  0x5a	/* 90 */
263 #define LDAP_CONNECT_ERROR              0x5b	/* 91 */
264 #define LDAP_NOT_SUPPORTED              0x5c	/* 92 - LDAPv3 */
265 #define LDAP_CONTROL_NOT_FOUND		0x5d	/* 93 - LDAPv3 */
266 #define LDAP_NO_RESULTS_RETURNED	0x5e	/* 94 - LDAPv3 */
267 #define LDAP_MORE_RESULTS_TO_RETURN	0x5f	/* 95 - LDAPv3 */
268 #define LDAP_CLIENT_LOOP		0x60	/* 96 - LDAPv3 */
269 #define LDAP_REFERRAL_LIMIT_EXCEEDED	0x61	/* 97 - LDAPv3 */
270 
271 /*
272  * LDAPv3 unsolicited notification messages we know about
273  */
274 #define LDAP_NOTICE_OF_DISCONNECTION	"1.3.6.1.4.1.1466.20036"
275 
276 /*
277  * Client controls we know about
278  */
279 #define LDAP_CONTROL_REFERRALS		"1.2.840.113556.1.4.616"
280 
281 /*
282  * Initializing an ldap sesssion, set session handle options, and
283  * closing an ldap session functions
284  *
285  * NOTE: If you want to use IPv6, you must use prldap creating a LDAP handle
286  * with prldap_init instead of ldap_init. Or install the NSPR functions
287  * by calling prldap_install_routines. (See the nspr samples in examples)
288  */
289 LDAP_API(LDAP *) LDAP_CALL ldap_init( const char *defhost, int defport );
290 LDAP_API(int) LDAP_CALL ldap_set_option( LDAP *ld, int option,
291 	const void *optdata );
292 LDAP_API(int) LDAP_CALL ldap_get_option( LDAP *ld, int option, void *optdata );
293 LDAP_API(int) LDAP_CALL ldap_unbind( LDAP *ld );
294 LDAP_API(int) LDAP_CALL ldap_unbind_s( LDAP *ld );
295 
296 /*
297  * perform ldap operations
298  */
299 LDAP_API(int) LDAP_CALL ldap_abandon( LDAP *ld, int msgid );
300 LDAP_API(int) LDAP_CALL ldap_add( LDAP *ld, const char *dn, LDAPMod **attrs );
301 LDAP_API(int) LDAP_CALL ldap_add_s( LDAP *ld, const char *dn, LDAPMod **attrs );
302 LDAP_API(int) LDAP_CALL ldap_simple_bind( LDAP *ld, const char *who,
303 	const char *passwd );
304 LDAP_API(int) LDAP_CALL ldap_simple_bind_s( LDAP *ld, const char *who,
305 	const char *passwd );
306 LDAP_API(int) LDAP_CALL ldap_modify( LDAP *ld, const char *dn, LDAPMod **mods );
307 LDAP_API(int) LDAP_CALL ldap_modify_s( LDAP *ld, const char *dn,
308 	LDAPMod **mods );
309 LDAP_API(int) LDAP_CALL ldap_compare( LDAP *ld, const char *dn,
310 	const char *attr, const char *value );
311 LDAP_API(int) LDAP_CALL ldap_compare_s( LDAP *ld, const char *dn,
312 	const char *attr, const char *value );
313 LDAP_API(int) LDAP_CALL ldap_delete( LDAP *ld, const char *dn );
314 LDAP_API(int) LDAP_CALL ldap_delete_s( LDAP *ld, const char *dn );
315 LDAP_API(int) LDAP_CALL ldap_search( LDAP *ld, const char *base, int scope,
316 	const char *filter, char **attrs, int attrsonly );
317 LDAP_API(int) LDAP_CALL ldap_search_s( LDAP *ld, const char *base, int scope,
318 	const char *filter, char **attrs, int attrsonly, LDAPMessage **res );
319 LDAP_API(int) LDAP_CALL ldap_search_st( LDAP *ld, const char *base, int scope,
320 	const char *filter, char **attrs, int attrsonly,
321 	struct timeval *timeout, LDAPMessage **res );
322 
323 /*
324  * obtain result from ldap operation
325  */
326 LDAP_API(int) LDAP_CALL ldap_result( LDAP *ld, int msgid, int all,
327 	struct timeval *timeout, LDAPMessage **result );
328 
329 /*
330  * peeking inside LDAP Messages and deallocating LDAP Messages
331  */
332 LDAP_API(int) LDAP_CALL ldap_msgfree( LDAPMessage *lm );
333 LDAP_API(int) LDAP_CALL ldap_msgid( LDAPMessage *lm );
334 LDAP_API(int) LDAP_CALL ldap_msgtype( LDAPMessage *lm );
335 
336 
337 /*
338  * Routines to parse/deal with results and errors returned
339  */
340 LDAP_API(char *) LDAP_CALL ldap_err2string( int err );
341 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_entry( LDAP *ld,
342 	LDAPMessage *chain );
343 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_entry( LDAP *ld,
344 	LDAPMessage *entry );
345 LDAP_API(int) LDAP_CALL ldap_count_entries( LDAP *ld, LDAPMessage *chain );
346 LDAP_API(char *) LDAP_CALL ldap_get_dn( LDAP *ld, LDAPMessage *entry );
347 LDAP_API(char *) LDAP_CALL ldap_dn2ufn( const char *dn );
348 LDAP_API(char **) LDAP_CALL ldap_explode_dn( const char *dn,
349 	const int notypes );
350 LDAP_API(char **) LDAP_CALL ldap_explode_rdn( const char *rdn,
351 	const int notypes );
352 LDAP_API(char *) LDAP_CALL ldap_first_attribute( LDAP *ld, LDAPMessage *entry,
353 	BerElement **ber );
354 LDAP_API(char *) LDAP_CALL ldap_next_attribute( LDAP *ld, LDAPMessage *entry,
355 	BerElement *ber );
356 LDAP_API(char **) LDAP_CALL ldap_get_values( LDAP *ld, LDAPMessage *entry,
357 	const char *target );
358 LDAP_API(struct berval **) LDAP_CALL ldap_get_values_len( LDAP *ld,
359 	LDAPMessage *entry, const char *target );
360 LDAP_API(int) LDAP_CALL ldap_count_values( char **vals );
361 LDAP_API(int) LDAP_CALL ldap_count_values_len( struct berval **vals );
362 LDAP_API(void) LDAP_CALL ldap_value_free( char **vals );
363 LDAP_API(void) LDAP_CALL ldap_value_free_len( struct berval **vals );
364 LDAP_API(void) LDAP_CALL ldap_memfree( void *p );
365 
366 
367 /*
368  * LDAPv3 extended operation calls
369  */
370 /*
371  * Note: all of the new asynchronous calls return an LDAP error code,
372  * not a message id.  A message id is returned via the int *msgidp
373  * parameter (usually the last parameter) if appropriate.
374  */
375 LDAP_API(int) LDAP_CALL ldap_abandon_ext( LDAP *ld, int msgid,
376 	LDAPControl **serverctrls, LDAPControl **clientctrls );
377 LDAP_API(int) LDAP_CALL ldap_add_ext( LDAP *ld, const char *dn, LDAPMod **attrs,
378 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
379 LDAP_API(int) LDAP_CALL ldap_add_ext_s( LDAP *ld, const char *dn,
380 	LDAPMod **attrs, LDAPControl **serverctrls, LDAPControl **clientctrls );
381 LDAP_API(int) LDAP_CALL ldap_sasl_bind( LDAP *ld, const char *dn,
382 	const char *mechanism, const struct berval *cred,
383 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
384 LDAP_API(int) LDAP_CALL ldap_sasl_bind_s( LDAP *ld, const char *dn,
385 	const char *mechanism, const struct berval *cred,
386 	LDAPControl **serverctrls, LDAPControl **clientctrls,
387 	struct berval **servercredp );
388 LDAP_API(int) LDAP_CALL ldap_modify_ext( LDAP *ld, const char *dn,
389 	LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls,
390 	int *msgidp );
391 LDAP_API(int) LDAP_CALL ldap_modify_ext_s( LDAP *ld, const char *dn,
392 	LDAPMod **mods, LDAPControl **serverctrls, LDAPControl **clientctrls );
393 LDAP_API(int) LDAP_CALL ldap_rename( LDAP *ld, const char *dn,
394 	const char *newrdn, const char *newparent, int deleteoldrdn,
395 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
396 LDAP_API(int) LDAP_CALL ldap_rename_s( LDAP *ld, const char *dn,
397 	const char *newrdn, const char *newparent, int deleteoldrdn,
398 	LDAPControl **serverctrls, LDAPControl **clientctrls );
399 LDAP_API(int) LDAP_CALL ldap_compare_ext( LDAP *ld, const char *dn,
400 	const char *attr, const struct berval *bvalue,
401 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
402 LDAP_API(int) LDAP_CALL ldap_compare_ext_s( LDAP *ld, const char *dn,
403 	const char *attr, const struct berval *bvalue,
404 	LDAPControl **serverctrls, LDAPControl **clientctrls );
405 LDAP_API(int) LDAP_CALL ldap_delete_ext( LDAP *ld, const char *dn,
406 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
407 LDAP_API(int) LDAP_CALL ldap_delete_ext_s( LDAP *ld, const char *dn,
408 	LDAPControl **serverctrls, LDAPControl **clientctrls );
409 LDAP_API(int) LDAP_CALL ldap_search_ext( LDAP *ld, const char *base,
410 	int scope, const char *filter, char **attrs, int attrsonly,
411 	LDAPControl **serverctrls, LDAPControl **clientctrls,
412 	struct timeval *timeoutp, int sizelimit, int *msgidp );
413 LDAP_API(int) LDAP_CALL ldap_search_ext_s( LDAP *ld, const char *base,
414 	int scope, const char *filter, char **attrs, int attrsonly,
415 	LDAPControl **serverctrls, LDAPControl **clientctrls,
416 	struct timeval *timeoutp, int sizelimit, LDAPMessage **res );
417 LDAP_API(int) LDAP_CALL ldap_extended_operation( LDAP *ld,
418 	const char *requestoid, const struct berval *requestdata,
419 	LDAPControl **serverctrls, LDAPControl **clientctrls, int *msgidp );
420 LDAP_API(int) LDAP_CALL ldap_extended_operation_s( LDAP *ld,
421 	const char *requestoid, const struct berval *requestdata,
422 	LDAPControl **serverctrls, LDAPControl **clientctrls,
423 	char **retoidp, struct berval **retdatap );
424 LDAP_API(int) LDAP_CALL ldap_unbind_ext( LDAP *ld, LDAPControl **serverctrls,
425 	LDAPControl **clientctrls );
426 
427 
428 /*
429  * LDAPv3 extended parsing / result handling calls
430  */
431 LDAP_API(int) LDAP_CALL ldap_parse_sasl_bind_result( LDAP *ld,
432 	LDAPMessage *res, struct berval **servercredp, int freeit );
433 LDAP_API(int) LDAP_CALL ldap_parse_result( LDAP *ld, LDAPMessage *res,
434 	int *errcodep, char **matcheddnp, char **errmsgp, char ***referralsp,
435 	LDAPControl ***serverctrlsp, int freeit );
436 LDAP_API(int) LDAP_CALL ldap_parse_extended_result( LDAP *ld, LDAPMessage *res,
437 	char **retoidp, struct berval **retdatap, int freeit );
438 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_message( LDAP *ld,
439 	LDAPMessage *res );
440 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_message( LDAP *ld,
441 	LDAPMessage *msg );
442 LDAP_API(int) LDAP_CALL ldap_count_messages( LDAP *ld, LDAPMessage *res );
443 LDAP_API(LDAPMessage *) LDAP_CALL ldap_first_reference( LDAP *ld,
444 	LDAPMessage *res );
445 LDAP_API(LDAPMessage *) LDAP_CALL ldap_next_reference( LDAP *ld,
446 	LDAPMessage *ref );
447 LDAP_API(int) LDAP_CALL ldap_count_references( LDAP *ld, LDAPMessage *res );
448 LDAP_API(int) LDAP_CALL ldap_parse_reference( LDAP *ld, LDAPMessage *ref,
449 	char ***referralsp, LDAPControl ***serverctrlsp, int freeit );
450 LDAP_API(int) LDAP_CALL ldap_get_entry_controls( LDAP *ld, LDAPMessage *entry,
451 	LDAPControl ***serverctrlsp );
452 LDAP_API(void) LDAP_CALL ldap_control_free( LDAPControl *ctrl );
453 LDAP_API(void) LDAP_CALL ldap_controls_free( LDAPControl **ctrls );
454 
455 #ifdef __cplusplus
456 }
457 #endif
458 #endif /* _LDAP_STANDARD_H */
459