#include "slapi-plugin.h" int slapi_build_control_from_berval( char const *oid, struct berval *bvp, char iscritical, LDAPControl **ctrlp );
This function takes the following parameters:
The OID (object identifier) for the control that is to be created.
A berval that contains the control value. Pass NULL if the control has no value.
The criticality flag. If non-zero, the control will be marked as critical. If 0, it will not be marked as critical.
Pointer that will receive the allocated LDAPControl structure.
This function always returns LDAP_SUCCESS (LDAP result code).
Directory Server makes a copy of the oid string.
The contents of the bvp parameter are consumed by this function. Because of this, the caller should not free the bvp->bv_val pointer once a successful call to this function has been made.
The LDAPControl pointer that is returned in ctrlp should be freed by calling ldap_control_free(3LDAP), which is an LDAP API function.