]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap.3
Happy new year
[openldap] / doc / man / man3 / ldap.3
1 .TH LDAP 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2003 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldap - OpenLDAP Lightweight Directory Access Protocol API
7 .SH LIBRARY
8 OpenLDAP LDAP (libldap, -lldap)
9 .SH SYNOPSIS
10 .nf
11 .ft B
12 #include <ldap.h>
13 .ft
14 .fi
15 .SH DESCRIPTION
16 .LP
17 The Lightweight Directory Access Protocol provides access to X.500
18 directory services.  The services may be stand\-alone or part of
19 a distributed directory service.  This API supports LDAP over TCP
20 (RFC2251), LDAP over SSL, and LDAP over IPC (UNIX domain sockets).
21 This API supports SASL (RFC2829) and Start TLS (RFC2830).  This
22 API is based upon IETF C LDAP API draft specification, a work in
23 progress.
24 .LP
25 The OpenLDAP Software package includes a stand\-alone server in
26 .BR slapd (8),
27 various LDAP clients, and an LDAP client library used to provide
28 programmatic access to the LDAP protocol. This man page gives an
29 overview of the LDAP library routines.
30 .LP
31 Both synchronous and asynchronous APIs are provided.  Also included are
32 various routines to parse the results returned from these routines.
33 These routines are found in the \-lldap library.
34 .LP
35 The basic interaction is as follows.  A session handle is
36 created using
37 .BR ldap_init (3)
38 or
39 .BR ldap_initialize (3).
40 (The
41 .BR ldap_initialize (3)
42 routine is preferred, but is not part of the draft specification.)
43 The underlying session is established upon first use which is
44 commonly an LDAP bind operation.  The LDAP bind operation is
45 performed by calling
46 .BR ldap_sasl_bind (3)
47 or one of its friends.  Next, other operations are performed
48 by calling one of the synchronous or asynchronous routines (e.g.,
49 .BR ldap_search_ext_s (3)
50 or
51 .BR ldap_search_ext (3)
52 followed by
53 .BR ldap_result (3)).
54 Results returned from these routines are interpreted by calling the
55 LDAP parsing routines such as
56 .BR ldap_parse_result (3).
57 The LDAP association and underlying connection is terminated by calling
58 .BR ldap_unbind_ext (3).
59 Errors can be interpreted by calling
60 .BR ldap_err2string (3).
61 .SH SEARCH FILTERS
62 Search filters to be passed to the ldap search routines are to be
63 constructed by hand and should conform to RFC 2254.
64 .SH DISPLAYING RESULTS
65 Results obtained from the ldap search routines can be output by hand,
66 by calling
67 .BR ldap_first_entry (3)
68 and
69 .BR ldap_next_entry (3)
70 to step through
71 the entries returned,
72 .BR ldap_first_attribute (3)
73 and
74 .BR ldap_next_attribute (3)
75 to step through an entry's attributes, and
76 .BR ldap_get_values (3)
77 to retrieve a given attribute's values.  Attribute values
78 may or may not be displayable.
79 .SH CONTROLS
80 This library supports both LDAP Version 2 and Version 3, with the Version 2
81 protocol selected by default.
82 LDAP Version 3 operations can be extended through the use of controls. Controls
83 can be sent to a server or returned to the client with any LDAP message.
84 Extended versions of the standard routines are available for use with
85 controls. These routines are generally named by adding
86 .BR _ext
87 to the regular routine's name.
88 .SH UNIFORM RESOURCE LOCATORS (URLS)
89 The
90 .BR ldap_url (3)
91 routines can be used to 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
93 an LDAP URL.
94 .SH CACHING
95 The
96 .BR ldap_cache (3)
97 routines implement a local client caching scheme,
98 providing a substantial performance increase for repeated queries.
99 Caching is experiemental.
100 .SH UTILITY ROUTINES
101 Also provided are various utility routines.  The
102 .BR ldap_sort (3)
103 routines are used to sort the entries and values returned via
104 the ldap search routines. 
105 .SH BER LIBRARY
106 Also included in the distribution is a set of lightweight Basic
107 Encoding Rules routines.  These routines are used by the LDAP library
108 routines to encode and decode LDAP protocol elements using the
109 (slightly simplified) Basic Encoding Rules defined by LDAP.  They are
110 not normally used directly by an LDAP application program except
111 in the handling of controls and extended operations.  The
112 routines provide a printf and scanf\-like interface, as well as
113 lower\-level access.  These routines are discussed in
114 .BR lber\-decode (3),
115 .BR lber\-encode (3),
116 .BR lber\-memory (3),
117 and
118 .BR lber\-types (3).
119 .SH INDEX
120 .TP 20
121 .SM ldap_open(3)
122 open a connection to an LDAP server (deprecated, use
123 .BR ldap_init (3))
124 .TP
125 .SM ldap_init(3)
126 initialize the LDAP library without opening a connection to a server
127 .TP
128 .SM ldap_initialize(3)
129 initialize the LDAP library without opening a connection to a server
130 .TP
131 .SM ldap_result(3)
132 wait for the result from an asynchronous operation
133 .TP
134 .SM ldap_abandon(3)
135 abandon (abort) an asynchronous operation
136 .TP
137 .SM ldap_add(3)
138 asynchronously add an entry
139 .TP
140 .SM ldap_add_s(3)
141 synchronously add an entry
142 .TP
143 .SM ldap_bind(3)
144 asynchronously bind to the directory
145 .TP
146 .SM ldap_bind_s(3)
147 synchronously bind to the directory
148 .TP
149 .SM ldap_simple_bind(3)
150 asynchronously bind to the directory using simple authentication
151 .TP
152 .SM ldap_simple_bind_s(3)
153 synchronously bind to the directory using simple authentication
154 .TP
155 .SM ldap_unbind(3)
156 synchronously unbind from the LDAP server and close the connection
157 .TP
158 .SM ldap_unbind_s(3)
159 equivalent to
160 .BR ldap_unbind (3)
161 .TP
162 .SM ldap_memfree(3)
163 dispose of memory allocated by LDAP routines.
164 .TP
165 .SM ldap_enable_cache(3)
166 enable LDAP client caching
167 .TP
168 .SM ldap_disable_cache(3)
169 disable LDAP client caching
170 .TP
171 .SM ldap_destroy_cache(3)
172 disable LDAP client caching and destroy cache contents
173 .TP
174 .SM ldap_flush_cache(3)
175 flush LDAP client cache
176 .TP
177 .SM ldap_uncache_entry(3)
178 uncache requests pertaining to an entry
179 .TP
180 .SM ldap_uncache_request(3)
181 uncache a request
182 .TP
183 .SM ldap_set_cache_options(3)
184 set cache options
185 .TP
186 .SM ldap_compare(3)
187 asynchronously compare to a directory entry
188 .TP
189 .SM ldap_compare_s(3)
190 synchronously compare to a directory entry
191 .TP
192 .SM ldap_delete(3)
193 asynchronously delete an entry
194 .TP
195 .SM ldap_delete_s(3)
196 synchronously delete an entry
197 .TP
198 .SM ldap_perror(3)
199 print an LDAP error indication to standard error
200 .TP
201 .SM ld_errno(3)
202 LDAP error indication
203 .TP
204 .SM ldap_result2error(3)
205 extract LDAP error indication from LDAP result
206 .TP
207 .SM ldap_errlist(3)
208 list of LDAP errors and their meanings
209 .TP
210 .SM ldap_err2string(3)
211 convert LDAP error indication to a string
212 .TP
213 .SM ldap_first_attribute(3)
214 return first attribute name in an entry
215 .TP
216 .SM ldap_next_attribute(3)
217 return next attribute name in an entry
218 .TP
219 .SM ldap_first_entry(3)
220 return first entry in a chain of search results
221 .TP
222 .SM ldap_next_entry(3)
223 return next entry in a chain of search results
224 .TP
225 .SM ldap_count_entries(3)
226 return number of entries in a search result
227 .TP
228 .SM ldap_get_dn(3)
229 extract the DN from an entry
230 .TP
231 .SM ldap_explode_dn(3)
232 convert a DN into its component parts
233 .TP
234 .SM ldap_explode_rdn(3)
235 convert an RDN into its component parts
236 .TP
237 .SM ldap_get_values(3)
238 return an attribute's values
239 .TP
240 .SM ldap_get_values_len(3)
241 return an attribute's values with lengths
242 .TP
243 .SM ldap_value_free(3)
244 free memory allocated by ldap_get_values(3)
245 .TP
246 .SM ldap_value_free_len(3)
247 free memory allocated by ldap_get_values_len(3)
248 .TP
249 .SM ldap_count_values(3)
250 return number of values
251 .TP
252 .SM ldap_count_values_len(3)
253 return number of values
254 .TP
255 .SM ldap_modify(3)
256 asynchronously modify an entry
257 .TP
258 .SM ldap_modify_s(3)
259 synchronously modify an entry
260 .TP
261 .SM ldap_mods_free(3)
262 free array of pointers to mod structures used by ldap_modify(3)
263 .TP
264 .SM ldap_modrdn2(3)
265 asynchronously modify the RDN of an entry
266 .TP
267 .SM ldap_modrdn2_s(3)
268 synchronously modify the RDN of an entry
269 .TP
270 .SM ldap_modrdn(3)
271 deprecated - use ldap_modrdn2(3)
272 .TP
273 .SM ldap_modrdn_s(3)
274 depreciated - use ldap_modrdn2_s(3)
275 .TP
276 .SM ldap_msgfree(3)
277 free results allocated by ldap_result(3)
278 .TP
279 .SM ldap_msgtype(3)
280 return the message type of a message from ldap_result(3)
281 .TP
282 .SM ldap_msgid(3)
283 return the message id of a message from ldap_result(3)
284 .TP
285 .SM ldap_search(3)
286 asynchronously search the directory
287 .TP
288 .SM ldap_search_s(3)
289 synchronously search the directory
290 .TP
291 .SM ldap_search_st(3)
292 synchronously search the directory with timeout
293 .TP
294 .SM ldap_is_ldap_url(3)
295 check a URL string to see if it is an LDAP URL
296 .TP
297 .SM ldap_url_parse(3)
298 break up an LDAP URL string into its components
299 .TP
300 .SM ldap_sort_entries(3)
301 sort a list of search results
302 .TP
303 .SM ldap_sort_values(3)
304 sort a list of attribute values
305 .TP
306 .SM ldap_sort_strcasecmp(3)
307 case insensitive string comparison
308 .SH SEE ALSO
309 .BR ldap.conf (5),
310 .BR slapd (8),
311 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
312 .SH ACKNOWLEDGEMENTS
313 .B      OpenLDAP
314 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
315 .B      OpenLDAP
316 is derived from University of Michigan LDAP 3.3 Release.  
317 .LP
318 These API manual pages are based upon descriptions provided in the
319 IETF C LDAP API Internet Draft, a work in progress, edited by
320 Mark Smith.