ldap_parse_page_control()--Retrieve Values in a Paged Results Control


  Syntax
 #include <ldap.h>

 int ldap_parse_page_control(
              LDAP          *ld,
              LDAPControl   **serverControls,
              unsigned long *totalCount,
              struct berval **cookie)

  Library Name/Service Program: QSYS/QGLDCLNT

  Default Public Authority: *USE

  Threadsafe: Yes

The ldap_parse_page_control() function is used to retrieve the values in a paged results control used when paging search results.

See Paged LDAP Search Results for usage information about the functions used to perform paging of entries returned from the server following an LDAP search operation.

Note: serverControls, and cookie must be freed by the caller.


Authorities and Locks

No IBM® i authority is required. All authority checking is done by the LDAP server.


Parameters

ld
(Input) Specifies the LDAP pointer returned by previous call to ldap_init() or ldap_ssl_init(). Must not be NULL.

serverControls
(Input) Specifies a list of LDAP server controls. See Controls for LDAP APIs for more information about server controls. These controls are returned to the client when calling the ldap_parse_result() function on the set of results returned by the server. ServerControls can be freed immediately after the call to ldap_parse_page_control() with a call to ldap_controls_free().

totalCount
(Output) Specifies the estimate of the total number of entries for this search. The value can be zero if the estimate cannot be provided.

cookie
(Output) Specifies an opaque structure returned by the server. The cookie should be passed into this API as a pointer to a NULL pointer. Upon return the value of the cookie indicates if there are more pages of results for this search stored on the server. An empty cookie upon return indicates that all results have been returned. Otherwise, this value must be passed into a subsequent call to ldap_create_page_control() to get the next page of results. Thereafter, the cookie must be freed with a call to ber_bvfree().


Example

See the example that uses ldap_create_page_control() and ldap_parse_page_control() to perform an LDAP sorted search in ldap_create_page_control() --Create a Paged Results Control used when paging search results.


Return Value

LDAP_SUCCESS
if the request was successful.
another LDAP error code
if the control could not be parsed.

Related Information



API introduced: V5R3

[ Back to top | LDAP APIs | APIs by category ]