]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap.3
Update copyright statements
[openldap] / doc / man / man3 / ldap.3
1 .TH LDAP 3 "1 August 2001" "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 associated
34 with created using
35 .BR ldap_init (3).
36 The underlying session is established upon first use which is
37 commonly an LDAP bind operation.  The LDAP bind operation is
38 performed by calling
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)
43 or
44 .BR ldap_search_ext (3)
45 followed by
46 .BR ldap_result (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).
54 .SH SEARCH FILTERS
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,
59 by calling
60 .BR ldap_first_entry (3)
61 and
62 .BR ldap_next_entry (3)
63 to step through
64 the entries returned,
65 .BR ldap_first_attribute (3)
66 and
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)
73 The
74 .BR ldap_url (3)
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
77 an LDAP URL.
78 .SH CACHING
79 The
80 .BR ldap_cache (3)
81 routines implement a local client caching scheme,
82 providing a substantial performance increase for repeated queries.
83 Caching is experiemental.
84 .SH UTILITY ROUTINES
85 Also provided are various utility routines.  The
86 .BR ldap_sort (3)
87 routines are used to sort the entries and values returned via
88 the ldap search routines. 
89 .SH BER LIBRARY
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
98 .BR lber\-decode (3),
99 .BR lber\-encode (3),
100 .BR lber\-memory (3),
101 and
102 .BR lber\-types (3).
103 .SH INDEX
104 .TP 20
105 .SM ldap_open(3)
106 open a connection to an LDAP server
107 .TP
108 .SM ldap_init(3)
109 initialize the LDAP library without opening a connection to a server
110 .TP
111 .SM ldap_result(3)
112 wait for the result from an asynchronous operation
113 .TP
114 .SM ldap_abandon(3)
115 abandon (abort) an asynchronous operation
116 .TP
117 .SM ldap_add(3)
118 asynchronously add an entry
119 .TP
120 .SM ldap_add_s(3)
121 synchronously add an entry
122 .TP
123 .SM ldap_bind(3)
124 asynchronously bind to the directory
125 .TP
126 .SM ldap_bind_s(3)
127 synchronously bind to the directory
128 .TP
129 .SM ldap_simple_bind(3)
130 asynchronously bind to the directory using simple authentication
131 .TP
132 .SM ldap_simple_bind_s(3)
133 synchronously bind to the directory using simple authentication
134 .TP
135 .SM ldap_unbind(3)
136 synchronously unbind from the LDAP server and close the connection
137 .TP
138 .SM ldap_unbind_s(3)
139 equivalent to
140 .BR ldap_unbind (3)
141 .TP
142 .SM ldap_memfree (3)
143 dispose of memory allocated by LDAP routines.
144 .TP
145 .SM ldap_enable_cache(3)
146 enable LDAP client caching
147 .TP
148 .SM ldap_disable_cache(3)
149 disable LDAP client caching
150 .TP
151 .SM ldap_destroy_cache(3)
152 disable LDAP client caching and destroy cache contents
153 .TP
154 .SM ldap_flush_cache(3)
155 flush LDAP client cache
156 .TP
157 .SM ldap_uncache_entry(3)
158 uncache requests pertaining to an entry
159 .TP
160 .SM ldap_uncache_request(3)
161 uncache a request
162 .TP
163 .SM ldap_set_cache_options(3)
164 set cache options
165 .TP
166 .SM ldap_compare(3)
167 asynchronous compare to a directory entry
168 .TP
169 .SM ldap_compare_s(3)
170 synchronous compare to a directory entry
171 .TP
172 .SM ldap_delete(3)
173 asynchronously delete an entry
174 .TP
175 .SM ldap_delete_s(3)
176 synchronously delete an entry
177 .TP
178 .SM ldap_perror(3)
179 print an LDAP error indication to standard error
180 .TP
181 .SM ld_errno(3)
182 LDAP error indication
183 .TP
184 .SM ldap_result2error(3)
185 extract LDAP error indication from LDAP result
186 .TP
187 .SM ldap_errlist(3)
188 list of ldap errors and their meanings
189 .TP
190 .SM ldap_err2string(3)
191 convert LDAP error indication to a string
192 .TP
193 .SM ldap_first_attribute(3)
194 return first attribute name in an entry
195 .TP
196 .SM ldap_next_attribute(3)
197 return next attribute name in an entry
198 .TP
199 .SM ldap_first_entry(3)
200 return first entry in a chain of search results
201 .TP
202 .SM ldap_next_entry(3)
203 return next entry in a chain of search results
204 .TP
205 .SM ldap_count_entries(3)
206 return number of entries in a search result
207 .TP
208 .SM ldap_get_dn(3)
209 extract the DN from an entry
210 .TP
211 .SM ldap_explode_dn(3)
212 convert a DN into its component parts
213 .TP
214 .SM ldap_explode_rdn(3)
215 convert a RDN into its component parts
216 .TP
217 .SM ldap_get_values(3)
218 return an attribute's values
219 .TP
220 .SM ldap_get_values_len(3)
221 return an attribute values with lengths
222 .TP
223 .SM ldap_value_free(3)
224 free memory allocated by ldap_get_values(3)
225 .TP
226 .SM ldap_value_free_len(3)
227 free memory allocated by ldap_get_values_len(3)
228 .TP
229 .SM ldap_count_values(3)
230 return number of values
231 .TP
232 .SM ldap_count_values_len(3)
233 return number of values
234 .TP
235 .SM ldap_modify(3)
236 asynchronously modify an entry
237 .TP
238 .SM ldap_modify_s(3)
239 synchronously modify an entry
240 .TP
241 .SM ldap_mods_free(3)
242 free array of pointers to mod structures used by ldap_modify(3)
243 .TP
244 .SM ldap_modrdn2(3)
245 asynchronously modify the RDN of an entry
246 .TP
247 .SM ldap_modrdn2_s(3)
248 synchronously modify the RDN of an entry
249 .TP
250 .SM ldap_modrdn(3)
251 deprecated - use ldap_modrdn2(3)
252 .TP
253 .SM ldap_modrdn_s(3)
254 depreciated - use ldap_modrdn2_s(3)
255 .TP
256 .SM ldap_msgfree(3)
257 free results allocated by ldap_result(3)
258 .TP
259 .SM ldap_msgtype(3)
260 return the message type of a message from ldap_result(3)
261 .TP
262 .SM ldap_msgid(3)
263 return the message id of a message from ldap_result(3)
264 .TP
265 .SM ldap_search(3)
266 asynchronously search the directory
267 .TP
268 .SM ldap_search_s(3)
269 synchronously search the directory
270 .TP
271 .SM ldap_search_st(3)
272 synchronously search the directory with timeout
273 .TP
274 .SM ldap_is_ldap_url(3)
275 check a URL string to see if it is an LDAP URL
276 .TP
277 .SM ldap_url_parse(3)
278 break up an LDAP URL string into its components
279 .TP
280 .SM ldap_sort_entries(3)
281 sort a list of search results
282 .TP
283 .SM ldap_sort_values(3)
284 sort a list of attribute values
285 .TP
286 .SM ldap_sort_strcasecmp(3)
287 case insensitive string comparison
288 .SH SEE ALSO
289 .BR slapd (8)
290 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
291 .SH ACKNOWLEDGEMENTS
292 .B      OpenLDAP
293 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
294 .B      OpenLDAP
295 is derived from University of Michigan LDAP 3.3 Release.  
296 .LP
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
299 Mark Smith.