#include <ldap.h>
int ldap_search_ext_s( LDAP *ld, const char *base, int scope,
const char *filter, char **attrs, int attrsonly,
LDAPControl **serverctrls, LDAPControl **clientctrls,
struct timeval *timeoutp, int sizelimit, LDAPMessage **res );
ld |
Connection handle, which is a pointer to an |
base | |
scope | Scope of the search, which can be one of the following values: |
filter | For details on the syntax for filters, see "Specifying a Search Filter" on page 113. |
attrs | |
attrsonly | |
serverctrls |
Pointer to an array of |
clientctrls |
Pointer to an array of |
timeoutp |
Pointer to a |
sizelimit | |
res |
LDAP_SUCCESS if successful. LDAP_PARAM_ERROR if any of the arguments are invalid. LDAP_ENCODING_ERROR if an error occurred when BER-encoding the request. LDAP_SERVER_DOWN if the LDAP server did not receive the request or if the connection to the server was lost. LDAP_NO_MEMORY if memory cannot be allocated. LDAP_LOCAL_ERROR if an error occurred when receiving the results from the server. LDAP_DECODING_ERROR if an error occurred when decoding the BER-encoded results from the server. LDAP_NOT_SUPPORTED if controls are included in your request (for example, as a session preference) and your LDAP client does not specify that it is using the LDAP v3 protocol. Make sure that you set the version of your LDAP client to version 3 before calling this function. (For details, see "Specifying the LDAP Version of Your Client" on page 54.) LDAP_FILTER_ERROR if an error occurred when parsing and BER-encoding the search filter specified by the filter argument. LDAP_TIMEOUT if the search exceeded the time specified by the timeoutp argument. LDAP_OPERATIONS_ERROR may be sent by the Netscape Directory Server for general errors encountered by the server when processing the request.LDAP_PROTOCOL_ERROR if the search request did not comply with the LDAP protocol. The Netscape Directory Server may set this error code in the results for a variety of reasons. Some of these reasons include: LDAP_INVALID_SYNTAX may be sent by the Netscape Directory Server if your LDAP client specified a substring filter containing no value for comparison. LDAP_NO_SUCH_OBJECT may be sent by the Netscape Directory Server if the entry specified by the base argument does not exist and if no referral URLs are available. LDAP_REFERRAL may be sent by the Netscape Directory Server if the entry specified by the base argument is not handled by the current server and if referral URLs identify a different server to handle the entry. (For example, if the DN is uid=bjensen, ou=European Sales, o=Airius.com, all entries under ou=European Sales might be handled by a different Directory Server.) LDAP_TIMELIMIT_EXCEEDED may be sent by the Netscape Directory Server if the search exceeded the maximum time specified by the timeoutp argument. LDAP_SIZELIMIT_EXCEEDED may be sent by the Netscape Directory Server if the search found more results than the maximum number of results specified by the sizelimit argument. LDAP_ADMINLIMIT_EXCEEDED may be sent by the Netscape Directory Server if the search found more results than the limit specified by the lookthroughlimit directive in the slapd.conf configuration file. (If not specified in the configuration file, the limit is 5000.) ldap_search_ext_s() searches the directory for matching entries synchronously.
You can use this function to pass LDAP server controls to the server if you want the server to sort the results or if you want to request a persistent search. (See ldap_create_sort_control() and ldap_create_persistentsearch_control() for more information on these controls.)
This function is a new version of the ldap_search_s() function. If you are writing a new LDAP client, you should call this function instead of ldap_search_s().
ldap_search_ext_s() is a synchronous function, which directly returns the results of the operation. If you want to perform other operations while waiting for the results of this operation, call the asynchronous function ldap_search_ext() instead. (For more information on asynchronous and synchronous functions, see "Calling Synchronous and Asynchronous Functions" on page 80.)
For more information on searching the directory, see Chapter 6, "Searching the Directory".
ldap_search_ext().
Last Updated: 10/01/98 17:06:23