ldap_create_sort_control

Creates and encodes a server-side sort control.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:8.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_create_sort_control (
     LDAP           *ld,
     LDAPSortKey   **keyList,
     int             isCritical,
     LDAPControl   **ctrlp);
  
  

Parameters

ld

(IN) Points to the handle of the LDAP session.

keyList

(IN) Points to a NULL-terminated array of pointers to LDAPSortKey structures which contain the attributes to match and the rules to use for matching.

isCritical

(IN) Specifies whether the control is required for the search operation:

  • Non-zero specifies that the control is required.

  • Zero specifies that the search operation can be performed without the control.

ctrlp

(OUT) Points to a pointer for the LDAPControl structure which this function creates and which can be used in the search operation. When you are done with this control, its memory should be freed by calling the ldap_control_free function.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. See LDAP Return Codes.

Remarks

The ldap_create_sort_control function creates a sort control that you can use as the server control parameter in the ldap_search_ext and the ldap_search_ext_s functions.

For example code, see sortcntl.c.

See Also

ldap_parse_sort_control, ldap_control_free, ldap_controls_free