LDAP_CREATE_LIMIT_NUM_VALUES_CONTROL

Use the LDAP_CREATE_LIMIT_NUM_VALUES_CONTROL API or LDAP routine to create the Limit Number of Attribute Values Control. This control is used to limit the number of values that are returned for the entire entry.

Synopsis

#include ldap.h
    
    int ldap_create_limit_num_values_control(
              LDAP        *ld,
              int         maxTotalValues,
              int         maxValuesPerAttribute,
              int         returnDetails,
              int         isCritical,
              LDAPControl **control);

Input parameters

ld
Specifies a pointer to the LDAP structure that represents an LDAP connection.
maxTotalValues
An integer that indicates the maximum number of attribute values that can be returned for an entry.
maxValuesPerAttribute
An integer that indicates the maximum number of attribute values that can be returned for an attribute in an entry.
returnDetails
An integer that indicates the type of response wanted. If the value of returnDetails is 0, no response controls are returned with the entries. Otherwise, response controls are returned with the entries.
isCritical
An integer that indicates whether the criticality of the control must be critical or not critical. If the value is 0, the criticality of the control is set to not critical. If the value is non-zero, the criticality of the control is set to critical.
control
Specifies the address of a pointer to an LDAPControl structure, where the created control is built if the API is successful.

Usage

The ldap_create_limit_num_values_control routine is used for creating the Limit Number of Attribute Values Control.

Errors

The ldap_create_limit_num_values_control routine returns an LDAP error code if the routine encounters an error.

The errors that are returned by the ldap_create_limit_num_values_control routine are listed:
  • LDAP_PARAM_ERROR // bad input parameter
  • LDAP_NO_MEMORY // server is out of memory
  • LDAP_SUCCESS // operation was successful
  • LDAP_ENCODING_ERROR // an encoding error was encountered

See also

ldap_parse_limit_num_values_response, ldap_free_limit_num_values_response