Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

592 lines
18 KiB

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