]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap.3
Generate man page date from version.sh
[openldap] / doc / man / man3 / ldap.3
1 .TH LDAP 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2002 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 SYNOPSIS
8 .nf
9 .ft B
10 #include <ldap.h>
11 .ft
12 .fi
13 .SH DESCRIPTION
14 .LP
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
21 progress.
22 .LP
23 The OpenLDAP Software package includes a stand\-alone server in
24 .BR slapd (8),
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.
28 .LP
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.
32 .LP
33 The basic interaction is as follows.  A session handle is
34 created using
35 .BR ldap_init (3)
36 or
37 .BR ldap_initialize (3).
38 (The
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
43 performed by calling
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)
48 or
49 .BR ldap_search_ext (3)
50 followed by
51 .BR ldap_result (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).
59 .SH SEARCH FILTERS
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,
64 by calling
65 .BR ldap_first_entry (3)
66 and
67 .BR ldap_next_entry (3)
68 to step through
69 the entries returned,
70 .BR ldap_first_attribute (3)
71 and
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.
77 .SH CONTROLS
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
84 .BR _ext
85 to the regular routine's name.
86 .SH UNIFORM RESOURCE LOCATORS (URLS)
87 The
88 .BR ldap_url (3)
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
91 an LDAP URL.
92 .SH CACHING
93 The
94 .BR ldap_cache (3)
95 routines implement a local client caching scheme,
96 providing a substantial performance increase for repeated queries.
97 Caching is experiemental.
98 .SH UTILITY ROUTINES
99 Also provided are various utility routines.  The
100 .BR ldap_sort (3)
101 routines are used to sort the entries and values returned via
102 the ldap search routines. 
103 .SH BER LIBRARY
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),
115 and
116 .BR lber\-types (3).
117 .SH INDEX
118 .TP 20
119 .SM ldap_open(3)
120 open a connection to an LDAP server (deprecated, use
121 .BR ldap_init (3))
122 .TP
123 .SM ldap_init(3)
124 initialize the LDAP library without opening a connection to a server
125 .TP
126 .SM ldap_initialize(3)
127 initialize the LDAP library without opening a connection to a server
128 .TP
129 .SM ldap_result(3)
130 wait for the result from an asynchronous operation
131 .TP
132 .SM ldap_abandon(3)
133 abandon (abort) an asynchronous operation
134 .TP
135 .SM ldap_add(3)
136 asynchronously add an entry
137 .TP
138 .SM ldap_add_s(3)
139 synchronously add an entry
140 .TP
141 .SM ldap_bind(3)
142 asynchronously bind to the directory
143 .TP
144 .SM ldap_bind_s(3)
145 synchronously bind to the directory
146 .TP
147 .SM ldap_simple_bind(3)
148 asynchronously bind to the directory using simple authentication
149 .TP
150 .SM ldap_simple_bind_s(3)
151 synchronously bind to the directory using simple authentication
152 .TP
153 .SM ldap_unbind(3)
154 synchronously unbind from the LDAP server and close the connection
155 .TP
156 .SM ldap_unbind_s(3)
157 equivalent to
158 .BR ldap_unbind (3)
159 .TP
160 .SM ldap_memfree (3)
161 dispose of memory allocated by LDAP routines.
162 .TP
163 .SM ldap_enable_cache(3)
164 enable LDAP client caching
165 .TP
166 .SM ldap_disable_cache(3)
167 disable LDAP client caching
168 .TP
169 .SM ldap_destroy_cache(3)
170 disable LDAP client caching and destroy cache contents
171 .TP
172 .SM ldap_flush_cache(3)
173 flush LDAP client cache
174 .TP
175 .SM ldap_uncache_entry(3)
176 uncache requests pertaining to an entry
177 .TP
178 .SM ldap_uncache_request(3)
179 uncache a request
180 .TP
181 .SM ldap_set_cache_options(3)
182 set cache options
183 .TP
184 .SM ldap_compare(3)
185 asynchronously compare to a directory entry
186 .TP
187 .SM ldap_compare_s(3)
188 synchronously compare to a directory entry
189 .TP
190 .SM ldap_delete(3)
191 asynchronously delete an entry
192 .TP
193 .SM ldap_delete_s(3)
194 synchronously delete an entry
195 .TP
196 .SM ldap_perror(3)
197 print an LDAP error indication to standard error
198 .TP
199 .SM ld_errno(3)
200 LDAP error indication
201 .TP
202 .SM ldap_result2error(3)
203 extract LDAP error indication from LDAP result
204 .TP
205 .SM ldap_errlist(3)
206 list of LDAP errors and their meanings
207 .TP
208 .SM ldap_err2string(3)
209 convert LDAP error indication to a string
210 .TP
211 .SM ldap_first_attribute(3)
212 return first attribute name in an entry
213 .TP
214 .SM ldap_next_attribute(3)
215 return next attribute name in an entry
216 .TP
217 .SM ldap_first_entry(3)
218 return first entry in a chain of search results
219 .TP
220 .SM ldap_next_entry(3)
221 return next entry in a chain of search results
222 .TP
223 .SM ldap_count_entries(3)
224 return number of entries in a search result
225 .TP
226 .SM ldap_get_dn(3)
227 extract the DN from an entry
228 .TP
229 .SM ldap_explode_dn(3)
230 convert a DN into its component parts
231 .TP
232 .SM ldap_explode_rdn(3)
233 convert an RDN into its component parts
234 .TP
235 .SM ldap_get_values(3)
236 return an attribute's values
237 .TP
238 .SM ldap_get_values_len(3)
239 return an attribute's values with lengths
240 .TP
241 .SM ldap_value_free(3)
242 free memory allocated by ldap_get_values(3)
243 .TP
244 .SM ldap_value_free_len(3)
245 free memory allocated by ldap_get_values_len(3)
246 .TP
247 .SM ldap_count_values(3)
248 return number of values
249 .TP
250 .SM ldap_count_values_len(3)
251 return number of values
252 .TP
253 .SM ldap_modify(3)
254 asynchronously modify an entry
255 .TP
256 .SM ldap_modify_s(3)
257 synchronously modify an entry
258 .TP
259 .SM ldap_mods_free(3)
260 free array of pointers to mod structures used by ldap_modify(3)
261 .TP
262 .SM ldap_modrdn2(3)
263 asynchronously modify the RDN of an entry
264 .TP
265 .SM ldap_modrdn2_s(3)
266 synchronously modify the RDN of an entry
267 .TP
268 .SM ldap_modrdn(3)
269 deprecated - use ldap_modrdn2(3)
270 .TP
271 .SM ldap_modrdn_s(3)
272 depreciated - use ldap_modrdn2_s(3)
273 .TP
274 .SM ldap_msgfree(3)
275 free results allocated by ldap_result(3)
276 .TP
277 .SM ldap_msgtype(3)
278 return the message type of a message from ldap_result(3)
279 .TP
280 .SM ldap_msgid(3)
281 return the message id of a message from ldap_result(3)
282 .TP
283 .SM ldap_search(3)
284 asynchronously search the directory
285 .TP
286 .SM ldap_search_s(3)
287 synchronously search the directory
288 .TP
289 .SM ldap_search_st(3)
290 synchronously search the directory with timeout
291 .TP
292 .SM ldap_is_ldap_url(3)
293 check a URL string to see if it is an LDAP URL
294 .TP
295 .SM ldap_url_parse(3)
296 break up an LDAP URL string into its components
297 .TP
298 .SM ldap_sort_entries(3)
299 sort a list of search results
300 .TP
301 .SM ldap_sort_values(3)
302 sort a list of attribute values
303 .TP
304 .SM ldap_sort_strcasecmp(3)
305 case insensitive string comparison
306 .SH SEE ALSO
307 .BR slapd (8),
308 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
309 .SH ACKNOWLEDGEMENTS
310 .B      OpenLDAP
311 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
312 .B      OpenLDAP
313 is derived from University of Michigan LDAP 3.3 Release.  
314 .LP
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
317 Mark Smith.