1 .TH LDAP_GET_OPTION 3 "2008/07/16" "OpenLDAP 2.4.11"
2 .\" $OpenLDAP: pkg/ldap/doc/man/man3/ldap_get_option.3,v 1.3.2.5 2008/02/11 23:26:39 kurt Exp $
3 .\" Copyright 1998-2008 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_get_option, ldap_set_option \- LDAP option handling routines
8 OpenLDAP LDAP (libldap, -lldap)
13 .BI "int ldap_get_option(LDAP *" ld ", int " option ", void *" outvalue ");"
15 .BI "int ldap_set_option(LDAP *" ld ", int " option ", const void *" invalue ");"
18 These routines provide access to options stored either in a LDAP handle
19 or as global options, where applicable.
20 They make use of a neutral interface, where the type of the value
22 .BR ldap_get_option (3)
24 .BR ldap_set_option (3)
27 The actual type is determined based on the value of the
30 Global options are set/retrieved by passing a NULL LDAP handle.
34 .BR "struct ldapapiinfo" ;
37 .BR "struct ldapapiinfo *" ,
38 pointing to an already allocated struct.
39 This is a read-only option.
42 Returns the file descriptor associated to the socket buffer
43 of the LDAP handle passed in as
48 This is a read-only, handler-specific option.
51 Returns a pointer to the socket buffer of the LDAP handle passed in as
56 This is a read-only, handler-specific option.
59 Sets/gets a timeout value for the synchronous API calls.
62 .BR "struct timeval **"
63 (the caller has to free
68 .BR "struct timeval *" ,
69 and they cannot be NULL. Using a struct with seconds set to -1 results
70 in an infinite timeout, which is the default.
72 .B LDAP_OPT_NETWORK_TIMEOUT
73 Sets/gets the network timeout value after which
74 .BR poll (2)/ select (2)
77 returns in case of no activity.
80 .BR "struct timeval **"
81 (the caller has to free
86 .BR "struct timeval *" ,
87 and they cannot be NULL. Using a struct with seconds set to -1 results
88 in an infinite timeout, which is the default.
91 Sets/gets the value that defines when alias dereferencing must occur.
97 and they cannot be NULL.
100 Sets/gets the value that defines the maximum number of entries
101 to be returned by a search operation.
107 and they cannot be NULL.
109 .B LDAP_OPT_TIMELIMIT
110 Sets/gets the value that defines the time limit after which
111 a search operation should be terminated by the server.
117 and they cannot be NULL.
119 .B LDAP_OPT_REFERRALS
120 Determines whether the library should implicitly chase referrals or not.
126 their value should either be
132 Determines whether the library should implicitly restart connections (FIXME).
138 their value should either be
143 .B LDAP_OPT_PROTOCOL_VERSION
144 Sets/gets the protocol version.
151 .B LDAP_OPT_SERVER_CONTROLS
152 Sets/gets the server-side controls to be used for all operations.
153 This is now deprecated as modern LDAP C API provides replacements
154 for all main operations which accepts server-side controls as
155 explicit arguments; see for example
156 .BR ldap_search_ext (3),
157 .BR ldap_add_ext (3),
158 .BR ldap_modify_ext (3)
162 .BR "LDAPControl ***" ,
163 and the caller is responsible of freeing the returned controls, if any,
165 .BR ldap_controls_free (3),
169 .BR "LDAPControl **" ;
170 the library duplicates the controls passed via
173 .B LDAP_OPT_CLIENT_CONTROLS
174 Sets/gets the client-side controls to be used for all operations.
175 This is now deprecated as modern LDAP C API provides replacements
176 for all main operations which accepts client-side controls as
177 explicit arguments; see for example
178 .BR ldap_search_ext (3),
179 .BR ldap_add_ext (3),
180 .BR ldap_modify_ext (3)
184 .BR "LDAPControl ***" ,
185 and the caller is responsible of freeing the returned controls, if any,
187 .BR ldap_controls_free (3),
191 .BR "LDAPControl **" ;
192 the library duplicates the controls passed via
195 .B LDAP_OPT_HOST_NAME
196 Sets/gets a space-separated list of hosts to be contacted by the library
197 when trying to establish a connection.
198 This is now deprecated in favor of
203 and the caller is responsible of freeing the resulting string by calling
204 .BR ldap_memfree (3),
209 the library duplicates the corresponding string.
212 Sets/gets a space-separated list of URIs to be contacted by the library
213 when trying to establish a connection.
217 and the caller is responsible of freeing the resulting string by calling
218 .BR ldap_memfree (3),
223 the library parses the string into a list of
225 structures, so the invocation of
226 .BR ldap_set_option (3)
227 may fail if URL parsing fails.
230 Sets/gets a string containing the DN to be used as default base
231 for search operations.
235 and the caller is responsible of freeing the returned string by calling
236 .BR ldap_memfree (3),
241 the library duplicates the corresponding string.
243 .B LDAP_OPT_RESULT_CODE
244 Sets/gets the LDAP result code associated to the handle.
245 This option was formerly known as
246 .BR LDAP_OPT_ERROR_NUMBER .
254 .B LDAP_OPT_DIAGNOSTIC_MESSAGE
255 Sets/gets a string containing the error string associated to the LDAP handle.
256 This option was formerly known as
257 .BR LDAP_OPT_ERROR_STRING .
261 and the caller is responsible of freeing the returned string by calling
262 .BR ldap_memfree (3),
267 the library duplicates the corresponding string.
269 .B LDAP_OPT_MATCHED_DN
270 Sets/gets a string containing the matched DN associated to the LDAP handle.
274 and the caller is responsible of freeing the returned string by calling
275 .BR ldap_memfree (3),
280 the library duplicates the corresponding string.
282 .B LDAP_OPT_REFERRAL_URLS
283 Sets/gets an array containing the referral URIs associated to the LDAP handle.
287 and the caller is responsible of freeing the returned string by calling
288 .BR ber_memvfree (3),
291 must be a NULL-terminated
293 the library duplicates the corresponding string.
295 .B LDAP_OPT_API_FEATURE_INFO
297 .BR "LDAPAPIFeatureInfo" ;
300 .BR "LDAPAPIFeatureInfo *" ,
301 pointing to an already allocated struct.
302 This is a read-only option.
304 .B LDAP_OPT_DEBUG_LEVEL
305 Sets/gets the debug level of the client library.
313 On success, the functions return
314 .BR LDAP_OPT_SUCCESS ,
315 while they may return
317 to indicate a generic option handling error.
318 Occasionally, more specific errors can be returned, like
320 to indicate a failure in memory allocation.
322 The LDAP libraries with the
323 .B LDAP_OPT_REFERRALS
326 (default value) automatically follow referrals using an anonymous bind.
327 Application developers are encouraged to either implement consistent
328 referral chasing features, or explicitly disable referral chasing
329 by setting that option to
335 (http://www.rfc-editor.org),
337 .\" Shared Project Acknowledgement Text
338 .B "OpenLDAP Software"
339 is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>.
340 .B "OpenLDAP Software"
341 is derived from University of Michigan LDAP 3.3 Release.