slapi_register_supported_control()

slapi_register_supported_control() registers the specified control with the server. It also associates the control with an OID.

When the server receives a request that specifies this OID, the server uses this information to determine whether the control is supported. For example, to register a control for Add and Delete operation:
slapi_register_supported_control(<Control OID>,
					SLAPI_OPERATION_ADD | SLAPI_OPERATION_DELETE );
Syntax
#include "slapi-plugin.h"
void slapi_register_supported_control( char *controloid,
				unsigned long controlops );
Parameters
controloid
The OID of the control you want to register.
controlops
The operation that the control is applicable to. It can have one or more of the following values:
  • SLAPI_OPERATION_BIND - Applies to the LDAP bind operation.
  • SLAPI_OPERATION_UNBIND - Applies to the LDAP unbind operation.
  • SLAPI_OPERATION_SEARCH - Applies to the LDAP search operation.
  • SLAPI_OPERATION_MODIFY - Applies to the LDAP modify operation.
  • SLAPI_OPERATION_ADD - Applies to the LDAP add operation.
  • SLAPI_OPERATION_DELETE - Applies to the LDAP delete operation.
  • SLAPI_OPERATION_MODDN - Applies to the LDAP modify DN operation.
  • SLAPI_OPERATION_MODRDN - Applies to the LDAP V3 modify RDN operation.
  • SLAPI_OPERATION_COMPARE - Applies to the LDAP compare operation.
  • SLAPI_OPERATION_ABANDON - Applies to the LDAP abandon operation.
  • SLAPI_OPERATION_EXTENDED - Applies to the LDAP V3 extended operation.
  • SLAPI_OPERATION_ANY - Applies to any LDAP operation.
  • SLAPI_OPERATION_NONE - Applies to none of the LDAP operations.