1 .TH LDAP 3 "1 August 2001" "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 associated
36 The underlying session is established upon first use which is
37 commonly an LDAP bind operation. The LDAP bind operation is
39 .BR ldap_sasl_bind (3)
40 or one of its friends. Next, other operations are performed
41 by calling one of the synchronous or asynchronous routines (e.g.,
42 .BR ldap_search_ext_s (3)
44 .BR ldap_search_ext (3)
47 Results returned from these routines are interpreted by calling the
48 LDAP parsing routines such as
49 .BR ldap_parse_result (3).
50 The LDAP association and underlying connection is terminated by calling
51 .BR ldap_unbind_ext (3).
52 Errors can be interpreted by calling
53 .BR ldap_err2string (3).
55 Search filters to be passed to the ldap search routines are to be
56 constructed by hand and should conform to RFC 2254.
57 .SH DISPLAYING RESULTS
58 Results obtained from the ldap search routines can be output by hand,
60 .BR ldap_first_entry (3)
62 .BR ldap_next_entry (3)
65 .BR ldap_first_attribute (3)
67 .BR ldap_next_attribute (3)
68 to step through an entry's attributes, and
69 .BR ldap_get_values (3)
70 to retrieve a given attribute's value. Attribute values
71 may or may not be displayable.
72 .SH UNIFORM RESOURCE LOCATORS (URLS)
75 routines can be used test a URL to see if it is an LDAP URL, to parse LDAP
76 URLs into their component pieces, and to initiate searches directly using
81 routines implement a local client caching scheme,
82 providing a substantial performance increase for repeated queries.
83 Caching is experiemental.
85 Also provided are various utility routines. The
87 routines are used to sort the entries and values returned via
88 the ldap search routines.
90 Also included in the distribution is a set of lightweight Basic
91 Encoding Rules routines. These routines are used by the LDAP library
92 routines to encode and decode LDAP protocol elements using the
93 (slightly simplified) Basic Encoding Rules defined by LDAP. They are
94 not normally used directly by an LDAP application program except
95 in the handling of controls and extended operations. The
96 routines provide a printf and scanf\-like interface, as well as
97 lower\-level access. These routines are discussed in
100 .BR lber\-memory (3),
106 open a connection to an LDAP server
109 initialize the LDAP library without opening a connection to a server
112 wait for the result from an asynchronous operation
115 abandon (abort) an asynchronous operation
118 asynchronously add an entry
121 synchronously add an entry
124 asynchronously bind to the directory
127 synchronously bind to the directory
129 .SM ldap_simple_bind(3)
130 asynchronously bind to the directory using simple authentication
132 .SM ldap_simple_bind_s(3)
133 synchronously bind to the directory using simple authentication
136 synchronously unbind from the LDAP server and close the connection
143 dispose of memory allocated by LDAP routines.
145 .SM ldap_enable_cache(3)
146 enable LDAP client caching
148 .SM ldap_disable_cache(3)
149 disable LDAP client caching
151 .SM ldap_destroy_cache(3)
152 disable LDAP client caching and destroy cache contents
154 .SM ldap_flush_cache(3)
155 flush LDAP client cache
157 .SM ldap_uncache_entry(3)
158 uncache requests pertaining to an entry
160 .SM ldap_uncache_request(3)
163 .SM ldap_set_cache_options(3)
167 asynchronous compare to a directory entry
169 .SM ldap_compare_s(3)
170 synchronous compare to a directory entry
173 asynchronously delete an entry
176 synchronously delete an entry
179 print an LDAP error indication to standard error
182 LDAP error indication
184 .SM ldap_result2error(3)
185 extract LDAP error indication from LDAP result
188 list of ldap errors and their meanings
190 .SM ldap_err2string(3)
191 convert LDAP error indication to a string
193 .SM ldap_first_attribute(3)
194 return first attribute name in an entry
196 .SM ldap_next_attribute(3)
197 return next attribute name in an entry
199 .SM ldap_first_entry(3)
200 return first entry in a chain of search results
202 .SM ldap_next_entry(3)
203 return next entry in a chain of search results
205 .SM ldap_count_entries(3)
206 return number of entries in a search result
209 extract the DN from an entry
211 .SM ldap_explode_dn(3)
212 convert a DN into its component parts
214 .SM ldap_explode_rdn(3)
215 convert a RDN into its component parts
217 .SM ldap_get_values(3)
218 return an attribute's values
220 .SM ldap_get_values_len(3)
221 return an attribute values with lengths
223 .SM ldap_value_free(3)
224 free memory allocated by ldap_get_values(3)
226 .SM ldap_value_free_len(3)
227 free memory allocated by ldap_get_values_len(3)
229 .SM ldap_count_values(3)
230 return number of values
232 .SM ldap_count_values_len(3)
233 return number of values
236 asynchronously modify an entry
239 synchronously modify an entry
241 .SM ldap_mods_free(3)
242 free array of pointers to mod structures used by ldap_modify(3)
245 asynchronously modify the RDN of an entry
247 .SM ldap_modrdn2_s(3)
248 synchronously modify the RDN of an entry
251 deprecated - use ldap_modrdn2(3)
254 depreciated - use ldap_modrdn2_s(3)
257 free results allocated by ldap_result(3)
260 return the message type of a message from ldap_result(3)
263 return the message id of a message from ldap_result(3)
266 asynchronously search the directory
269 synchronously search the directory
271 .SM ldap_search_st(3)
272 synchronously search the directory with timeout
274 .SM ldap_is_ldap_url(3)
275 check a URL string to see if it is an LDAP URL
277 .SM ldap_url_parse(3)
278 break up an LDAP URL string into its components
280 .SM ldap_sort_entries(3)
281 sort a list of search results
283 .SM ldap_sort_values(3)
284 sort a list of attribute values
286 .SM ldap_sort_strcasecmp(3)
287 case insensitive string comparison
290 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
293 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
295 is derived from University of Michigan LDAP 3.3 Release.
297 These API manual pages are based upon descriptions provided in the
298 IETF C LDAP API Internet Draft, a work in progress, edited by