Returns the number of entries in the specified partition.
#include <ldapx.h> int ldap_partition_entry_count ( LDAP *ld, char *dn, unsigned long *count);
(IN) Points to the handle for the LDAP session.
(IN) Points to the distinguished name, in LDAP format, of an entry in the partition whose entries are to be counted.
(OUT) Points to the address where the count is returned.
0x00 |
LDAP_SUCCESS |
0x01 |
LDAP_OPERATIONS_ERROR: A string is returned with this error code that indicates the source of the error. |
0x53 |
LDAP_ENCODING_ERROR |
0x5A |
LDAP_NO_MEMORY |
0x5C |
LDAP_NOT_SUPPORTED |
Non-zero |
Non-zero values indicate errors. See |
This function stops at the boundary of the partition. It does not cross the boundary and count the entries in child partitions.
If this function is called immediately after creating a new partition, the count will be inaccurate until the partition moves from the new state (LDAP_RS_NEW_REPLICA) to the on state (LDAP_RS_ON).
For sample code, see getcount.c.
The requestName is set to the OID (2.16.840.1.113719.1.27.100.13) and the requestValue is a BER encoding of the following:
RequestBer dn LDAPDN
The responseName is set to the OID (2.16.840.1.113719.1.27.100.14) and the responsetValue is a BER encoding of the following:
ResponseBer count INTEGER