1 .TH LDAP_GET_OPTION 3 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2006 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)
26 The actual type is determined based on the value of the
29 Global options are set/retrieved by passing a NULL LDAP handle.
33 .BR "struct ldapapiinfo" ;
36 .BR "struct ldapapiinfo *" ,
37 pointing to an already allocated struct.
38 This is a read-only option.
41 Returns the file descriptor associated to the socket buffer
42 of the LDAP handle passed in as
47 This is a read-only, handler-specific option.
50 Returns a pointer to the socket buffer of the LDAP handle passed in as
55 This is a read-only, handler-specific option.
58 Sets/gets a timeout value (\fIFIXME: currently unused\fP).
61 .BR "struct timeval **" ,
62 and the resulting pointer must be freed by the caller using
66 .BR "struct timeval *" .
68 .B LDAP_OPT_NETWORK_TIMEOUT
69 Sets/gets the network timeout value after which
70 .BR poll (2)/ select (2)
73 returns in case of no activity.
76 .BR "struct timeval **" ,
77 and the resulting pointer must be freed by the caller using
81 .BR "struct timeval *" .
84 Sets/gets the value that defines when alias deferencing must occur.
90 and they cannot be NULL.
93 Sets/gets the value that defines the maximum number of entries
94 to be returned by a search operation.
100 and they cannot be NULL.
102 .B LDAP_OPT_TIMELIMIT
103 Sets/gets the value that defines the time limit after which
104 a search operation should be terminated by the server.
110 and they cannot be NULL.
112 .B LDAP_OPT_REFERRALS
113 Determines whether the library should implicitly chase referrals or not.
119 their value should either be
125 Determines whether the library should implicitly restart connections (FIXME).
131 their value should either be
136 .B LDAP_OPT_PROTOCOL_VERSION
137 Sets/gets the protocol version.
144 .B LDAP_OPT_SERVER_CONTROLS
145 Sets/gets the server-side controls to be used for all operations.
146 This is now deprecated as modern LDAP C API provides replacements
147 for all main operations which accepts server-side controls as
148 explicit arguments; see for example
149 .BR ldap_search_ext (3),
150 .BR ldap_add_ext (3),
151 .BR ldap_modify_ext (3)
155 .BR "LDAPControl ***" ,
156 and the caller is responsible of freeing the returned controls, if any,
158 .BR ldap_controls_free (3),
162 .BR "LDAPControl **" ;
163 the library duplicates the controls passed via
166 .B LDAP_OPT_CLIENT_CONTROLS
167 Sets/gets the client-side controls to be used for all operations.
168 This is now deprecated as modern LDAP C API provides replacements
169 for all main operations which accepts client-side controls as
170 explicit arguments; see for example
171 .BR ldap_search_ext (3),
172 .BR ldap_add_ext (3),
173 .BR ldap_modify_ext (3)
177 .BR "LDAPControl ***" ,
178 and the caller is responsible of freeing the returned controls, if any,
180 .BR ldap_controls_free (3),
184 .BR "LDAPControl **" ;
185 the library duplicates the controls passed via
188 .B LDAP_OPT_HOST_NAME
189 Sets/gets a space-separated list of hosts to be contacted by the library
190 when trying to establish a connection.
191 This is now deprecated in favour of
196 and the caller is responsible of freeing the resulting string by calling
197 .BR ldap_memfree (3),
202 the library duplicates the corresponding string.
205 Sets/gets a space-separated list of URIs to be contacted by the library
206 when trying to establish a connection.
210 and the caller is responsible of freeing the resulting string by calling
211 .BR ldap_memfree (3),
216 the library parses the string into a list of
218 structures, so the invocation of
219 .BR ldap_set_option (3)
220 may fail if URL parsing fails.
223 Sets/gets a string containing the DN to be used as default base
224 for search operations.
228 and the caller is responsible of freeing the returned string by calling
229 .BR ldap_memfree (3),
234 the library duplicates the corresponding string.
236 .B LDAP_OPT_RESULT_CODE
237 Sets/gets the LDAP result code associated to the handle.
238 This option was formerly known as
239 .BR LDAP_OPT_ERROR_NUMBER.
247 .B LDAP_OPT_ERROR_STRING
248 Sets/gets a string containing the error string associated to the LDAP handle.
252 and the caller is responsible of freeing the returned string by calling
253 .BR ldap_memfree (3),
258 the library duplicates the corresponding string.
260 .B LDAP_OPT_MATCHED_DN
261 Sets/gets a string containing the matched DN associated to the LDAP handle.
265 and the caller is responsible of freeing the returned string by calling
266 .BR ldap_memfree (3),
271 the library duplicates the corresponding string.
273 .B LDAP_OPT_REFERRAL_URLS
274 Sets/gets an array containing the referral URIs associated to the LDAP handle.
278 and the caller is responsible of freeing the returned string by calling
279 .BR ber_memvfree (3),
282 must be a NULL-terminated
284 the library duplicates the corresponding string.
286 .B LDAP_OPT_API_FEATURE_INFO
288 .BR "LDAPAPIFeatureInfo" ;
291 .BR "LDAPAPIFeatureInfo *" ,
292 pointing to an already allocated struct.
293 This is a read-only option.
295 .B LDAP_OPT_DEBUG_LEVEL
296 Sets/gets the debug level of the client library.
304 On success, the functions return
305 .BR LDAP_OPT_SUCCESS ,
306 while they may return
308 to indicate a generic option handling error.
309 Occasionally, more specific errors can be returned, like
311 to indicate a failure in memory allocation.
313 The LDAP libraries with the
314 .B LDAP_OPT_REFERRALS
317 (default value) automatically follow referrals using an anonymous bind.
318 Application developers are encouraged to either implement consistent
319 referral chasing features, or explicitly disable referral chasing
320 by setting that option to
326 (http://www.rfc-editor.org),
329 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
331 is derived from University of Michigan LDAP 3.3 Release.