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