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