Copyright Digital Equipment Corp. All rights reserved.

Attribute_Value

   The following functions are used to compare a given attribute
   value assertion against an LDAP entry. There are four variations.

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

           int ldap_compare_ext_s(
                   LDAP                              *ld,
                   const char                        *dn,
                   const char                        *attr,
                   const struct berval               *bvalue,
                   LDAPControl                       **serverctrls,
                   LDAPControl                       **clientctrls
           );

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

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

   Parameters are as follows:

   ld             The session handle.
   dn             The name of the entry to compare against.
   attr           The attribute to compare against.
   bvalue         The attribute value to compare against those found
                  in the given entry. This parameter is used in the
                  extended functions and is a pointer to a struct
                  berval so it is possible to compare binary values.
   value          A string attribute value to compare against,
                  used by the ldap_compare() and ldap_compare_s()
                  functions. Use ldap_compare_ext() or ldap_compare_
                  ext_s() if you need to compare binary values.
   serverctrls    List of LDAP server controls.
   clientctrls    List of client controls.
   msgidp         This result parameter will be set to the message
                  id of the request if the ldap_compare_ext() call
                  succeeds.

   The ldap_compare_ext() function initiates an asynchronous compare
   operation and returns either the constant LDAP_SUCCESS if the
   request was successfully sent, or another LDAP error code if not.
   See Errors for more information about possible errors and how
   to interpret them. 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 compare.

   Similar to ldap_compare_ext(), the ldap_compare()  function
   initiates an asynchronous compare operation and returns the
   message id of the operation initiated. As for ldap_compare_ext(),
   a subsequent call to ldap_result() can be used to obtain the
   result of the compare. In case of error, ldap_compare() will
   return -1, setting the session error parameters in the LDAP
   structure appropriately.

   The synchronous ldap_compare_ext_s() and ldap_compare_s()
   functions both return the result of the operation, either
   the constants LDAP_COMPARE_TRUE or LDAP_COMPARE_FALSE if the
   operation was successful, or another LDAP error code if it was
   not. See Errors for more information about possible errors and
   how to interpret them.

   The ldap_compare_ext() and ldap_compare_ext_s()  functions
   support LDAPv3 server controls and client controls.