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 /* IMPORTANT: do not use code 0x04, it is used internally by the backends!
322 * (see ldap/servers/slapd/slap.h)
323 * JCG 05/1999 (gomez@engr.sgi.com)
325 #define LDAP_MOD_BVALUES 0x0080
329 struct berval **modv_bvals;
331 #define mod_values mod_vals.modv_strvals
332 #define mod_bvalues mod_vals.modv_bvals
336 * possible error codes we can return
339 #define LDAP_SUCCESS 0x00
340 #define LDAP_OPERATIONS_ERROR 0x01
341 #define LDAP_PROTOCOL_ERROR 0x02
342 #define LDAP_TIMELIMIT_EXCEEDED 0x03
343 #define LDAP_SIZELIMIT_EXCEEDED 0x04
344 #define LDAP_COMPARE_FALSE 0x05
345 #define LDAP_COMPARE_TRUE 0x06
346 #define LDAP_STRONG_AUTH_NOT_SUPPORTED 0x07
347 #define LDAP_AUTH_METHOD_NOT_SUPPORTED LDAP_STRONG_AUTH_NOT_SUPPORTED
348 #define LDAP_STRONG_AUTH_REQUIRED 0x08
349 #define LDAP_PARTIAL_RESULTS 0x09 /* not listed in v3 */
351 #define LDAP_REFERRAL 0x0a /* LDAPv3 */
352 #define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
353 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION 0x0c /* LDAPv3 */
354 #define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
355 #define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
357 #define LDAP_NO_SUCH_ATTRIBUTE 0x10
358 #define LDAP_UNDEFINED_TYPE 0x11
359 #define LDAP_INAPPROPRIATE_MATCHING 0x12
360 #define LDAP_CONSTRAINT_VIOLATION 0x13
361 #define LDAP_TYPE_OR_VALUE_EXISTS 0x14
362 #define LDAP_INVALID_SYNTAX 0x15
364 #define LDAP_NO_SUCH_OBJECT 0x20
365 #define LDAP_ALIAS_PROBLEM 0x21
366 #define LDAP_INVALID_DN_SYNTAX 0x22
367 #define LDAP_IS_LEAF 0x23 /* not LDAPv3 */
368 #define LDAP_ALIAS_DEREF_PROBLEM 0x24
370 #define LDAP_NAME_ERROR(n) (((int)(n) & 0x00f0) == 0x0020)
372 #define LDAP_INAPPROPRIATE_AUTH 0x30
373 #define LDAP_INVALID_CREDENTIALS 0x31
374 #define LDAP_INSUFFICIENT_ACCESS 0x32
375 #define LDAP_BUSY 0x33
376 #define LDAP_UNAVAILABLE 0x34
377 #define LDAP_UNWILLING_TO_PERFORM 0x35
378 #define LDAP_LOOP_DETECT 0x36
380 #define LDAP_NAMING_VIOLATION 0x40
381 #define LDAP_OBJECT_CLASS_VIOLATION 0x41
382 #define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
383 #define LDAP_NOT_ALLOWED_ON_RDN 0x43
384 #define LDAP_ALREADY_EXISTS 0x44
385 #define LDAP_NO_OBJECT_CLASS_MODS 0x45
386 #define LDAP_RESULTS_TOO_LARGE 0x46 /* CLDAP */
387 #define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* LDAPv3 */
389 #define LDAP_OTHER 0x50
390 #define LDAP_SERVER_DOWN 0x51
391 #define LDAP_LOCAL_ERROR 0x52
392 #define LDAP_ENCODING_ERROR 0x53
393 #define LDAP_DECODING_ERROR 0x54
394 #define LDAP_TIMEOUT 0x55
395 #define LDAP_AUTH_UNKNOWN 0x56
396 #define LDAP_FILTER_ERROR 0x57
397 #define LDAP_USER_CANCELLED 0x58
398 #define LDAP_PARAM_ERROR 0x59
399 #define LDAP_NO_MEMORY 0x5a
401 #define LDAP_CONNECT_ERROR 0x5b /* new */
402 #define LDAP_NOT_SUPPORTED 0x5c /* new */
403 #define LDAP_CONTROL_NOT_FOUND 0x5d /* new */
404 #define LDAP_NO_RESULTS_RETURNED 0x5e /* new */
405 #define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* new */
406 #define LDAP_CLIENT_LOOP 0x60 /* new */
407 #define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* new */
410 * This structure represents both ldap messages and ldap responses.
411 * These are really the same, except in the case of search responses,
412 * where a response has multiple messages.
415 typedef struct ldapmsg LDAPMessage;
418 * structures for ldap getfilter routines
421 typedef struct ldap_filt_info {
424 int lfi_scope; /* LDAP_SCOPE_BASE, etc */
425 int lfi_isexact; /* exact match filter? */
426 struct ldap_filt_info *lfi_next;
429 typedef struct ldap_filt_list {
433 LDAPFiltInfo *lfl_ilist;
434 struct ldap_filt_list *lfl_next;
438 #define LDAP_FILT_MAXSIZ 1024
440 typedef struct ldap_filt_desc {
441 LDAPFiltList *lfd_filtlist;
442 LDAPFiltInfo *lfd_curfip;
443 LDAPFiltInfo lfd_retfi;
444 char lfd_filter[ LDAP_FILT_MAXSIZ ];
446 char *lfd_curvalcopy;
447 char **lfd_curvalwords;
448 char *lfd_filtprefix;
449 char *lfd_filtsuffix;
454 * structure representing an ldap connection
457 typedef struct ldap LDAP;
459 #define LDAP_DEREF_NEVER 0x00
460 #define LDAP_DEREF_SEARCHING 0x01
461 #define LDAP_DEREF_FINDING 0x02
462 #define LDAP_DEREF_ALWAYS 0x03
464 #define LDAP_NO_LIMIT 0
466 /* how many messages to retrieve results for */
467 #define LDAP_MSG_ONE 0x00
468 #define LDAP_MSG_ALL 0x01
469 #define LDAP_MSG_RECEIVED 0x02
472 * structure for ldap friendly mapping routines
475 typedef struct ldap_friendly {
481 * types for ldap URL handling
483 typedef struct ldap_url_desc {
490 char *lud_string; /* for internal use only */
493 #define LDAP_URL_ERR_NOTLDAP 0x01 /* URL doesn't begin with "ldap://" */
494 #define LDAP_URL_ERR_NODN 0x02 /* URL has no DN (required) */
495 #define LDAP_URL_ERR_BADSCOPE 0x03 /* URL scope string is invalid */
496 #define LDAP_URL_ERR_MEM 0x04 /* can't allocate memory space */
499 * The API draft spec says we should declare (or cause to be declared)
500 * 'struct timeval'. We don't. See LDAPext discussions.
508 ldap_get_option LDAP_P((
514 ldap_set_option LDAP_P((
517 LDAP_CONST void *invalue));
524 ldap_control_free LDAP_P((
525 LDAPControl *ctrl ));
528 ldap_controls_free LDAP_P((
529 LDAPControl **ctrls ));
536 ldap_extended_operation LDAP_P((
538 LDAP_CONST char *exoid,
539 struct berval *exdata,
540 LDAPControl **serverctrls,
541 LDAPControl **clientctrls,
545 ldap_extended_operation_s LDAP_P((
547 LDAP_CONST char *exoid,
548 struct berval *exdata,
549 LDAPControl **serverctrls,
550 LDAPControl **clientctrls,
552 struct berval **retdatap ));
555 ldap_parse_extended_result LDAP_P((
559 struct berval **retdatap,
566 ldap_abandon LDAP_P((
571 ldap_abandon_ext LDAP_P((
574 LDAPControl **serverctrls,
575 LDAPControl **clientctrls ));
582 ldap_add_ext LDAP_P((
586 LDAPControl **serverctrls,
587 LDAPControl **clientctrls,
591 ldap_add_ext_s LDAP_P((
595 LDAPControl **serverctrls,
596 LDAPControl **clientctrls ));
615 ldap_sasl_bind LDAP_P((
618 LDAP_CONST char *mechanism,
620 LDAPControl **serverctrls,
621 LDAPControl **clientctrls,
625 ldap_sasl_bind_s LDAP_P((
628 LDAP_CONST char *mechanism,
630 LDAPControl **serverctrls,
631 LDAPControl **clientctrls,
632 struct berval **servercredp ));
635 ldap_parse_sasl_bind_result LDAP_P((
638 struct berval **servercredp,
648 LDAP_CONST char *who,
649 LDAP_CONST char *passwd,
655 LDAP_CONST char *who,
656 LDAP_CONST char *cred,
660 ldap_set_rebind_proc LDAP_P((
662 int (*rebindproc) LDAP_P((
674 ldap_simple_bind LDAP_P((
676 LDAP_CONST char *who,
677 LDAP_CONST char *passwd ));
680 ldap_simple_bind_s LDAP_P((
682 LDAP_CONST char *who,
683 LDAP_CONST char *passwd ));
691 ldap_kerberos_bind_s LDAP_P((
693 LDAP_CONST char *who ));
696 ldap_kerberos_bind1 LDAP_P((
698 LDAP_CONST char *who ));
701 ldap_kerberos_bind1_s LDAP_P((
703 LDAP_CONST char *who ));
706 ldap_kerberos_bind2 LDAP_P((
708 LDAP_CONST char *who ));
711 ldap_kerberos_bind2_s LDAP_P((
713 LDAP_CONST char *who ));
720 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
723 ldap_disable_cache LDAP_P(( LDAP *ld ));
726 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
729 ldap_destroy_cache LDAP_P(( LDAP *ld ));
732 ldap_flush_cache LDAP_P(( LDAP *ld ));
735 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
738 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
745 ldap_compare_ext LDAP_P((
748 LDAP_CONST char *attr,
749 struct berval *bvalue,
750 LDAPControl **serverctrls,
751 LDAPControl **clientctrls,
755 ldap_compare_ext_s LDAP_P((
758 LDAP_CONST char *attr,
759 struct berval *bvalue,
760 LDAPControl **serverctrls,
761 LDAPControl **clientctrls ));
764 ldap_compare LDAP_P((
767 LDAP_CONST char *attr,
768 LDAP_CONST char *value ));
771 ldap_compare_s LDAP_P((
774 LDAP_CONST char *attr,
775 LDAP_CONST char *value ));
782 ldap_delete_ext LDAP_P((
785 LDAPControl **serverctrls,
786 LDAPControl **clientctrls,
790 ldap_delete_ext_s LDAP_P((
793 LDAPControl **serverctrls,
794 LDAPControl **clientctrls ));
799 LDAP_CONST char *dn ));
802 ldap_delete_s LDAP_P((
804 LDAP_CONST char *dn ));
811 ldap_result2error LDAP_P(( /* deprecated */
817 ldap_err2string LDAP_P((
821 ldap_perror LDAP_P(( /* deprecated */
823 LDAP_CONST char *s ));
830 ldap_modify_ext LDAP_P((
834 LDAPControl **serverctrls,
835 LDAPControl **clientctrls,
839 ldap_modify_ext_s LDAP_P((
843 LDAPControl **serverctrls,
844 LDAPControl **clientctrls ));
853 ldap_modify_s LDAP_P((
863 ldap_rename_ext LDAP_P((
866 LDAP_CONST char *newrdn,
867 LDAP_CONST char *newparent,
869 LDAPControl **serverctrls,
870 LDAPControl **clientctrls,
874 ldap_rename_ext_s LDAP_P((
877 LDAP_CONST char *newrdn,
878 LDAP_CONST char *newparent,
880 LDAPControl **serverctrls,
881 LDAPControl **clientctrls ));
884 ldap_rename2 LDAP_P((
887 LDAP_CONST char *newrdn,
889 LDAP_CONST char *newSuperior ));
892 ldap_rename2_s LDAP_P((
895 LDAP_CONST char *newrdn,
897 LDAP_CONST char *newSuperior));
903 LDAP_CONST char *newrdn ));
906 ldap_modrdn_s LDAP_P((
909 LDAP_CONST char *newrdn ));
912 ldap_modrdn2 LDAP_P((
915 LDAP_CONST char *newrdn,
919 ldap_modrdn2_s LDAP_P((
922 LDAP_CONST char *newrdn,
931 LDAP_CONST char *host,
936 LDAP_CONST char *host,
943 LDAP_F( LDAPMessage *)
944 ldap_first_message LDAP_P((
946 LDAPMessage *chain ));
948 LDAP_F( LDAPMessage *)
949 ldap_next_message LDAP_P((
954 ldap_count_messages LDAP_P((
956 LDAPMessage *chain ));
962 LDAP_F( LDAPMessage *)
963 ldap_first_reference LDAP_P((
965 LDAPMessage *chain ));
967 LDAP_F( LDAPMessage *)
968 ldap_next_reference LDAP_P((
973 ldap_count_references LDAP_P((
975 LDAPMessage *chain ));
978 ldap_parse_reference LDAP_P((
982 LDAPControl ***serverctrls,
989 LDAP_F( LDAPMessage *)
990 ldap_first_entry LDAP_P((
992 LDAPMessage *chain ));
994 LDAP_F( LDAPMessage *)
995 ldap_next_entry LDAP_P((
997 LDAPMessage *entry ));
1000 ldap_count_entries LDAP_P((
1002 LDAPMessage *chain ));
1005 ldap_get_entry_controls LDAP_P((
1008 LDAPControl ***serverctrls));
1014 LDAP_F( LDAPMessage *)
1015 ldap_delete_result_entry LDAP_P((
1020 ldap_add_result_entry LDAP_P((
1029 ldap_get_dn LDAP_P((
1031 LDAPMessage *entry ));
1034 ldap_dn2ufn LDAP_P((
1035 LDAP_CONST char *dn ));
1038 ldap_explode_dn LDAP_P((
1039 LDAP_CONST char *dn,
1043 ldap_explode_rdn LDAP_P((
1044 LDAP_CONST char *rdn,
1048 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1049 LDAP_CONST char *dn ));
1052 ldap_relative_dn LDAP_P(( /* new (from slapd) */
1053 LDAP_CONST char *dn ));
1056 ldap_normalize_dn LDAP_P(( /* new (from slapd) */
1057 LDAP_CONST char *dn ));
1060 ldap_explode_dns LDAP_P(( /* deprecated */
1061 LDAP_CONST char *dn ));
1064 ldap_is_dns_dn LDAP_P(( /* deprecated */
1065 LDAP_CONST char *dn ));
1072 ldap_first_attribute LDAP_P((
1075 BerElement **ber ));
1078 ldap_next_attribute LDAP_P((
1088 ldap_get_values LDAP_P((
1091 LDAP_CONST char *target ));
1093 LDAP_F( struct berval **)
1094 ldap_get_values_len LDAP_P((
1097 LDAP_CONST char *target ));
1100 ldap_count_values LDAP_P((
1104 ldap_count_values_len LDAP_P((
1105 struct berval **vals ));
1108 ldap_value_free LDAP_P((
1112 ldap_value_free_len LDAP_P((
1113 struct berval **vals ));
1119 ldap_result LDAP_P((
1123 struct timeval *timeout,
1124 LDAPMessage **result ));
1127 ldap_parse_result LDAP_P((
1134 LDAPControl ***serverctrls,
1138 ldap_msgtype LDAP_P((
1146 ldap_msgfree LDAP_P((
1150 ldap_msgdelete LDAP_P((
1159 ldap_search_ext LDAP_P((
1161 LDAP_CONST char *base,
1163 LDAP_CONST char *filter,
1166 LDAPControl **serverctrls,
1167 LDAPControl **clientctrls,
1168 struct timeval *timeout,
1173 ldap_search_ext_s LDAP_P((
1175 LDAP_CONST char *base,
1177 LDAP_CONST char *filter,
1180 LDAPControl **serverctrls,
1181 LDAPControl **clientctrls,
1182 struct timeval *timeout,
1184 LDAPMessage **res ));
1187 ldap_search LDAP_P((
1189 LDAP_CONST char *base,
1191 LDAP_CONST char *filter,
1196 ldap_search_s LDAP_P((
1198 LDAP_CONST char *base,
1200 LDAP_CONST char *filter,
1203 LDAPMessage **res ));
1206 ldap_search_st LDAP_P((
1208 LDAP_CONST char *base,
1210 LDAP_CONST char *filter,
1213 struct timeval *timeout,
1214 LDAPMessage **res ));
1221 ldap_ufn_search_c LDAP_P((
1223 LDAP_CONST char *ufn,
1227 int (*cancelproc)( void *cl ),
1228 void *cancelparm ));
1231 ldap_ufn_search_ct LDAP_P((
1233 LDAP_CONST char *ufn,
1237 int (*cancelproc)( void *cl ),
1244 ldap_ufn_search_s LDAP_P((
1246 LDAP_CONST char *ufn,
1249 LDAPMessage **res ));
1251 LDAP_F( LDAPFiltDesc *)
1252 ldap_ufn_setfilter LDAP_P((
1254 LDAP_CONST char *fname ));
1257 ldap_ufn_setprefix LDAP_P((
1259 LDAP_CONST char *prefix ));
1262 ldap_ufn_timeout LDAP_P((
1270 ldap_unbind LDAP_P((
1274 ldap_unbind_s LDAP_P((
1278 ldap_unbind_ext LDAP_P((
1280 LDAPControl **serverctrls,
1281 LDAPControl **clientctrls));
1284 ldap_unbind_ext_s LDAP_P((
1286 LDAPControl **serverctrls,
1287 LDAPControl **clientctrls));
1292 LDAP_F( LDAPFiltDesc *)
1293 ldap_init_getfilter LDAP_P((
1294 LDAP_CONST char *fname ));
1296 LDAP_F( LDAPFiltDesc *)
1297 ldap_init_getfilter_buf LDAP_P((
1298 /* LDAP_CONST */ char *buf,
1301 LDAP_F( LDAPFiltInfo *)
1302 ldap_getfirstfilter LDAP_P((
1304 /* LDAP_CONST */ char *tagpat,
1305 /* LDAP_CONST */ char *value ));
1307 LDAP_F( LDAPFiltInfo *)
1308 ldap_getnextfilter LDAP_P((
1309 LDAPFiltDesc *lfdp ));
1312 ldap_setfilteraffixes LDAP_P((
1314 LDAP_CONST char *prefix,
1315 LDAP_CONST char *suffix ));
1318 ldap_build_filter LDAP_P((
1320 unsigned long buflen,
1321 LDAP_CONST char *pattern,
1322 LDAP_CONST char *prefix,
1323 LDAP_CONST char *suffix,
1324 LDAP_CONST char *attr,
1325 LDAP_CONST char *value,
1334 ldap_memalloc LDAP_P((
1338 ldap_memrealloc LDAP_P((
1343 ldap_memcalloc LDAP_P((
1348 ldap_memfree LDAP_P((
1352 ldap_memvfree LDAP_P((
1356 ldap_getfilter_free LDAP_P((
1357 LDAPFiltDesc *lfdp ));
1360 ldap_mods_free LDAP_P((
1369 ldap_friendly_name LDAP_P((
1370 LDAP_CONST char *filename,
1371 /* LDAP_CONST */ char *uname,
1372 LDAPFriendlyMap **map ));
1375 ldap_free_friendlymap LDAP_P((
1376 LDAPFriendlyMap **map ));
1384 LDAP_CONST char *host,
1388 cldap_close LDAP_P((
1392 cldap_search_s LDAP_P(( LDAP *ld,
1393 LDAP_CONST char *base,
1395 LDAP_CONST char *filter,
1402 cldap_setretryinfo LDAP_P((
1412 ldap_sort_entries LDAP_P(( LDAP *ld,
1413 LDAPMessage **chain,
1414 LDAP_CONST char *attr,
1415 int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1418 ldap_sort_values LDAP_P((
1421 int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1424 ldap_sort_strcasecmp LDAP_P((
1426 LDAP_CONST void *b ));
1432 * need _ext varients
1435 ldap_is_ldap_url LDAP_P((
1436 LDAP_CONST char *url ));
1439 ldap_url_parse LDAP_P((
1440 LDAP_CONST char *url,
1441 LDAPURLDesc **ludpp ));
1444 ldap_free_urldesc LDAP_P((
1445 LDAPURLDesc *ludp ));
1448 ldap_url_search LDAP_P((
1450 LDAP_CONST char *url,
1454 ldap_url_search_s LDAP_P((
1456 LDAP_CONST char *url,
1458 LDAPMessage **res ));
1461 ldap_url_search_st LDAP_P((
1463 LDAP_CONST char *url,
1465 struct timeval *timeout,
1466 LDAPMessage **res ));
1474 ldap_set_string_translators LDAP_P((
1476 BERTranslateProc encode_proc,
1477 BERTranslateProc decode_proc ));
1480 ldap_translate_from_t61 LDAP_P((
1483 unsigned long *lenp,
1487 ldap_translate_to_t61 LDAP_P((
1490 unsigned long *lenp, int free_input ));
1493 ldap_enable_translation LDAP_P((
1499 ldap_t61_to_8859 LDAP_P((
1501 unsigned long *buflenp,
1505 ldap_8859_to_t61 LDAP_P((
1507 unsigned long *buflenp,
1512 #endif /* _LDAP_H */