ldap_compare()--Perform an LDAP Compare Operation


  Syntax
 #include <ldap.h>
 

 int ldap_compare(
        LDAP           *ld,
        const char     *dn,
        const char     *attr,
        const char     *value)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_compare() function is used to perform an LDAP compare operation. The API uses as input the distinguished name (DN) of the entry on which to perform the compare, and uses an attr and value (the attribute type and value to compare to those found in the entry).

Binary values are not supported by this API. Use ldap_compare_ext() if binary values must be compared.

ldap_compare() is an asynchronous request. The result of the operation can be obtained by a subsequent call to ldap_result().


Authorities and Locks

No IBM® i authority is required. All authority checking is done by the LDAP server.


Parameters

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

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

attr
(Input) The attribute type to use in the comparison.

value
(Input) The string attribute value to compare against the value in the entry.

Return Value

Message ID of the Operation Initiated
if the request was successful.

-1
if the request was not successful.

Error Conditions

If ldap_compare() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() function to retrieve the error information.


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_compare API.


Related Information



API introduced: V4R3

[ Back to top | LDAP APIs | APIs by category ]