|
Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!
LDAP_SEARCH(3) LDAP_SEARCH(3)
NAME
ldap_search, ldap_search_s, ldap_search_st, ldap_search_ext,
ldap_search_ext_s - Perform an LDAP search operation
LIBRARY
OpenLDAP LDAP (libldap, -lldap)
SYNOPSIS
#include <sys/time.h> /* for struct timeval definition */
#include <ldap.h>
int ldap_search(ld, base, scope, filter, attrs, attrsonly)
LDAP *ld;
char *base;
int scope;
char *filter, *attrs[];
int attrsonly;
int ldap_search_s(ld, base, scope, filter, attrs, attrsonly, res)
LDAP *ld;
char *base;
int scope;
char *filter, *attrs[]
int attrsonly;
LDAPMessage **res;
int ldap_search_st(ld, base, scope, filter, attrs, attrsonly, timeout, res)
LDAP *ld;
char *base;
int scope;
char *filter, *attrs[]
int attrsonly;
struct timeval *timeout;
LDAPMessage **res;
int ldap_search_ext(ld, base, scope, filter, attrs, attrsonly, serverctrls,
clientctrls, timeout, sizelimit, msgidp)
LDAP *ld;
char *base;
int scope;
char *filter, *attrs[]
int attrsonly;
LDAPControl **serverctrls, **clientctrls;
struct timeval *timeout;
int sizelimit, *msgidp;
int ldap_search_ext_s(ld, base, scope, filter, attrs, attrsonly, serverctrls,
clientctrls, timeout, sizelimit, res)
LDAP *ld;
char *base;
int scope;
char *filter, *attrs[]
int attrsonly;
LDAPControl **serverctrls, **clientctrls;
struct timeval *timeout;
int sizelimit;
LDAPMessage **res;
DESCRIPTION
These routines are used to perform LDAP search operations.
ldap_search_s() does the search synchronously (i.e., not returning
until the operation completes). ldap_search_st() does the same, but
allows a timeout to be specified. ldap_search() is the asynchronous
version, initiating the search and returning the message id of the
operation it initiated. Base is the DN of the entry at which to start
the search. Scope is the scope of the search and should be one of
LDAP_SCOPE_BASE, to search the object itself, LDAP_SCOPE_ONELEVEL, to
search the object's immediate children, or LDAP_SCOPE_SUBTREE, to
search the object and all its descendants.
Filter is a string
representation of the filter to apply in the search. Simple filters
can be specified as (attributetype=attributevalue). More complex fil-
ters are specified using a prefix notation according to the following
BNF:
<filter> ::= '(' <filtercomp> ')'
<filtercomp> ::= <and> | <or> | <not> | <simple>
<and> ::= '&' <filterlist>
<or> ::= '|' <filterlist>
<not> ::= '!' <filter>
<filterlist> ::= <filter> | <filter> <filterlist>
<simple> ::= <attributetype> <filtertype> <attributevalue>
<filtertype> ::= '=' | '~=' | '<=' | '>='
The '~=' construct is used to specify approximate matching. The repre-
sentation for <attributetype> and <attributevalue> are as described in
RFC 2254. In addition, <attributevalue> can be a single * to achieve
an attribute existence test, or can contain text and *'s interspersed
to achieve substring matching.
For example, the filter "(mail=*)" will find any entries that have a
mail attribute. The filter "(mail=*@terminator.rs.itd.umich.edu)" will
find any entries that have a mail attribute ending in the specified
string. To put parentheses in a filter, escape them with a backslash
'\' character. See RFC 2254 for a more complete description of allow-
able filters.
Attrs is a null-terminated array of attribute types to return from
entries that match filter. If NULL is specified, the return of all
user attributes is requested. The type "*" (LDAP_ALL_USER_ATTRIBUTES)
may be used to request all user attributes to be returned. The type
"+"(LDAP_ALL_OPERATIONAL_ATTRIBUTES) may be used to request all opera-
tional attributes to be returned. To request no attributes, the type
"1.1" (LDAP_NO_ATTRS) should be listed by itself.
Attrsonly should be set to 1 if only attribute types are wanted. It
should be set to 0 if both attributes types and attribute values are
wanted.
ldap_search_ext() routine allows server and client controls to be spec-
ified to extend the search request. This routine is asynchronous like
ldap_search(), but its return value is an LDAP error code. It stores
the message id of the request in the integer pointed to by msgidp.
The ldap_search_ext_s() routine is the synchronous version of
ldap_search_ext(). It also returns an LDAP error code indicating suc-
cess or failure of the operation.
ERRORS
ldap_search_s() and ldap_search_st() will return the LDAP error code
resulting from the search operation. See ldap_error(3) for details.
ldap_search() returns -1 in case of trouble.
ldap_search_s(), ldap_search_ext_s and ldap_search_st() will return the
LDAP error code resulting from the search operation. See ldap_error(3)
for details. ldap_search() and ldap_search_ext returns -1 in case of
trouble.
NOTES
Note that both read and list functionality are subsumed by these rou-
tines, by using a filter like "(objectclass=*)" and a scope of
LDAP_SCOPE_BASE (to emulate read) or LDAP_SCOPE_ONELEVEL (to emulate
list).
These routines may dynamically allocate memory. The caller is responsi-
ble for freeing such memory using supplied deallocation routines.
Return values are contained in <ldap.h>.
SEE ALSO
ldap(3), ldap_result(3), ldap_error(3)
ACKNOWLEDGEMENTS
OpenLDAP is developed and maintained by The OpenLDAP Project
(http://www.openldap.org/). OpenLDAP is derived from University of
Michigan LDAP 3.3 Release.
OpenLDAP 2.3.27 2006/08/19 LDAP_SEARCH(3)
Man(1) output converted with
man2html and wrapped by fishsponge
This page was generated on Sat Sep 8 16:38:17 GMT 2007
|
Your favourite pages:
No pages logged yet. Trying to save cookie... Top 10 most popular pages:
svn man page (6143 hits) (FreeBSD 6.2)
sqlite3 man page (5592 hits) (openSUSE 10.2)
adv_cap_autoneg man page (5041 hits) (Solaris 10 11_06)
CPAN man page (4787 hits) (Suse Linux 10.1)
ssh man page (4438 hits) (Suse Linux 10.1)
ssh-socks5-proxy-connect man page (3506 hits) (Solaris 10 11_06)
signal man page (3363 hits) (Suse Linux 10.1)
netcat man page (3359 hits) (Suse Linux 10.1)
pprosetup man page (2876 hits) (Solaris 10 11_06)
startproc man page (2732 hits) (Suse Linux 10.1)
|