2 * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5 * Redistribution and use in source and binary forms are permitted only
6 * as authorized by the OpenLDAP Public License. A copy of this
7 * license is available at http://www.OpenLDAP.org/license.html or
8 * in file LICENSE in the top-level directory of the distribution.
11 * Copyright (c) 1990 Regents of the University of Michigan.
12 * All rights reserved.
14 * Redistribution and use in source and binary forms are permitted
15 * provided that this notice is preserved and that due credit is given
16 * to the University of Michigan at Ann Arbor. The name of the University
17 * may not be used to endorse or promote products derived from this
18 * software without specific prior written permission. This software
19 * is provided ``as is'' without express or implied warranty.
25 #include <ldap_cdefs.h>
29 #define LDAP_VERSION1 1
30 #define LDAP_VERSION2 2
31 #define LDAP_VERSION3 3
33 #define LDAP_VERSION LDAP_VERSION2
34 #define LDAP_VERSION_MIN LDAP_VERSION2
35 #define LDAP_VERSION_MAX LDAP_VERSION2
38 * We'll use 2000+draft revision for our API version number
39 * As such, the number will be above the old RFC but below
40 * whatever number does finally get assigned
42 #define LDAP_API_VERSION 2002
43 #define LDAP_VENDOR_NAME "OpenLDAP"
44 /* We'll eventually release as 200 */
45 #define LDAP_VENDOR_VERSION 192
47 /* OpenLDAP API Features */
48 #define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
50 /* include LDAP_API_FEATURE defines */
51 #include <ldap_features.h>
53 #if defined( LDAP_API_FEATURE_X_OPENLDAP_REENTRANT ) || \
54 ( defined( LDAP_THREAD_SAFE ) && \
55 defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE ) )
56 /* -lldap may or may not be thread safe */
57 /* -lldap_r, if available, is always thread safe */
58 # define LDAP_API_FEATURE_THREAD_SAFE 1
60 #if defined( LDAP_THREAD_SAFE ) && \
61 defined( LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE )
62 /* #define LDAP_API_FEATURE_SESSION_SAFE 1 */
63 /* #define LDAP_API_OPERATION_SESSION_SAFE 1 */
68 #define LDAP_ROOT_DSE ""
69 #define LDAP_NO_ATTRS "1.1"
70 #define LDAP_ALL_USER_ATTRIBUTES "*"
74 #if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
78 /* LDAP_OPTions defined by draft-ldapext-ldap-c-api-02 */
79 #define LDAP_OPT_API_INFO 0x0000
80 #define LDAP_OPT_DESC 0x0001
81 #define LDAP_OPT_DEREF 0x0002
82 #define LDAP_OPT_SIZELIMIT 0x0003
83 #define LDAP_OPT_TIMELIMIT 0x0004
84 /* 0x05 - 0x07 not defined by current draft */
85 #define LDAP_OPT_REFERRALS 0x0008
86 #define LDAP_OPT_RESTART 0x0009
87 /* 0x0a - 0x10 not defined by current draft */
88 #define LDAP_OPT_PROTOCOL_VERSION 0x0011
89 #define LDAP_OPT_SERVER_CONTROLS 0x0012
90 #define LDAP_OPT_CLIENT_CONTROLS 0x0013
91 /* 0x14 not defined by current draft */
92 #define LDAP_OPT_API_FEATURE_INFO 0x0015
94 /* 0x16 - 0x2f not defined by current draft */
95 #define LDAP_OPT_HOST_NAME 0x0030
96 #define LDAP_OPT_ERROR_NUMBER 0x0031
97 #define LDAP_OPT_ERROR_STRING 0x0032
99 /* not defined by current draft */
100 /* for LDAPv2 compatibility */
101 #define LDAP_OPT_DNS 0x1001 /* use DN & DNS */
103 /* OpenLDAP specific options */
104 #define LDAP_OPT_DEBUG_LEVEL 0x4001 /* OpenLDAP - debug level */
107 #define LDAP_OPT_ON ((void *) 1)
108 #define LDAP_OPT_OFF ((void *) 0)
110 #define LDAP_OPT_SUCCESS 0
111 #define LDAP_OPT_ERROR (-1)
113 #define LDAP_API_INFO_VERSION 1
114 typedef struct ldapapiinfo {
115 int ldapai_info_version; /* version of LDAPAPIInfo (1) */
116 int ldapai_api_version; /* revision of API supported */
117 int ldapai_protocol_version; /* highest LDAP version supported */
118 char **ldapai_extensions; /* names of API extensions */
119 char *ldapai_vendor_name; /* name of supplier */
120 int ldapai_vendor_version; /* supplier-specific version * 100 */
123 #define LDAP_FEATURE_INFO_VERSION 1 /* version of api feature structure */
124 typedef struct ldap_apifeature_info {
125 int ldapaif_info_version; /* version of this struct (1) */
126 char* ldapaif_name; /* matches LDAP_API_FEATURE_... less the prefix */
127 int ldapaif_version; /* matches the value LDAP_API_FEATURE_... */
128 } LDAPAPIFeatureInfo;
130 typedef struct ldapcontrol {
132 struct berval ldctl_value;
133 char ldctl_iscritical;
134 } LDAPControl, *PLDAPControl;
136 #define LDAP_MAX_ATTR_LEN 100
139 * specific LDAP instantiations of BER types we know about
142 /* Overview of LBER tag construction
149 * 1 0 = CONTEXT-SPECIFIC
156 * | 5 ... 1 | TAG-NUMBER
160 #define LDAP_TAG_MESSAGE 0x30UL /* constructed + 16 */
161 #define OLD_LDAP_TAG_MESSAGE 0x10UL /* forgot the constructed bit */
162 #define LDAP_TAG_MSGID 0x02UL /* integer */
163 #define LDAP_TAG_LDAPDN 0x04UL /* octect string */
164 #define LDAP_TAG_CONTROLS 0xa0UL /* context specific + constructed + 0 */
165 #define LDAP_TAG_REFERRAL 0xa3UL /* context specific + constructed + 3 */
166 #define LDAP_TAG_NEWSUPERIOR 0x80UL /* context-specific + primitive + 0 */
168 #define LDAP_TAG_SASL_RES_CREDS 0x87UL /* context specific + primitive */
170 /* possible operations a client can invoke */
171 #define LDAP_REQ_BIND 0x60UL /* application + constructed */
172 #define LDAP_REQ_UNBIND 0x42UL /* application + primitive */
173 #define LDAP_REQ_SEARCH 0x63UL /* application + constructed */
174 #define LDAP_REQ_MODIFY 0x66UL /* application + constructed */
175 #define LDAP_REQ_ADD 0x68UL /* application + constructed */
176 #define LDAP_REQ_DELETE 0x4aUL /* application + primitive */
177 #define LDAP_REQ_MODRDN 0x6cUL /* application + constructed */
178 #define LDAP_REQ_MODDN LDAP_REQ_MODRDN
179 #define LDAP_REQ_RENAME LDAP_REQ_MODRDN
180 #define LDAP_REQ_COMPARE 0x6eUL /* application + constructed */
181 #define LDAP_REQ_ABANDON 0x50UL /* application + primitive */
182 #define LDAP_REQ_EXTENDED 0x77UL /* application + constructed */
184 /* U-Mich version 3.0 compatibility stuff */
185 #define LDAP_REQ_UNBIND_30 0x62UL
186 #define LDAP_REQ_DELETE_30 0x6aUL
187 #define LDAP_REQ_ABANDON_30 0x70UL
190 * old broken stuff for backwards compatibility - forgot application tag
191 * and constructed/primitive bit
193 #define OLD_LDAP_REQ_BIND 0x00UL
194 #define OLD_LDAP_REQ_UNBIND 0x02UL
195 #define OLD_LDAP_REQ_SEARCH 0x03UL
196 #define OLD_LDAP_REQ_MODIFY 0x06UL
197 #define OLD_LDAP_REQ_ADD 0x08UL
198 #define OLD_LDAP_REQ_DELETE 0x0aUL
199 #define OLD_LDAP_REQ_MODRDN 0x0cUL
200 #define OLD_LDAP_REQ_COMPARE 0x0eUL
201 #define OLD_LDAP_REQ_ABANDON 0x10UL
203 /* possible result types a server can return */
204 #define LDAP_RES_BIND 0x61UL /* application + constructed */
205 #define LDAP_RES_SEARCH_ENTRY 0x64UL /* application + constructed */
206 #define LDAP_RES_SEARCH_REFERENCE 0x73UL /* V3: application + constructed */
207 #define LDAP_RES_SEARCH_RESULT 0x65UL /* application + constructed */
208 #define LDAP_RES_MODIFY 0x67UL /* application + constructed */
209 #define LDAP_RES_ADD 0x69UL /* application + constructed */
210 #define LDAP_RES_DELETE 0x6bUL /* application + constructed */
211 #define LDAP_RES_MODRDN 0x6dUL /* application + constructed */
212 #define LDAP_RES_MODDN LDAP_RES_MODRDN /* application + constructed */
213 #define LDAP_RES_RENAME LDAP_RES_MODRDN /* application + constructed */
214 #define LDAP_RES_COMPARE 0x6fUL /* application + constructed */
215 #define LDAP_RES_EXTENDED 0x78UL /* V3: application + constructed */
216 #define LDAP_RES_ANY ((unsigned long)(-1))
218 /* old broken stuff for backwards compatibility */
219 #define OLD_LDAP_RES_BIND 0x01UL
220 #define OLD_LDAP_RES_SEARCH_ENTRY 0x04UL
221 #define OLD_LDAP_RES_SEARCH_RESULT 0x05UL
222 #define OLD_LDAP_RES_MODIFY 0x07UL
223 #define OLD_LDAP_RES_ADD 0x09UL
224 #define OLD_LDAP_RES_DELETE 0x0bUL
225 #define OLD_LDAP_RES_MODRDN 0x0dUL
226 #define OLD_LDAP_RES_MODDN OLD_LDAP_RES_MODRDN
227 #define OLD_LDAP_RES_COMPARE 0x0fUL
230 #define LDAP_SASL_SIMPLE NULL
232 /* authentication methods available */
233 #define LDAP_AUTH_NONE 0x00UL /* no authentication */
234 #define LDAP_AUTH_SIMPLE 0x80UL /* context specific + primitive */
235 #define LDAP_AUTH_SASL 0xa3UL /* context specific + primitive */
236 #define LDAP_AUTH_KRBV4 0xffUL /* means do both of the following */
237 #define LDAP_AUTH_KRBV41 0x81UL /* context specific + primitive */
238 #define LDAP_AUTH_KRBV42 0x82UL /* context specific + primitive */
240 /* U-Mich version 3.0 compatibility auth methods */
241 #define LDAP_AUTH_SIMPLE_30 0xa0UL /* context specific + constructed */
242 #define LDAP_AUTH_KRBV41_30 0xa1UL /* context specific + constructed */
243 #define LDAP_AUTH_KRBV42_30 0xa2UL /* context specific + constructed */
245 /* old broken stuff */
246 #define OLD_LDAP_AUTH_SIMPLE 0x00UL
247 #define OLD_LDAP_AUTH_KRBV4 0x01UL
248 #define OLD_LDAP_AUTH_KRBV42 0x02UL
251 #define LDAP_FILTER_AND 0xa0UL /* context specific + constructed */
252 #define LDAP_FILTER_OR 0xa1UL /* context specific + constructed */
253 #define LDAP_FILTER_NOT 0xa2UL /* context specific + constructed */
254 #define LDAP_FILTER_EQUALITY 0xa3UL /* context specific + constructed */
255 #define LDAP_FILTER_SUBSTRINGS 0xa4UL /* context specific + constructed */
256 #define LDAP_FILTER_GE 0xa5UL /* context specific + constructed */
257 #define LDAP_FILTER_LE 0xa6UL /* context specific + constructed */
258 #define LDAP_FILTER_PRESENT 0x87UL /* context specific + primitive */
259 #define LDAP_FILTER_APPROX 0xa8UL /* context specific + constructed */
260 #define LDAP_FILTER_EXTENDED 0xa9UL /* context specific + constructed */
262 /* U-Mich version 3.0 compatibility filter types */
263 #define LDAP_FILTER_PRESENT_30 0xa7UL /* context specific + constructed */
265 /* old broken stuff */
266 #define OLD_LDAP_FILTER_AND 0x00UL
267 #define OLD_LDAP_FILTER_OR 0x01UL
268 #define OLD_LDAP_FILTER_NOT 0x02UL
269 #define OLD_LDAP_FILTER_EQUALITY 0x03UL
270 #define OLD_LDAP_FILTER_SUBSTRINGS 0x04UL
271 #define OLD_LDAP_FILTER_GE 0x05UL
272 #define OLD_LDAP_FILTER_LE 0x06UL
273 #define OLD_LDAP_FILTER_PRESENT 0x07UL
274 #define OLD_LDAP_FILTER_APPROX 0x08UL
276 /* extended filter component types */
277 #define LDAP_FILTER_EXTENDED_OID 0x81UL /* context specific */
278 #define LDAP_FILTER_EXTENDED_TYPE 0x82UL /* context specific */
279 #define LDAP_FILTER_EXTENDED_VALUE 0x83UL /* context specific */
280 #define LDAP_FILTER_EXTENDED_DNATTRS 0x84UL /* context specific */
282 /* substring filter component types */
283 #define LDAP_SUBSTRING_INITIAL 0x80UL /* context specific */
284 #define LDAP_SUBSTRING_ANY 0x81UL /* context specific */
285 #define LDAP_SUBSTRING_FINAL 0x82UL /* context specific */
287 /* U-Mich version 3.0 compatibility substring filter component types */
288 #define LDAP_SUBSTRING_INITIAL_30 0xa0UL /* context specific */
289 #define LDAP_SUBSTRING_ANY_30 0xa1UL /* context specific */
290 #define LDAP_SUBSTRING_FINAL_30 0xa2UL /* context specific */
292 /* old broken stuff */
293 #define OLD_LDAP_SUBSTRING_INITIAL 0x00UL
294 #define OLD_LDAP_SUBSTRING_ANY 0x01UL
295 #define OLD_LDAP_SUBSTRING_FINAL 0x02UL
298 #define LDAP_SCOPE_BASE 0x0000
299 #define LDAP_SCOPE_ONELEVEL 0x0001
300 #define LDAP_SCOPE_SUBTREE 0x0002
302 /* for modifications */
303 typedef struct ldapmod {
305 #define LDAP_MOD_ADD 0x0000
306 #define LDAP_MOD_DELETE 0x0001
307 #define LDAP_MOD_REPLACE 0x0002
308 #define LDAP_MOD_BVALUES 0x0080
312 struct berval **modv_bvals;
314 #define mod_values mod_vals.modv_strvals
315 #define mod_bvalues mod_vals.modv_bvals
319 * possible error codes we can return
322 #define LDAP_SUCCESS 0x00
323 #define LDAP_OPERATIONS_ERROR 0x01
324 #define LDAP_PROTOCOL_ERROR 0x02
325 #define LDAP_TIMELIMIT_EXCEEDED 0x03
326 #define LDAP_SIZELIMIT_EXCEEDED 0x04
327 #define LDAP_COMPARE_FALSE 0x05
328 #define LDAP_COMPARE_TRUE 0x06
329 #define LDAP_STRONG_AUTH_NOT_SUPPORTED 0x07
330 #define LDAP_AUTH_METHOD_NOT_SUPPORTED LDAP_STRONG_AUTH_NOT_SUPPORTED
331 #define LDAP_STRONG_AUTH_REQUIRED 0x08
332 #define LDAP_PARTIAL_RESULTS 0x09 /* not listed in v3 */
334 #define LDAP_REFERRAL 0x0a /* LDAPv3 */
335 #define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
336 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION 0x0c /* LDAPv3 */
337 #define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
338 #define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
340 #define LDAP_NO_SUCH_ATTRIBUTE 0x10
341 #define LDAP_UNDEFINED_TYPE 0x11
342 #define LDAP_INAPPROPRIATE_MATCHING 0x12
343 #define LDAP_CONSTRAINT_VIOLATION 0x13
344 #define LDAP_TYPE_OR_VALUE_EXISTS 0x14
345 #define LDAP_INVALID_SYNTAX 0x15
347 #define LDAP_NO_SUCH_OBJECT 0x20
348 #define LDAP_ALIAS_PROBLEM 0x21
349 #define LDAP_INVALID_DN_SYNTAX 0x22
350 #define LDAP_IS_LEAF 0x23 /* not LDAPv3 */
351 #define LDAP_ALIAS_DEREF_PROBLEM 0x24
353 #define LDAP_NAME_ERROR(n) (((n) & 0x00f0) == 0x0020)
355 #define LDAP_INAPPROPRIATE_AUTH 0x30
356 #define LDAP_INVALID_CREDENTIALS 0x31
357 #define LDAP_INSUFFICIENT_ACCESS 0x32
358 #define LDAP_BUSY 0x33
359 #define LDAP_UNAVAILABLE 0x34
360 #define LDAP_UNWILLING_TO_PERFORM 0x35
361 #define LDAP_LOOP_DETECT 0x36
363 #define LDAP_NAMING_VIOLATION 0x40
364 #define LDAP_OBJECT_CLASS_VIOLATION 0x41
365 #define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
366 #define LDAP_NOT_ALLOWED_ON_RDN 0x43
367 #define LDAP_ALREADY_EXISTS 0x44
368 #define LDAP_NO_OBJECT_CLASS_MODS 0x45
369 #define LDAP_RESULTS_TOO_LARGE 0x46 /* CLDAP */
370 #define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* LDAPv3 */
372 #define LDAP_OTHER 0x50
373 #define LDAP_SERVER_DOWN 0x51
374 #define LDAP_LOCAL_ERROR 0x52
375 #define LDAP_ENCODING_ERROR 0x53
376 #define LDAP_DECODING_ERROR 0x54
377 #define LDAP_TIMEOUT 0x55
378 #define LDAP_AUTH_UNKNOWN 0x56
379 #define LDAP_FILTER_ERROR 0x57
380 #define LDAP_USER_CANCELLED 0x58
381 #define LDAP_PARAM_ERROR 0x59
382 #define LDAP_NO_MEMORY 0x5a
384 #define LDAP_CONNECT_ERROR 0x5b /* new */
385 #define LDAP_NOT_SUPPORTED 0x5c /* new */
386 #define LDAP_CONTROL_NOT_FOUND 0x5d /* new */
387 #define LDAP_NO_RESULTS_RETURNED 0x5e /* new */
388 #define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* new */
389 #define LDAP_CLIENT_LOOP 0x60 /* new */
390 #define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* new */
392 /* default limit on nesting of referrals */
393 #define LDAP_DEFAULT_REFHOPLIMIT 5
396 * This structure represents both ldap messages and ldap responses.
397 * These are really the same, except in the case of search responses,
398 * where a response has multiple messages.
401 typedef struct ldapmsg LDAPMessage;
404 * structures for ldap getfilter routines
407 typedef struct ldap_filt_info {
410 int lfi_scope; /* LDAP_SCOPE_BASE, etc */
411 int lfi_isexact; /* exact match filter? */
412 struct ldap_filt_info *lfi_next;
415 typedef struct ldap_filt_list {
419 LDAPFiltInfo *lfl_ilist;
420 struct ldap_filt_list *lfl_next;
424 #define LDAP_FILT_MAXSIZ 1024
426 typedef struct ldap_filt_desc {
427 LDAPFiltList *lfd_filtlist;
428 LDAPFiltInfo *lfd_curfip;
429 LDAPFiltInfo lfd_retfi;
430 char lfd_filter[ LDAP_FILT_MAXSIZ ];
432 char *lfd_curvalcopy;
433 char **lfd_curvalwords;
434 char *lfd_filtprefix;
435 char *lfd_filtsuffix;
440 * structure representing an ldap connection
443 typedef struct ldap LDAP;
445 #define LDAP_DEREF_NEVER 0x00
446 #define LDAP_DEREF_SEARCHING 0x01
447 #define LDAP_DEREF_FINDING 0x02
448 #define LDAP_DEREF_ALWAYS 0x03
450 #define LDAP_NO_LIMIT 0
452 /* how many messages to retrieve results for */
453 #define LDAP_MSG_ONE 0x00
454 #define LDAP_MSG_ALL 0x01
455 #define LDAP_MSG_RECEIVED 0x02
458 * structure for ldap friendly mapping routines
461 typedef struct ldap_friendly {
467 * types for ldap URL handling
469 typedef struct ldap_url_desc {
476 char *lud_string; /* for internal use only */
479 #define LDAP_URL_ERR_NOTLDAP 0x01 /* URL doesn't begin with "ldap://" */
480 #define LDAP_URL_ERR_NODN 0x02 /* URL has no DN (required) */
481 #define LDAP_URL_ERR_BADSCOPE 0x03 /* URL scope string is invalid */
482 #define LDAP_URL_ERR_MEM 0x04 /* can't allocate memory space */
484 /* avoid pulling in headers */
491 ldap_get_option LDAP_P((
497 ldap_set_option LDAP_P((
500 LDAP_CONST void *invalue));
507 ldap_control_free LDAP_P((
508 LDAPControl *ctrl ));
511 ldap_controls_free LDAP_P((
512 LDAPControl **ctrls ));
519 ldap_extended_operation LDAP_P((
521 LDAP_CONST char *exoid,
522 struct berval *exdata,
523 LDAPControl **serverctrls,
524 LDAPControl **clientctrls,
528 ldap_extended_operation_s LDAP_P((
530 LDAP_CONST char *exoid,
531 struct berval *exdata,
532 LDAPControl **serverctrls,
533 LDAPControl **clientctrls,
535 struct berval **retdatap ));
541 ldap_abandon LDAP_P((
546 ldap_abandon_ext LDAP_P((
549 LDAPControl **serverctrls,
550 LDAPControl **clientctrls ));
557 ldap_add_ext LDAP_P((
561 LDAPControl **serverctrls,
562 LDAPControl **clientctrls,
566 ldap_add_ext_s LDAP_P((
570 LDAPControl **serverctrls,
571 LDAPControl **clientctrls ));
590 ldap_sasl_bind LDAP_P((
593 LDAP_CONST char *mechanism,
595 LDAPControl **serverctrls,
596 LDAPControl **clientctrls,
600 ldap_sasl_bind_s LDAP_P((
603 LDAP_CONST char *mechanism,
605 LDAPControl **serverctrls,
606 LDAPControl **clientctrls,
607 struct berval **servercredp ));
617 LDAP_CONST char *who,
618 LDAP_CONST char *passwd,
624 LDAP_CONST char *who,
625 LDAP_CONST char *cred,
629 ldap_set_rebind_proc LDAP_P((
631 int (*rebindproc) LDAP_P((
643 ldap_simple_bind LDAP_P((
645 LDAP_CONST char *who,
646 LDAP_CONST char *passwd ));
649 ldap_simple_bind_s LDAP_P((
651 LDAP_CONST char *who,
652 LDAP_CONST char *passwd ));
660 ldap_kerberos_bind_s LDAP_P((
662 LDAP_CONST char *who ));
665 ldap_kerberos_bind1 LDAP_P((
667 LDAP_CONST char *who ));
670 ldap_kerberos_bind1_s LDAP_P((
672 LDAP_CONST char *who ));
675 ldap_kerberos_bind2 LDAP_P((
677 LDAP_CONST char *who ));
680 ldap_kerberos_bind2_s LDAP_P((
682 LDAP_CONST char *who ));
689 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
692 ldap_disable_cache LDAP_P(( LDAP *ld ));
695 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
698 ldap_destroy_cache LDAP_P(( LDAP *ld ));
701 ldap_flush_cache LDAP_P(( LDAP *ld ));
704 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
707 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
714 ldap_compare_ext LDAP_P((
717 LDAP_CONST char *attr,
718 struct berval *bvalue,
719 LDAPControl **serverctrls,
720 LDAPControl **clientctrls,
724 ldap_compare_ext_s LDAP_P((
727 LDAP_CONST char *attr,
728 struct berval *bvalue,
729 LDAPControl **serverctrls,
730 LDAPControl **clientctrls ));
733 ldap_compare LDAP_P((
736 LDAP_CONST char *attr,
737 LDAP_CONST char *value ));
740 ldap_compare_s LDAP_P((
743 LDAP_CONST char *attr,
744 LDAP_CONST char *value ));
751 ldap_delete_ext LDAP_P((
754 LDAPControl **serverctrls,
755 LDAPControl **clientctrls,
759 ldap_delete_ext_s LDAP_P((
762 LDAPControl **serverctrls,
763 LDAPControl **clientctrls ));
768 LDAP_CONST char *dn ));
771 ldap_delete_s LDAP_P((
773 LDAP_CONST char *dn ));
780 ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
782 ldap_err2string LDAP_P(( int err ));
786 LDAP_CONST char *s ));
793 ldap_modify_ext LDAP_P((
797 LDAPControl **serverctrls,
798 LDAPControl **clientctrls,
802 ldap_modify_ext_s LDAP_P((
806 LDAPControl **serverctrls,
807 LDAPControl **clientctrls ));
816 ldap_modify_s LDAP_P((
826 ldap_rename_ext LDAP_P((
829 LDAP_CONST char *newrdn,
830 LDAP_CONST char *newparent,
832 LDAPControl **serverctrls,
833 LDAPControl **clientctrls,
837 ldap_rename_ext_s LDAP_P((
840 LDAP_CONST char *newrdn,
841 LDAP_CONST char *newparent,
843 LDAPControl **serverctrls,
844 LDAPControl **clientctrls ));
854 LDAP_CONST char *newrdn ));
857 ldap_modrdn_s LDAP_P((
860 LDAP_CONST char *newrdn ));
863 ldap_modrdn2 LDAP_P((
866 LDAP_CONST char *newrdn,
870 ldap_modrdn2_s LDAP_P((
873 LDAP_CONST char *newrdn,
877 ldap_rename2 LDAP_P((
880 LDAP_CONST char *newrdn,
882 LDAP_CONST char *newSuperior ));
885 ldap_rename2_s LDAP_P((
888 LDAP_CONST char *newrdn,
890 LDAP_CONST char *newSuperior));
897 LDAP_CONST char *host,
902 LDAP_CONST char *host,
909 LDAP_F( LDAPMessage *)
910 ldap_first_message LDAP_P((
912 LDAPMessage *chain ));
914 LDAP_F( LDAPMessage *)
915 ldap_next_message LDAP_P((
920 ldap_count_messages LDAP_P((
922 LDAPMessage *chain ));
928 LDAP_F( LDAPMessage *)
929 ldap_first_reference LDAP_P((
931 LDAPMessage *chain ));
933 LDAP_F( LDAPMessage *)
934 ldap_next_reference LDAP_P((
939 ldap_count_references LDAP_P((
941 LDAPMessage *chain ));
944 ldap_parse_reference LDAP_P((
948 LDAPControl ***serverctrls,
955 LDAP_F( LDAPMessage *)
956 ldap_first_entry LDAP_P((
958 LDAPMessage *chain ));
960 LDAP_F( LDAPMessage *)
961 ldap_next_entry LDAP_P((
963 LDAPMessage *entry ));
966 ldap_count_entries LDAP_P((
968 LDAPMessage *chain ));
971 ldap_get_entry_controls LDAP_P((
974 LDAPControl ***serverctrls));
980 LDAP_F( LDAPMessage *)
981 ldap_delete_result_entry LDAP_P((
986 ldap_add_result_entry LDAP_P((
997 LDAPMessage *entry ));
1000 ldap_dn2ufn LDAP_P((
1001 LDAP_CONST char *dn ));
1004 ldap_explode_dn LDAP_P((
1005 LDAP_CONST char *dn,
1009 ldap_explode_rdn LDAP_P((
1010 LDAP_CONST char *rdn,
1014 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1015 LDAP_CONST char *dn ));
1018 ldap_relative_dn LDAP_P(( /* new (from slapd) */
1019 LDAP_CONST char *dn ));
1022 ldap_normalize_dn LDAP_P(( /* new (from slapd) */
1023 LDAP_CONST char *dn ));
1026 ldap_explode_dns LDAP_P(( /* deprecated */
1027 LDAP_CONST char *dn ));
1030 ldap_is_dns_dn LDAP_P(( /* deprecated */
1031 LDAP_CONST char *dn ));
1038 ldap_first_attribute LDAP_P((
1041 BerElement **ber ));
1044 ldap_next_attribute LDAP_P((
1054 ldap_get_values LDAP_P((
1057 LDAP_CONST char *target ));
1059 LDAP_F( struct berval **)
1060 ldap_get_values_len LDAP_P((
1063 LDAP_CONST char *target ));
1066 ldap_count_values LDAP_P((
1070 ldap_count_values_len LDAP_P((
1071 struct berval **vals ));
1074 ldap_value_free LDAP_P((
1078 ldap_value_free_len LDAP_P((
1079 struct berval **vals ));
1085 ldap_result LDAP_P((
1089 struct timeval *timeout,
1090 LDAPMessage **result ));
1093 ldap_msgtype LDAP_P((
1101 ldap_msgfree LDAP_P((
1105 ldap_msgdelete LDAP_P((
1114 ldap_search_ext LDAP_P((
1116 LDAP_CONST char *base,
1118 LDAP_CONST char *filter,
1120 LDAPControl **serverctrls,
1121 LDAPControl **clientctrls,
1122 struct timeval *timeout,
1127 ldap_search_ext_s LDAP_P((
1129 LDAP_CONST char *base,
1131 LDAP_CONST char *filter,
1133 LDAPControl **serverctrls,
1134 LDAPControl **clientctrls,
1135 struct timeval *timeout,
1137 LDAPMessage **res ));
1140 ldap_search LDAP_P((
1142 LDAP_CONST char *base,
1144 LDAP_CONST char *filter,
1149 ldap_search_s LDAP_P((
1151 LDAP_CONST char *base,
1153 LDAP_CONST char *filter,
1156 LDAPMessage **res ));
1159 ldap_search_st LDAP_P((
1161 LDAP_CONST char *base,
1163 LDAP_CONST char *filter,
1166 struct timeval *timeout,
1167 LDAPMessage **res ));
1174 ldap_ufn_search_c LDAP_P((
1176 LDAP_CONST char *ufn,
1180 int (*cancelproc)( void *cl ),
1181 void *cancelparm ));
1184 ldap_ufn_search_ct LDAP_P((
1186 LDAP_CONST char *ufn,
1190 int (*cancelproc)( void *cl ),
1197 ldap_ufn_search_s LDAP_P((
1199 LDAP_CONST char *ufn,
1202 LDAPMessage **res ));
1204 LDAP_F( LDAPFiltDesc *)
1205 ldap_ufn_setfilter LDAP_P((
1207 LDAP_CONST char *fname ));
1210 ldap_ufn_setprefix LDAP_P((
1212 LDAP_CONST char *prefix ));
1215 ldap_ufn_timeout LDAP_P((
1223 ldap_unbind LDAP_P((
1227 ldap_unbind_s LDAP_P((
1231 ldap_unbind_ext LDAP_P((
1233 LDAPControl **serverctrls,
1234 LDAPControl **clientctrls));
1237 ldap_unbind_ext_s LDAP_P((
1239 LDAPControl **serverctrls,
1240 LDAPControl **clientctrls));
1245 LDAP_F( LDAPFiltDesc *)
1246 ldap_init_getfilter LDAP_P((
1247 LDAP_CONST char *fname ));
1249 LDAP_F( LDAPFiltDesc *)
1250 ldap_init_getfilter_buf LDAP_P((
1251 /* LDAP_CONST */ char *buf,
1254 LDAP_F( LDAPFiltInfo *)
1255 ldap_getfirstfilter LDAP_P((
1257 /* LDAP_CONST */ char *tagpat,
1258 /* LDAP_CONST */ char *value ));
1260 LDAP_F( LDAPFiltInfo *)
1261 ldap_getnextfilter LDAP_P((
1262 LDAPFiltDesc *lfdp ));
1265 ldap_setfilteraffixes LDAP_P((
1267 LDAP_CONST char *prefix,
1268 LDAP_CONST char *suffix ));
1271 ldap_build_filter LDAP_P((
1273 unsigned long buflen,
1274 LDAP_CONST char *pattern,
1275 LDAP_CONST char *prefix,
1276 LDAP_CONST char *suffix,
1277 LDAP_CONST char *attr,
1278 LDAP_CONST char *value,
1286 ldap_memfree LDAP_P((
1290 ldap_getfilter_free LDAP_P((
1291 LDAPFiltDesc *lfdp ));
1294 ldap_mods_free LDAP_P((
1303 ldap_friendly_name LDAP_P((
1304 LDAP_CONST char *filename,
1305 /* LDAP_CONST */ char *uname,
1306 LDAPFriendlyMap **map ));
1309 ldap_free_friendlymap LDAP_P((
1310 LDAPFriendlyMap **map ));
1318 LDAP_CONST char *host,
1322 cldap_close LDAP_P((
1326 cldap_search_s LDAP_P(( LDAP *ld,
1327 LDAP_CONST char *base,
1329 LDAP_CONST char *filter,
1336 cldap_setretryinfo LDAP_P((
1346 ldap_sort_entries LDAP_P(( LDAP *ld,
1347 LDAPMessage **chain,
1348 LDAP_CONST char *attr,
1349 int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1352 ldap_sort_values LDAP_P((
1355 int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1358 ldap_sort_strcasecmp LDAP_P((
1360 LDAP_CONST void *b ));
1366 * need _ext varients
1369 ldap_is_ldap_url LDAP_P((
1370 LDAP_CONST char *url ));
1373 ldap_url_parse LDAP_P((
1374 LDAP_CONST char *url,
1375 LDAPURLDesc **ludpp ));
1378 ldap_free_urldesc LDAP_P((
1379 LDAPURLDesc *ludp ));
1382 ldap_url_search LDAP_P((
1384 LDAP_CONST char *url,
1388 ldap_url_search_s LDAP_P((
1390 LDAP_CONST char *url,
1392 LDAPMessage **res ));
1395 ldap_url_search_st LDAP_P((
1397 LDAP_CONST char *url,
1399 struct timeval *timeout,
1400 LDAPMessage **res ));
1408 ldap_set_string_translators LDAP_P((
1410 BERTranslateProc encode_proc,
1411 BERTranslateProc decode_proc ));
1414 ldap_translate_from_t61 LDAP_P((
1417 unsigned long *lenp,
1421 ldap_translate_to_t61 LDAP_P((
1424 unsigned long *lenp, int free_input ));
1427 ldap_enable_translation LDAP_P((
1433 ldap_t61_to_8859 LDAP_P((
1435 unsigned long *buflenp,
1439 ldap_8859_to_t61 LDAP_P((
1441 unsigned long *buflenp,
1446 #endif /* _LDAP_H */