]> git.sur5r.net Git - openldap/blob - include/ldap.h
More lint removal from Hallvard.
[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 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20
21 #ifdef WINSOCK
22 #include "msdos.h"
23 #include <winsock.h>
24 #endif
25
26 #if !defined( NEEDPROTOS ) && defined(__STDC__)
27 #define NEEDPROTOS      1
28 #endif
29
30 #define LDAP_PORT       389
31 #define LDAP_VERSION1   1
32 #define LDAP_VERSION2   2
33 #define LDAP_VERSION    LDAP_VERSION2
34
35 #define COMPAT20
36 #define COMPAT30
37 #if defined(COMPAT20) || defined(COMPAT30)
38 #define COMPAT
39 #endif
40
41 #define LDAP_MAX_ATTR_LEN       100
42
43 /* debugging stuff */
44 #ifdef LDAP_DEBUG
45 extern int      ldap_debug;
46 #ifdef LDAP_SYSLOG
47 extern int      ldap_syslog;
48 extern int      ldap_syslog_level;
49 #endif
50 #define LDAP_DEBUG_TRACE        0x001
51 #define LDAP_DEBUG_PACKETS      0x002
52 #define LDAP_DEBUG_ARGS         0x004
53 #define LDAP_DEBUG_CONNS        0x008
54 #define LDAP_DEBUG_BER          0x010
55 #define LDAP_DEBUG_FILTER       0x020
56 #define LDAP_DEBUG_CONFIG       0x040
57 #define LDAP_DEBUG_ACL          0x080
58 #define LDAP_DEBUG_STATS        0x100
59 #define LDAP_DEBUG_STATS2       0x200
60 #define LDAP_DEBUG_SHELL        0x400
61 #define LDAP_DEBUG_PARSE        0x800
62 #define LDAP_DEBUG_ANY          0xffff
63
64 #ifdef LDAP_SYSLOG
65 #define Debug( level, fmt, arg1, arg2, arg3 )   \
66         { \
67                 if ( ldap_debug & (level) ) \
68                         fprintf( stderr, (fmt), (arg1), (arg2), (arg3) ); \
69                 if ( ldap_syslog & level ) \
70                         syslog( ldap_syslog_level, (fmt), (arg1), (arg2), (arg3) ); \
71         }
72 #else /* LDAP_SYSLOG */
73 #ifndef WINSOCK
74 #define Debug( level, fmt, arg1, arg2, arg3 ) \
75                 if ( ldap_debug & (level) ) \
76                         fprintf( stderr, (fmt), (arg1), (arg2), (arg3) );
77 #else /* !WINSOCK */
78 extern void Debug( int level, char* fmt, ... );
79 #endif /* !WINSOCK */
80 #endif /* LDAP_SYSLOG */
81 #else /* LDAP_DEBUG */
82 #define Debug( level, fmt, arg1, arg2, arg3 )
83 #endif /* LDAP_DEBUG */
84
85 /* 
86  * specific LDAP instantiations of BER types we know about
87  */
88
89 /* general stuff */
90 #define LDAP_TAG_MESSAGE        0x30L   /* tag is 16 + constructed bit */
91 #define OLD_LDAP_TAG_MESSAGE    0x10L   /* forgot the constructed bit  */
92 #define LDAP_TAG_MSGID          0x02L
93
94 /* possible operations a client can invoke */
95 #define LDAP_REQ_BIND                   0x60L   /* application + constructed */
96 #define LDAP_REQ_UNBIND                 0x42L   /* application + primitive   */
97 #define LDAP_REQ_SEARCH                 0x63L   /* application + constructed */
98 #define LDAP_REQ_MODIFY                 0x66L   /* application + constructed */
99 #define LDAP_REQ_ADD                    0x68L   /* application + constructed */
100 #define LDAP_REQ_DELETE                 0x4aL   /* application + primitive   */
101 #define LDAP_REQ_MODRDN                 0x6cL   /* application + constructed */
102 #define LDAP_REQ_COMPARE                0x6eL   /* application + constructed */
103 #define LDAP_REQ_ABANDON                0x50L   /* application + primitive   */
104
105 /* version 3.0 compatibility stuff */
106 #define LDAP_REQ_UNBIND_30              0x62L
107 #define LDAP_REQ_DELETE_30              0x6aL
108 #define LDAP_REQ_ABANDON_30             0x70L
109
110 /* 
111  * old broken stuff for backwards compatibility - forgot application tag
112  * and constructed/primitive bit
113  */
114 #define OLD_LDAP_REQ_BIND               0x00L
115 #define OLD_LDAP_REQ_UNBIND             0x02L
116 #define OLD_LDAP_REQ_SEARCH             0x03L
117 #define OLD_LDAP_REQ_MODIFY             0x06L
118 #define OLD_LDAP_REQ_ADD                0x08L
119 #define OLD_LDAP_REQ_DELETE             0x0aL
120 #define OLD_LDAP_REQ_MODRDN             0x0cL
121 #define OLD_LDAP_REQ_COMPARE            0x0eL
122 #define OLD_LDAP_REQ_ABANDON            0x10L
123
124 /* possible result types a server can return */
125 #define LDAP_RES_BIND                   0x61L   /* application + constructed */
126 #define LDAP_RES_SEARCH_ENTRY           0x64L   /* application + constructed */
127 #define LDAP_RES_SEARCH_RESULT          0x65L   /* application + constructed */
128 #define LDAP_RES_MODIFY                 0x67L   /* application + constructed */
129 #define LDAP_RES_ADD                    0x69L   /* application + constructed */
130 #define LDAP_RES_DELETE                 0x6bL   /* application + constructed */
131 #define LDAP_RES_MODRDN                 0x6dL   /* application + constructed */
132 #define LDAP_RES_COMPARE                0x6fL   /* application + constructed */
133 #define LDAP_RES_ANY                    (-1L)
134
135 /* old broken stuff for backwards compatibility */
136 #define OLD_LDAP_RES_BIND               0x01L
137 #define OLD_LDAP_RES_SEARCH_ENTRY       0x04L
138 #define OLD_LDAP_RES_SEARCH_RESULT      0x05L
139 #define OLD_LDAP_RES_MODIFY             0x07L
140 #define OLD_LDAP_RES_ADD                0x09L
141 #define OLD_LDAP_RES_DELETE             0x0bL
142 #define OLD_LDAP_RES_MODRDN             0x0dL
143 #define OLD_LDAP_RES_COMPARE            0x0fL
144
145 /* authentication methods available */
146 #define LDAP_AUTH_NONE          0x00L   /* no authentication              */
147 #define LDAP_AUTH_SIMPLE        0x80L   /* context specific + primitive   */
148 #define LDAP_AUTH_KRBV4         0xffL   /* means do both of the following */
149 #define LDAP_AUTH_KRBV41        0x81L   /* context specific + primitive   */
150 #define LDAP_AUTH_KRBV42        0x82L   /* context specific + primitive   */
151
152 /* 3.0 compatibility auth methods */
153 #define LDAP_AUTH_SIMPLE_30     0xa0L   /* context specific + constructed */
154 #define LDAP_AUTH_KRBV41_30     0xa1L   /* context specific + constructed */
155 #define LDAP_AUTH_KRBV42_30     0xa2L   /* context specific + constructed */
156
157 /* old broken stuff */
158 #define OLD_LDAP_AUTH_SIMPLE    0x00L
159 #define OLD_LDAP_AUTH_KRBV4     0x01L
160 #define OLD_LDAP_AUTH_KRBV42    0x02L
161
162 /* filter types */
163 #define LDAP_FILTER_AND         0xa0L   /* context specific + constructed */
164 #define LDAP_FILTER_OR          0xa1L   /* context specific + constructed */
165 #define LDAP_FILTER_NOT         0xa2L   /* context specific + constructed */
166 #define LDAP_FILTER_EQUALITY    0xa3L   /* context specific + constructed */
167 #define LDAP_FILTER_SUBSTRINGS  0xa4L   /* context specific + constructed */
168 #define LDAP_FILTER_GE          0xa5L   /* context specific + constructed */
169 #define LDAP_FILTER_LE          0xa6L   /* context specific + constructed */
170 #define LDAP_FILTER_PRESENT     0x87L   /* context specific + primitive   */
171 #define LDAP_FILTER_APPROX      0xa8L   /* context specific + constructed */
172
173 /* 3.0 compatibility filter types */
174 #define LDAP_FILTER_PRESENT_30  0xa7L   /* context specific + constructed */
175
176 /* old broken stuff */
177 #define OLD_LDAP_FILTER_AND             0x00L
178 #define OLD_LDAP_FILTER_OR              0x01L
179 #define OLD_LDAP_FILTER_NOT             0x02L
180 #define OLD_LDAP_FILTER_EQUALITY        0x03L
181 #define OLD_LDAP_FILTER_SUBSTRINGS      0x04L
182 #define OLD_LDAP_FILTER_GE              0x05L
183 #define OLD_LDAP_FILTER_LE              0x06L
184 #define OLD_LDAP_FILTER_PRESENT         0x07L
185 #define OLD_LDAP_FILTER_APPROX          0x08L
186
187 /* substring filter component types */
188 #define LDAP_SUBSTRING_INITIAL  0x80L   /* context specific */
189 #define LDAP_SUBSTRING_ANY      0x81L   /* context specific */
190 #define LDAP_SUBSTRING_FINAL    0x82L   /* context specific */
191
192 /* 3.0 compatibility substring filter component types */
193 #define LDAP_SUBSTRING_INITIAL_30       0xa0L   /* context specific */
194 #define LDAP_SUBSTRING_ANY_30           0xa1L   /* context specific */
195 #define LDAP_SUBSTRING_FINAL_30         0xa2L   /* context specific */
196
197 /* old broken stuff */
198 #define OLD_LDAP_SUBSTRING_INITIAL      0x00L
199 #define OLD_LDAP_SUBSTRING_ANY          0x01L
200 #define OLD_LDAP_SUBSTRING_FINAL        0x02L
201
202 /* search scopes */
203 #define LDAP_SCOPE_BASE         0x00
204 #define LDAP_SCOPE_ONELEVEL     0x01
205 #define LDAP_SCOPE_SUBTREE      0x02
206
207 /* for modifications */
208 typedef struct ldapmod {
209         int             mod_op;
210 #define LDAP_MOD_ADD            0x00
211 #define LDAP_MOD_DELETE         0x01
212 #define LDAP_MOD_REPLACE        0x02
213 #define LDAP_MOD_BVALUES        0x80
214         char            *mod_type;
215         union {
216                 char            **modv_strvals;
217                 struct berval   **modv_bvals;
218         } mod_vals;
219 #define mod_values      mod_vals.modv_strvals
220 #define mod_bvalues     mod_vals.modv_bvals
221         struct ldapmod  *mod_next;
222 } LDAPMod;
223
224 /* 
225  * possible error codes we can return
226  */
227
228 #define LDAP_SUCCESS                    0x00
229 #define LDAP_OPERATIONS_ERROR           0x01
230 #define LDAP_PROTOCOL_ERROR             0x02
231 #define LDAP_TIMELIMIT_EXCEEDED         0x03
232 #define LDAP_SIZELIMIT_EXCEEDED         0x04
233 #define LDAP_COMPARE_FALSE              0x05
234 #define LDAP_COMPARE_TRUE               0x06
235 #define LDAP_STRONG_AUTH_NOT_SUPPORTED  0x07
236 #define LDAP_STRONG_AUTH_REQUIRED       0x08
237 #define LDAP_PARTIAL_RESULTS            0x09
238
239 #define LDAP_NO_SUCH_ATTRIBUTE          0x10
240 #define LDAP_UNDEFINED_TYPE             0x11
241 #define LDAP_INAPPROPRIATE_MATCHING     0x12
242 #define LDAP_CONSTRAINT_VIOLATION       0x13
243 #define LDAP_TYPE_OR_VALUE_EXISTS       0x14
244 #define LDAP_INVALID_SYNTAX             0x15
245
246 #define LDAP_NO_SUCH_OBJECT             0x20
247 #define LDAP_ALIAS_PROBLEM              0x21
248 #define LDAP_INVALID_DN_SYNTAX          0x22
249 #define LDAP_IS_LEAF                    0x23
250 #define LDAP_ALIAS_DEREF_PROBLEM        0x24
251
252 #define NAME_ERROR(n)   ((n & 0xf0) == 0x20)
253
254 #define LDAP_INAPPROPRIATE_AUTH         0x30
255 #define LDAP_INVALID_CREDENTIALS        0x31
256 #define LDAP_INSUFFICIENT_ACCESS        0x32
257 #define LDAP_BUSY                       0x33
258 #define LDAP_UNAVAILABLE                0x34
259 #define LDAP_UNWILLING_TO_PERFORM       0x35
260 #define LDAP_LOOP_DETECT                0x36
261
262 #define LDAP_NAMING_VIOLATION           0x40
263 #define LDAP_OBJECT_CLASS_VIOLATION     0x41
264 #define LDAP_NOT_ALLOWED_ON_NONLEAF     0x42
265 #define LDAP_NOT_ALLOWED_ON_RDN         0x43
266 #define LDAP_ALREADY_EXISTS             0x44
267 #define LDAP_NO_OBJECT_CLASS_MODS       0x45
268 #define LDAP_RESULTS_TOO_LARGE          0x46
269
270 #define LDAP_OTHER                      0x50
271 #define LDAP_SERVER_DOWN                0x51
272 #define LDAP_LOCAL_ERROR                0x52
273 #define LDAP_ENCODING_ERROR             0x53
274 #define LDAP_DECODING_ERROR             0x54
275 #define LDAP_TIMEOUT                    0x55
276 #define LDAP_AUTH_UNKNOWN               0x56
277 #define LDAP_FILTER_ERROR               0x57
278 #define LDAP_USER_CANCELLED             0x58
279 #define LDAP_PARAM_ERROR                0x59
280 #define LDAP_NO_MEMORY                  0x5a
281
282
283 /* default limit on nesting of referrals */
284 #define LDAP_DEFAULT_REFHOPLIMIT        5
285
286 /*
287  * This structure represents both ldap messages and ldap responses.
288  * These are really the same, except in the case of search responses,
289  * where a response has multiple messages.
290  */
291
292 typedef struct ldapmsg {
293         int             lm_msgid;       /* the message id */
294         int             lm_msgtype;     /* the message type */
295         BerElement      *lm_ber;        /* the ber encoded message contents */
296         struct ldapmsg  *lm_chain;      /* for search - next msg in the resp */
297         struct ldapmsg  *lm_next;       /* next response */
298         unsigned int    lm_time;        /* used to maintain cache */
299 } LDAPMessage;
300 #define NULLMSG ((LDAPMessage *) NULL)
301
302
303 #ifdef LDAP_REFERRALS
304 /*
305  * structure for tracking LDAP server host, ports, DNs, etc.
306  */
307 typedef struct ldap_server {
308         char                    *lsrv_host;
309         char                    *lsrv_dn;       /* if NULL, use default */
310         int                     lsrv_port;
311         struct ldap_server      *lsrv_next;
312 } LDAPServer;
313
314
315 /*
316  * structure for representing an LDAP server connection
317  */
318 typedef struct ldap_conn {
319         Sockbuf                 *lconn_sb;
320         int                     lconn_refcnt;
321         time_t          lconn_lastused; /* time */
322         int                     lconn_status;
323 #define LDAP_CONNST_NEEDSOCKET          1
324 #define LDAP_CONNST_CONNECTING          2
325 #define LDAP_CONNST_CONNECTED           3
326         LDAPServer              *lconn_server;
327         char                    *lconn_krbinstance;
328         struct ldap_conn        *lconn_next;
329 } LDAPConn;
330
331
332 /*
333  * structure used to track outstanding requests
334  */
335 typedef struct ldapreq {
336         int             lr_msgid;       /* the message id */
337         int             lr_status;      /* status of request */
338 #define LDAP_REQST_INPROGRESS   1
339 #define LDAP_REQST_CHASINGREFS  2
340 #define LDAP_REQST_NOTCONNECTED 3
341 #define LDAP_REQST_WRITING      4
342         int             lr_outrefcnt;   /* count of outstanding referrals */
343         int             lr_origid;      /* original request's message id */
344         int             lr_parentcnt;   /* count of parent requests */
345         int             lr_res_msgtype; /* result message type */
346         int             lr_res_errno;   /* result LDAP errno */
347         char            *lr_res_error;  /* result error string */
348         char            *lr_res_matched;/* result matched DN string */
349         BerElement      *lr_ber;        /* ber encoded request contents */
350         LDAPConn        *lr_conn;       /* connection used to send request */
351         struct ldapreq  *lr_parent;     /* request that spawned this referral */
352         struct ldapreq  *lr_refnext;    /* next referral spawned */
353         struct ldapreq  *lr_prev;       /* previous request */
354         struct ldapreq  *lr_next;       /* next request */
355 } LDAPRequest;
356 #endif /* LDAP_REFERRALS */
357
358
359 /*
360  * structure for client cache
361  */
362 #define LDAP_CACHE_BUCKETS      31      /* cache hash table size */
363 typedef struct ldapcache {
364         LDAPMessage     *lc_buckets[LDAP_CACHE_BUCKETS];/* hash table */
365         LDAPMessage     *lc_requests;                   /* unfulfilled reqs */
366         long            lc_timeout;                     /* request timeout */
367         long            lc_maxmem;                      /* memory to use */
368         long            lc_memused;                     /* memory in use */
369         int             lc_enabled;                     /* enabled? */
370         unsigned long   lc_options;                     /* options */
371 #define LDAP_CACHE_OPT_CACHENOERRS      0x00000001
372 #define LDAP_CACHE_OPT_CACHEALLERRS     0x00000002
373 }  LDAPCache;
374 #define NULLLDCACHE ((LDAPCache *)NULL)
375
376 /*
377  * structures for ldap getfilter routines
378  */
379
380 typedef struct ldap_filt_info {
381         char                    *lfi_filter;
382         char                    *lfi_desc;
383         int                     lfi_scope;      /* LDAP_SCOPE_BASE, etc */
384         int                     lfi_isexact;    /* exact match filter? */
385         struct ldap_filt_info   *lfi_next;
386 } LDAPFiltInfo;
387
388 typedef struct ldap_filt_list {
389     char                        *lfl_tag;
390     char                        *lfl_pattern;
391     char                        *lfl_delims;
392     LDAPFiltInfo                *lfl_ilist;
393     struct ldap_filt_list       *lfl_next;
394 } LDAPFiltList;
395
396
397 #define LDAP_FILT_MAXSIZ        1024
398
399 typedef struct ldap_filt_desc {
400         LDAPFiltList            *lfd_filtlist;
401         LDAPFiltInfo            *lfd_curfip;
402         LDAPFiltInfo            lfd_retfi;
403         char                    lfd_filter[ LDAP_FILT_MAXSIZ ];
404         char                    *lfd_curval;
405         char                    *lfd_curvalcopy;
406         char                    **lfd_curvalwords;
407         char                    *lfd_filtprefix;
408         char                    *lfd_filtsuffix;
409 } LDAPFiltDesc;
410
411
412 /*
413  * structure representing an ldap connection
414  */
415
416 typedef struct ldap {
417         Sockbuf         ld_sb;          /* socket descriptor & buffer */
418         char            *ld_host;
419         int             ld_version;
420         char            ld_lberoptions;
421         int             ld_deref;
422 #define LDAP_DEREF_NEVER        0
423 #define LDAP_DEREF_SEARCHING    1
424 #define LDAP_DEREF_FINDING      2
425 #define LDAP_DEREF_ALWAYS       3
426
427         int             ld_timelimit;
428         int             ld_sizelimit;
429 #define LDAP_NO_LIMIT           0
430
431         LDAPFiltDesc    *ld_filtd;      /* from getfilter for ufn searches */
432         char            *ld_ufnprefix;  /* for incomplete ufn's */
433
434         int             ld_errno;
435         char            *ld_error;
436         char            *ld_matched;
437         int             ld_msgid;
438
439         /* do not mess with these */
440 #ifdef LDAP_REFERRALS
441         LDAPRequest     *ld_requests;   /* list of outstanding requests */
442 #else /* LDAP_REFERRALS */
443         LDAPMessage     *ld_requests;   /* list of outstanding requests */
444 #endif /* LDAP_REFERRALS */
445         LDAPMessage     *ld_responses;  /* list of outstanding responses */
446         int             *ld_abandoned;  /* array of abandoned requests */
447         char            ld_attrbuffer[LDAP_MAX_ATTR_LEN];
448         LDAPCache       *ld_cache;      /* non-null if cache is initialized */
449         char            *ld_cldapdn;    /* DN used in connectionless search */
450
451         /* it is OK to change these next four values directly */
452         int             ld_cldaptries;  /* connectionless search retry count */
453         int             ld_cldaptimeout;/* time between retries */
454         int             ld_refhoplimit; /* limit on referral nesting */
455         unsigned long   ld_options;     /* boolean options */
456 #ifdef LDAP_DNS
457 #define LDAP_OPT_DNS            0x00000001      /* use DN & DNS */
458 #endif /* LDAP_DNS */
459 #ifdef LDAP_REFERRALS
460 #define LDAP_OPT_REFERRALS      0x00000002      /* chase referrals */
461 #endif /* LDAP_REFERRALS */
462 #define LDAP_OPT_RESTART        0x00000004      /* restart if EINTR occurs */
463
464         /* do not mess with the rest though */
465         char            *ld_defhost;    /* full name of default server */
466         int             ld_defport;     /* port of default server */
467         BERTranslateProc ld_lber_encode_translate_proc;
468         BERTranslateProc ld_lber_decode_translate_proc;
469 #ifdef LDAP_REFERRALS
470         LDAPConn        *ld_defconn;    /* default connection */
471         LDAPConn        *ld_conns;      /* list of server connections */
472         void            *ld_selectinfo; /* platform specifics for select */
473         int             (*ld_rebindproc)( struct ldap *ld, char **dnp,
474                                 char **passwdp, int *authmethodp, int freeit );
475                                 /* routine to get info needed for re-bind */
476 #endif /* LDAP_REFERRALS */
477 } LDAP;
478
479
480 /*
481  * structure for ldap friendly mapping routines
482  */
483
484 typedef struct friendly {
485         char    *f_unfriendly;
486         char    *f_friendly;
487 } FriendlyMap;
488
489
490 /*
491  * handy macro to check whether LDAP struct is set up for CLDAP or not
492  */
493 #define LDAP_IS_CLDAP( ld )     ( (ld)->ld_sb.sb_naddr > 0 )
494
495
496 /*
497  * types for ldap URL handling
498  */
499 typedef struct ldap_url_desc {
500     char        *lud_host;
501     int         lud_port;
502     char        *lud_dn;
503     char        **lud_attrs;
504     int         lud_scope;
505     char        *lud_filter;
506     char        *lud_string;    /* for internal use only */
507 } LDAPURLDesc;
508 #define NULLLDAPURLDESC ((LDAPURLDesc *)NULL)
509
510 #define LDAP_URL_ERR_NOTLDAP    1       /* URL doesn't begin with "ldap://" */
511 #define LDAP_URL_ERR_NODN       2       /* URL has no DN (required) */
512 #define LDAP_URL_ERR_BADSCOPE   3       /* URL scope string is invalid */
513 #define LDAP_URL_ERR_MEM        4       /* can't allocate memory space */
514
515
516 #ifndef NEEDPROTOS
517 extern LDAP *ldap_open();
518 extern LDAP *ldap_init();
519 #ifdef STR_TRANSLATION
520 extern void ldap_set_string_translators();
521 #ifdef LDAP_CHARSET_8859
522 extern int ldap_t61_to_8859();
523 extern int ldap_8859_to_t61();
524 #endif /* LDAP_CHARSET_8859 */
525 #endif /* STR_TRANSLATION */
526 extern LDAPMessage *ldap_first_entry();
527 extern LDAPMessage *ldap_next_entry();
528 extern char *ldap_get_dn();
529 extern char *ldap_dn2ufn();
530 extern char **ldap_explode_dn();
531 extern char *ldap_first_attribute();
532 extern char *ldap_next_attribute();
533 extern char **ldap_get_values();
534 extern struct berval **ldap_get_values_len();
535 extern void ldap_value_free();
536 extern void ldap_value_free_len();
537 extern int ldap_count_values();
538 extern int ldap_count_values_len();
539 extern char *ldap_err2string();
540 extern void ldap_getfilter_free();
541 extern LDAPFiltDesc *ldap_init_getfilter();
542 extern LDAPFiltDesc *ldap_init_getfilter_buf();
543 extern LDAPFiltInfo *ldap_getfirstfilter();
544 extern LDAPFiltInfo *ldap_getnextfilter();
545 extern void ldap_setfilteraffixes();
546 extern void ldap_build_filter();
547 extern void ldap_flush_cache();
548 extern void ldap_set_cache_options();
549 extern void ldap_uncache_entry();
550 extern void ldap_uncache_request();
551 extern char *ldap_friendly_name();
552 extern void ldap_free_friendlymap();
553 extern LDAP *cldap_open();
554 extern void cldap_setretryinfo();
555 extern void cldap_close();
556 extern LDAPFiltDesc *ldap_ufn_setfilter();
557 extern int ldap_ufn_timeout();
558 extern int ldap_sort_entries();
559 extern int ldap_sort_values();
560 extern int ldap_sort_strcasecmp();
561 void ldap_free_urldesc();
562 void ldap_set_rebind_proc();
563 void ldap_enable_translation();
564
565
566 #if defined(ultrix) || defined(VMS) || defined( nextstep )
567 extern char *strdup();
568 #endif
569
570 #else /* NEEDPROTOS */
571 #if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK)
572 #include <sys/types.h>
573 #include <time.h>
574 #include <sys/time.h>
575 #endif
576 #if defined(WINSOCK)
577 #include "proto-ld.h"
578 #else
579 #include "proto-ldap.h"
580 #endif
581
582 #ifdef VMS
583 extern char *strdup( const char *s );
584 #endif
585 #if defined(ultrix) || defined( nextstep )
586 extern char *strdup();
587 #endif
588
589 #endif /* NEEDPROTOS */
590
591 #ifdef __cplusplus
592 }
593 #endif
594 #endif /* _LDAP_H */