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 */
111 #define LDAP_OPT_ON ((void *) 1)
112 #define LDAP_OPT_OFF ((void *) 0)
114 #define LDAP_OPT_SUCCESS 0
115 #define LDAP_OPT_ERROR (-1)
117 #define LDAP_API_INFO_VERSION 1
118 typedef struct ldapapiinfo {
119 int ldapai_info_version; /* version of LDAPAPIInfo (1) */
120 int ldapai_api_version; /* revision of API supported */
121 int ldapai_protocol_version; /* highest LDAP version supported */
122 char **ldapai_extensions; /* names of API extensions */
123 char *ldapai_vendor_name; /* name of supplier */
124 int ldapai_vendor_version; /* supplier-specific version * 100 */
127 #define LDAP_FEATURE_INFO_VERSION (1) /* version of api feature structure */
128 typedef struct ldap_apifeature_info {
129 int ldapaif_info_version; /* version of this struct (1) */
130 char* ldapaif_name; /* matches LDAP_API_FEATURE_... less the prefix */
131 int ldapaif_version; /* matches the value LDAP_API_FEATURE_... */
132 } LDAPAPIFeatureInfo;
134 typedef struct ldapcontrol {
136 struct berval ldctl_value;
137 char ldctl_iscritical;
138 } LDAPControl, *PLDAPControl;
140 /* LDAP "Standard" Controls */
141 #define LDAP_CONTROL_REFERRALS "1.2.840.113666.1.4.616"
142 #define LDAP_CHASE_SUBORDINATE_REFERRALS 0x0020
143 #define LDAP_CHASE_EXTERNAL_REFERRALS 0x0040
145 /* LDAP "Extension" Controls */
147 /* LDAP "Private/Experiemental" Controls */
151 * specific LDAP instantiations of BER types we know about
154 /* Overview of LBER tag construction
161 * 1 0 = CONTEXT-SPECIFIC
168 * | 5 ... 1 | TAG-NUMBER
172 #define LDAP_TAG_MESSAGE 0x30UL /* constructed + 16 */
173 #define OLD_LDAP_TAG_MESSAGE 0x10UL /* forgot the constructed bit */
174 #define LDAP_TAG_MSGID 0x02UL /* integer */
175 #define LDAP_TAG_LDAPDN 0x04UL /* octect string */
176 #define LDAP_TAG_CONTROLS 0xa0UL /* context specific + constructed + 0 */
177 #define LDAP_TAG_REFERRAL 0xa3UL /* context specific + constructed + 3 */
178 #define LDAP_TAG_NEWSUPERIOR 0x80UL /* context-specific + primitive + 0 */
180 #define LDAP_TAG_SASL_RES_CREDS 0x87UL /* context specific + primitive */
182 /* possible operations a client can invoke */
183 #define LDAP_REQ_BIND 0x60UL /* application + constructed */
184 #define LDAP_REQ_UNBIND 0x42UL /* application + primitive */
185 #define LDAP_REQ_SEARCH 0x63UL /* application + constructed */
186 #define LDAP_REQ_MODIFY 0x66UL /* application + constructed */
187 #define LDAP_REQ_ADD 0x68UL /* application + constructed */
188 #define LDAP_REQ_DELETE 0x4aUL /* application + primitive */
189 #define LDAP_REQ_MODRDN 0x6cUL /* application + constructed */
190 #define LDAP_REQ_MODDN LDAP_REQ_MODRDN
191 #define LDAP_REQ_RENAME LDAP_REQ_MODRDN
192 #define LDAP_REQ_COMPARE 0x6eUL /* application + constructed */
193 #define LDAP_REQ_ABANDON 0x50UL /* application + primitive */
194 #define LDAP_REQ_EXTENDED 0x77UL /* application + constructed */
196 /* U-Mich version 3.0 compatibility stuff */
197 #define LDAP_REQ_UNBIND_30 0x62UL
198 #define LDAP_REQ_DELETE_30 0x6aUL
199 #define LDAP_REQ_ABANDON_30 0x70UL
202 * old broken stuff for backwards compatibility - forgot application tag
203 * and constructed/primitive bit
205 #define OLD_LDAP_REQ_BIND 0x00UL
206 #define OLD_LDAP_REQ_UNBIND 0x02UL
207 #define OLD_LDAP_REQ_SEARCH 0x03UL
208 #define OLD_LDAP_REQ_MODIFY 0x06UL
209 #define OLD_LDAP_REQ_ADD 0x08UL
210 #define OLD_LDAP_REQ_DELETE 0x0aUL
211 #define OLD_LDAP_REQ_MODRDN 0x0cUL
212 #define OLD_LDAP_REQ_COMPARE 0x0eUL
213 #define OLD_LDAP_REQ_ABANDON 0x10UL
215 /* possible result types a server can return */
216 #define LDAP_RES_BIND 0x61UL /* application + constructed */
217 #define LDAP_RES_SEARCH_ENTRY 0x64UL /* application + constructed */
218 #define LDAP_RES_SEARCH_REFERENCE 0x73UL /* V3: application + constructed */
219 #define LDAP_RES_SEARCH_RESULT 0x65UL /* application + constructed */
220 #define LDAP_RES_MODIFY 0x67UL /* application + constructed */
221 #define LDAP_RES_ADD 0x69UL /* application + constructed */
222 #define LDAP_RES_DELETE 0x6bUL /* application + constructed */
223 #define LDAP_RES_MODRDN 0x6dUL /* application + constructed */
224 #define LDAP_RES_MODDN LDAP_RES_MODRDN /* application + constructed */
225 #define LDAP_RES_RENAME LDAP_RES_MODRDN /* application + constructed */
226 #define LDAP_RES_COMPARE 0x6fUL /* application + constructed */
227 #define LDAP_RES_EXTENDED 0x78UL /* V3: application + constructed */
228 #define LDAP_RES_ANY ((unsigned long)(-1))
230 /* old broken stuff for backwards compatibility */
231 #define OLD_LDAP_RES_BIND 0x01UL
232 #define OLD_LDAP_RES_SEARCH_ENTRY 0x04UL
233 #define OLD_LDAP_RES_SEARCH_RESULT 0x05UL
234 #define OLD_LDAP_RES_MODIFY 0x07UL
235 #define OLD_LDAP_RES_ADD 0x09UL
236 #define OLD_LDAP_RES_DELETE 0x0bUL
237 #define OLD_LDAP_RES_MODRDN 0x0dUL
238 #define OLD_LDAP_RES_MODDN OLD_LDAP_RES_MODRDN
239 #define OLD_LDAP_RES_COMPARE 0x0fUL
242 #define LDAP_SASL_SIMPLE NULL
244 /* authentication methods available */
245 #define LDAP_AUTH_NONE 0x00UL /* no authentication */
246 #define LDAP_AUTH_SIMPLE 0x80UL /* context specific + primitive */
247 #define LDAP_AUTH_SASL 0xa3UL /* context specific + primitive */
248 #define LDAP_AUTH_KRBV4 0xffUL /* means do both of the following */
249 #define LDAP_AUTH_KRBV41 0x81UL /* context specific + primitive */
250 #define LDAP_AUTH_KRBV42 0x82UL /* context specific + primitive */
252 /* U-Mich version 3.0 compatibility auth methods */
253 #define LDAP_AUTH_SIMPLE_30 0xa0UL /* context specific + constructed */
254 #define LDAP_AUTH_KRBV41_30 0xa1UL /* context specific + constructed */
255 #define LDAP_AUTH_KRBV42_30 0xa2UL /* context specific + constructed */
257 /* old broken stuff */
258 #define OLD_LDAP_AUTH_SIMPLE 0x00UL
259 #define OLD_LDAP_AUTH_KRBV4 0x01UL
260 #define OLD_LDAP_AUTH_KRBV42 0x02UL
263 #define LDAP_FILTER_AND 0xa0UL /* context specific + constructed */
264 #define LDAP_FILTER_OR 0xa1UL /* context specific + constructed */
265 #define LDAP_FILTER_NOT 0xa2UL /* context specific + constructed */
266 #define LDAP_FILTER_EQUALITY 0xa3UL /* context specific + constructed */
267 #define LDAP_FILTER_SUBSTRINGS 0xa4UL /* context specific + constructed */
268 #define LDAP_FILTER_GE 0xa5UL /* context specific + constructed */
269 #define LDAP_FILTER_LE 0xa6UL /* context specific + constructed */
270 #define LDAP_FILTER_PRESENT 0x87UL /* context specific + primitive */
271 #define LDAP_FILTER_APPROX 0xa8UL /* context specific + constructed */
272 #define LDAP_FILTER_EXTENDED 0xa9UL /* context specific + constructed */
274 /* U-Mich version 3.0 compatibility filter types */
275 #define LDAP_FILTER_PRESENT_30 0xa7UL /* context specific + constructed */
277 /* old broken stuff */
278 #define OLD_LDAP_FILTER_AND 0x00UL
279 #define OLD_LDAP_FILTER_OR 0x01UL
280 #define OLD_LDAP_FILTER_NOT 0x02UL
281 #define OLD_LDAP_FILTER_EQUALITY 0x03UL
282 #define OLD_LDAP_FILTER_SUBSTRINGS 0x04UL
283 #define OLD_LDAP_FILTER_GE 0x05UL
284 #define OLD_LDAP_FILTER_LE 0x06UL
285 #define OLD_LDAP_FILTER_PRESENT 0x07UL
286 #define OLD_LDAP_FILTER_APPROX 0x08UL
288 /* extended filter component types */
289 #define LDAP_FILTER_EXTENDED_OID 0x81UL /* context specific */
290 #define LDAP_FILTER_EXTENDED_TYPE 0x82UL /* context specific */
291 #define LDAP_FILTER_EXTENDED_VALUE 0x83UL /* context specific */
292 #define LDAP_FILTER_EXTENDED_DNATTRS 0x84UL /* context specific */
294 /* substring filter component types */
295 #define LDAP_SUBSTRING_INITIAL 0x80UL /* context specific */
296 #define LDAP_SUBSTRING_ANY 0x81UL /* context specific */
297 #define LDAP_SUBSTRING_FINAL 0x82UL /* context specific */
299 /* U-Mich version 3.0 compatibility substring filter component types */
300 #define LDAP_SUBSTRING_INITIAL_30 0xa0UL /* context specific */
301 #define LDAP_SUBSTRING_ANY_30 0xa1UL /* context specific */
302 #define LDAP_SUBSTRING_FINAL_30 0xa2UL /* context specific */
304 /* old broken stuff */
305 #define OLD_LDAP_SUBSTRING_INITIAL 0x00UL
306 #define OLD_LDAP_SUBSTRING_ANY 0x01UL
307 #define OLD_LDAP_SUBSTRING_FINAL 0x02UL
310 #define LDAP_SCOPE_BASE 0x0000
311 #define LDAP_SCOPE_ONELEVEL 0x0001
312 #define LDAP_SCOPE_SUBTREE 0x0002
314 /* for modifications */
315 typedef struct ldapmod {
317 #define LDAP_MOD_ADD 0x0000
318 #define LDAP_MOD_DELETE 0x0001
319 #define LDAP_MOD_REPLACE 0x0002
320 #define LDAP_MOD_BVALUES 0x0080
324 struct berval **modv_bvals;
326 #define mod_values mod_vals.modv_strvals
327 #define mod_bvalues mod_vals.modv_bvals
331 * possible error codes we can return
334 #define LDAP_SUCCESS 0x00
335 #define LDAP_OPERATIONS_ERROR 0x01
336 #define LDAP_PROTOCOL_ERROR 0x02
337 #define LDAP_TIMELIMIT_EXCEEDED 0x03
338 #define LDAP_SIZELIMIT_EXCEEDED 0x04
339 #define LDAP_COMPARE_FALSE 0x05
340 #define LDAP_COMPARE_TRUE 0x06
341 #define LDAP_STRONG_AUTH_NOT_SUPPORTED 0x07
342 #define LDAP_AUTH_METHOD_NOT_SUPPORTED LDAP_STRONG_AUTH_NOT_SUPPORTED
343 #define LDAP_STRONG_AUTH_REQUIRED 0x08
344 #define LDAP_PARTIAL_RESULTS 0x09 /* not listed in v3 */
346 #define LDAP_REFERRAL 0x0a /* LDAPv3 */
347 #define LDAP_ADMINLIMIT_EXCEEDED 0x0b /* LDAPv3 */
348 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION 0x0c /* LDAPv3 */
349 #define LDAP_CONFIDENTIALITY_REQUIRED 0x0d /* LDAPv3 */
350 #define LDAP_SASL_BIND_IN_PROGRESS 0x0e /* LDAPv3 */
352 #define LDAP_NO_SUCH_ATTRIBUTE 0x10
353 #define LDAP_UNDEFINED_TYPE 0x11
354 #define LDAP_INAPPROPRIATE_MATCHING 0x12
355 #define LDAP_CONSTRAINT_VIOLATION 0x13
356 #define LDAP_TYPE_OR_VALUE_EXISTS 0x14
357 #define LDAP_INVALID_SYNTAX 0x15
359 #define LDAP_NO_SUCH_OBJECT 0x20
360 #define LDAP_ALIAS_PROBLEM 0x21
361 #define LDAP_INVALID_DN_SYNTAX 0x22
362 #define LDAP_IS_LEAF 0x23 /* not LDAPv3 */
363 #define LDAP_ALIAS_DEREF_PROBLEM 0x24
365 #define LDAP_NAME_ERROR(n) (((int)(n) & 0x00f0) == 0x0020)
367 #define LDAP_INAPPROPRIATE_AUTH 0x30
368 #define LDAP_INVALID_CREDENTIALS 0x31
369 #define LDAP_INSUFFICIENT_ACCESS 0x32
370 #define LDAP_BUSY 0x33
371 #define LDAP_UNAVAILABLE 0x34
372 #define LDAP_UNWILLING_TO_PERFORM 0x35
373 #define LDAP_LOOP_DETECT 0x36
375 #define LDAP_NAMING_VIOLATION 0x40
376 #define LDAP_OBJECT_CLASS_VIOLATION 0x41
377 #define LDAP_NOT_ALLOWED_ON_NONLEAF 0x42
378 #define LDAP_NOT_ALLOWED_ON_RDN 0x43
379 #define LDAP_ALREADY_EXISTS 0x44
380 #define LDAP_NO_OBJECT_CLASS_MODS 0x45
381 #define LDAP_RESULTS_TOO_LARGE 0x46 /* CLDAP */
382 #define LDAP_AFFECTS_MULTIPLE_DSAS 0x47 /* LDAPv3 */
384 #define LDAP_OTHER 0x50
385 #define LDAP_SERVER_DOWN 0x51
386 #define LDAP_LOCAL_ERROR 0x52
387 #define LDAP_ENCODING_ERROR 0x53
388 #define LDAP_DECODING_ERROR 0x54
389 #define LDAP_TIMEOUT 0x55
390 #define LDAP_AUTH_UNKNOWN 0x56
391 #define LDAP_FILTER_ERROR 0x57
392 #define LDAP_USER_CANCELLED 0x58
393 #define LDAP_PARAM_ERROR 0x59
394 #define LDAP_NO_MEMORY 0x5a
396 #define LDAP_CONNECT_ERROR 0x5b /* new */
397 #define LDAP_NOT_SUPPORTED 0x5c /* new */
398 #define LDAP_CONTROL_NOT_FOUND 0x5d /* new */
399 #define LDAP_NO_RESULTS_RETURNED 0x5e /* new */
400 #define LDAP_MORE_RESULTS_TO_RETURN 0x5f /* new */
401 #define LDAP_CLIENT_LOOP 0x60 /* new */
402 #define LDAP_REFERRAL_LIMIT_EXCEEDED 0x61 /* new */
405 * This structure represents both ldap messages and ldap responses.
406 * These are really the same, except in the case of search responses,
407 * where a response has multiple messages.
410 typedef struct ldapmsg LDAPMessage;
413 * structures for ldap getfilter routines
416 typedef struct ldap_filt_info {
419 int lfi_scope; /* LDAP_SCOPE_BASE, etc */
420 int lfi_isexact; /* exact match filter? */
421 struct ldap_filt_info *lfi_next;
424 typedef struct ldap_filt_list {
428 LDAPFiltInfo *lfl_ilist;
429 struct ldap_filt_list *lfl_next;
433 #define LDAP_FILT_MAXSIZ 1024
435 typedef struct ldap_filt_desc {
436 LDAPFiltList *lfd_filtlist;
437 LDAPFiltInfo *lfd_curfip;
438 LDAPFiltInfo lfd_retfi;
439 char lfd_filter[ LDAP_FILT_MAXSIZ ];
441 char *lfd_curvalcopy;
442 char **lfd_curvalwords;
443 char *lfd_filtprefix;
444 char *lfd_filtsuffix;
449 * structure representing an ldap connection
452 typedef struct ldap LDAP;
454 #define LDAP_DEREF_NEVER 0x00
455 #define LDAP_DEREF_SEARCHING 0x01
456 #define LDAP_DEREF_FINDING 0x02
457 #define LDAP_DEREF_ALWAYS 0x03
459 #define LDAP_NO_LIMIT 0
461 /* how many messages to retrieve results for */
462 #define LDAP_MSG_ONE 0x00
463 #define LDAP_MSG_ALL 0x01
464 #define LDAP_MSG_RECEIVED 0x02
467 * structure for ldap friendly mapping routines
470 typedef struct ldap_friendly {
476 * types for ldap URL handling
478 typedef struct ldap_url_desc {
485 char *lud_string; /* for internal use only */
488 #define LDAP_URL_ERR_NOTLDAP 0x01 /* URL doesn't begin with "ldap://" */
489 #define LDAP_URL_ERR_NODN 0x02 /* URL has no DN (required) */
490 #define LDAP_URL_ERR_BADSCOPE 0x03 /* URL scope string is invalid */
491 #define LDAP_URL_ERR_MEM 0x04 /* can't allocate memory space */
494 * The API draft spec says we should declare (or cause to be declared)
495 * 'struct timeval'. We don't. See LDAPext discussions.
503 ldap_get_option LDAP_P((
509 ldap_set_option LDAP_P((
512 LDAP_CONST void *invalue));
519 ldap_control_free LDAP_P((
520 LDAPControl *ctrl ));
523 ldap_controls_free LDAP_P((
524 LDAPControl **ctrls ));
531 ldap_extended_operation LDAP_P((
533 LDAP_CONST char *exoid,
534 struct berval *exdata,
535 LDAPControl **serverctrls,
536 LDAPControl **clientctrls,
540 ldap_extended_operation_s LDAP_P((
542 LDAP_CONST char *exoid,
543 struct berval *exdata,
544 LDAPControl **serverctrls,
545 LDAPControl **clientctrls,
547 struct berval **retdatap ));
550 ldap_parse_extended_result LDAP_P((
554 struct berval **retdatap,
561 ldap_abandon LDAP_P((
566 ldap_abandon_ext LDAP_P((
569 LDAPControl **serverctrls,
570 LDAPControl **clientctrls ));
577 ldap_add_ext LDAP_P((
581 LDAPControl **serverctrls,
582 LDAPControl **clientctrls,
586 ldap_add_ext_s LDAP_P((
590 LDAPControl **serverctrls,
591 LDAPControl **clientctrls ));
610 ldap_sasl_bind LDAP_P((
613 LDAP_CONST char *mechanism,
615 LDAPControl **serverctrls,
616 LDAPControl **clientctrls,
620 ldap_sasl_bind_s LDAP_P((
623 LDAP_CONST char *mechanism,
625 LDAPControl **serverctrls,
626 LDAPControl **clientctrls,
627 struct berval **servercredp ));
630 ldap_parse_sasl_bind_result LDAP_P((
633 struct berval **servercredp,
643 LDAP_CONST char *who,
644 LDAP_CONST char *passwd,
650 LDAP_CONST char *who,
651 LDAP_CONST char *cred,
655 ldap_set_rebind_proc LDAP_P((
657 int (*rebindproc) LDAP_P((
669 ldap_simple_bind LDAP_P((
671 LDAP_CONST char *who,
672 LDAP_CONST char *passwd ));
675 ldap_simple_bind_s LDAP_P((
677 LDAP_CONST char *who,
678 LDAP_CONST char *passwd ));
686 ldap_kerberos_bind_s LDAP_P((
688 LDAP_CONST char *who ));
691 ldap_kerberos_bind1 LDAP_P((
693 LDAP_CONST char *who ));
696 ldap_kerberos_bind1_s LDAP_P((
698 LDAP_CONST char *who ));
701 ldap_kerberos_bind2 LDAP_P((
703 LDAP_CONST char *who ));
706 ldap_kerberos_bind2_s LDAP_P((
708 LDAP_CONST char *who ));
715 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
718 ldap_disable_cache LDAP_P(( LDAP *ld ));
721 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
724 ldap_destroy_cache LDAP_P(( LDAP *ld ));
727 ldap_flush_cache LDAP_P(( LDAP *ld ));
730 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
733 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
740 ldap_compare_ext LDAP_P((
743 LDAP_CONST char *attr,
744 struct berval *bvalue,
745 LDAPControl **serverctrls,
746 LDAPControl **clientctrls,
750 ldap_compare_ext_s LDAP_P((
753 LDAP_CONST char *attr,
754 struct berval *bvalue,
755 LDAPControl **serverctrls,
756 LDAPControl **clientctrls ));
759 ldap_compare LDAP_P((
762 LDAP_CONST char *attr,
763 LDAP_CONST char *value ));
766 ldap_compare_s LDAP_P((
769 LDAP_CONST char *attr,
770 LDAP_CONST char *value ));
777 ldap_delete_ext LDAP_P((
780 LDAPControl **serverctrls,
781 LDAPControl **clientctrls,
785 ldap_delete_ext_s LDAP_P((
788 LDAPControl **serverctrls,
789 LDAPControl **clientctrls ));
794 LDAP_CONST char *dn ));
797 ldap_delete_s LDAP_P((
799 LDAP_CONST char *dn ));
806 ldap_result2error LDAP_P(( /* deprecated */
812 ldap_err2string LDAP_P((
816 ldap_perror LDAP_P(( /* deprecated */
818 LDAP_CONST char *s ));
825 ldap_modify_ext LDAP_P((
829 LDAPControl **serverctrls,
830 LDAPControl **clientctrls,
834 ldap_modify_ext_s LDAP_P((
838 LDAPControl **serverctrls,
839 LDAPControl **clientctrls ));
848 ldap_modify_s LDAP_P((
858 ldap_rename_ext LDAP_P((
861 LDAP_CONST char *newrdn,
862 LDAP_CONST char *newparent,
864 LDAPControl **serverctrls,
865 LDAPControl **clientctrls,
869 ldap_rename_ext_s LDAP_P((
872 LDAP_CONST char *newrdn,
873 LDAP_CONST char *newparent,
875 LDAPControl **serverctrls,
876 LDAPControl **clientctrls ));
886 LDAP_CONST char *newrdn ));
889 ldap_modrdn_s LDAP_P((
892 LDAP_CONST char *newrdn ));
895 ldap_modrdn2 LDAP_P((
898 LDAP_CONST char *newrdn,
902 ldap_modrdn2_s LDAP_P((
905 LDAP_CONST char *newrdn,
909 ldap_rename2 LDAP_P((
912 LDAP_CONST char *newrdn,
914 LDAP_CONST char *newSuperior ));
917 ldap_rename2_s LDAP_P((
920 LDAP_CONST char *newrdn,
922 LDAP_CONST char *newSuperior));
929 LDAP_CONST char *host,
934 LDAP_CONST char *host,
941 LDAP_F( LDAPMessage *)
942 ldap_first_message LDAP_P((
944 LDAPMessage *chain ));
946 LDAP_F( LDAPMessage *)
947 ldap_next_message LDAP_P((
952 ldap_count_messages LDAP_P((
954 LDAPMessage *chain ));
960 LDAP_F( LDAPMessage *)
961 ldap_first_reference LDAP_P((
963 LDAPMessage *chain ));
965 LDAP_F( LDAPMessage *)
966 ldap_next_reference LDAP_P((
971 ldap_count_references LDAP_P((
973 LDAPMessage *chain ));
976 ldap_parse_reference LDAP_P((
980 LDAPControl ***serverctrls,
987 LDAP_F( LDAPMessage *)
988 ldap_first_entry LDAP_P((
990 LDAPMessage *chain ));
992 LDAP_F( LDAPMessage *)
993 ldap_next_entry LDAP_P((
995 LDAPMessage *entry ));
998 ldap_count_entries LDAP_P((
1000 LDAPMessage *chain ));
1003 ldap_get_entry_controls LDAP_P((
1006 LDAPControl ***serverctrls));
1012 LDAP_F( LDAPMessage *)
1013 ldap_delete_result_entry LDAP_P((
1018 ldap_add_result_entry LDAP_P((
1027 ldap_get_dn LDAP_P((
1029 LDAPMessage *entry ));
1032 ldap_dn2ufn LDAP_P((
1033 LDAP_CONST char *dn ));
1036 ldap_explode_dn LDAP_P((
1037 LDAP_CONST char *dn,
1041 ldap_explode_rdn LDAP_P((
1042 LDAP_CONST char *rdn,
1046 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1047 LDAP_CONST char *dn ));
1050 ldap_relative_dn LDAP_P(( /* new (from slapd) */
1051 LDAP_CONST char *dn ));
1054 ldap_normalize_dn LDAP_P(( /* new (from slapd) */
1055 LDAP_CONST char *dn ));
1058 ldap_explode_dns LDAP_P(( /* deprecated */
1059 LDAP_CONST char *dn ));
1062 ldap_is_dns_dn LDAP_P(( /* deprecated */
1063 LDAP_CONST char *dn ));
1070 ldap_first_attribute LDAP_P((
1073 BerElement **ber ));
1076 ldap_next_attribute LDAP_P((
1086 ldap_get_values LDAP_P((
1089 LDAP_CONST char *target ));
1091 LDAP_F( struct berval **)
1092 ldap_get_values_len LDAP_P((
1095 LDAP_CONST char *target ));
1098 ldap_count_values LDAP_P((
1102 ldap_count_values_len LDAP_P((
1103 struct berval **vals ));
1106 ldap_value_free LDAP_P((
1110 ldap_value_free_len LDAP_P((
1111 struct berval **vals ));
1117 ldap_result LDAP_P((
1121 struct timeval *timeout,
1122 LDAPMessage **result ));
1125 ldap_parse_result LDAP_P((
1132 LDAPControl ***serverctrls,
1136 ldap_msgtype LDAP_P((
1144 ldap_msgfree LDAP_P((
1148 ldap_msgdelete LDAP_P((
1157 ldap_search_ext LDAP_P((
1159 LDAP_CONST char *base,
1161 LDAP_CONST char *filter,
1164 LDAPControl **serverctrls,
1165 LDAPControl **clientctrls,
1166 struct timeval *timeout,
1171 ldap_search_ext_s LDAP_P((
1173 LDAP_CONST char *base,
1175 LDAP_CONST char *filter,
1178 LDAPControl **serverctrls,
1179 LDAPControl **clientctrls,
1180 struct timeval *timeout,
1182 LDAPMessage **res ));
1185 ldap_search LDAP_P((
1187 LDAP_CONST char *base,
1189 LDAP_CONST char *filter,
1194 ldap_search_s LDAP_P((
1196 LDAP_CONST char *base,
1198 LDAP_CONST char *filter,
1201 LDAPMessage **res ));
1204 ldap_search_st LDAP_P((
1206 LDAP_CONST char *base,
1208 LDAP_CONST char *filter,
1211 struct timeval *timeout,
1212 LDAPMessage **res ));
1219 ldap_ufn_search_c LDAP_P((
1221 LDAP_CONST char *ufn,
1225 int (*cancelproc)( void *cl ),
1226 void *cancelparm ));
1229 ldap_ufn_search_ct LDAP_P((
1231 LDAP_CONST char *ufn,
1235 int (*cancelproc)( void *cl ),
1242 ldap_ufn_search_s LDAP_P((
1244 LDAP_CONST char *ufn,
1247 LDAPMessage **res ));
1249 LDAP_F( LDAPFiltDesc *)
1250 ldap_ufn_setfilter LDAP_P((
1252 LDAP_CONST char *fname ));
1255 ldap_ufn_setprefix LDAP_P((
1257 LDAP_CONST char *prefix ));
1260 ldap_ufn_timeout LDAP_P((
1268 ldap_unbind LDAP_P((
1272 ldap_unbind_s LDAP_P((
1276 ldap_unbind_ext LDAP_P((
1278 LDAPControl **serverctrls,
1279 LDAPControl **clientctrls));
1282 ldap_unbind_ext_s LDAP_P((
1284 LDAPControl **serverctrls,
1285 LDAPControl **clientctrls));
1290 LDAP_F( LDAPFiltDesc *)
1291 ldap_init_getfilter LDAP_P((
1292 LDAP_CONST char *fname ));
1294 LDAP_F( LDAPFiltDesc *)
1295 ldap_init_getfilter_buf LDAP_P((
1296 /* LDAP_CONST */ char *buf,
1299 LDAP_F( LDAPFiltInfo *)
1300 ldap_getfirstfilter LDAP_P((
1302 /* LDAP_CONST */ char *tagpat,
1303 /* LDAP_CONST */ char *value ));
1305 LDAP_F( LDAPFiltInfo *)
1306 ldap_getnextfilter LDAP_P((
1307 LDAPFiltDesc *lfdp ));
1310 ldap_setfilteraffixes LDAP_P((
1312 LDAP_CONST char *prefix,
1313 LDAP_CONST char *suffix ));
1316 ldap_build_filter LDAP_P((
1318 unsigned long buflen,
1319 LDAP_CONST char *pattern,
1320 LDAP_CONST char *prefix,
1321 LDAP_CONST char *suffix,
1322 LDAP_CONST char *attr,
1323 LDAP_CONST char *value,
1331 ldap_memfree LDAP_P((
1335 ldap_getfilter_free LDAP_P((
1336 LDAPFiltDesc *lfdp ));
1339 ldap_mods_free LDAP_P((
1348 ldap_friendly_name LDAP_P((
1349 LDAP_CONST char *filename,
1350 /* LDAP_CONST */ char *uname,
1351 LDAPFriendlyMap **map ));
1354 ldap_free_friendlymap LDAP_P((
1355 LDAPFriendlyMap **map ));
1363 LDAP_CONST char *host,
1367 cldap_close LDAP_P((
1371 cldap_search_s LDAP_P(( LDAP *ld,
1372 LDAP_CONST char *base,
1374 LDAP_CONST char *filter,
1381 cldap_setretryinfo LDAP_P((
1391 ldap_sort_entries LDAP_P(( LDAP *ld,
1392 LDAPMessage **chain,
1393 LDAP_CONST char *attr,
1394 int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1397 ldap_sort_values LDAP_P((
1400 int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1403 ldap_sort_strcasecmp LDAP_P((
1405 LDAP_CONST void *b ));
1411 * need _ext varients
1414 ldap_is_ldap_url LDAP_P((
1415 LDAP_CONST char *url ));
1418 ldap_url_parse LDAP_P((
1419 LDAP_CONST char *url,
1420 LDAPURLDesc **ludpp ));
1423 ldap_free_urldesc LDAP_P((
1424 LDAPURLDesc *ludp ));
1427 ldap_url_search LDAP_P((
1429 LDAP_CONST char *url,
1433 ldap_url_search_s LDAP_P((
1435 LDAP_CONST char *url,
1437 LDAPMessage **res ));
1440 ldap_url_search_st LDAP_P((
1442 LDAP_CONST char *url,
1444 struct timeval *timeout,
1445 LDAPMessage **res ));
1453 ldap_set_string_translators LDAP_P((
1455 BERTranslateProc encode_proc,
1456 BERTranslateProc decode_proc ));
1459 ldap_translate_from_t61 LDAP_P((
1462 unsigned long *lenp,
1466 ldap_translate_to_t61 LDAP_P((
1469 unsigned long *lenp, int free_input ));
1472 ldap_enable_translation LDAP_P((
1478 ldap_t61_to_8859 LDAP_P((
1480 unsigned long *buflenp,
1484 ldap_8859_to_t61 LDAP_P((
1486 unsigned long *buflenp,
1491 #endif /* _LDAP_H */