ldap_compare_ext

Asynchronously determines whether a specified entry contains a specified attribute value. LDAP client or server controls can be used with the compare.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_compare_ext (
     LDAP                 *ld,
     const char           *dn,
     const char           *attr,
     const struct berval  *bvalue,
     LDAPControl          **serverctrls,
     LDAPControl          **clientctrls,
     int                   *msgidp);
  
  
  

Parameters

ld

(IN) Points to the handle for the LDAP session.

dn

(IN) Points to the distinguished name of the entry whose attribute is being compared.

attr

(IN) Points to the name of the attribute to compare.

bvalue

(IN) Points to a berval structure that contains the attribute's value to compare with the entry's attribute value.

serverctrls

(IN) Points to an array of LDAPControl structures that list the server controls to use with the search. Use NULL to specify no server controls.

clientctrls

(IN) Points to an array of LDAPControl structures that list the client controls to use with the search. Use NULL to specify no client controls.

msgidp

(OUT) Points to the message ID of the request when the search request succeeds.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. For a complete list, see LDAP Return Codes.

0x53

LDAP_ENCODING_ERROR

0x5A

LDAP_NO_MEMORY

Remarks

This function compares the specified value with the values in the entry's attribute. The results specify whether a match is found.

The ldap_compare_ext function can be used to compare any type of data. For string data, you can use the ldap_compare function.

The data returned in msgidp is opaque to the caller. To obtain the results of the operation, call the ldap_result function with the returned message ID.

Compare operations are faster than search operations. Whenever possible in your application, use a compare rather than a search operation.

eDirectory does not currently support any server controls to use with compare operations.

See Also

ldap_compare