Chapter 21. Functions for Dealing with Controls
Table 21.1. Routines for Dealing with Controls
| Function | Description |
|---|---|
| slapi_add_control_ext() | Adds the specified control to the end of an array of controls. |
| slapi_add_controls() | Appends all of an array of controls to an existing array of controls. |
| slapi_build_control() | Creates an LDAPControl structure based on a BerElement, an OID, and a criticality flag. |
| slapi_build_control_from_berval() | Creates an LDAPControl structure based on a struct berval, an OID, and a criticality flag. |
| slapi_control_present() | Determines whether the specified object identification (OID) identifies a control that is present in a list of controls. |
| slapi_dup_control() | Makes an allocated copy of an LDAPControl. |
| slapi_get_supported_controls_copy() | Retrieves an allocated array of object identifiers (OIDs) representing the controls supported by the Directory Server. |
| slapi_register_supported_control() | Registers the specified control with the server. This function associates the control with an object identification (OID). |
21.1. slapi_add_control_ext()
slapi_add_control_ext(&ctrls, newctrl, 1);
#include "slapi-plugin.h" void slapi_add_control_ext(LDAPControl ***ctrlsp, LDAPControl *newctrl, int copy)
This function takes the following parameters:
| ctrlsp | Pointer that will receive the specified LDAPControl. If ctrls is NULL, then the array is created using slapi_ch_malloc(). |
| newctrl | Pointer to the specified LDAPControl. |
| copy | Sets whether the given control is copied. If the value is true (0), then the control in newctrl is copied. If the value is false (1), then the control in newctrl is used and owned by the array and must be freed using ldap_controls_free. |
This function returns LDAP_SUCCESS (LDAP result code) if successful.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.