ldap_compare_ext()--Perform an LDAP Compare Operation with Controls



Syntax

#include <ldap.h>

struct berval {
                unsigned long    bv_len;
                char             *bv_val;
 };

int ldap_compare_ext(
		LDAP        *ld,
                char        *dn,
                char        *attr,
		berval      *bvalue,
	        LDAPControl **serverctrls,
                LDAPControl **clientctrls,
                int         *msgidp)



Threadsafe: Yes

The ldap_compare_ext() function is used to perform an LDAP compare operation with controls. The ldap_compare_ext() API initiates an asynchronous compare operation and returns the constant LDAP_SUCCESS if the request was successfully sent, or another LDAP error code if not.

Authorities and Locks

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(),ldap_ssl_init(), or ldap_open().

dn
(Input) Specifies the DN of the entry upon which to perform the compare.

attrs
(Input) Specifies the attribute type to use in the comparison.

bvalue
(Input) Specifies the attribute value to compare against the value in the entry. This is a pointer to a struct berval, making it possible to compare binary values.

serverctrls
(Input) Specifies a list of LDAP server controls. This parameter may be set to null. See LDAP Controls for more information about server controls.

clientctrls
(Input) Specifies a list of LDAP client controls. This parameter may be set to null. See LDAP Controls for more information about client controls.

msgidp
(Output) This result parameter is set to the message id of the request if the ldap_compare_ext() call succeeds.

Return Value

LDAP_SUCCESS
If the request was successfully sent. If successful, ldap_compare_ext() places the message id of the request in *msgidp. A subsequent call to ldap_result() can be used to obtain the result of the operation. Once the operation has completed, ldap_result() returns a result that contains the status of the operation in the form of an error code. The error code indicates if the operation completed successful( LDAP_COMPARE_TRUE or LDAP_COMPARE_FALSE ).
another LDAP error code
if the request was not successful.

Error Conditions

ldap_compare_ext() will return LDAP error code if not successful. See LDAP Client API Error Conditions for possible LDAP error code values.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_compare_ext API.

Related Information

    ldap_compare() -- Asynchronous compare to a directory entry.
    ldap_compare_s() -- Synchronous compare to a directory entry.
    ldap_compare_ext_s() -- Synchronous compare to a directory entry with controls.

The ldap_compare_ext() API support LDAP V3 server controls and client controls.


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]