1 .TH LDAP 3 "21 July 2000" "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 part of a distributed directory service. This API supports
18 LDAP over TCP, LDAP over SSL, and LDAP over IPC (UNIX domain
21 The OpenLDAP LDAP 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.
100 Also provided are various utility routines. The
102 routines are used to sort the entries and values returned via
103 the ldap search routines. The
104 .BR ldap_friendly (3)
106 used to map from short two letter country codes (or other strings)
107 to longer "friendlier" names.
109 Also included in the distribution is a set of lightweight Basic
110 Encoding Rules routines. These routines are used by the LDAP library
111 routines to encode and decode LDAP protocol elements using the
112 (slightly simplified) Basic Encoding Rules defined by LDAP. They are
113 not normally used directly by an LDAP application program excepting
114 in the handling of controls and extended operations. The
115 routines provide a printf and scanf-like interface, as well as
116 lower-level access. These routines are found in the -llber
121 open a connection to an LDAP server
124 initialize the LDAP library without opening a connection to a server
127 wait for the result from an asynchronous operation
130 abandon (abort) an asynchronous operation
133 asynchronously add an entry
136 synchronously add an entry
139 asynchronously bind to the directory
142 synchronously bind to the directory
144 .SM ldap_simple_bind(3)
145 asynchronously bind to the directory using simple authentication
147 .SM ldap_simple_bind_s(3)
148 synchronously bind to the directory using simple authentication
150 .SM ldap_kerberos_bind_s(3)
151 synchronously bind to the directory using kerberos authentication
153 .SM ldap_kerberos_bind1(3)
154 asynchronously bind to the LDAP server using kerberos authentication
156 .SM ldap_kerberos_bind1_s(3)
157 synchronously bind to the LDAP server using kerberos authentication
159 .SM ldap_kerberos_bind2(3)
160 asynchronously bind to the DSA using kerberos authentication
162 .SM ldap_kerberos_bind2_s(3)
163 synchronously bind to the DSA using kerberos authentication
166 synchronously unbind from the LDAP server and close the connection
173 dispose of memory allocated by LDAP routines.
175 .SM ldap_enable_cache(3)
176 enable LDAP client caching
178 .SM ldap_disable_cache(3)
179 disable LDAP client caching
181 .SM ldap_destroy_cache(3)
182 disable LDAP client caching and destroy cache contents
184 .SM ldap_flush_cache(3)
185 flush LDAP client cache
187 .SM ldap_uncache_entry(3)
188 uncache requests pertaining to an entry
190 .SM ldap_uncache_request(3)
193 .SM ldap_set_cache_options(3)
197 asynchronous compare to a directory entry
199 .SM ldap_compare_s(3)
200 synchronous compare to a directory entry
203 asynchronously delete an entry
206 synchronously delete an entry
208 .SM ldap_init_templates(3)
209 initialize display template routines from a file
211 .SM ldap_init_templates_buf(3)
212 initialize display template routines from a buffer
214 .SM ldap_free_templates(3)
215 free display template routine memory
217 .SM ldap_first_disptmpl(3)
218 get first display template
220 .SM ldap_next_disptmpl(3)
221 get next display template
223 .SM ldap_oc2template(3)
224 return template appropriate for objectclass
226 .SM ldap_name2template(3)
227 return named template
229 .SM ldap_tmplattrs(3)
230 return attributes needed by template
232 .SM ldap_first_tmplrow(3)
233 return first row of displayable items in a template
235 .SM ldap_next_tmplrow(3)
236 return next row of displayable items in a template
238 .SM ldap_first_tmplcol(3)
239 return first column of displayable items in a template
241 .SM ldap_next_tmplcol(3)
242 return next column of displayable items in a template
244 .SM ldap_entry2text(3)
245 display an entry as text using a display template
247 .SM ldap_entry2text_search(3)
248 search for and display an entry as text using a display template
250 .SM ldap_vals2text(3)
251 display values as text
253 .SM ldap_entry2html(3)
254 display an entry as HTML (HyperText Markup Language) using a display template
256 .SM ldap_entry2html_search(3)
257 search for and display an entry as HTML using a display template
259 .SM ldap_vals2html(3)
260 display values as HTML
263 print an LDAP error indication to standard error
266 LDAP error indication
268 .SM ldap_result2error(3)
269 extract LDAP error indication from LDAP result
272 list of ldap errors and their meanings
274 .SM ldap_err2string(3)
275 convert LDAP error indication to a string
277 .SM ldap_first_attribute(3)
278 return first attribute name in an entry
280 .SM ldap_next_attribute(3)
281 return next attribute name in an entry
283 .SM ldap_first_entry(3)
284 return first entry in a chain of search results
286 .SM ldap_next_entry(3)
287 return next entry in a chain of search results
289 .SM ldap_count_entries(3)
290 return number of entries in a search result
292 .SM ldap_friendly_name(3)
293 map from unfriendly to friendly names
295 .SM ldap_free_friendlymap(3)
296 free resources used by ldap_friendly(3)
299 extract the DN from an entry
301 .SM ldap_explode_dn(3)
302 convert a DN into its component parts
304 .SM ldap_explode_rdn(3)
305 convert a RDN into its component parts
307 .SM ldap_get_values(3)
308 return an attribute's values
310 .SM ldap_get_values_len(3)
311 return an attribute values with lengths
313 .SM ldap_value_free(3)
314 free memory allocated by ldap_get_values(3)
316 .SM ldap_value_free_len(3)
317 free memory allocated by ldap_get_values_len(3)
319 .SM ldap_count_values(3)
320 return number of values
322 .SM ldap_count_values_len(3)
323 return number of values
325 .SM ldap_init_getfilter(3)
326 initialize getfilter routines from a file
328 .SM ldap_init_getfilter_buf(3)
329 initialize getfilter routines from a buffer
331 .SM ldap_getfilter_free(3)
332 free resources allocated by ldap_init_getfilter(3)
334 .SM ldap_getfirstfilter(3)
335 return first search filter
337 .SM ldap_getnextfilter(3)
338 return next search filter
340 .SM ldap_build_filter(3)
341 construct an LDAP search filter from a pattern
343 .SM ldap_setfilteraffixes(3)
344 set prefix and suffix for search filters
347 asynchronously modify an entry
350 synchronously modify an entry
352 .SM ldap_mods_free(3)
353 free array of pointers to mod structures used by ldap_modify(3)
356 asynchronously modify the RDN of an entry
358 .SM ldap_modrdn2_s(3)
359 synchronously modify the RDN of an entry
362 depreciated - use ldap_modrdn2(3)
365 depreciated - use ldap_modrdn2_s(3)
368 free results allocated by ldap_result(3)
371 return the message type of a message from ldap_result(3)
374 return the message id of a message from ldap_result(3)
377 asynchronously search the directory
380 synchronously search the directory
382 .SM ldap_search_st(3)
383 synchronously search the directory with timeout
385 .SM ldap_is_ldap_url(3)
386 check a URL string to see if it is an LDAP URL
388 .SM ldap_url_parse(3)
389 break up an LDAP URL string into its components
391 .SM ldap_url_search(3)
392 asynchronously search using an LDAP URL
394 .SM ldap_url_search_s(3)
395 synchronously search using an LDAP URL
397 .SM ldap_url_search_st(3)
398 synchronously search using an LDAP URL and a timeout
400 .SM ldap_init_searchprefs(3)
401 initialize searchprefs routines from a file
403 .SM ldap_init_searchprefs_buf(3)
404 initialize searchprefs routines from a buffer
406 .SM ldap_free_searchprefs(3)
407 free memory allocated by searchprefs routines
409 .SM ldap_first_searchobj(3)
410 return first searchpref object
412 .SM ldap_next_searchobj(3)
413 return next searchpref object
415 .SM ldap_sort_entries(3)
416 sort a list of search results
418 .SM ldap_sort_values(3)
419 sort a list of attribute values
421 .SM ldap_sort_strcasecmp(3)
422 case insensitive string comparison
427 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
429 is derived from University of Michigan LDAP 3.3 Release.