1 .TH LDAP 3 "1 August 2001" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2000 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
16 X.500 directory services. The services may be stand\-alone
17 or part of a distributed directory service. This API supports
18 LDAP over TCP (RFC2251), LDAP over SSL, and LDAP over IPC (UNIX domain
19 sockets). This API supports SASL (RFC2829) and Start TLS (RFC2830).
21 The OpenLDAP Software package includes a stand-alone server in
23 various LDAP clients, and an LDAP client library used to provide
24 programmatic access to the LDAP protocol. This man page gives an
25 overview of the LDAP library routines.
27 Both synchronous and asynchronous APIs are provided. Also included are
28 various routines to parse the results returned from these routines.
29 These routines are found in the \-lldap library.
31 The basic interaction is as follows. A session handle associated
34 The underlying session is established upon first use which is
35 commonly an LDAP bind operation. The LDAP bind operation is
36 performed by calling one of
37 .BR ldap_sasl_bind (3)
38 and friends. Next, other operations are performed
39 by calling one of the synchronous or asynchronous routines (e.g.,
40 .BR ldap_search_ext_s (3)
42 .BR ldap_search_ext (3)
45 Results returned from these routines are interpreted by calling the
46 LDAP parsing routines such as
47 .BR ldap_parse_result (3).
48 The LDAP association and underlying connection is terminated by calling
49 .BR ldap_unbind_ext (3).
50 Errors can be interpreted by calling
51 .BR ldap_err2string (3).
53 Search filters to be passed to the ldap search routines can be
54 constructed by hand, or by calling the
55 .BR ldap_getfilter (3)
56 routines, which use the
57 .BR ldapgetfilter.conf (5)
58 file to turn a string (presumably that a user has typed) into a series
60 .SH DISPLAYING RESULTS
61 Results obtained from the ldap search routines can be output by hand,
63 .BR ldap_first_entry (3)
65 .BR ldap_next_entry (3)
68 .BR ldap_first_attribute (3)
70 .BR ldap_next_attribute (3)
71 to step through an entry's attributes, and
72 .BR ldap_get_values (3)
73 to retrieve a given attribute's value. Attribute values
74 may or may not be displayable.
76 Alternatively, the entry can be output automatically by calling
78 .BR ldap_entry2text (3),
79 .BR ldap_entry2text_search (3),
80 .BR ldap_entry2html (3),
82 .BR ldap_entry2html_search (3)
83 routines. These routines look up the object
84 class of the entry they are passed in the
85 .BR ldaptemplates.conf (5)
86 file to decide which attributes to display and how to display them.
87 Output is handled via a routine passed in as a parameter.
88 .SH UNIFORM RESOURCE LOCATORS (URLS)
91 routines can be used test a URL to see if it is an LDAP URL, to parse LDAP
92 URLs into their component pieces, and to initiate searches directly using
97 routines implement a local client caching scheme,
98 providing a substantial performance increase for repeated queries.
99 Caching is experiemental.
101 Also provided are various utility routines. The
103 routines are used to sort the entries and values returned via
104 the ldap search routines. The
105 .BR ldap_friendly (3)
107 used to map from short two letter country codes (or other strings)
108 to longer "friendlier" names.
110 Also included in the distribution is a set of lightweight Basic
111 Encoding Rules routines. These routines are used by the LDAP library
112 routines to encode and decode LDAP protocol elements using the
113 (slightly simplified) Basic Encoding Rules defined by LDAP. They are
114 not normally used directly by an LDAP application program except
115 in the handling of controls and extended operations. The
116 routines provide a printf and scanf-like interface, as well as
117 lower-level access. These routines are found in the -llber
122 open a connection to an LDAP server
125 initialize the LDAP library without opening a connection to a server
128 wait for the result from an asynchronous operation
131 abandon (abort) an asynchronous operation
134 asynchronously add an entry
137 synchronously add an entry
140 asynchronously bind to the directory
143 synchronously bind to the directory
145 .SM ldap_simple_bind(3)
146 asynchronously bind to the directory using simple authentication
148 .SM ldap_simple_bind_s(3)
149 synchronously bind to the directory using simple authentication
152 synchronously unbind from the LDAP server and close the connection
159 dispose of memory allocated by LDAP routines.
161 .SM ldap_enable_cache(3)
162 enable LDAP client caching
164 .SM ldap_disable_cache(3)
165 disable LDAP client caching
167 .SM ldap_destroy_cache(3)
168 disable LDAP client caching and destroy cache contents
170 .SM ldap_flush_cache(3)
171 flush LDAP client cache
173 .SM ldap_uncache_entry(3)
174 uncache requests pertaining to an entry
176 .SM ldap_uncache_request(3)
179 .SM ldap_set_cache_options(3)
183 asynchronous compare to a directory entry
185 .SM ldap_compare_s(3)
186 synchronous compare to a directory entry
189 asynchronously delete an entry
192 synchronously delete an entry
194 .SM ldap_init_templates(3)
195 initialize display template routines from a file
197 .SM ldap_init_templates_buf(3)
198 initialize display template routines from a buffer
200 .SM ldap_free_templates(3)
201 free display template routine memory
203 .SM ldap_first_disptmpl(3)
204 get first display template
206 .SM ldap_next_disptmpl(3)
207 get next display template
209 .SM ldap_oc2template(3)
210 return template appropriate for objectclass
212 .SM ldap_name2template(3)
213 return named template
215 .SM ldap_tmplattrs(3)
216 return attributes needed by template
218 .SM ldap_first_tmplrow(3)
219 return first row of displayable items in a template
221 .SM ldap_next_tmplrow(3)
222 return next row of displayable items in a template
224 .SM ldap_first_tmplcol(3)
225 return first column of displayable items in a template
227 .SM ldap_next_tmplcol(3)
228 return next column of displayable items in a template
230 .SM ldap_entry2text(3)
231 display an entry as text using a display template
233 .SM ldap_entry2text_search(3)
234 search for and display an entry as text using a display template
236 .SM ldap_vals2text(3)
237 display values as text
239 .SM ldap_entry2html(3)
240 display an entry as HTML (HyperText Markup Language) using a display template
242 .SM ldap_entry2html_search(3)
243 search for and display an entry as HTML using a display template
245 .SM ldap_vals2html(3)
246 display values as HTML
249 print an LDAP error indication to standard error
252 LDAP error indication
254 .SM ldap_result2error(3)
255 extract LDAP error indication from LDAP result
258 list of ldap errors and their meanings
260 .SM ldap_err2string(3)
261 convert LDAP error indication to a string
263 .SM ldap_first_attribute(3)
264 return first attribute name in an entry
266 .SM ldap_next_attribute(3)
267 return next attribute name in an entry
269 .SM ldap_first_entry(3)
270 return first entry in a chain of search results
272 .SM ldap_next_entry(3)
273 return next entry in a chain of search results
275 .SM ldap_count_entries(3)
276 return number of entries in a search result
278 .SM ldap_friendly_name(3)
279 map from unfriendly to friendly names
281 .SM ldap_free_friendlymap(3)
282 free resources used by ldap_friendly(3)
285 extract the DN from an entry
287 .SM ldap_explode_dn(3)
288 convert a DN into its component parts
290 .SM ldap_explode_rdn(3)
291 convert a RDN into its component parts
293 .SM ldap_get_values(3)
294 return an attribute's values
296 .SM ldap_get_values_len(3)
297 return an attribute values with lengths
299 .SM ldap_value_free(3)
300 free memory allocated by ldap_get_values(3)
302 .SM ldap_value_free_len(3)
303 free memory allocated by ldap_get_values_len(3)
305 .SM ldap_count_values(3)
306 return number of values
308 .SM ldap_count_values_len(3)
309 return number of values
311 .SM ldap_init_getfilter(3)
312 initialize getfilter routines from a file
314 .SM ldap_init_getfilter_buf(3)
315 initialize getfilter routines from a buffer
317 .SM ldap_getfilter_free(3)
318 free resources allocated by ldap_init_getfilter(3)
320 .SM ldap_getfirstfilter(3)
321 return first search filter
323 .SM ldap_getnextfilter(3)
324 return next search filter
326 .SM ldap_build_filter(3)
327 construct an LDAP search filter from a pattern
329 .SM ldap_setfilteraffixes(3)
330 set prefix and suffix for search filters
333 asynchronously modify an entry
336 synchronously modify an entry
338 .SM ldap_mods_free(3)
339 free array of pointers to mod structures used by ldap_modify(3)
342 asynchronously modify the RDN of an entry
344 .SM ldap_modrdn2_s(3)
345 synchronously modify the RDN of an entry
348 depreciated - use ldap_modrdn2(3)
351 depreciated - use ldap_modrdn2_s(3)
354 free results allocated by ldap_result(3)
357 return the message type of a message from ldap_result(3)
360 return the message id of a message from ldap_result(3)
363 asynchronously search the directory
366 synchronously search the directory
368 .SM ldap_search_st(3)
369 synchronously search the directory with timeout
371 .SM ldap_is_ldap_url(3)
372 check a URL string to see if it is an LDAP URL
374 .SM ldap_url_parse(3)
375 break up an LDAP URL string into its components
377 .SM ldap_init_searchprefs(3)
378 initialize searchprefs routines from a file
380 .SM ldap_init_searchprefs_buf(3)
381 initialize searchprefs routines from a buffer
383 .SM ldap_free_searchprefs(3)
384 free memory allocated by searchprefs routines
386 .SM ldap_first_searchobj(3)
387 return first searchpref object
389 .SM ldap_next_searchobj(3)
390 return next searchpref object
392 .SM ldap_sort_entries(3)
393 sort a list of search results
395 .SM ldap_sort_values(3)
396 sort a list of attribute values
398 .SM ldap_sort_strcasecmp(3)
399 case insensitive string comparison
404 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
406 is derived from University of Michigan LDAP 3.3 Release.