]> git.sur5r.net Git - openldap/blob - include/ldap.h
f1d4c7d792618385d4cde3e806a2b8afa03d490c
[openldap] / include / ldap.h
1 /*
2  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
3  * All rights reserved.
4  *
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.
9  */
10 /* Portions
11  * Copyright (c) 1990 Regents of the University of Michigan.
12  * All rights reserved.
13  *
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.
20  */
21
22 #ifndef _LDAP_H
23 #define _LDAP_H
24
25 #include <ldap_cdefs.h>
26
27 LDAP_BEGIN_DECL
28
29 #define LDAP_VERSION1   1
30 #define LDAP_VERSION2   2
31 #define LDAP_VERSION3   3
32
33 #define LDAP_VERSION            LDAP_VERSION2
34 #define LDAP_VERSION_MIN        LDAP_VERSION2
35 #define LDAP_VERSION_MAX        LDAP_VERSION2
36
37 /*
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
41  */
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
46
47 /* OpenLDAP API Features */
48 #define LDAP_API_FEATURE_X_OPENLDAP LDAP_VENDOR_VERSION
49
50 /* include LDAP_API_FEATURE defines */
51 #include <ldap_features.h>
52
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
59 #endif
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       */
64 #endif
65
66 #define LDAP_PORT               389
67
68 #define LDAP_ROOT_DSE                           ""
69 #define LDAP_NO_ATTRS                           "1.1"
70 #define LDAP_ALL_USER_ATTRIBUTES        "*"
71
72 #define LDAP_COMPAT20
73 #define LDAP_COMPAT30
74 #if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
75 #define LDAP_COMPAT
76 #endif
77
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
93
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
98
99 /* not defined by current draft */
100 /*      for LDAPv2 compatibility */
101 #define LDAP_OPT_DNS                            0x1001  /* use DN & DNS */
102
103 /* OpenLDAP specific options */
104 #define LDAP_OPT_DEBUG_LEVEL            0x4001  /* OpenLDAP - debug level */
105
106 /* on/off values */
107 #define LDAP_OPT_ON             ((void *) 1)
108 #define LDAP_OPT_OFF    ((void *) 0)
109
110 #define LDAP_OPT_SUCCESS        0
111 #define LDAP_OPT_ERROR          (-1)
112
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 */
121 } LDAPAPIInfo;
122
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;
129
130 typedef struct ldapcontrol {
131         char *                  ldctl_oid;
132         struct berval   ldctl_value;
133         char                    ldctl_iscritical;
134 } LDAPControl, *PLDAPControl;
135
136 #define LDAP_MAX_ATTR_LEN       100
137
138 /* 
139  * specific LDAP instantiations of BER types we know about
140  */
141
142 /* Overview of LBER tag construction
143  *
144  *      Bits
145  *      ______
146  *      8 7 | CLASS
147  *      0 0 = UNIVERSAL
148  *      0 1 = APPLICATION
149  *      1 0 = CONTEXT-SPECIFIC
150  *      1 1 = PRIVATE
151  *              _____
152  *              | 6 | DATA-TYPE
153  *                0 = PRIMITIVE
154  *                1 = CONSTRUCTED
155  *                      ___________
156  *                      | 5 ... 1 | TAG-NUMBER
157  */
158
159 /* general stuff */
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 */
167
168 #define LDAP_TAG_SASL_RES_CREDS 0x87UL  /* context specific + primitive */
169
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 */
183
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
188
189 /* 
190  * old broken stuff for backwards compatibility - forgot application tag
191  * and constructed/primitive bit
192  */
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
202
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))
217
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
228
229 /* sasl methods */
230 #define LDAP_SASL_SIMPLE                        NULL
231
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   */
239
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 */
244
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
249
250 /* filter types */
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 */
261
262 /* U-Mich version 3.0 compatibility filter types */
263 #define LDAP_FILTER_PRESENT_30  0xa7UL  /* context specific + constructed */
264
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
275
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 */
281
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 */
286
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 */
291
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
296
297 /* search scopes */
298 #define LDAP_SCOPE_BASE         0x0000
299 #define LDAP_SCOPE_ONELEVEL     0x0001
300 #define LDAP_SCOPE_SUBTREE      0x0002
301
302 /* for modifications */
303 typedef struct ldapmod {
304         int             mod_op;
305 #define LDAP_MOD_ADD            0x0000
306 #define LDAP_MOD_DELETE         0x0001
307 #define LDAP_MOD_REPLACE        0x0002
308 #define LDAP_MOD_BVALUES        0x0080
309         char            *mod_type;
310         union mod_vals_u {
311                 char            **modv_strvals;
312                 struct berval   **modv_bvals;
313         } mod_vals;
314 #define mod_values      mod_vals.modv_strvals
315 #define mod_bvalues     mod_vals.modv_bvals
316 } LDAPMod;
317
318 /* 
319  * possible error codes we can return
320  */
321
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 */
333
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 */       
339
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
346
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
352
353 #define LDAP_NAME_ERROR(n)      (((n) & 0x00f0) == 0x0020)
354
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
362
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 */
371
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
383
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 */
391
392 /* default limit on nesting of referrals */
393 #define LDAP_DEFAULT_REFHOPLIMIT        5
394
395 /*
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.
399  */
400
401 typedef struct ldapmsg LDAPMessage;
402
403 /*
404  * structures for ldap getfilter routines
405  */
406
407 typedef struct ldap_filt_info {
408         char                    *lfi_filter;
409         char                    *lfi_desc;
410         int                     lfi_scope;      /* LDAP_SCOPE_BASE, etc */
411         int                     lfi_isexact;    /* exact match filter? */
412         struct ldap_filt_info   *lfi_next;
413 } LDAPFiltInfo;
414
415 typedef struct ldap_filt_list {
416     char                        *lfl_tag;
417     char                        *lfl_pattern;
418     char                        *lfl_delims;
419     LDAPFiltInfo                *lfl_ilist;
420     struct ldap_filt_list       *lfl_next;
421 } LDAPFiltList;
422
423
424 #define LDAP_FILT_MAXSIZ        1024
425
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 ];
431         char                    *lfd_curval;
432         char                    *lfd_curvalcopy;
433         char                    **lfd_curvalwords;
434         char                    *lfd_filtprefix;
435         char                    *lfd_filtsuffix;
436 } LDAPFiltDesc;
437
438
439 /*
440  * structure representing an ldap connection
441  */
442
443 typedef struct ldap LDAP;
444
445 #define LDAP_DEREF_NEVER        0x00
446 #define LDAP_DEREF_SEARCHING    0x01
447 #define LDAP_DEREF_FINDING      0x02
448 #define LDAP_DEREF_ALWAYS       0x03
449
450 #define LDAP_NO_LIMIT           0
451
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
456
457 /*
458  * structure for ldap friendly mapping routines
459  */
460
461 typedef struct ldap_friendly {
462         char    *lf_unfriendly;
463         char    *lf_friendly;
464 } LDAPFriendlyMap;
465
466 /*
467  * types for ldap URL handling
468  */
469 typedef struct ldap_url_desc {
470     char        *lud_host;
471     int         lud_port;
472     char        *lud_dn;
473     char        **lud_attrs;
474     int         lud_scope;
475     char        *lud_filter;
476     char        *lud_string;    /* for internal use only */
477 } LDAPURLDesc;
478
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 */
483
484 /* avoid pulling in headers */
485 struct timeval;
486
487 /*
488  * in options.c:
489  */
490 LDAP_F( int )
491 ldap_get_option LDAP_P((
492         LDAP *ld,
493         int option,
494         void *outvalue));
495
496 LDAP_F( int )
497 ldap_set_option LDAP_P((
498         LDAP *ld,
499         int option,
500         LDAP_CONST void *invalue));
501
502
503 /*
504  * in controls.c:
505  */
506 LDAP_F( void )
507 ldap_control_free LDAP_P((
508         LDAPControl *ctrl ));
509
510 LDAP_F( void )
511 ldap_controls_free LDAP_P((
512         LDAPControl **ctrls ));
513
514   
515 /*
516  * in extended.c:
517  */
518 LDAP_F( int )
519 ldap_extended_operation LDAP_P((
520         LDAP                    *ld,
521         LDAP_CONST char *exoid,
522         struct berval   *exdata,
523         LDAPControl             **serverctrls,
524         LDAPControl             **clientctrls,
525         int                             *msgidp ));
526
527 LDAP_F( int )
528 ldap_extended_operation_s LDAP_P((
529         LDAP                    *ld,
530         LDAP_CONST char *exoid,
531         struct berval   *exdata,
532         LDAPControl             **serverctrls,
533         LDAPControl             **clientctrls,
534         char                    **retoidp,
535         struct berval   **retdatap ));
536
537 LDAP_F( int )
538 ldap_parse_extended_result LDAP_P((
539         LDAP                    *ld,
540         LDAPMessage             *res,
541         char                    **retoidp,
542         struct berval   **retdatap,
543         int                             freeit ));
544
545 /*
546  * in abandon.c:
547  */
548 LDAP_F( int )
549 ldap_abandon LDAP_P((
550         LDAP *ld,
551         int msgid ));
552
553 LDAP_F( int )
554 ldap_abandon_ext LDAP_P((
555         LDAP                    *ld,
556         int                             msgid,
557         LDAPControl             **serverctrls,
558         LDAPControl             **clientctrls ));
559
560
561 /*
562  * in add.c:
563  */
564 LDAP_F( int )
565 ldap_add_ext LDAP_P((
566         LDAP                    *ld,
567         LDAP_CONST char *dn,
568         LDAPMod                 **attrs,
569         LDAPControl             **serverctrls,
570         LDAPControl             **clientctrls,
571         int                     *msgidp ));
572
573 LDAP_F( int )
574 ldap_add_ext_s LDAP_P((
575         LDAP                    *ld,
576         LDAP_CONST char *dn,
577         LDAPMod                 **attrs,
578         LDAPControl             **serverctrls,
579         LDAPControl             **clientctrls ));
580
581 LDAP_F( int )
582 ldap_add LDAP_P((
583         LDAP *ld,
584         LDAP_CONST char *dn,
585         LDAPMod **attrs ));
586
587 LDAP_F( int )
588 ldap_add_s LDAP_P((
589         LDAP *ld,
590         LDAP_CONST char *dn,
591         LDAPMod **attrs ));
592
593
594 /*
595  * in saslbind.c:
596  */
597 LDAP_F( int )
598 ldap_sasl_bind LDAP_P((
599         LDAP                    *ld,
600         LDAP_CONST char *dn,
601         LDAP_CONST char *mechanism,
602         struct berval   *cred,
603         LDAPControl             **serverctrls,
604         LDAPControl             **clientctrls,
605         int                             msgidp ));
606
607 LDAP_F( int )
608 ldap_sasl_bind_s LDAP_P((
609         LDAP                    *ld,
610         LDAP_CONST char *dn,
611         LDAP_CONST char *mechanism,
612         struct berval   *cred,
613         LDAPControl             **serverctrls,
614         LDAPControl             **clientctrls,
615         struct berval   **servercredp ));
616
617 LDAP_F( int )
618 ldap_parse_sasl_bind_result LDAP_P((
619         LDAP                    *ld,
620         LDAPMessage             *res,
621         struct berval   **servercredp,
622         int                             freeit ));
623
624 /*
625  * in bind.c:
626  *      (deprecated)
627  */
628 LDAP_F( int )
629 ldap_bind LDAP_P((
630         LDAP *ld,
631         LDAP_CONST char *who,
632         LDAP_CONST char *passwd,
633         int authmethod ));
634
635 LDAP_F( int )
636 ldap_bind_s LDAP_P((
637         LDAP *ld,
638         LDAP_CONST char *who,
639         LDAP_CONST char *cred,
640         int authmethod ));
641
642 LDAP_F( void )
643 ldap_set_rebind_proc LDAP_P((
644         LDAP *ld,
645         int (*rebindproc) LDAP_P((
646                 LDAP *ld,
647                 char **dnp,
648                 char **passwdp,
649                 int *authmethodp,
650                 int freeit ))));
651
652
653 /*
654  * in sbind.c:
655  */
656 LDAP_F( int )
657 ldap_simple_bind LDAP_P((
658         LDAP *ld,
659         LDAP_CONST char *who,
660         LDAP_CONST char *passwd ));
661
662 LDAP_F( int )
663 ldap_simple_bind_s LDAP_P((
664         LDAP *ld,
665         LDAP_CONST char *who,
666         LDAP_CONST char *passwd ));
667
668
669 /*
670  * in kbind.c:
671  *      (deprecated)
672  */
673 LDAP_F( int )
674 ldap_kerberos_bind_s LDAP_P((
675         LDAP *ld,
676         LDAP_CONST char *who ));
677
678 LDAP_F( int )
679 ldap_kerberos_bind1 LDAP_P((
680         LDAP *ld,
681         LDAP_CONST char *who ));
682
683 LDAP_F( int )
684 ldap_kerberos_bind1_s LDAP_P((
685         LDAP *ld,
686         LDAP_CONST char *who ));
687
688 LDAP_F( int )
689 ldap_kerberos_bind2 LDAP_P((
690         LDAP *ld,
691         LDAP_CONST char *who ));
692
693 LDAP_F( int )
694 ldap_kerberos_bind2_s LDAP_P((
695         LDAP *ld,
696         LDAP_CONST char *who ));
697
698 /*
699  * in cache.c
700  * DEPRECATED
701  */
702 LDAP_F( int )
703 ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
704
705 LDAP_F( void )
706 ldap_disable_cache LDAP_P(( LDAP *ld ));
707
708 LDAP_F( void )
709 ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
710
711 LDAP_F( void )
712 ldap_destroy_cache LDAP_P(( LDAP *ld ));
713
714 LDAP_F( void )
715 ldap_flush_cache LDAP_P(( LDAP *ld ));
716
717 LDAP_F( void )
718 ldap_uncache_entry LDAP_P(( LDAP *ld, LDAP_CONST char *dn ));
719
720 LDAP_F( void )
721 ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
722
723
724 /*
725  * in compare.c:
726  */
727 LDAP_F( int )
728 ldap_compare_ext LDAP_P((
729         LDAP                    *ld,
730         LDAP_CONST char *dn,
731         LDAP_CONST char *attr,
732         struct berval   *bvalue,
733         LDAPControl             **serverctrls,
734         LDAPControl             **clientctrls,
735         int                     *msgidp ));
736
737 LDAP_F( int )
738 ldap_compare_ext_s LDAP_P((
739         LDAP                    *ld,
740         LDAP_CONST char *dn,
741         LDAP_CONST char *attr,
742         struct berval   *bvalue,
743         LDAPControl             **serverctrls,
744         LDAPControl             **clientctrls ));
745
746 LDAP_F( int )
747 ldap_compare LDAP_P((
748         LDAP *ld,
749         LDAP_CONST char *dn,
750         LDAP_CONST char *attr,
751         LDAP_CONST char *value ));
752
753 LDAP_F( int )
754 ldap_compare_s LDAP_P((
755         LDAP *ld,
756         LDAP_CONST char *dn,
757         LDAP_CONST char *attr,
758         LDAP_CONST char *value ));
759
760
761 /*
762  * in delete.c:
763  */
764 LDAP_F( int )
765 ldap_delete_ext LDAP_P((
766         LDAP                    *ld,
767         LDAP_CONST char *dn,
768         LDAPControl             **serverctrls,
769         LDAPControl             **clientctrls,
770         int                     *msgidp ));
771
772 LDAP_F( int )
773 ldap_delete_ext_s LDAP_P((
774         LDAP                    *ld,
775         LDAP_CONST char *dn,
776         LDAPControl             **serverctrls,
777         LDAPControl             **clientctrls ));
778
779 LDAP_F( int )
780 ldap_delete LDAP_P((
781         LDAP *ld,
782         LDAP_CONST char *dn ));
783
784 LDAP_F( int )
785 ldap_delete_s LDAP_P((
786         LDAP *ld,
787         LDAP_CONST char *dn ));
788
789
790 /*
791  * in error.c:
792  */
793 LDAP_F( int )
794 ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
795 LDAP_F( char *)
796 ldap_err2string LDAP_P(( int err ));
797 LDAP_F( void )
798 ldap_perror LDAP_P((
799         LDAP *ld,
800         LDAP_CONST char *s ));
801
802
803 /*
804  * in modify.c:
805  */
806 LDAP_F( int )
807 ldap_modify_ext LDAP_P((
808         LDAP                    *ld,
809         LDAP_CONST char *dn,
810         LDAPMod                 **mods,
811         LDAPControl             **serverctrls,
812         LDAPControl             **clientctrls,
813         int                     *msgidp ));
814
815 LDAP_F( int )
816 ldap_modify_ext_s LDAP_P((
817         LDAP                    *ld,
818         LDAP_CONST char *dn,
819         LDAPMod                 **mods,
820         LDAPControl             **serverctrls,
821         LDAPControl             **clientctrls ));
822
823 LDAP_F( int )
824 ldap_modify LDAP_P((
825         LDAP *ld,
826         LDAP_CONST char *dn,
827         LDAPMod **mods ));
828
829 LDAP_F( int )
830 ldap_modify_s LDAP_P((
831         LDAP *ld,
832         LDAP_CONST char *dn,
833         LDAPMod **mods ));
834
835
836 /*
837  * in rename.c:
838  */
839 LDAP_F( int )
840 ldap_rename_ext LDAP_P((
841         LDAP                    *ld,
842         LDAP_CONST char *dn,
843         LDAP_CONST char *newrdn,
844         LDAP_CONST char *newparent,
845         int                             deleteoldrdn,
846         LDAPControl             **serverctrls,
847         LDAPControl             **clientctrls,
848         int                     *msgidp ));
849
850 LDAP_F( int )
851 ldap_rename_ext_s LDAP_P((
852         LDAP                    *ld,
853         LDAP_CONST char *dn,
854         LDAP_CONST char *newrdn,
855         LDAP_CONST char *newparent,
856         int                             deleteoldrdn,
857         LDAPControl             **serverctrls,
858         LDAPControl             **clientctrls ));
859
860
861 /*
862  * in modrdn.c:
863  */
864 LDAP_F( int )
865 ldap_modrdn LDAP_P((
866         LDAP *ld,
867         LDAP_CONST char *dn,
868         LDAP_CONST char *newrdn ));
869
870 LDAP_F( int )
871 ldap_modrdn_s LDAP_P((
872         LDAP *ld,
873         LDAP_CONST char *dn,
874         LDAP_CONST char *newrdn ));
875
876 LDAP_F( int )
877 ldap_modrdn2 LDAP_P((
878         LDAP *ld,
879         LDAP_CONST char *dn,
880         LDAP_CONST char *newrdn,
881         int deleteoldrdn ));
882
883 LDAP_F( int )
884 ldap_modrdn2_s LDAP_P((
885         LDAP *ld,
886         LDAP_CONST char *dn,
887         LDAP_CONST char *newrdn,
888         int deleteoldrdn));
889
890 LDAP_F( int )
891 ldap_rename2 LDAP_P((
892         LDAP *ld,
893         LDAP_CONST char *dn,
894         LDAP_CONST char *newrdn,
895         int deleteoldrdn,
896         LDAP_CONST char *newSuperior ));
897
898 LDAP_F( int )
899 ldap_rename2_s LDAP_P((
900         LDAP *ld,
901         LDAP_CONST char *dn,
902         LDAP_CONST char *newrdn,
903         int deleteoldrdn,
904         LDAP_CONST char *newSuperior));
905
906 /*
907  * in open.c:
908  */
909 LDAP_F( LDAP *)
910 ldap_open LDAP_P((
911         LDAP_CONST char *host,
912         int port ));
913
914 LDAP_F( LDAP *)
915 ldap_init LDAP_P((
916         LDAP_CONST char *host,
917         int port ));
918
919
920 /*
921  * in messages.c:
922  */
923 LDAP_F( LDAPMessage *)
924 ldap_first_message LDAP_P((
925         LDAP *ld,
926         LDAPMessage *chain ));
927
928 LDAP_F( LDAPMessage *)
929 ldap_next_message LDAP_P((
930         LDAP *ld,
931         LDAPMessage *msg ));
932
933 LDAP_F( int )
934 ldap_count_messages LDAP_P((
935         LDAP *ld,
936         LDAPMessage *chain ));
937
938
939 /*
940  * in references.c:
941  */
942 LDAP_F( LDAPMessage *)
943 ldap_first_reference LDAP_P((
944         LDAP *ld,
945         LDAPMessage *chain ));
946
947 LDAP_F( LDAPMessage *)
948 ldap_next_reference LDAP_P((
949         LDAP *ld,
950         LDAPMessage *ref ));
951
952 LDAP_F( int )
953 ldap_count_references LDAP_P((
954         LDAP *ld,
955         LDAPMessage *chain ));
956
957 LDAP_F( int )
958 ldap_parse_reference LDAP_P((
959         LDAP                    *ld,
960         LDAPMessage             *ref,
961         char                    ***referralsp,
962         LDAPControl             ***serverctrls,
963         int                             freeit));
964
965
966 /*
967  * in getentry.c:
968  */
969 LDAP_F( LDAPMessage *)
970 ldap_first_entry LDAP_P((
971         LDAP *ld,
972         LDAPMessage *chain ));
973
974 LDAP_F( LDAPMessage *)
975 ldap_next_entry LDAP_P((
976         LDAP *ld,
977         LDAPMessage *entry ));
978
979 LDAP_F( int )
980 ldap_count_entries LDAP_P((
981         LDAP *ld,
982         LDAPMessage *chain ));
983
984 LDAP_F( int )
985 ldap_get_entry_controls LDAP_P((
986         LDAP                    *ld,
987         LDAPMessage             *entry,
988         LDAPControl             ***serverctrls));
989
990
991 /*
992  * in addentry.c
993  */
994 LDAP_F( LDAPMessage *)
995 ldap_delete_result_entry LDAP_P((
996         LDAPMessage **list,
997         LDAPMessage *e ));
998
999 LDAP_F( void )
1000 ldap_add_result_entry LDAP_P((
1001         LDAPMessage **list,
1002         LDAPMessage *e ));
1003
1004
1005 /*
1006  * in getdn.c
1007  */
1008 LDAP_F( char *)
1009 ldap_get_dn LDAP_P((
1010         LDAP *ld,
1011         LDAPMessage *entry ));
1012
1013 LDAP_F( char *)
1014 ldap_dn2ufn LDAP_P((
1015         LDAP_CONST char *dn ));
1016
1017 LDAP_F( char **)
1018 ldap_explode_dn LDAP_P((
1019         LDAP_CONST char *dn,
1020         int notypes ));
1021
1022 LDAP_F( char **)
1023 ldap_explode_rdn LDAP_P((
1024         LDAP_CONST char *rdn,
1025         int notypes ));
1026
1027 LDAP_F( char *)
1028 ldap_parent_dn LDAP_P(( /* new (from slapd) */
1029         LDAP_CONST char *dn ));
1030
1031 LDAP_F( char *)
1032 ldap_relative_dn LDAP_P((       /* new (from slapd) */
1033         LDAP_CONST char *dn ));
1034
1035 LDAP_F( char *)
1036 ldap_normalize_dn LDAP_P((      /* new (from slapd) */
1037         LDAP_CONST char *dn ));
1038
1039 LDAP_F( char **)
1040 ldap_explode_dns LDAP_P(( /* deprecated */
1041         LDAP_CONST char *dn ));
1042
1043 LDAP_F( int )
1044 ldap_is_dns_dn LDAP_P(( /* deprecated */
1045         LDAP_CONST char *dn ));
1046
1047
1048 /*
1049  * in getattr.c
1050  */
1051 LDAP_F( char *)
1052 ldap_first_attribute LDAP_P((                                                                    
1053         LDAP *ld,
1054         LDAPMessage *entry,
1055         BerElement **ber ));
1056
1057 LDAP_F( char *)
1058 ldap_next_attribute LDAP_P((
1059         LDAP *ld,
1060         LDAPMessage *entry,
1061         BerElement *ber ));
1062
1063
1064 /*
1065  * in getvalues.c
1066  */
1067 LDAP_F( char **)
1068 ldap_get_values LDAP_P((
1069         LDAP *ld,
1070         LDAPMessage *entry,
1071         LDAP_CONST char *target ));
1072
1073 LDAP_F( struct berval **)
1074 ldap_get_values_len LDAP_P((
1075         LDAP *ld,
1076         LDAPMessage *entry,
1077         LDAP_CONST char *target ));
1078
1079 LDAP_F( int )
1080 ldap_count_values LDAP_P((
1081         char **vals ));
1082
1083 LDAP_F( int )
1084 ldap_count_values_len LDAP_P((
1085         struct berval **vals ));
1086
1087 LDAP_F( void )
1088 ldap_value_free LDAP_P((
1089         char **vals ));
1090
1091 LDAP_F( void )
1092 ldap_value_free_len LDAP_P((
1093         struct berval **vals ));
1094
1095 /*
1096  * in result.c:
1097  */
1098 LDAP_F( int )
1099 ldap_result LDAP_P((
1100         LDAP *ld,
1101         int msgid,
1102         int all,
1103         struct timeval *timeout,
1104         LDAPMessage **result ));
1105
1106 LDAP_F( int )
1107 ldap_parse_result LDAP_P((
1108         LDAP                    *ld,
1109         LDAPMessage             *res,
1110         int                             *errcodep,
1111         char                    **matcheddnp,
1112         char                    **errmsgp,
1113         char                    ***referralsp,
1114         LDAPControl             ***serverctrls,
1115         int                             freeit ));
1116
1117 LDAP_F( int )
1118 ldap_msgtype LDAP_P((
1119         LDAPMessage *lm ));
1120
1121 LDAP_F( int )
1122 ldap_msgid   LDAP_P((
1123         LDAPMessage *lm ));
1124
1125 LDAP_F( int )
1126 ldap_msgfree LDAP_P((
1127         LDAPMessage *lm ));
1128
1129 LDAP_F( int )
1130 ldap_msgdelete LDAP_P((
1131         LDAP *ld,
1132         int msgid ));
1133
1134
1135 /*
1136  * in search.c:
1137  */
1138 LDAP_F( int )
1139 ldap_search_ext LDAP_P((
1140         LDAP                    *ld,
1141         LDAP_CONST char *base,
1142         int                             scope,
1143         LDAP_CONST char *filter,
1144         char                    **attrs,
1145         int                             attrsonly,
1146         LDAPControl             **serverctrls,
1147         LDAPControl             **clientctrls,
1148         struct timeval  *timeout,
1149         int                             sizelimit,
1150         int                             *msgidp ));
1151
1152 LDAP_F( int )
1153 ldap_search_ext_s LDAP_P((
1154         LDAP                    *ld,
1155         LDAP_CONST char *base,
1156         int                             scope,
1157         LDAP_CONST char *filter,
1158         char                    **attrs,
1159         int                             attrsonly,
1160         LDAPControl             **serverctrls,
1161         LDAPControl             **clientctrls,
1162         struct timeval  *timeout,
1163         int                             sizelimit,
1164         LDAPMessage             **res ));
1165
1166 LDAP_F( int )
1167 ldap_search LDAP_P((
1168         LDAP *ld,
1169         LDAP_CONST char *base,
1170         int scope,
1171         LDAP_CONST char *filter,
1172         char **attrs,
1173         int attrsonly ));
1174
1175 LDAP_F( int )
1176 ldap_search_s LDAP_P((
1177         LDAP *ld,
1178         LDAP_CONST char *base,
1179         int scope,
1180         LDAP_CONST char *filter,
1181         char **attrs,
1182         int attrsonly,
1183         LDAPMessage **res ));
1184
1185 LDAP_F( int )
1186 ldap_search_st LDAP_P((                                                  
1187         LDAP *ld,
1188         LDAP_CONST char *base,
1189         int scope,
1190         LDAP_CONST char *filter,
1191     char **attrs,
1192         int attrsonly,
1193         struct timeval *timeout,
1194         LDAPMessage **res ));
1195
1196
1197 /*
1198  * in ufn.c
1199  */
1200 LDAP_F( int )
1201 ldap_ufn_search_c LDAP_P((
1202         LDAP *ld,
1203         LDAP_CONST char *ufn,
1204         char **attrs,
1205         int attrsonly,
1206         LDAPMessage **res,
1207         int (*cancelproc)( void *cl ),
1208         void *cancelparm ));
1209
1210 LDAP_F( int )
1211 ldap_ufn_search_ct LDAP_P((
1212         LDAP *ld,
1213         LDAP_CONST char *ufn,
1214         char **attrs,
1215         int attrsonly,
1216         LDAPMessage **res,
1217         int (*cancelproc)( void *cl ),
1218         void *cancelparm,
1219         char *tag1,
1220         char *tag2,
1221         char *tag3 ));
1222
1223 LDAP_F( int )
1224 ldap_ufn_search_s LDAP_P((
1225         LDAP *ld,
1226         LDAP_CONST char *ufn,
1227         char **attrs,
1228         int attrsonly,
1229         LDAPMessage **res ));
1230
1231 LDAP_F( LDAPFiltDesc *)
1232 ldap_ufn_setfilter LDAP_P((
1233         LDAP *ld,
1234         LDAP_CONST char *fname ));
1235
1236 LDAP_F( void )
1237 ldap_ufn_setprefix LDAP_P((
1238         LDAP *ld,
1239         LDAP_CONST char *prefix ));
1240
1241 LDAP_F( int )
1242 ldap_ufn_timeout LDAP_P((
1243         void *tvparam ));
1244
1245
1246 /*
1247  * in unbind.c
1248  */
1249 LDAP_F( int )
1250 ldap_unbind LDAP_P((
1251         LDAP *ld ));
1252
1253 LDAP_F( int )
1254 ldap_unbind_s LDAP_P((
1255         LDAP *ld ));
1256
1257 LDAP_F( int )
1258 ldap_unbind_ext LDAP_P((
1259         LDAP                    *ld,
1260         LDAPControl             **serverctrls,
1261         LDAPControl             **clientctrls));
1262
1263 LDAP_F( int )
1264 ldap_unbind_ext_s LDAP_P((
1265         LDAP                    *ld,
1266         LDAPControl             **serverctrls,
1267         LDAPControl             **clientctrls));
1268
1269 /*
1270  * in getfilter.c
1271  */
1272 LDAP_F( LDAPFiltDesc *)
1273 ldap_init_getfilter LDAP_P((
1274         LDAP_CONST char *fname ));
1275
1276 LDAP_F( LDAPFiltDesc *)
1277 ldap_init_getfilter_buf LDAP_P((
1278         /* LDAP_CONST */ char *buf,
1279         long buflen ));
1280
1281 LDAP_F( LDAPFiltInfo *)
1282 ldap_getfirstfilter LDAP_P((
1283         LDAPFiltDesc *lfdp,
1284         /* LDAP_CONST */ char *tagpat,
1285         /* LDAP_CONST */ char *value ));
1286
1287 LDAP_F( LDAPFiltInfo *)
1288 ldap_getnextfilter LDAP_P((
1289         LDAPFiltDesc *lfdp ));
1290
1291 LDAP_F( void )
1292 ldap_setfilteraffixes LDAP_P((
1293         LDAPFiltDesc *lfdp,
1294         LDAP_CONST char *prefix,
1295         LDAP_CONST char *suffix ));
1296
1297 LDAP_F( void )
1298 ldap_build_filter LDAP_P((
1299         char *buf,
1300         unsigned long buflen,
1301         LDAP_CONST char *pattern,
1302         LDAP_CONST char *prefix,
1303         LDAP_CONST char *suffix,
1304         LDAP_CONST char *attr,
1305         LDAP_CONST char *value,
1306         char **valwords ));
1307
1308
1309 /*
1310  * in free.c
1311  */
1312 LDAP_F( void )
1313 ldap_memfree LDAP_P((
1314         void *p ));
1315
1316 LDAP_F( void )
1317 ldap_getfilter_free LDAP_P((
1318         LDAPFiltDesc *lfdp ));
1319
1320 LDAP_F( void )
1321 ldap_mods_free LDAP_P((
1322         LDAPMod **mods,
1323         int freemods ));
1324
1325
1326 /*
1327  * in friendly.c
1328  */
1329 LDAP_F( char * )
1330 ldap_friendly_name LDAP_P((
1331         LDAP_CONST char *filename,
1332         /* LDAP_CONST */ char *uname,
1333         LDAPFriendlyMap **map ));
1334
1335 LDAP_F( void )
1336 ldap_free_friendlymap LDAP_P((
1337         LDAPFriendlyMap **map ));
1338
1339
1340 /*
1341  * in cldap.c
1342  */
1343 LDAP_F( LDAP * )
1344 cldap_open LDAP_P((
1345         LDAP_CONST char *host,
1346         int port ));
1347
1348 LDAP_F( void )
1349 cldap_close LDAP_P((
1350         LDAP *ld ));
1351
1352 LDAP_F( int )
1353 cldap_search_s LDAP_P(( LDAP *ld,
1354         LDAP_CONST char *base,
1355         int scope,
1356         LDAP_CONST char *filter,
1357         char **attrs,
1358         int attrsonly,
1359         LDAPMessage **res,
1360         char *logdn ));
1361
1362 LDAP_F( void )
1363 cldap_setretryinfo LDAP_P((
1364         LDAP *ld,
1365         int tries,
1366         int timeout ));
1367
1368
1369 /*
1370  * in sort.c
1371  */
1372 LDAP_F( int )
1373 ldap_sort_entries LDAP_P(( LDAP *ld,
1374         LDAPMessage **chain,
1375         LDAP_CONST char *attr,
1376         int (*cmp) (LDAP_CONST char *, LDAP_CONST char *) ));
1377
1378 LDAP_F( int )
1379 ldap_sort_values LDAP_P((
1380         LDAP *ld,
1381         char **vals,
1382         int (*cmp) (LDAP_CONST void *, LDAP_CONST void *) ));
1383
1384 LDAP_F( int )
1385 ldap_sort_strcasecmp LDAP_P((
1386         LDAP_CONST void *a,
1387         LDAP_CONST void *b ));
1388
1389
1390 /*
1391  * in url.c
1392  *
1393  * need _ext varients
1394  */
1395 LDAP_F( int )
1396 ldap_is_ldap_url LDAP_P((
1397         LDAP_CONST char *url ));
1398
1399 LDAP_F( int )
1400 ldap_url_parse LDAP_P((
1401         LDAP_CONST char *url,
1402         LDAPURLDesc **ludpp ));
1403
1404 LDAP_F( void )
1405 ldap_free_urldesc LDAP_P((
1406         LDAPURLDesc *ludp ));
1407
1408 LDAP_F( int )
1409 ldap_url_search LDAP_P((
1410         LDAP *ld,
1411         LDAP_CONST char *url,
1412         int attrsonly ));
1413
1414 LDAP_F( int )
1415 ldap_url_search_s LDAP_P((
1416         LDAP *ld,
1417         LDAP_CONST char *url,
1418         int attrsonly,
1419         LDAPMessage **res ));
1420
1421 LDAP_F( int )
1422 ldap_url_search_st LDAP_P((
1423         LDAP *ld,
1424         LDAP_CONST char *url,
1425         int attrsonly,
1426         struct timeval *timeout,
1427         LDAPMessage **res ));
1428
1429
1430 /*
1431  * in charset.c
1432  *      DEPRECATED
1433  */
1434 LDAP_F( void )
1435 ldap_set_string_translators LDAP_P((
1436         LDAP *ld,
1437         BERTranslateProc encode_proc,
1438         BERTranslateProc decode_proc ));
1439
1440 LDAP_F( int )
1441 ldap_translate_from_t61 LDAP_P((
1442         LDAP *ld,
1443         char **bufp,
1444         unsigned long *lenp,
1445         int free_input ));
1446
1447 LDAP_F( int )
1448 ldap_translate_to_t61 LDAP_P((
1449         LDAP *ld,
1450         char **bufp,
1451         unsigned long *lenp, int free_input ));
1452
1453 LDAP_F( void )
1454 ldap_enable_translation LDAP_P((
1455         LDAP *ld,
1456         LDAPMessage *entry,
1457         int enable ));
1458
1459 LDAP_F( int )
1460 ldap_t61_to_8859 LDAP_P((
1461         char **bufp,
1462         unsigned long *buflenp,
1463         int free_input ));
1464
1465 LDAP_F( int )
1466 ldap_8859_to_t61 LDAP_P((
1467         char **bufp,
1468         unsigned long *buflenp,
1469         int free_input ));
1470
1471 LDAP_END_DECL
1472
1473 #endif /* _LDAP_H */