1ldap_compare(3LDAP) LDAP Library Functions ldap_compare(3LDAP)
2
3
4
6 ldap_compare, ldap_compare_s, ldap_compare_ext, ldap_compare_ext_s -
7 LDAP compare operation
8
10 cc[ flag... ] file... -lldap[ library... ]
11 #include <lber.h>
12 #include <ldap.h>
13
14 int ldap_compare(LDAP *ld, char *dn, char *attr, char *value);
15
16
17 int ldap_compare_s(LDAP *ld, char *dn, char *attr, char *value);
18
19
20 int ldap_compare_ext(LDAP *ld, char *dn, char *attr,
21 struct berval *bvalue, LDAPControl **serverctrls,
22 LDAPControl **clientctrls,int *msgidp);
23
24
25 int ldap_compare_ext_s(LDAP *ld, char *dn, char *attr,
26 struct berval *bvalue, LDAPControl **serverctrls,
27 LDAPControl **clientctrls);
28
29
31 The ldap_compare_s() function is used to perform an LDAP compare opera‐
32 tion synchronously. It takes dn, the DN of the entry upon which to
33 perform the compare, and attr and value, the attribute type and value
34 to compare to those found in the entry. It returns an LDAP error code,
35 which will be LDAP_COMPARE_TRUE if the entry contains the attribute
36 value and LDAP_COMPARE_FALSE if it does not. Otherwise, some error
37 code is returned.
38
39
40 The ldap_compare() function is used to perform an LDAP compare opera‐
41 tion asynchronously. It takes the same parameters as ldap_compare_s(),
42 but returns the message id of the request it initiated. The result of
43 the compare can be obtained by a subsequent call to ldap_result(3LDAP).
44
45
46 The ldap_compare_ext() function initiates an asynchronous compare
47 operation and returns LDAP_SUCCESS if the request was successfully
48 sent to the server, or else it returns a LDAP error code if not (see
49 ldap_error(3LDAP). If successful, ldap_compare_ext() places the mes‐
50 sage id of the request in *msgidp. A subsequent call to
51 ldap_result(), can be used to obtain the result of the add request.
52
53
54 The ldap_compare_ext_s() function initiates a synchronous compare
55 operation and as such returns the result of the operation itself.
56
58 ldap_compare_s() returns an LDAP error code which can be interpreted by
59 calling one of ldap_perror(3LDAP) and friends. ldap_compare() returns
60 −1 if something went wrong initiating the request. It returns the non-
61 negative message id of the request if it was successful.
62
64 See attributes(5) for a description of the following attributes:
65
66
67
68
69 ┌─────────────────────────────┬─────────────────────────────┐
70 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
71 │Availability │SUNWcsl (32-bit) │
72 │ │SUNWcslx (64-bit) │
73 │Interface Stability │Evolving │
74 └─────────────────────────────┴─────────────────────────────┘
75
77 ldap(3LDAP), ldap_error(3LDAP), attributes(5)
78
80 There is no way to compare binary values using ldap_compare().
81
82
83
84SunOS 5.11 27 Jan 2002 ldap_compare(3LDAP)