I am using the Netscape client SDK to query LDAP servers, some of which
are running Active Directory.  When querying Active Directory, I would
like to use the "paged control" to page through the search result.
Unfortunately, the Netscape SDK does not seem to have a single API call
to create this LDAP server control.  Does anyone have any sample code
for creating the LDAPControl structure that could be sent into the
ldap_search_ext call?  In particular, I don't know how to create the ber
that goes into the searchControlValue field.


Thanks!
-Bridget Frey



Microsoft describes the control as follows:
*********************************************************************************************

The LDAP_PAGED_RESULT_OID_STRING control is used internally with the
LDAP paged search API functions to instruct the server to return the
results of a search request in smaller, more manageable "chunks" rather
than in one huge block.

The pagedResultsControl structure is as follows:

Sequence {
  controlType  LDAP_PAGED_RESULT_OID_STRING, which is
               defined as "1.2.840.113556.1.4.319"
  criticality  BOOLEAN (default = FALSE)
  controlValue searchControlValue
}
The searchControlValue is a BER-encoded sequence as follows:

Sequence {
  size   INTEGER specifying the requested page size from
         the client, or the estimated result set size
         returned by the server.
  cookie OCTET STRING
}

Client programs should use the LDAP API functions, such as
ldap_create_page_control, ldap_search_init_page, ldap_parse_result,
ldap_parse_page_control, etc., instead of attempting to create and
manipulate this control directly.
*********************************************************************************************


Reply via email to