21.7. slapi_get_supported_controls_copy()

Description

This function replaces the deprecated slapi_get_supported_controls() function from previous releases, as it was not multi thread safe. It retrieves an allocated array of object identifiers (OIDs) representing the controls supported by the Directory Server. You can register new controls by calling slapi_register_supported_control().

When you call slapi_register_supported_control() to register a control, you specify the OID of the control and the IDs of the operations that support the control. The server records this information in two arrays; an array of control OIDs and an array of operations that support the control. You can get copies of these arrays by calling slapi_get_supported_controls_copy().
For each OID returned in the ctrloidsp array, the corresponding array element (with the same index) in the ctrlopsp array identifies the operations that support the control. For a list of the possible IDs for the operations, refer to slapi_register_supported_control().
Syntax

#include "slapi-plugin.h"
int slapi_get_supported_controls_copy( char ***ctrloidsp, unsigned long **ctrlopsp );

Parameters

This function takes the following parameters:

ctrloidsp
Pointer to a character array that will receive the set of supported control OIDs. Pass NULL for this parameter if you do not wish to receive the OIDs.
ctrlopsp
Pointer to an unsigned long array that will receive the supported operation values for each control in the ctrloidsp array. Pass NULL for this parameter if you do not wish to receive the supported operation values.
Returns

This function returns one of the following values:

  • 0 if successful.
  • A non-zero value if an error occurs.
Memory Concerns

The returned ctrloidsp array should be freed by calling slapi_ch_array_free(). The returned ctrlopsp array should be freed by calling slapi_ch_free().