1 .TH LDAP 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2002 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap - OpenLDAP Lightweight Directory Access Protocol API
15 The Lightweight Directory Access Protocol provides access to X.500
16 directory services. The services may be stand\-alone or part of
17 a distributed directory service. This API supports LDAP over TCP
18 (RFC2251), LDAP over SSL, and LDAP over IPC (UNIX domain sockets).
19 This API supports SASL (RFC2829) and Start TLS (RFC2830). This
20 API is based upon IETF C LDAP API draft specification, a work in
23 The OpenLDAP Software package includes a stand\-alone server in
25 various LDAP clients, and an LDAP client library used to provide
26 programmatic access to the LDAP protocol. This man page gives an
27 overview of the LDAP library routines.
29 Both synchronous and asynchronous APIs are provided. Also included are
30 various routines to parse the results returned from these routines.
31 These routines are found in the \-lldap library.
33 The basic interaction is as follows. A session handle is
37 .BR ldap_initialize (3).
39 .BR ldap_initialize (3)
40 routine is preferred, but is not part of the draft specification.)
41 The underlying session is established upon first use which is
42 commonly an LDAP bind operation. The LDAP bind operation is
44 .BR ldap_sasl_bind (3)
45 or one of its friends. Next, other operations are performed
46 by calling one of the synchronous or asynchronous routines (e.g.,
47 .BR ldap_search_ext_s (3)
49 .BR ldap_search_ext (3)
52 Results returned from these routines are interpreted by calling the
53 LDAP parsing routines such as
54 .BR ldap_parse_result (3).
55 The LDAP association and underlying connection is terminated by calling
56 .BR ldap_unbind_ext (3).
57 Errors can be interpreted by calling
58 .BR ldap_err2string (3).
60 Search filters to be passed to the ldap search routines are to be
61 constructed by hand and should conform to RFC 2254.
62 .SH DISPLAYING RESULTS
63 Results obtained from the ldap search routines can be output by hand,
65 .BR ldap_first_entry (3)
67 .BR ldap_next_entry (3)
70 .BR ldap_first_attribute (3)
72 .BR ldap_next_attribute (3)
73 to step through an entry's attributes, and
74 .BR ldap_get_values (3)
75 to retrieve a given attribute's values. Attribute values
76 may or may not be displayable.
78 This library supports both LDAP Version 2 and Version 3, with the Version 2
79 protocol selected by default.
80 LDAP Version 3 operations can be extended through the use of controls. Controls
81 can be sent to a server or returned to the client with any LDAP message.
82 Extended versions of the standard routines are available for use with
83 controls. These routines are generally named by adding
85 to the regular routine's name.
86 .SH UNIFORM RESOURCE LOCATORS (URLS)
89 routines can be used to test a URL to see if it is an LDAP URL, to parse LDAP
90 URLs into their component pieces, and to initiate searches directly using
95 routines implement a local client caching scheme,
96 providing a substantial performance increase for repeated queries.
97 Caching is experiemental.
99 Also provided are various utility routines. The
101 routines are used to sort the entries and values returned via
102 the ldap search routines.
104 Also included in the distribution is a set of lightweight Basic
105 Encoding Rules routines. These routines are used by the LDAP library
106 routines to encode and decode LDAP protocol elements using the
107 (slightly simplified) Basic Encoding Rules defined by LDAP. They are
108 not normally used directly by an LDAP application program except
109 in the handling of controls and extended operations. The
110 routines provide a printf and scanf\-like interface, as well as
111 lower\-level access. These routines are discussed in
112 .BR lber\-decode (3),
113 .BR lber\-encode (3),
114 .BR lber\-memory (3),
120 open a connection to an LDAP server (deprecated, use
124 initialize the LDAP library without opening a connection to a server
126 .SM ldap_initialize(3)
127 initialize the LDAP library without opening a connection to a server
130 wait for the result from an asynchronous operation
133 abandon (abort) an asynchronous operation
136 asynchronously add an entry
139 synchronously add an entry
142 asynchronously bind to the directory
145 synchronously bind to the directory
147 .SM ldap_simple_bind(3)
148 asynchronously bind to the directory using simple authentication
150 .SM ldap_simple_bind_s(3)
151 synchronously bind to the directory using simple authentication
154 synchronously unbind from the LDAP server and close the connection
161 dispose of memory allocated by LDAP routines.
163 .SM ldap_enable_cache(3)
164 enable LDAP client caching
166 .SM ldap_disable_cache(3)
167 disable LDAP client caching
169 .SM ldap_destroy_cache(3)
170 disable LDAP client caching and destroy cache contents
172 .SM ldap_flush_cache(3)
173 flush LDAP client cache
175 .SM ldap_uncache_entry(3)
176 uncache requests pertaining to an entry
178 .SM ldap_uncache_request(3)
181 .SM ldap_set_cache_options(3)
185 asynchronously compare to a directory entry
187 .SM ldap_compare_s(3)
188 synchronously compare to a directory entry
191 asynchronously delete an entry
194 synchronously delete an entry
197 print an LDAP error indication to standard error
200 LDAP error indication
202 .SM ldap_result2error(3)
203 extract LDAP error indication from LDAP result
206 list of LDAP errors and their meanings
208 .SM ldap_err2string(3)
209 convert LDAP error indication to a string
211 .SM ldap_first_attribute(3)
212 return first attribute name in an entry
214 .SM ldap_next_attribute(3)
215 return next attribute name in an entry
217 .SM ldap_first_entry(3)
218 return first entry in a chain of search results
220 .SM ldap_next_entry(3)
221 return next entry in a chain of search results
223 .SM ldap_count_entries(3)
224 return number of entries in a search result
227 extract the DN from an entry
229 .SM ldap_explode_dn(3)
230 convert a DN into its component parts
232 .SM ldap_explode_rdn(3)
233 convert an RDN into its component parts
235 .SM ldap_get_values(3)
236 return an attribute's values
238 .SM ldap_get_values_len(3)
239 return an attribute's values with lengths
241 .SM ldap_value_free(3)
242 free memory allocated by ldap_get_values(3)
244 .SM ldap_value_free_len(3)
245 free memory allocated by ldap_get_values_len(3)
247 .SM ldap_count_values(3)
248 return number of values
250 .SM ldap_count_values_len(3)
251 return number of values
254 asynchronously modify an entry
257 synchronously modify an entry
259 .SM ldap_mods_free(3)
260 free array of pointers to mod structures used by ldap_modify(3)
263 asynchronously modify the RDN of an entry
265 .SM ldap_modrdn2_s(3)
266 synchronously modify the RDN of an entry
269 deprecated - use ldap_modrdn2(3)
272 depreciated - use ldap_modrdn2_s(3)
275 free results allocated by ldap_result(3)
278 return the message type of a message from ldap_result(3)
281 return the message id of a message from ldap_result(3)
284 asynchronously search the directory
287 synchronously search the directory
289 .SM ldap_search_st(3)
290 synchronously search the directory with timeout
292 .SM ldap_is_ldap_url(3)
293 check a URL string to see if it is an LDAP URL
295 .SM ldap_url_parse(3)
296 break up an LDAP URL string into its components
298 .SM ldap_sort_entries(3)
299 sort a list of search results
301 .SM ldap_sort_values(3)
302 sort a list of attribute values
304 .SM ldap_sort_strcasecmp(3)
305 case insensitive string comparison
308 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
311 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
313 is derived from University of Michigan LDAP 3.3 Release.
315 These API manual pages are based upon descriptions provided in the
316 IETF C LDAP API Internet Draft, a work in progress, edited by