]> git.sur5r.net Git - openldap/blob - include/ldap.h
Kill off #elif in ldap/include/. K&R does not support it.
[openldap] / include / ldap.h
1 /*
2  * Copyright (c) 1990 Regents of the University of Michigan.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of Michigan at Ann Arbor. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  */
12
13 #ifndef _LDAP_H
14 #define _LDAP_H
15
16 #include <ldap_cdefs.h>
17
18 LDAP_BEGIN_DECL
19
20 #define LDAP_PORT       389
21
22 #define LDAP_VERSION1   1
23 #define LDAP_VERSION2   2
24 #define LDAP_VERSION3   3
25
26 #define LDAP_VERSION            LDAP_VERSION2
27 #define LDAP_VERSION_MIN        LDAP_VERSION2
28 #define LDAP_VERSION_MAX        LDAP_VERSION2
29
30 /*
31  * We'll use 2000+draft revision for our API version number
32  * As such, the number will be above the old RFC but below 
33  * whatever number does finally get assigned
34  */
35 #define LDAP_API_VERSION        2001
36 #define LDAP_VENDOR_NAME        "OpenLDAP"
37 /* We'll eventually release as 200 */
38 #define LDAP_VENDOR_VERSION     190
39
40 /* include LDAP_API_FEATURE defines */
41 #include <ldap_features.h>
42
43 #define LDAP_COMPAT20
44 #define LDAP_COMPAT30
45 #if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30)
46 #define LDAP_COMPAT
47 #endif
48
49 #define LDAP_OPT_API_INFO                       0x0000
50 #define LDAP_OPT_DESC                           0x0001
51 #define LDAP_OPT_DEREF                          0x0002
52 #define LDAP_OPT_SIZELIMIT                      0x0003
53 #define LDAP_OPT_TIMELIMIT                      0x0004
54 #define LDAP_OPT_REFERRALS                      0x0008
55 #define LDAP_OPT_RESTART                        0x0009
56 #define LDAP_OPT_PROTOCOL_VERSION       0x0011
57 #define LDAP_OPT_SERVER_CONTROLS        0x0012
58 #define LDAP_OPT_CLIENT_CONTROLS        0x0013
59 #define LDAP_OPT_HOST_NAME                      0x0030
60 #define LDAP_OPT_ERROR_NUMBER           0x0031
61 #define LDAP_OPT_ERROR_STRING           0x0032
62
63 /* for LDAPv2 compatibility */
64 #define LDAP_OPT_DNS                            0x0101  /* use DN & DNS */
65
66 /* on/off values */
67 #define LDAP_OPT_ON             ((void *) 1)
68 #define LDAP_OPT_OFF    ((void *) 0)
69
70 #define LDAP_OPT_SUCCESS        0
71 #define LDAP_OPT_ERROR          (-1)
72
73 #ifdef LDAP_DEBUG
74 extern int ldap_debug;
75 #endif
76
77 #define LDAP_API_INFO_VERSION   1
78 typedef struct ldapapiinfo {
79         int             ldapai_info_version;            /* version of LDAPAPIInfo (1) */
80         int             ldapai_api_version;                     /* revision of API supported */
81         int             ldapai_protocol_version;        /* highest LDAP version supported */
82         char    **ldapai_extensions;            /* names of API extensions */
83         char    *ldapai_vendor_name;            /* name of supplier */
84         int             ldapai_vendor_version;          /* supplier-specific version * 100 */
85 } LDAPAPIInfo;
86
87 typedef struct ldapcontrol {
88         char                    *ldctl_oid;
89         struct berval   ldctl_value;
90         char                    ldctl_iscritical;
91 } LDAPControl, *PLDAPControl;
92
93 #define LDAP_MAX_ATTR_LEN       100
94
95 /* 
96  * specific LDAP instantiations of BER types we know about
97  */
98
99 /* general stuff */
100 #define LDAP_TAG_MESSAGE        0x30L   /* tag is 16 + constructed bit */
101 #define OLD_LDAP_TAG_MESSAGE    0x10L   /* forgot the constructed bit  */
102 #define LDAP_TAG_MSGID          0x02L
103
104 /* possible operations a client can invoke */
105 #define LDAP_REQ_BIND                   0x60L   /* application + constructed */
106 #define LDAP_REQ_UNBIND                 0x42L   /* application + primitive   */
107 #define LDAP_REQ_SEARCH                 0x63L   /* application + constructed */
108 #define LDAP_REQ_MODIFY                 0x66L   /* application + constructed */
109 #define LDAP_REQ_ADD                    0x68L   /* application + constructed */
110 #define LDAP_REQ_DELETE                 0x4aL   /* application + primitive   */
111 #define LDAP_REQ_MODRDN                 0x6cL   /* application + constructed */
112 #define LDAP_REQ_COMPARE                0x6eL   /* application + constructed */
113 #define LDAP_REQ_ABANDON                0x50L   /* application + primitive   */
114
115 /* version 3.0 compatibility stuff */
116 #define LDAP_REQ_UNBIND_30              0x62L
117 #define LDAP_REQ_DELETE_30              0x6aL
118 #define LDAP_REQ_ABANDON_30             0x70L
119
120 /* 
121  * old broken stuff for backwards compatibility - forgot application tag
122  * and constructed/primitive bit
123  */
124 #define OLD_LDAP_REQ_BIND               0x00L
125 #define OLD_LDAP_REQ_UNBIND             0x02L
126 #define OLD_LDAP_REQ_SEARCH             0x03L
127 #define OLD_LDAP_REQ_MODIFY             0x06L
128 #define OLD_LDAP_REQ_ADD                0x08L
129 #define OLD_LDAP_REQ_DELETE             0x0aL
130 #define OLD_LDAP_REQ_MODRDN             0x0cL
131 #define OLD_LDAP_REQ_COMPARE            0x0eL
132 #define OLD_LDAP_REQ_ABANDON            0x10L
133
134 /* possible result types a server can return */
135 #define LDAP_RES_BIND                   0x61L   /* application + constructed */
136 #define LDAP_RES_SEARCH_ENTRY           0x64L   /* application + constructed */
137 #define LDAP_RES_SEARCH_RESULT          0x65L   /* application + constructed */
138 #define LDAP_RES_MODIFY                 0x67L   /* application + constructed */
139 #define LDAP_RES_ADD                    0x69L   /* application + constructed */
140 #define LDAP_RES_DELETE                 0x6bL   /* application + constructed */
141 #define LDAP_RES_MODRDN                 0x6dL   /* application + constructed */
142 #define LDAP_RES_COMPARE                0x6fL   /* application + constructed */
143 #define LDAP_RES_ANY                    (-1L)
144
145 /* old broken stuff for backwards compatibility */
146 #define OLD_LDAP_RES_BIND               0x01L
147 #define OLD_LDAP_RES_SEARCH_ENTRY       0x04L
148 #define OLD_LDAP_RES_SEARCH_RESULT      0x05L
149 #define OLD_LDAP_RES_MODIFY             0x07L
150 #define OLD_LDAP_RES_ADD                0x09L
151 #define OLD_LDAP_RES_DELETE             0x0bL
152 #define OLD_LDAP_RES_MODRDN             0x0dL
153 #define OLD_LDAP_RES_COMPARE            0x0fL
154
155 /* authentication methods available */
156 #define LDAP_AUTH_NONE          0x00L   /* no authentication              */
157 #define LDAP_AUTH_SIMPLE        0x80L   /* context specific + primitive   */
158 #define LDAP_AUTH_KRBV4         0xffL   /* means do both of the following */
159 #define LDAP_AUTH_KRBV41        0x81L   /* context specific + primitive   */
160 #define LDAP_AUTH_KRBV42        0x82L   /* context specific + primitive   */
161
162 /* 3.0 compatibility auth methods */
163 #define LDAP_AUTH_SIMPLE_30     0xa0L   /* context specific + constructed */
164 #define LDAP_AUTH_KRBV41_30     0xa1L   /* context specific + constructed */
165 #define LDAP_AUTH_KRBV42_30     0xa2L   /* context specific + constructed */
166
167 /* old broken stuff */
168 #define OLD_LDAP_AUTH_SIMPLE    0x00L
169 #define OLD_LDAP_AUTH_KRBV4     0x01L
170 #define OLD_LDAP_AUTH_KRBV42    0x02L
171
172 /* filter types */
173 #define LDAP_FILTER_AND         0xa0L   /* context specific + constructed */
174 #define LDAP_FILTER_OR          0xa1L   /* context specific + constructed */
175 #define LDAP_FILTER_NOT         0xa2L   /* context specific + constructed */
176 #define LDAP_FILTER_EQUALITY    0xa3L   /* context specific + constructed */
177 #define LDAP_FILTER_SUBSTRINGS  0xa4L   /* context specific + constructed */
178 #define LDAP_FILTER_GE          0xa5L   /* context specific + constructed */
179 #define LDAP_FILTER_LE          0xa6L   /* context specific + constructed */
180 #define LDAP_FILTER_PRESENT     0x87L   /* context specific + primitive   */
181 #define LDAP_FILTER_APPROX      0xa8L   /* context specific + constructed */
182
183 /* 3.0 compatibility filter types */
184 #define LDAP_FILTER_PRESENT_30  0xa7L   /* context specific + constructed */
185
186 /* old broken stuff */
187 #define OLD_LDAP_FILTER_AND             0x00L
188 #define OLD_LDAP_FILTER_OR              0x01L
189 #define OLD_LDAP_FILTER_NOT             0x02L
190 #define OLD_LDAP_FILTER_EQUALITY        0x03L
191 #define OLD_LDAP_FILTER_SUBSTRINGS      0x04L
192 #define OLD_LDAP_FILTER_GE              0x05L
193 #define OLD_LDAP_FILTER_LE              0x06L
194 #define OLD_LDAP_FILTER_PRESENT         0x07L
195 #define OLD_LDAP_FILTER_APPROX          0x08L
196
197 /* substring filter component types */
198 #define LDAP_SUBSTRING_INITIAL  0x80L   /* context specific */
199 #define LDAP_SUBSTRING_ANY      0x81L   /* context specific */
200 #define LDAP_SUBSTRING_FINAL    0x82L   /* context specific */
201
202 /* 3.0 compatibility substring filter component types */
203 #define LDAP_SUBSTRING_INITIAL_30       0xa0L   /* context specific */
204 #define LDAP_SUBSTRING_ANY_30           0xa1L   /* context specific */
205 #define LDAP_SUBSTRING_FINAL_30         0xa2L   /* context specific */
206
207 /* old broken stuff */
208 #define OLD_LDAP_SUBSTRING_INITIAL      0x00L
209 #define OLD_LDAP_SUBSTRING_ANY          0x01L
210 #define OLD_LDAP_SUBSTRING_FINAL        0x02L
211
212 /* search scopes */
213 #define LDAP_SCOPE_BASE         0x00
214 #define LDAP_SCOPE_ONELEVEL     0x01
215 #define LDAP_SCOPE_SUBTREE      0x02
216
217 /* for modifications */
218 typedef struct ldapmod {
219         int             mod_op;
220 #define LDAP_MOD_ADD            0x00
221 #define LDAP_MOD_DELETE         0x01
222 #define LDAP_MOD_REPLACE        0x02
223 #define LDAP_MOD_BVALUES        0x80
224         char            *mod_type;
225         union {
226                 char            **modv_strvals;
227                 struct berval   **modv_bvals;
228         } mod_vals;
229 #define mod_values      mod_vals.modv_strvals
230 #define mod_bvalues     mod_vals.modv_bvals
231         struct ldapmod  *mod_next;
232 } LDAPMod;
233
234 /* 
235  * possible error codes we can return
236  */
237
238 #define LDAP_SUCCESS                    0x00
239 #define LDAP_OPERATIONS_ERROR           0x01
240 #define LDAP_PROTOCOL_ERROR             0x02
241 #define LDAP_TIMELIMIT_EXCEEDED         0x03
242 #define LDAP_SIZELIMIT_EXCEEDED         0x04
243 #define LDAP_COMPARE_FALSE              0x05
244 #define LDAP_COMPARE_TRUE               0x06
245 #define LDAP_STRONG_AUTH_NOT_SUPPORTED  0x07
246 #define LDAP_STRONG_AUTH_REQUIRED       0x08
247 #define LDAP_PARTIAL_RESULTS            0x09
248 #define LDAP_REFERRAL           0x0a /* LDAPv3 */
249 #define LDAP_ADMINLIMIT_EXCEEDED        0x0b /* LDAPv3 */
250 #define LDAP_UNAVAILABLE_CRITICIAL_EXTENSION    0x0c /* LDAPv3 */
251 #define LDAP_CONFIDENTIALITY_REQUIRED   0x0d /* LDAPv3 */
252 #define LDAP_SASL_BIND_IN_PROGRESS      0x0e /* LDAPv3 */       
253
254 #define LDAP_NO_SUCH_ATTRIBUTE          0x10
255 #define LDAP_UNDEFINED_TYPE             0x11
256 #define LDAP_INAPPROPRIATE_MATCHING     0x12
257 #define LDAP_CONSTRAINT_VIOLATION       0x13
258 #define LDAP_TYPE_OR_VALUE_EXISTS       0x14
259 #define LDAP_INVALID_SYNTAX             0x15
260
261 #define LDAP_NO_SUCH_OBJECT             0x20
262 #define LDAP_ALIAS_PROBLEM              0x21
263 #define LDAP_INVALID_DN_SYNTAX          0x22
264 #define LDAP_IS_LEAF                    0x23 /* not LDAPv3 */
265 #define LDAP_ALIAS_DEREF_PROBLEM        0x24
266
267 #define NAME_ERROR(n)   ((n & 0xf0) == 0x20)
268
269 #define LDAP_INAPPROPRIATE_AUTH         0x30
270 #define LDAP_INVALID_CREDENTIALS        0x31
271 #define LDAP_INSUFFICIENT_ACCESS        0x32
272 #define LDAP_BUSY                       0x33
273 #define LDAP_UNAVAILABLE                0x34
274 #define LDAP_UNWILLING_TO_PERFORM       0x35
275 #define LDAP_LOOP_DETECT                0x36
276
277 #define LDAP_NAMING_VIOLATION           0x40
278 #define LDAP_OBJECT_CLASS_VIOLATION     0x41
279 #define LDAP_NOT_ALLOWED_ON_NONLEAF     0x42
280 #define LDAP_NOT_ALLOWED_ON_RDN         0x43
281 #define LDAP_ALREADY_EXISTS             0x44
282 #define LDAP_NO_OBJECT_CLASS_MODS       0x45
283 #define LDAP_RESULTS_TOO_LARGE          0x46 /* CLDAP */
284 #define LDAP_AFFECTS_MULTIPLE_DSAS      0x47 /* LDAPv3 */
285
286 #define LDAP_OTHER                      0x50
287 #define LDAP_SERVER_DOWN                0x51
288 #define LDAP_LOCAL_ERROR                0x52
289 #define LDAP_ENCODING_ERROR             0x53
290 #define LDAP_DECODING_ERROR             0x54
291 #define LDAP_TIMEOUT                    0x55
292 #define LDAP_AUTH_UNKNOWN               0x56
293 #define LDAP_FILTER_ERROR               0x57
294 #define LDAP_USER_CANCELLED             0x58
295 #define LDAP_PARAM_ERROR                0x59
296 #define LDAP_NO_MEMORY                  0x5a
297
298
299 /* default limit on nesting of referrals */
300 #define LDAP_DEFAULT_REFHOPLIMIT        5
301
302 /*
303  * This structure represents both ldap messages and ldap responses.
304  * These are really the same, except in the case of search responses,
305  * where a response has multiple messages.
306  */
307
308 typedef struct ldapmsg LDAPMessage;
309 #define NULLMSG ((LDAPMessage *) NULL)
310
311
312 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
313 /*
314  * structure for tracking LDAP server host, ports, DNs, etc.
315  */
316 typedef struct ldap_server {
317         char                    *lsrv_host;
318         char                    *lsrv_dn;       /* if NULL, use default */
319         int                     lsrv_port;
320         struct ldap_server      *lsrv_next;
321 } LDAPServer;
322
323
324 /*
325  * structure for representing an LDAP server connection
326  */
327 typedef struct ldap_conn {
328         Sockbuf                 *lconn_sb;
329         int                     lconn_refcnt;
330         time_t          lconn_lastused; /* time */
331         int                     lconn_status;
332 #define LDAP_CONNST_NEEDSOCKET          1
333 #define LDAP_CONNST_CONNECTING          2
334 #define LDAP_CONNST_CONNECTED           3
335         LDAPServer              *lconn_server;
336         char                    *lconn_krbinstance;
337         struct ldap_conn        *lconn_next;
338 } LDAPConn;
339
340
341 /*
342  * structure used to track outstanding requests
343  */
344 typedef struct ldapreq {
345         int             lr_msgid;       /* the message id */
346         int             lr_status;      /* status of request */
347 #define LDAP_REQST_INPROGRESS   1
348 #define LDAP_REQST_CHASINGREFS  2
349 #define LDAP_REQST_NOTCONNECTED 3
350 #define LDAP_REQST_WRITING      4
351         int             lr_outrefcnt;   /* count of outstanding referrals */
352         int             lr_origid;      /* original request's message id */
353         int             lr_parentcnt;   /* count of parent requests */
354         int             lr_res_msgtype; /* result message type */
355         int             lr_res_errno;   /* result LDAP errno */
356         char            *lr_res_error;  /* result error string */
357         char            *lr_res_matched;/* result matched DN string */
358         BerElement      *lr_ber;        /* ber encoded request contents */
359         LDAPConn        *lr_conn;       /* connection used to send request */
360         struct ldapreq  *lr_parent;     /* request that spawned this referral */
361         struct ldapreq  *lr_refnext;    /* next referral spawned */
362         struct ldapreq  *lr_prev;       /* previous request */
363         struct ldapreq  *lr_next;       /* next request */
364 } LDAPRequest;
365 #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
366
367
368 /*
369  * structure for client cache
370  */
371 #define LDAP_CACHE_BUCKETS      31      /* cache hash table size */
372 typedef struct ldapcache {
373         LDAPMessage     *lc_buckets[LDAP_CACHE_BUCKETS];/* hash table */
374         LDAPMessage     *lc_requests;                   /* unfulfilled reqs */
375         long            lc_timeout;                     /* request timeout */
376         long            lc_maxmem;                      /* memory to use */
377         long            lc_memused;                     /* memory in use */
378         int             lc_enabled;                     /* enabled? */
379         unsigned long   lc_options;                     /* options */
380 #define LDAP_CACHE_OPT_CACHENOERRS      0x00000001
381 #define LDAP_CACHE_OPT_CACHEALLERRS     0x00000002
382 }  LDAPCache;
383 #define NULLLDCACHE ((LDAPCache *)NULL)
384
385 /*
386  * structures for ldap getfilter routines
387  */
388
389 typedef struct ldap_filt_info {
390         char                    *lfi_filter;
391         char                    *lfi_desc;
392         int                     lfi_scope;      /* LDAP_SCOPE_BASE, etc */
393         int                     lfi_isexact;    /* exact match filter? */
394         struct ldap_filt_info   *lfi_next;
395 } LDAPFiltInfo;
396
397 typedef struct ldap_filt_list {
398     char                        *lfl_tag;
399     char                        *lfl_pattern;
400     char                        *lfl_delims;
401     LDAPFiltInfo                *lfl_ilist;
402     struct ldap_filt_list       *lfl_next;
403 } LDAPFiltList;
404
405
406 #define LDAP_FILT_MAXSIZ        1024
407
408 typedef struct ldap_filt_desc {
409         LDAPFiltList            *lfd_filtlist;
410         LDAPFiltInfo            *lfd_curfip;
411         LDAPFiltInfo            lfd_retfi;
412         char                    lfd_filter[ LDAP_FILT_MAXSIZ ];
413         char                    *lfd_curval;
414         char                    *lfd_curvalcopy;
415         char                    **lfd_curvalwords;
416         char                    *lfd_filtprefix;
417         char                    *lfd_filtsuffix;
418 } LDAPFiltDesc;
419
420
421 /*
422  * structure representing an ldap connection
423  */
424
425 typedef struct ldap LDAP;
426
427 #define LDAP_DEREF_NEVER        0x00
428 #define LDAP_DEREF_SEARCHING    0x01
429 #define LDAP_DEREF_FINDING      0x02
430 #define LDAP_DEREF_ALWAYS       0x03
431
432 #define LDAP_NO_LIMIT           0
433
434
435 /*
436  * structure for ldap friendly mapping routines
437  */
438
439 typedef struct friendly {
440         char    *f_unfriendly;
441         char    *f_friendly;
442 } FriendlyMap;
443
444
445 /*
446  * handy macro to check whether LDAP struct is set up for CLDAP or not
447  */
448 #define LDAP_IS_CLDAP( ld )     ( (ld)->ld_sb.sb_naddr > 0 )
449
450
451 /*
452  * types for ldap URL handling
453  */
454 typedef struct ldap_url_desc {
455     char        *lud_host;
456     int         lud_port;
457     char        *lud_dn;
458     char        **lud_attrs;
459     int         lud_scope;
460     char        *lud_filter;
461     char        *lud_string;    /* for internal use only */
462 } LDAPURLDesc;
463 #define NULLLDAPURLDESC ((LDAPURLDesc *)NULL)
464
465 #define LDAP_URL_ERR_NOTLDAP    1       /* URL doesn't begin with "ldap://" */
466 #define LDAP_URL_ERR_NODN       2       /* URL has no DN (required) */
467 #define LDAP_URL_ERR_BADSCOPE   3       /* URL scope string is invalid */
468 #define LDAP_URL_ERR_MEM        4       /* can't allocate memory space */
469
470 /* avoid pulling in headers */
471 struct timeval;
472
473 /*
474  * in options.c:
475  */
476 LDAP_F int ldap_get_option LDAP_P((LDAP *ld, int option, void *outvalue));
477 LDAP_F int ldap_set_option LDAP_P((LDAP *ld, int option, void *invalue));
478
479 /* Not yet */
480 LDAP_F void ldap_control_free LDAP_P(( LDAPControl *ctrl ));
481 LDAP_F void ldap_controls_free LDAP_P(( LDAPControl **ctrls ));
482   
483 /*
484  * in abandon.c:
485  */
486 LDAP_F int ldap_abandon LDAP_P(( LDAP *ld, int msgid ));
487
488 /*
489  * in add.c:
490  */
491 LDAP_F int ldap_add LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs ));
492 LDAP_F int ldap_add_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs ));
493
494 /*
495  * in bind.c:
496  */
497 LDAP_F int ldap_bind LDAP_P(( LDAP *ld, char *who, char *passwd, int authmethod ));
498 LDAP_F int ldap_bind_s LDAP_P(( LDAP *ld, char *who, char *cred, int method ));
499 LDAP_F void ldap_set_rebind_proc LDAP_P(( LDAP *ld,
500         int (*rebindproc) LDAP_P(( LDAP *ld, char **dnp, char **passwdp, int *authmethodp, int freeit ))
501 ));
502
503 /*
504  * in sbind.c:
505  */
506 LDAP_F int ldap_simple_bind LDAP_P(( LDAP *ld, char *who, char *passwd ));
507 LDAP_F int ldap_simple_bind_s LDAP_P(( LDAP *ld, char *who, char *passwd ));
508
509 /*
510  * in kbind.c:
511  */
512 LDAP_F int ldap_kerberos_bind_s LDAP_P(( LDAP *ld, char *who ));
513 LDAP_F int ldap_kerberos_bind1 LDAP_P(( LDAP *ld, char *who ));
514 LDAP_F int ldap_kerberos_bind1_s LDAP_P(( LDAP *ld, char *who ));
515 LDAP_F int ldap_kerberos_bind2 LDAP_P(( LDAP *ld, char *who ));
516 LDAP_F int ldap_kerberos_bind2_s LDAP_P(( LDAP *ld, char *who ));
517  
518
519 /*
520  * in cache.c
521  */
522 LDAP_F int ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem ));
523 LDAP_F void ldap_disable_cache LDAP_P(( LDAP *ld ));
524 LDAP_F void ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts ));
525 LDAP_F void ldap_destroy_cache LDAP_P(( LDAP *ld ));
526 LDAP_F void ldap_flush_cache LDAP_P(( LDAP *ld ));
527 LDAP_F void ldap_uncache_entry LDAP_P(( LDAP *ld, char *dn ));
528 LDAP_F void ldap_uncache_request LDAP_P(( LDAP *ld, int msgid ));
529
530 /*
531  * in compare.c:
532  */
533 LDAP_F int ldap_compare LDAP_P(( LDAP *ld, char *dn, char *attr, char *value ));
534 LDAP_F int ldap_compare_s LDAP_P(( LDAP *ld, char *dn, char *attr, char *value ));
535
536 /*
537  * in delete.c:
538  */
539 LDAP_F int ldap_delete LDAP_P(( LDAP *ld, char *dn ));
540 LDAP_F int ldap_delete_s LDAP_P(( LDAP *ld, char *dn ));
541
542 /*
543  * in error.c:
544  */
545 LDAP_F int ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit ));
546 LDAP_F char *ldap_err2string LDAP_P(( int err ));
547 LDAP_F void ldap_perror LDAP_P(( LDAP *ld, char *s ));
548 LDAP_F int ldap_get_lderrno LDAP_P((LDAP *ld, char **matched, char **msg));
549
550 /*
551  * in modify.c:
552  */
553 LDAP_F int ldap_modify LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods ));
554 LDAP_F int ldap_modify_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods ));
555
556 /*
557  * in modrdn.c:
558  */
559 LDAP_F int ldap_modrdn LDAP_P(( LDAP *ld, char *dn, char *newrdn ));
560 LDAP_F int ldap_modrdn_s LDAP_P(( LDAP *ld, char *dn, char *newrdn ));
561 LDAP_F int ldap_modrdn2 LDAP_P(( LDAP *ld, char *dn, char *newrdn,
562         int deleteoldrdn ));
563 LDAP_F int ldap_modrdn2_s LDAP_P(( LDAP *ld, char *dn, char *newrdn,
564         int deleteoldrdn));
565
566 /*
567  * in open.c:
568  */
569 LDAP_F LDAP *ldap_open LDAP_P(( char *host, int port ));
570 LDAP_F LDAP *ldap_init LDAP_P(( char *defhost, int defport ));
571
572 /*
573  * in getentry.c:
574  */
575 LDAP_F LDAPMessage *ldap_first_entry LDAP_P(( LDAP *ld, LDAPMessage *chain ));
576 LDAP_F LDAPMessage *ldap_next_entry LDAP_P(( LDAP *ld, LDAPMessage *entry ));
577 LDAP_F int ldap_count_entries LDAP_P(( LDAP *ld, LDAPMessage *chain ));
578
579 /*
580  * in addentry.c
581  */
582 LDAP_F LDAPMessage *ldap_delete_result_entry LDAP_P(( LDAPMessage **list,
583         LDAPMessage *e ));
584 LDAP_F void ldap_add_result_entry LDAP_P(( LDAPMessage **list, LDAPMessage *e ));
585
586 /*
587  * in getdn.c
588  */
589 LDAP_F char *ldap_get_dn LDAP_P(( LDAP *ld, LDAPMessage *entry ));
590 LDAP_F char *ldap_dn2ufn LDAP_P(( char *dn ));
591 LDAP_F char **ldap_explode_dn LDAP_P(( char *dn, int notypes ));
592 LDAP_F char **ldap_explode_rdn LDAP_P(( char *rdn, int notypes ));
593 LDAP_F char **ldap_explode_dns LDAP_P(( char *dn ));
594 LDAP_F int ldap_is_dns_dn LDAP_P(( char *dn ));
595
596 /*
597  * in getattr.c
598  */
599 LDAP_F char *ldap_first_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry,
600         BerElement **ber ));
601 LDAP_F char *ldap_next_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry,
602         BerElement *ber ));
603
604 /*
605  * in getvalues.c
606  */
607 LDAP_F char **ldap_get_values LDAP_P(( LDAP *ld, LDAPMessage *entry, char *target ));
608 LDAP_F struct berval **ldap_get_values_len LDAP_P(( LDAP *ld, LDAPMessage *entry,
609         char *target ));
610 LDAP_F int ldap_count_values LDAP_P(( char **vals ));
611 LDAP_F int ldap_count_values_len LDAP_P(( struct berval **vals ));
612 LDAP_F void ldap_value_free LDAP_P(( char **vals ));
613 LDAP_F void ldap_value_free_len LDAP_P(( struct berval **vals ));
614
615 /*
616  * in result.c:
617  */
618 LDAP_F int ldap_result LDAP_P(( LDAP *ld, int msgid, int all,
619         struct timeval *timeout, LDAPMessage **result ));
620 LDAP_F int ldap_msgtype LDAP_P(( LDAPMessage *lm ));
621 LDAP_F int ldap_msgid   LDAP_P(( LDAPMessage *lm ));
622 LDAP_F int ldap_msgfree LDAP_P(( LDAPMessage *lm ));
623 LDAP_F int ldap_msgdelete LDAP_P(( LDAP *ld, int msgid ));
624
625 /*
626  * in search.c:
627  */
628 LDAP_F int ldap_search LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
629         char **attrs, int attrsonly ));
630 LDAP_F int ldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
631         char **attrs, int attrsonly, LDAPMessage **res ));
632 LDAP_F int ldap_search_st LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
633     char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res ));
634
635 /*
636  * in ufn.c
637  */
638 LDAP_F int ldap_ufn_search_c LDAP_P(( LDAP *ld, char *ufn, char **attrs,
639         int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ),
640         void *cancelparm ));
641 LDAP_F int ldap_ufn_search_ct LDAP_P(( LDAP *ld, char *ufn, char **attrs,
642         int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ),
643         void *cancelparm, char *tag1, char *tag2, char *tag3 ));
644 LDAP_F int ldap_ufn_search_s LDAP_P(( LDAP *ld, char *ufn, char **attrs,
645         int attrsonly, LDAPMessage **res ));
646 LDAP_F LDAPFiltDesc *ldap_ufn_setfilter LDAP_P(( LDAP *ld, char *fname ));
647 LDAP_F void ldap_ufn_setprefix LDAP_P(( LDAP *ld, char *prefix ));
648 LDAP_F int ldap_ufn_timeout LDAP_P(( void *tvparam ));
649
650
651 /*
652  * in unbind.c
653  */
654 LDAP_F int ldap_unbind LDAP_P(( LDAP *ld ));
655 LDAP_F int ldap_unbind_s LDAP_P(( LDAP *ld ));
656
657
658 /*
659  * in getfilter.c
660  */
661 LDAP_F LDAPFiltDesc *ldap_init_getfilter LDAP_P(( char *fname ));
662 LDAP_F LDAPFiltDesc *ldap_init_getfilter_buf LDAP_P(( char *buf, long buflen ));
663 LDAP_F LDAPFiltInfo *ldap_getfirstfilter LDAP_P(( LDAPFiltDesc *lfdp, char *tagpat,
664         char *value ));
665 LDAP_F LDAPFiltInfo *ldap_getnextfilter LDAP_P(( LDAPFiltDesc *lfdp ));
666 LDAP_F void ldap_setfilteraffixes LDAP_P(( LDAPFiltDesc *lfdp, char *prefix, char *suffix ));
667 LDAP_F void ldap_build_filter LDAP_P(( char *buf, unsigned long buflen,
668         char *pattern, char *prefix, char *suffix, char *attr,
669         char *value, char **valwords ));
670
671 /*
672  * in free.c
673  */
674 LDAP_F void ldap_getfilter_free LDAP_P(( LDAPFiltDesc *lfdp ));
675 LDAP_F void ldap_mods_free LDAP_P(( LDAPMod **mods, int freemods ));
676
677 /*
678  * in friendly.c
679  */
680 LDAP_F char *ldap_friendly_name LDAP_P(( char *filename, char *uname,
681         FriendlyMap **map ));
682 LDAP_F void ldap_free_friendlymap LDAP_P(( FriendlyMap **map ));
683
684
685 /*
686  * in cldap.c
687  */
688 LDAP_F LDAP *cldap_open LDAP_P(( char *host, int port ));
689 LDAP_F void cldap_close LDAP_P(( LDAP *ld ));
690 LDAP_F int cldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter,
691         char **attrs, int attrsonly, LDAPMessage **res, char *logdn ));
692 LDAP_F void cldap_setretryinfo LDAP_P(( LDAP *ld, int tries, int timeout ));
693
694
695 /*
696  * in sort.c
697  */
698 LDAP_F int ldap_sort_entries LDAP_P(( LDAP *ld,
699         LDAPMessage **chain, char *attr,
700         int (*cmp) (const char *, const char *) ));
701 LDAP_F int ldap_sort_values LDAP_P(( LDAP *ld,
702         char **vals, int (*cmp) (const void *, const void *) ));
703 LDAP_F int ldap_sort_strcasecmp LDAP_P(( const void *a, const void *b ));
704
705
706 /*
707  * in url.c
708  */
709 LDAP_F int ldap_is_ldap_url LDAP_P(( char *url ));
710 LDAP_F int ldap_url_parse LDAP_P(( char *url, LDAPURLDesc **ludpp ));
711 LDAP_F void ldap_free_urldesc LDAP_P(( LDAPURLDesc *ludp ));
712 LDAP_F int ldap_url_search LDAP_P(( LDAP *ld, char *url, int attrsonly ));
713 LDAP_F int ldap_url_search_s LDAP_P(( LDAP *ld, char *url, int attrsonly,
714         LDAPMessage **res ));
715 LDAP_F int ldap_url_search_st LDAP_P(( LDAP *ld, char *url, int attrsonly,
716         struct timeval *timeout, LDAPMessage **res ));
717
718
719 /*
720  * in charset.c
721  */
722 LDAP_F void ldap_set_string_translators LDAP_P(( LDAP *ld,
723         BERTranslateProc encode_proc, BERTranslateProc decode_proc ));
724 LDAP_F int ldap_translate_from_t61 LDAP_P(( LDAP *ld, char **bufp,
725         unsigned long *lenp, int free_input ));
726 LDAP_F int ldap_translate_to_t61 LDAP_P(( LDAP *ld, char **bufp,
727         unsigned long *lenp, int free_input ));
728 LDAP_F void ldap_enable_translation LDAP_P(( LDAP *ld, LDAPMessage *entry,
729         int enable ));
730
731 LDAP_F int ldap_t61_to_8859 LDAP_P(( char **bufp, unsigned long *buflenp,
732         int free_input ));
733 LDAP_F int ldap_8859_to_t61 LDAP_P(( char **bufp, unsigned long *buflenp,
734         int free_input ));
735
736
737 /*
738  * in msdos/winsock/wsa.c
739  */
740 LDAP_F void ldap_memfree LDAP_P(( void *p ));
741
742 LDAP_END_DECL
743
744 #endif /* _LDAP_H */