Directory Services |
The ldap_parse_vlv_control function is used to look for and parse the VLV search results.
int ldap_parse_vlv_control( LDAP* ld, LDAPControl** ctrls, unsigned long* target_posp, unsigned long* list_countp, struct berval** contextp, int* errcodep );
This function returns an LDAP error code that indicates whether a VLV result control was found and parsed successfully. LDAP_SUCCESS is returned if all goes well, LDAP_CONTROL_MISSING is returned if the ctrls array does not include a response control (LDAP_CONTROL_VLVRESPONSE), and another LDAP error code is returned if a parsing error or other problem occurs.
VLV uses the following LDAP result codes:
LDAP_OPERATIONS_ERROR
LDAP_UNWILLING_TO_PERFORM
LDAP_INSUFFICIENT_ACCESS
LDAP_BUSY
LDAP_TIMELIMIT_EXCEEDED
LDAP_ADMINLIMIT_EXCEEDED
LDAP_OTHER
In addition, the following two codes have been added to support VLV:
Return Code | Description |
---|---|
LDAP_SORT_CONTROL_MISSING | The VLV control must be accompanied by a sort control for it to work. If not, the server returns this error. |
LDAP_OFFSET_RANGE_ERROR | The server returns this error when you have set up a search using offsets, but you have set the offset member of the LDAPVLVInfo structure to zero (0). |
This control parses the search results that are returned by the server in the response control (LDAP_CONTROL_VLVRESPONSE). A context identifier is passed from the server to the client to identify the control, which you will need to free at the end of the session by calling ber_bvfree.
For a code sample for this function, see Example Code for Using LDAP VLV.
Client: Included in Windows XP.
Server: Included in Windows Server 2003.
Unicode: Implemented as Unicode and ANSI versions.
Header: Declared in Winldap.h.
Library: Use Wldap32.lib.
ldap_create_vlv_control, LDAP_CONTROL_VLVREQUEST, LDAP_CONTROL_VLVRESPONSE, LDAPVLVInfo, Searching with the LDAP VLV Control, ldap_search_ext, ldap_search_ext_s, ldap_create_sort_control, LDAPControl