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