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 "*"
73 * LDAP_OPTions defined by draft-ldapext-ldap-c-api-02
74 * 0x0000 - 0x0fff reserved for api options
75 * 0x1000 - 0x3fff reserved for api extended options
76 * 0x4000 - 0x7fff reserved for private and experimental options
78 #define LDAP_OPT_API_INFO 0x0000
79 #define LDAP_OPT_DESC 0x0001
80 #define LDAP_OPT_DEREF 0x0002
81 #define LDAP_OPT_SIZELIMIT 0x0003
82 #define LDAP_OPT_TIMELIMIT 0x0004
83 /* 0x05 - 0x07 not defined by current draft */
84 #define LDAP_OPT_REFERRALS 0x0008
85 #define LDAP_OPT_RESTART 0x0009
86 /* 0x0a - 0x10 not defined by current draft */
87 #define LDAP_OPT_PROTOCOL_VERSION 0x0011
88 #define LDAP_OPT_SERVER_CONTROLS 0x0012
89 #define LDAP_OPT_CLIENT_CONTROLS 0x0013
90 /* 0x14 not defined by current draft */
91 #define LDAP_OPT_API_FEATURE_INFO 0x0015
93 /* 0x16 - 0x2f not defined by current draft */
94 #define LDAP_OPT_HOST_NAME 0x0030
95 #define LDAP_OPT_ERROR_NUMBER 0x0031
96 #define LDAP_OPT_ERROR_STRING 0x0032
98 /* 0x33 - 0x0fff not defined by current draft */
100 /* extended options - none */
102 /* private and experimental options */
103 #define LDAP_OPT_DNS 0x4001 /* use DN & DNS */
105 /* OpenLDAP specific options */
106 #define LDAP_OPT_DEBUG_LEVEL 0x5001 /* debug level */
107 #define LDAP_OPT_TIMEOUT 0x5002 /* default timeout */
108 #define LDAP_OPT_REFHOPLIMIT 0x5003 /* ref hop limit */
109 #define LDAP_OPT_MATCH_STRING 0x5004 /* should have been in draft */
112 #define LDAP_OPT_ON ((void *) 1)
113 #define LDAP_OPT_OFF ((void *) 0)
115 #define LDAP_OPT_SUCCESS 0
116 #define LDAP_OPT_ERROR (-1)
118 #define LDAP_API_INFO_VERSION 1
119 typedef struct ldapapiinfo {
120 int ldapai_info_version; /* version of LDAPAPIInfo (1) */
121 int ldapai_api_version; /* revision of API supported */
122 int ldapai_protocol_version; /* highest LDAP version supported */
123 char **ldapai_extensions; /* names of API extensions */
124 char *ldapai_vendor_name; /* name of supplier */
125 int ldapai_vendor_version; /* supplier-specific version * 100 */
128 #define LDAP_FEATURE_INFO_VERSION (1) /* version of api feature structure */
129 typedef struct ldap_apifeature_info {
130 int ldapaif_info_version; /* version of this struct (1) */
131 char* ldapaif_name; /* matches LDAP_API_FEATURE_... less the prefix */
132 int ldapaif_version; /* matches the value LDAP_API_FEATURE_... */
133 } LDAPAPIFeatureInfo;
135 typedef struct ldapcontrol {
137 struct berval ldctl_value;
138 char ldctl_iscritical;
141 /* LDAP "Standard" Controls */
142 #define LDAP_CONTROL_REFERRALS "1.2.840.113666.1.4.616"
143 #define LDAP_CHASE_SUBORDINATE_REFERRALS 0x0020
144 #define LDAP_CHASE_EXTERNAL_REFERRALS 0x0040
146 /* LDAP "Extension" Controls */
148 /* LDAP "Private/Experiemental" Controls */
152 * specific LDAP instantiations of BER types we know about
155 /* Overview of LBER tag construction
162 * 1 0 = CONTEXT-SPECIFIC
169 * | 5 ... 1 | TAG-NUMBER
173 #define LDAP_TAG_MESSAGE 0x30UL /* constructed + 16 */
174 #define OLD_LDAP_TAG_MESSAGE 0x10UL /* forgot the constructed bit */
175 #define LDAP_TAG_MSGID 0x02UL /* integer */
176 #define LDAP_TAG_LDAPDN 0x04UL /* octect string */
177 #define LDAP_TAG_CONTROLS 0xa0UL /* context specific + constructed + 0 */
178 #define LDAP_TAG_REFERRAL 0xa3UL /* context specific + constructed + 3 */
179 #define LDAP_TAG_NEWSUPERIOR 0x80UL /* context-specific + primitive + 0 */
181 #define LDAP_TAG_SASL_RES_CREDS 0x87UL /* context specific + primitive */
183 /* possible operations a client can invoke */
184 #define LDAP_REQ_BIND 0x60UL /* application + constructed */
185 #define LDAP_REQ_UNBIND 0x42UL /* application + primitive */
186 #define LDAP_REQ_SEARCH 0x63UL /* application + constructed */
187 #define LDAP_REQ_MODIFY 0x66UL /* application + constructed */
188 #define LDAP_REQ_ADD 0x68UL /* application + constructed */
189 #define LDAP_REQ_DELETE 0x4aUL /* application + primitive */
190 #define LDAP_REQ_MODRDN 0x6cUL /* application + constructed */
191 #define LDAP_REQ_MODDN LDAP_REQ_MODRDN
192 #define LDAP_REQ_RENAME LDAP_REQ_MODRDN
193 #define LDAP_REQ_COMPARE 0x6eUL /* application + constructed */
194 #define LDAP_REQ_ABANDON 0x50UL /* application + primitive */
195 #define LDAP_REQ_EXTENDED 0x77UL /* application + constructed */
197 /* U-Mich version 3.0 compatibility stuff */
198 #define LDAP_REQ_UNBIND_30 0x62UL
199 #define LDAP_REQ_DELETE_30 0x6aUL
200 #define LDAP_REQ_ABANDON_30 0x70UL
203 * old broken stuff for backwards compatibility - forgot application tag
204 * and constructed/primitive bit
206 #define OLD_LDAP_REQ_BIND 0x00UL
207 #define OLD_LDAP_REQ_UNBIND 0x02UL
208 #define OLD_LDAP_REQ_SEARCH 0x03UL
209 #define OLD_LDAP_REQ_MODIFY 0x06UL
210 #define OLD_LDAP_REQ_ADD 0x08UL
211 #define OLD_LDAP_REQ_DELETE 0x0aUL
212 #define OLD_LDAP_REQ_MODRDN 0x0cUL
213 #define OLD_LDAP_REQ_COMPARE 0x0eUL
214 #define OLD_LDAP_REQ_ABANDON 0x10UL
216 /* possible result types a server can return */
217 #define LDAP_RES_BIND 0x61UL /* application + constructed */
218 #define LDAP_RES_SEARCH_ENTRY 0x64UL /* application + constructed */
219 #define LDAP_RES_SEARCH_REFERENCE 0x73UL /* V3: application + constructed */
220 #define LDAP_RES_SEARCH_RESULT 0x65UL /* application + constructed */
221 #define LDAP_RES_MODIFY 0x67UL /* application + constructed */
222 #define LDAP_RES_ADD 0x69UL /* application + constructed */
223 #define LDAP_RES_DELETE 0x6bUL /* application + constructed */
224 #define LDAP_RES_MODRDN 0x6dUL /* application + constructed */
225 #define LDAP_RES_MODDN LDAP_RES_MODRDN /* application + constructed */
226 #define LDAP_RES_RENAME LDAP_RES_MODRDN /* application + constructed */
227 #define LDAP_RES_COMPARE 0x6fUL /* application + constructed */
228 #define LDAP_RES_EXTENDED 0x78UL /* V3: application + constructed */
229 #define LDAP_RES_ANY ((unsigned long)(-1))
231 /* old broken stuff for backwards compatibility */
232 #define OLD_LDAP_RES_BIND 0x01UL
233 #define OLD_LDAP_RES_SEARCH_ENTRY 0x04UL
234 #define OLD_LDAP_RES_SEARCH_RESULT 0x05UL
235 #define OLD_LDAP_RES_MODIFY 0x07UL
236 #define OLD_LDAP_RES_ADD 0x09UL
237 #define OLD_LDAP_RES_DELETE 0x0bUL
238 #define OLD_LDAP_RES_MODRDN 0x0dUL
239 #define OLD_LDAP_RES_MODDN OLD_LDAP_RES_MODRDN
240 #define OLD_LDAP_RES_COMPARE 0x0fUL
243 #define LDAP_SASL_SIMPLE NULL
245 /* authentication methods available */
246 #define LDAP_AUTH_NONE 0x00UL /* no authentication */
247 #define LDAP_AUTH_SIMPLE 0x80UL /* context specific + primitive */
248 #define LDAP_AUTH_SASL 0xa3UL /* context specific + primitive */
249 #define LDAP_AUTH_KRBV4 0xffUL /* means do both of the following */
250 #define LDAP_AUTH_KRBV41 0x81UL /* context specific + primitive */
251 #define LDAP_AUTH_KRBV42 0x82UL /* context specific + primitive */
253 /* U-Mich version 3.0 compatibility auth methods */
254 #define LDAP_AUTH_SIMPLE_30 0xa0UL /* context specific + constructed */
255 #define LDAP_AUTH_KRBV41_30 0xa1UL /* context specific + constructed */
256 #define LDAP_AUTH_KRBV42_30 0xa2UL /* context specific + constructed */
258 /* old broken stuff */
259 #define OLD_LDAP_AUTH_SIMPLE 0x00UL
260 #define OLD_LDAP_AUTH_KRBV4 0x01UL
261 #define OLD_LDAP_AUTH_KRBV42 0x02UL
264 #define LDAP_FILTER_AND 0xa0UL /* context specific + constructed */
265 #define LDAP_FILTER_OR 0xa1UL /* context specific + constructed */
266 #define LDAP_FILTER_NOT 0xa2UL /* context specific + constructed */
267 #define LDAP_FILTER_EQUALITY 0xa3UL /* context specific + constructed */
268 #define LDAP_FILTER_SUBSTRINGS 0xa4UL /* context specific + constructed */
269 #define LDAP_FILTER_GE 0xa5UL /* context specific + constructed */
270 #define LDAP_FILTER_LE 0xa6UL /* context specific + constructed */
271 #define LDAP_FILTER_PRESENT 0x87UL /* context specific + primitive */
272 #define LDAP_FILTER_APPROX 0xa8UL /* context specific + constructed */
273 #define LDAP_FILTER_EXTENDED 0xa9UL /* context specific + constructed */
275 /* U-Mich version 3.0 compatibility filter types */
276 #define LDAP_FILTER_PRESENT_30 0xa7UL /* context specific + constructed */
278 /* old broken stuff */
279 #define OLD_LDAP_FILTER_AND 0x00UL
280 #define OLD_LDAP_FILTER_OR 0x01UL
281 #define OLD_LDAP_FILTER_NOT 0x02UL
282 #define OLD_LDAP_FILTER_EQUALITY 0x03UL
283 #define OLD_LDAP_FILTER_SUBSTRINGS 0x04UL
284 #define OLD_LDAP_FILTER_GE 0x05UL
285 #define OLD_LDAP_FILTER_LE 0x06UL
286 #define OLD_LDAP_FILTER_PRESENT 0x07UL
287 #define OLD_LDAP_FILTER_APPROX 0x08UL
289 /* extended filter component types */
290 #define LDAP_FILTER_EXTENDED_OID 0x81UL /* context specific */
291 #define LDAP_FILTER_EXTENDED_TYPE 0x82UL /* context specific */
292 #define LDAP_FILTER_EXTENDED_VALUE 0x83UL /* context specific */
293 #define LDAP_FILTER_EXTENDED_DNATTRS 0x84UL /* context specific */
295 /* substring filter component types */
296 #define LDAP_SUBSTRING_INITIAL 0x80UL /* context specific */
297 #define LDAP_SUBSTRING_ANY 0x81UL /* context specific */
298 #define LDAP_SUBSTRING_FINAL 0x82UL /* context specific */
300 /* U-Mich version 3.0 compatibility substring filter component types */
301 #define LDAP_SUBSTRING_INITIAL_30 0xa0UL /* context specific */
302 #define LDAP_SUBSTRING_ANY_30 0xa1UL /* context specific */
303 #define LDAP_SUBSTRING_FINAL_30 0xa2UL /* context specific */
305 /* old broken stuff */
306 #define OLD_LDAP_SUBSTRING_INITIAL 0x00UL
307 #define OLD_LDAP_SUBSTRING_ANY 0x01UL
308 #define OLD_LDAP_SUBSTRING_FINAL 0x02UL
311 #define LDAP_SCOPE_BASE 0x0000
312 #define LDAP_SCOPE_ONELEVEL 0x0001
313 #define LDAP_SCOPE_SUBTREE 0x0002
315 /* for modifications */
316 typedef struct ldapmod {
318 #define LDAP_MOD_ADD 0x0000
319 #define LDAP_MOD_DELETE 0x0001
320 #define LDAP_MOD_REPLACE 0x0002
321 #define LDAP_MOD_BVALUES 0x0080
322 /* IMPORTANT: do not use code 0x1000 (or above),
323 * it is used internally by the backends!
324 * (see ldap/servers/slapd/slap.h)
325 * JCG 05/1999 (gomez@engr.sgi.com)
330 struct berval **modv_bvals;
332 #define mod_values mod_vals.modv_strvals
333 #define mod_bvalues mod_vals.modv_bvals
337 * possible error codes we can return
340 #define LDAP_SUCCESS 0x00
341 #define LDAP_OPERATIONS_ERROR 0x01
342 #define LDAP_PROTOCOL_ERROR 0x02
343 #define LDAP_TIMELIMIT_EXCEEDED 0x03
344 #define LDAP_SIZELIMIT_EXCEEDED 0x04
345 #define LDAP_COMPARE_FALSE 0x05
346 #define LDAP_COMPARE_TRUE 0x06
347 #define LDAP_STRONG_AUTH_NOT_SUPPORTED 0x07
348 #define LDAP_AUTH_METHOD_NOT_SUPPORTED LDAP_STRONG_AUTH_NOT_SUPPORTED
349 #define LDAP_STRONG_AUTH_REQUIRED 0x08
350 #define LDAP_PARTIAL_RESULTS 0x09 /* not listed in v3 */
352 #define LDAP_REFERRAL 0x0a /* LDAPv3 */
353 #define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
354 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION 0x0c /* LDAPv3 */
355 #define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
356 #define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
358 #define LDAP_NO_SUCH_ATTRIBUTE 0x10
359 #define LDAP_UNDEFINED_TYPE 0x11
360 #define LDAP_INAPPROPRIATE_MATCHING 0x12
361 #define LDAP_CONSTRAINT_VIOLATION 0x13
362 #define LDAP_TYPE_OR_VALUE_EXISTS 0x14
363 #define LDAP_INVALID_SYNTAX 0x15
365 #define LDAP_NO_SUCH_OBJECT 0x20
366 #define LDAP_ALIAS_PROBLEM 0x21
367 #define LDAP_INVALID_DN_SYNTAX 0x22
368 #define LDAP_IS_LEAF 0x23 /* not LDAPv3 */
369 #define LDAP_ALIAS_DEREF_PROBLEM 0x24
371 #define LDAP_NAME_ERROR(n) (((int)(n) & 0x00f0) == 0x0020)
373 #define LDAP_INAPPROPRIATE_AUTH 0x30
374 #define LDAP_INVALID_CREDENTIALS 0x31
375 #define LDAP_INSUFFICIENT_ACCESS 0x32
376 #define LDAP_BUSY 0x33
377 #define LDAP_UNAVAILABLE 0x34
378 #define LDAP_UNWILLING_TO_PERFORM 0x35
379 #define LDAP_LOOP_DETECT 0x36
381 #define LDAP_NAMING_VIOLATION 0x40
382 #define LDAP_OBJECT_CLASS_VIOLATION 0x41
383 #define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
384 #define LDAP_NOT_ALLOWED_ON_RDN 0x43
385 #define LDAP_ALREADY_EXISTS 0x44
386 #define LDAP_NO_OBJECT_CLASS_MODS 0x45
387 #define LDAP_RESULTS_TOO_LARGE 0x46 /* CLDAP */
388 #define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* LDAPv3 */
390 #define LDAP_OTHER 0x50
391 #define LDAP_SERVER_DOWN 0x51
392 #define LDAP_LOCAL_ERROR 0x52
393 #define LDAP_ENCODING_ERROR 0x53
394 #define LDAP_DECODING_ERROR 0x54
395 #define LDAP_TIMEOUT 0x55
396 #define LDAP_AUTH_UNKNOWN 0x56
397 #define LDAP_FILTER_ERROR 0x57
398 #define LDAP_USER_CANCELLED 0x58
399 #define LDAP_PARAM_ERROR 0x59
400 #define LDAP_NO_MEMORY 0x5a
402 #define LDAP_CONNECT_ERROR 0x5b /* new */
403 #define LDAP_NOT_SUPPORTED 0x5c /* new */
404 #define LDAP_CONTROL_NOT_FOUND 0x5d /* new */
405 #define LDAP_NO_RESULTS_RETURNED 0x5e /* new */
406 #define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* new */
407 #define LDAP_CLIENT_LOOP 0x60 /* new */
408 #define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* new */
411 * This structure represents both ldap messages and ldap responses.
412 * These are really the same, except in the case of search responses,
413 * where a response has multiple messages.
416 typedef struct ldapmsg LDAPMessage;
419 * structures for ldap getfilter routines
422 typedef struct ldap_filt_info {
425 int lfi_scope; /* LDAP_SCOPE_BASE, etc */
426 int lfi_isexact; /* exact match filter? */
427 struct ldap_filt_info *lfi_next;
430 typedef struct ldap_filt_list {
434 LDAPFiltInfo *lfl_ilist;
435 struct ldap_filt_list *lfl_next;
439 #define LDAP_FILT_MAXSIZ 1024
441 typedef struct ldap_filt_desc {
442 LDAPFiltList *lfd_filtlist;
443 LDAPFiltInfo *lfd_curfip;
444 LDAPFiltInfo lfd_retfi;
445 char lfd_filter[ LDAP_FILT_MAXSIZ ];
447 char *lfd_curvalcopy;
448 char **lfd_curvalwords;
449 char *lfd_filtprefix;
450 char *lfd_filtsuffix;
455 * structure representing an ldap connection
458 typedef struct ldap LDAP;
460 #define LDAP_DEREF_NEVER 0x00
461 #define LDAP_DEREF_SEARCHING 0x01
462 #define LDAP_DEREF_FINDING 0x02
463 #define LDAP_DEREF_ALWAYS 0x03
465 #define LDAP_NO_LIMIT 0
467 /* how many messages to retrieve results for */
468 #define LDAP_MSG_ONE 0x00
469 #define LDAP_MSG_ALL 0x01
470 #define LDAP_MSG_RECEIVED 0x02
473 * structure for ldap friendly mapping routines
476 typedef struct ldap_friendly {
482 * types for ldap URL handling
484 typedef struct ldap_url_desc {
491 char *lud_string; /* for internal use only */
494 #define LDAP_URL_ERR_NOTLDAP 0x01 /* URL doesn't begin with "ldap://" */
495 #define LDAP_URL_ERR_NODN 0x02 /* URL has no DN (required) */
496 #define LDAP_URL_ERR_BADSCOPE 0x03 /* URL scope string is invalid */
497 #define LDAP_URL_ERR_MEM 0x04 /* can't allocate memory space */
500 * The API draft spec says we should declare (or cause to be declared)
501 * 'struct timeval'. We don't. See LDAPext discussions.
509 ldap_get_option LDAP_P((
515 ldap_set_option LDAP_P((
518 LDAP_CONST void *invalue));
525 ldap_control_free LDAP_P((
526 LDAPControl *ctrl ));
529 ldap_controls_free LDAP_P((
530 LDAPControl **ctrls ));
537 ldap_extended_operation LDAP_P((
539 LDAP_CONST char *exoid,
540 struct berval *exdata,
541 LDAPControl **serverctrls,
542 LDAPControl **clientctrls,
546 ldap_extended_operation_s LDAP_P((
548 LDAP_CONST char *exoid,
549 struct berval *exdata,
550 LDAPControl **serverctrls,
551 LDAPControl **clientctrls,
553 struct berval **retdatap ));
556 ldap_parse_extended_result LDAP_P((
560 struct berval **retdatap,
567 ldap_abandon LDAP_P((
572 ldap_abandon_ext LDAP_P((
575 LDAPControl **serverctrls,
576 LDAPControl **clientctrls ));
583 ldap_add_ext LDAP_P((
587 LDAPControl **serverctrls,
588 LDAPControl **clientctrls,
592 ldap_add_ext_s LDAP_P((
596 LDAPControl **serverctrls,
597 LDAPControl **clientctrls ));
616 ldap_sasl_bind LDAP_P((
619 LDAP_CONST char *mechanism,
621 LDAPControl **serverctrls,
622 LDAPControl **clientctrls,
626 ldap_sasl_bind_s LDAP_P((
629 LDAP_CONST char *mechanism,
631 LDAPControl **serverctrls,
632 LDAPControl **clientctrls,
633 struct berval **servercredp ));
636 ldap_parse_sasl_bind_result LDAP_P((
639 struct berval **servercredp,
649 LDAP_CONST char *who,
650 LDAP_CONST char *passwd,
656 LDAP_CONST char *who,
657 LDAP_CONST char *cred,
661 ldap_set_rebind_proc LDAP_P((
663 int (*rebindproc) LDAP_P((
675 ldap_simple_bind LDAP_P((
677 LDAP_CONST char *who,
678 LDAP_CONST char *passwd ));
681 ldap_simple_bind_s LDAP_P((
683 LDAP_CONST char *who,
684 LDAP_CONST char *passwd ));
692 ldap_kerberos_bind_s LDAP_P((
694 LDAP_CONST char *who ));
697 ldap_kerberos_bind1 LDAP_P((
699 LDAP_CONST char *who ));
702 ldap_kerberos_bind1_s LDAP_P((
704 LDAP_CONST char *who ));
707 ldap_kerberos_bind2 LDAP_P((
709 LDAP_CONST char *who ));
712 ldap_kerberos_bind2_s LDAP_P((
714 LDAP_CONST char *who ));
721 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
724 ldap_disable_cache LDAP_P(( LDAP *ld ));
727 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
730 ldap_destroy_cache LDAP_P(( LDAP *ld ));
733 ldap_flush_cache LDAP_P(( LDAP *ld ));
736 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
739 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
746 ldap_compare_ext LDAP_P((
749 LDAP_CONST char *attr,
750 struct berval *bvalue,
751 LDAPControl **serverctrls,
752 LDAPControl **clientctrls,
756 ldap_compare_ext_s LDAP_P((
759 LDAP_CONST char *attr,
760 struct berval *bvalue,
761 LDAPControl **serverctrls,
762 LDAPControl **clientctrls ));
765 ldap_compare LDAP_P((
768 LDAP_CONST char *attr,
769 LDAP_CONST char *value ));
772 ldap_compare_s LDAP_P((
775 LDAP_CONST char *attr,
776 LDAP_CONST char *value ));
783 ldap_delete_ext LDAP_P((
786 LDAPControl **serverctrls,
787 LDAPControl **clientctrls,
791 ldap_delete_ext_s LDAP_P((
794 LDAPControl **serverctrls,
795 LDAPControl **clientctrls ));
800 LDAP_CONST char *dn ));
803 ldap_delete_s LDAP_P((
805 LDAP_CONST char *dn ));
812 ldap_result2error LDAP_P(( /* deprecated */
818 ldap_err2string LDAP_P((
822 ldap_perror LDAP_P(( /* deprecated */
824 LDAP_CONST char *s ));
831 ldap_modify_ext LDAP_P((
835 LDAPControl **serverctrls,
836 LDAPControl **clientctrls,
840 ldap_modify_ext_s LDAP_P((
844 LDAPControl **serverctrls,
845 LDAPControl **clientctrls ));
854 ldap_modify_s LDAP_P((
864 ldap_rename_ext LDAP_P((
867 LDAP_CONST char *newrdn,
868 LDAP_CONST char *newparent,
870 LDAPControl **serverctrls,
871 LDAPControl **clientctrls,
875 ldap_rename_ext_s LDAP_P((
878 LDAP_CONST char *newrdn,
879 LDAP_CONST char *newparent,
881 LDAPControl **serverctrls,
882 LDAPControl **clientctrls ));
885 ldap_rename2 LDAP_P((
888 LDAP_CONST char *newrdn,
890 LDAP_CONST char *newSuperior ));
893 ldap_rename2_s LDAP_P((
896 LDAP_CONST char *newrdn,
898 LDAP_CONST char *newSuperior));
904 LDAP_CONST char *newrdn ));
907 ldap_modrdn_s LDAP_P((
910 LDAP_CONST char *newrdn ));
913 ldap_modrdn2 LDAP_P((
916 LDAP_CONST char *newrdn,
920 ldap_modrdn2_s LDAP_P((
923 LDAP_CONST char *newrdn,
932 LDAP_CONST char *host,
937 LDAP_CONST char *host,
944 LDAP_F( LDAPMessage *)
945 ldap_first_message LDAP_P((
947 LDAPMessage *chain ));
949 LDAP_F( LDAPMessage *)
950 ldap_next_message LDAP_P((
955 ldap_count_messages LDAP_P((
957 LDAPMessage *chain ));
963 LDAP_F( LDAPMessage *)
964 ldap_first_reference LDAP_P((
966 LDAPMessage *chain ));
968 LDAP_F( LDAPMessage *)
969 ldap_next_reference LDAP_P((
974 ldap_count_references LDAP_P((
976 LDAPMessage *chain ));
979 ldap_parse_reference LDAP_P((
983 LDAPControl ***serverctrls,
990 LDAP_F( LDAPMessage *)
991 ldap_first_entry LDAP_P((
993 LDAPMessage *chain ));
995 LDAP_F( LDAPMessage *)
996 ldap_next_entry LDAP_P((
998 LDAPMessage *entry ));
1001 ldap_count_entries LDAP_P((
1003 LDAPMessage *chain ));
1006 ldap_get_entry_controls LDAP_P((
1009 LDAPControl ***serverctrls));
1015 LDAP_F( LDAPMessage *)
1016 ldap_delete_result_entry LDAP_P((
1021 ldap_add_result_entry LDAP_P((
1030 ldap_get_dn LDAP_P((
1032 LDAPMessage *entry ));
1035 ldap_dn2ufn LDAP_P((
1036 LDAP_CONST char *dn ));
1039 ldap_explode_dn LDAP_P((
1040 LDAP_CONST char *dn,
1044 ldap_explode_rdn LDAP_P((
1045 LDAP_CONST char *rdn,
1049 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1050 LDAP_CONST char *dn ));
1053 ldap_relative_dn LDAP_P(( /* new (from slapd) */
1054 LDAP_CONST char *dn ));
1057 ldap_normalize_dn LDAP_P(( /* new (from slapd) */
1058 LDAP_CONST char *dn ));
1061 ldap_explode_dns LDAP_P(( /* deprecated */
1062 LDAP_CONST char *dn ));
1065 ldap_is_dns_dn LDAP_P(( /* deprecated */
1066 LDAP_CONST char *dn ));
1073 ldap_first_attribute LDAP_P((
1076 BerElement **ber ));
1079 ldap_next_attribute LDAP_P((
1089 ldap_get_values LDAP_P((
1092 LDAP_CONST char *target ));
1094 LDAP_F( struct berval **)
1095 ldap_get_values_len LDAP_P((
1098 LDAP_CONST char *target ));
1101 ldap_count_values LDAP_P((
1105 ldap_count_values_len LDAP_P((
1106 struct berval **vals ));
1109 ldap_value_free LDAP_P((
1113 ldap_value_free_len LDAP_P((
1114 struct berval **vals ));
1120 ldap_result LDAP_P((
1124 struct timeval *timeout,
1125 LDAPMessage **result ));
1128 ldap_parse_result LDAP_P((
1135 LDAPControl ***serverctrls,
1139 ldap_msgtype LDAP_P((
1147 ldap_msgfree LDAP_P((
1151 ldap_msgdelete LDAP_P((
1160 ldap_search_ext LDAP_P((
1162 LDAP_CONST char *base,
1164 LDAP_CONST char *filter,
1167 LDAPControl **serverctrls,
1168 LDAPControl **clientctrls,
1169 struct timeval *timeout,
1174 ldap_search_ext_s LDAP_P((
1176 LDAP_CONST char *base,
1178 LDAP_CONST char *filter,
1181 LDAPControl **serverctrls,
1182 LDAPControl **clientctrls,
1183 struct timeval *timeout,
1185 LDAPMessage **res ));
1188 ldap_search LDAP_P((
1190 LDAP_CONST char *base,
1192 LDAP_CONST char *filter,
1197 ldap_search_s LDAP_P((
1199 LDAP_CONST char *base,
1201 LDAP_CONST char *filter,
1204 LDAPMessage **res ));
1207 ldap_search_st LDAP_P((
1209 LDAP_CONST char *base,
1211 LDAP_CONST char *filter,
1214 struct timeval *timeout,
1215 LDAPMessage **res ));
1222 ldap_ufn_search_c LDAP_P((
1224 LDAP_CONST char *ufn,
1228 int (*cancelproc)( void *cl ),
1229 void *cancelparm ));
1232 ldap_ufn_search_ct LDAP_P((
1234 LDAP_CONST char *ufn,
1238 int (*cancelproc)( void *cl ),
1245 ldap_ufn_search_s LDAP_P((
1247 LDAP_CONST char *ufn,
1250 LDAPMessage **res ));
1252 LDAP_F( LDAPFiltDesc *)
1253 ldap_ufn_setfilter LDAP_P((
1255 LDAP_CONST char *fname ));
1258 ldap_ufn_setprefix LDAP_P((
1260 LDAP_CONST char *prefix ));
1263 ldap_ufn_timeout LDAP_P((
1271 ldap_unbind LDAP_P((
1275 ldap_unbind_s LDAP_P((
1279 ldap_unbind_ext LDAP_P((
1281 LDAPControl **serverctrls,
1282 LDAPControl **clientctrls));
1285 ldap_unbind_ext_s LDAP_P((
1287 LDAPControl **serverctrls,
1288 LDAPControl **clientctrls));
1293 LDAP_F( LDAPFiltDesc *)
1294 ldap_init_getfilter LDAP_P((
1295 LDAP_CONST char *fname ));
1297 LDAP_F( LDAPFiltDesc *)
1298 ldap_init_getfilter_buf LDAP_P((
1299 /* LDAP_CONST */ char *buf,
1302 LDAP_F( LDAPFiltInfo *)
1303 ldap_getfirstfilter LDAP_P((
1305 /* LDAP_CONST */ char *tagpat,
1306 /* LDAP_CONST */ char *value ));
1308 LDAP_F( LDAPFiltInfo *)
1309 ldap_getnextfilter LDAP_P((
1310 LDAPFiltDesc *lfdp ));
1313 ldap_setfilteraffixes LDAP_P((
1315 LDAP_CONST char *prefix,
1316 LDAP_CONST char *suffix ));
1319 ldap_build_filter LDAP_P((
1321 unsigned long buflen,
1322 LDAP_CONST char *pattern,
1323 LDAP_CONST char *prefix,
1324 LDAP_CONST char *suffix,
1325 LDAP_CONST char *attr,
1326 LDAP_CONST char *value,
1335 ldap_memalloc LDAP_P((
1339 ldap_memrealloc LDAP_P((
1344 ldap_memcalloc LDAP_P((
1349 ldap_memfree LDAP_P((
1353 ldap_memvfree LDAP_P((
1357 ldap_strdup LDAP_P((
1358 LDAP_CONST char * ));
1361 ldap_getfilter_free LDAP_P((
1362 LDAPFiltDesc *lfdp ));
1365 ldap_mods_free LDAP_P((
1374 ldap_friendly_name LDAP_P((
1375 LDAP_CONST char *filename,
1376 /* LDAP_CONST */ char *uname,
1377 LDAPFriendlyMap **map ));
1380 ldap_free_friendlymap LDAP_P((
1381 LDAPFriendlyMap **map ));
1389 LDAP_CONST char *host,
1393 cldap_close LDAP_P((
1397 cldap_search_s LDAP_P(( LDAP *ld,
1398 LDAP_CONST char *base,
1400 LDAP_CONST char *filter,
1407 cldap_setretryinfo LDAP_P((
1417 ldap_sort_entries LDAP_P(( LDAP *ld,
1418 LDAPMessage **chain,
1419 LDAP_CONST char *attr,
1420 int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1423 ldap_sort_values LDAP_P((
1426 int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1429 ldap_sort_strcasecmp LDAP_P((
1431 LDAP_CONST void *b ));
1437 * need _ext varients
1440 ldap_is_ldap_url LDAP_P((
1441 LDAP_CONST char *url ));
1444 ldap_url_parse LDAP_P((
1445 LDAP_CONST char *url,
1446 LDAPURLDesc **ludpp ));
1449 ldap_free_urldesc LDAP_P((
1450 LDAPURLDesc *ludp ));
1453 ldap_url_search LDAP_P((
1455 LDAP_CONST char *url,
1459 ldap_url_search_s LDAP_P((
1461 LDAP_CONST char *url,
1463 LDAPMessage **res ));
1466 ldap_url_search_st LDAP_P((
1468 LDAP_CONST char *url,
1470 struct timeval *timeout,
1471 LDAPMessage **res ));
1479 ldap_set_string_translators LDAP_P((
1481 BERTranslateProc encode_proc,
1482 BERTranslateProc decode_proc ));
1485 ldap_translate_from_t61 LDAP_P((
1488 unsigned long *lenp,
1492 ldap_translate_to_t61 LDAP_P((
1495 unsigned long *lenp, int free_input ));
1498 ldap_enable_translation LDAP_P((
1504 ldap_t61_to_8859 LDAP_P((
1506 unsigned long *buflenp,
1510 ldap_8859_to_t61 LDAP_P((
1512 unsigned long *buflenp,
1517 #endif /* _LDAP_H */