ldap_parse_sort_control

Decodes the information returned from a search operation that used 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_parse_sort_control (
     LDAP            *ld,
     LDAPControl    **ctrls,
     unsigned long   *returnCode,
     char           **attribute);
  
  

Parameters

ld

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

ctrls

(IN) Points to the address of a NULL-terminated array of LDAPControl structures, usually obtained by a call to the ldap_parse_result function.

returnCode

(OUT) Points to the sort control result code. This parameter must not be NULL. See Remarks for a list of possible return codes.

attribute

(OUT) If the sort operation fails, the server may return a string that indicates the first attribute in the sortKey list that caused the failure. If this parameter is NULL, no string is returned. If a string is returned, the memory should be freed by calling the ldap_memfree function.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. See LDAP Return Codes.

Remarks

The returnCode parameter returns one of the following values.

Return Value

Description

success (0)

Server returned sorted results.

operationsError (1)

Server had an internal failure.

timeLimitExceeded (3)

Server reached the time limit before the sorting was completed.

strongAuthRequired (8)

Server refused to return sorted results over an insecure protocol.

adminLimitExceeded (11)

The results contain too many matching entries for the server to sort.

noSuchAttribute (16)

Server does not recognized an attribute type in the sort key.

inappropriateMatching (18)

Server does not recognized the matching rule in the sort key, or the matching rule is inappropriate for the attribute type.

insufficientAccessRights (50)

Server refused to return sorted results to this client.

busy (51)

Server is too busy to process.

unwillingToPerform (53)

Server is unable to sort the results.

other (80)

An error occurred.

For example code, see sortcntl.c and vlvcntl.c.

See Also

ldap_create_sort_control