]> git.sur5r.net Git - openldap/blob - doc/man/man3/ldap.3
Minor tweak, my man2html program only recognizes manpage references
[openldap] / doc / man / man3 / ldap.3
1 .TH LDAP 3 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2007 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 (LDAP) (RFC 4510) provides
18 access to X.500 directory services.  These services may be stand\-alone
19 or part of a distributed directory service.  This client API supports
20 LDAP over TCP (RFC 4511), LDAP over TLS/SSL, and LDAP over IPC (UNIX
21 domain sockets).  This API supports SASL (RFC 4513) and Start TLS
22 (RFC 4513) as well as a number of protocol extensions.  This API is
23 loosely based upon IETF/LDAPEXT C LDAP API draft specification, a (orphaned)
24 work in progress.
25 .LP
26 The OpenLDAP Software package includes a stand\-alone server in
27 .BR slapd (8),
28 various LDAP clients, and an LDAP client library used to provide
29 programmatic access to the LDAP protocol. This man page gives an
30 overview of the LDAP library routines.
31 .LP
32 Both synchronous and asynchronous APIs are provided.  Also included are
33 various routines to parse the results returned from these routines.
34 These routines are found in the \-lldap library.
35 .LP
36 The basic interaction is as follows.  A session handle is
37 created using
38 .BR ldap_initialize (3)
39 and set the protocol version to 3 by calling
40 .BR ldap_set_option (3).
41 The underlying session is established first operation is
42 issued.  This would generally be a Start TLS or Bind operation,
43 or a Search operation to read attributes of the Root DSE.
44 A Start TLS operation is performed by calling
45 .BR ldap_start_tls_s (3).
46 A LDAP bind operation is performed by calling
47 .BR ldap_sasl_bind (3)
48 or one of its friends.
49 A Search operation is performed by calling ldap_search_ext_s(3)
50 or one of its friends.
51
52 Subsequently, additional operations are performed
53 by calling one of the synchronous or asynchronous routines (e.g.,
54 .BR ldap_compare_ext_s (3)
55 or
56 .BR ldap_compare_ext (3)
57 followed by
58 .BR ldap_result (3)).
59 Results returned from these routines are interpreted by calling the
60 LDAP parsing routines such as
61 .BR ldap_parse_result (3).
62 The LDAP association and underlying connection is terminated by calling
63 .BR ldap_unbind_ext (3).
64 Errors can be interpreted by calling
65 .BR ldap_err2string (3).
66 .SH LDAP versions
67 This library supports version 3 of the Lightweight Directory Access
68 Protocol (LDAPv3) as defined in RFC 4510.  It also supports a variant
69 of version 2 of LDAP as defined by U-Mich LDAP and, to some degree,
70 RFC 1777.  Version 2 (all variants) are considered obsolete.
71 Version 3 should be used instead.
72 .LP
73 For backwards compatibility reasons, the library defaults to version 2.
74 Hence, all new applications (and all actively maintained applications)
75 should use
76 .BR ldap_set_option (3)
77 to select version 3.  The library manual pages assume version 3
78 has been selected.
79 .SH INPUT and OUTPUT PARAMETERS
80 All character string input/output is expected to be/is UTF\-8
81 encoded Unicode (version 3.2). 
82 .LP
83 Distinguished names (DN) (and relative distinguished names (RDN) to
84 be passed to the LDAP routines should conform to RFC 4514 UTF\-8
85 string representation. 
86 .LP
87 Search filters to be passed to the search routines are to be
88 constructed by hand and should conform to RFC 4515 UTF\-8
89 string representation.
90 .LP
91 LDAP URL are to be passed to routines are expected to conform
92 to RFC 4516 format.  The
93 .BR ldap_url (3)
94 routines can be used to work with LDAP URLs.
95 .SH DISPLAYING RESULTS
96 Results obtained from the search routines can be output by hand,
97 by calling
98 .BR ldap_first_entry (3)
99 and
100 .BR ldap_next_entry (3)
101 to step through
102 the entries returned,
103 .BR ldap_first_attribute (3)
104 and
105 .BR ldap_next_attribute (3)
106 to step through an entry's attributes, and
107 .BR ldap_get_values (3)
108 to retrieve a given attribute's values.  Attribute values
109 may or may not be displayable.
110 .SH UTILITY ROUTINES
111 Also provided are various utility routines.  The
112 .BR ldap_sort (3)
113 routines are used to sort the entries and values returned via
114 the ldap search routines. 
115 .SH DEPRECATED INTERFACES
116 A number of interfaces are now considered deprecated.  For instance,
117 ldap_add(3) is deprecated in favor of ldap_add_ext(3).
118 .so Deprecated
119 .SH BER LIBRARY
120 Also included in the distribution is a set of lightweight Basic
121 Encoding Rules routines.  These routines are used by the LDAP library
122 routines to encode and decode LDAP protocol elements using the
123 (slightly simplified) Basic Encoding Rules defined by LDAP.  They are
124 not normally used directly by an LDAP application program except
125 in the handling of controls and extended operations.  The
126 routines provide a printf and scanf\-like interface, as well as
127 lower\-level access.  These routines are discussed in
128 .BR lber\-decode (3),
129 .BR lber\-encode (3),
130 .BR lber\-memory (3),
131 and
132 .BR lber\-types (3).
133 .SH INDEX
134 .TP 20
135 .SM ldap_initialize(3)
136 initialize the LDAP library without opening a connection to a server
137 .TP
138 .SM ldap_result(3)
139 wait for the result from an asynchronous operation
140 .TP
141 .SM ldap_abandon_ext(3)
142 abandon (abort) an asynchronous operation
143 .TP
144 .SM ldap_add_ext(3)
145 asynchronously add an entry
146 .TP
147 .SM ldap_add_ext_s(3)
148 synchronously add an entry
149 .TP
150 .SM ldap_sasl_bind(3)
151 asynchronously bind to the directory
152 .TP
153 .SM ldap_sasl_bind_s(3)
154 synchronously bind to the directory
155 .TP
156 .SM ldap_unbind_ext(3)
157 synchronously unbind from the LDAP server and close the connection
158 .TP
159 .SM ldap_unbind(3) and ldap_unbind_s(3) are
160 equivalent to
161 .BR ldap_unbind_ext (3)
162 .TP
163 .SM ldap_memfree(3)
164 dispose of memory allocated by LDAP routines.
165 .TP
166 .SM ldap_compare_ext(3)
167 asynchronously compare to a directory entry
168 .TP
169 .SM ldap_compare_ext_s(3)
170 synchronously compare to a directory entry
171 .TP
172 .SM ldap_delete_ext(3)
173 asynchronously delete an entry
174 .TP
175 .SM ldap_delete_ext_s(3)
176 synchronously delete an entry
177 .TP
178 .SM ld_errno(3)
179 LDAP error indication
180 .TP
181 .SM ldap_errlist(3)
182 list of LDAP errors and their meanings
183 .TP
184 .SM ldap_err2string(3)
185 convert LDAP error indication to a string
186 .TP
187 .SM ldap_first_attribute(3)
188 return first attribute name in an entry
189 .TP
190 .SM ldap_next_attribute(3)
191 return next attribute name in an entry
192 .TP
193 .SM ldap_first_entry(3)
194 return first entry in a chain of search results
195 .TP
196 .SM ldap_next_entry(3)
197 return next entry in a chain of search results
198 .TP
199 .SM ldap_count_entries(3)
200 return number of entries in a search result
201 .TP
202 .SM ldap_get_dn(3)
203 extract the DN from an entry
204 .TP
205 .SM ldap_get_values_len(3)
206 return an attribute's values with lengths
207 .TP
208 .SM ldap_value_free_len(3)
209 free memory allocated by ldap_get_values_len(3)
210 .TP
211 .SM ldap_count_values_len(3)
212 return number of values
213 .TP
214 .SM ldap_modify_ext(3)
215 asynchronously modify an entry
216 .TP
217 .SM ldap_modify_ext_s(3)
218 synchronously modify an entry
219 .TP
220 .SM ldap_mods_free(3)
221 free array of pointers to mod structures used by ldap_modify_ext(3)
222 .TP
223 .SM ldap_rename(3)
224 asynchronously rename an entry
225 .TP
226 .SM ldap_rename_s(3)
227 synchronously rename an entry
228 .TP
229 .SM ldap_msgfree(3)
230 free results allocated by ldap_result(3)
231 .TP
232 .SM ldap_msgtype(3)
233 return the message type of a message from ldap_result(3)
234 .TP
235 .SM ldap_msgid(3)
236 return the message id of a message from ldap_result(3)
237 .TP
238 .SM ldap_search_ext(3)
239 asynchronously search the directory
240 .TP
241 .SM ldap_search_ext_s(3)
242 synchronously search the directory
243 .TP
244 .SM ldap_is_ldap_url(3)
245 check a URL string to see if it is an LDAP URL
246 .TP
247 .SM ldap_url_parse(3)
248 break up an LDAP URL string into its components
249 .TP
250 .SM ldap_sort_entries(3)
251 sort a list of search results
252 .TP
253 .SM ldap_sort_values(3)
254 sort a list of attribute values
255 .TP
256 .SM ldap_sort_strcasecmp(3)
257 case insensitive string comparison
258 .SH SEE ALSO
259 .BR ldap.conf (5),
260 .BR slapd (8),
261 .BR draft-ietf-ldapext-ldap-c-api-xx.txt \ <http://www.ietf.org>
262 .SH ACKNOWLEDGEMENTS
263 .so ../Project
264 .LP
265 These API manual pages are loosely based upon descriptions provided
266 in the IETF/LDAPEXT C LDAP API Internet Draft, a (orphaned) work
267 in progress.
268