18.2. slapi_add_internal_set_pb()

Description

This function sets up a parameter block so that it can be used by slapi_add_internal_pb() for an internal add operation. This function is similar to slapi_add_entry_internal_set_pb() except that it constructs the entry from a DN and a set of attributes. The function sets pblock to contain the following data:

  • SLAPI_TARGET_DN set to DN of the new entry.
  • SLAPI_CONTROLS_ARG set to request controls, if present.
  • SLAPI_ADD_ENTRY set to Slapi_Entry to add.
Syntax

 

#include "slapi-plugin.h"
int slapi_add_internal_set_pb(Slapi_PBlock *pb, const Slapi_DN *dn, LDAPMod **attrs, LDAPControl **controls,
 Slapi_ComponentId *plugin_identity, int operation_flags);
Parameters

This function takes the following parameters:

pb Parameter block populated with add parameters.
dn Entry DN.
attrs Entry attributes.
controls List of controls associated with the operation.
plugin_identity Plug-in identity; a cookie that identifies the plug-in to the Directory Server during an internal operation. This cookie is used by the server to retrieve the plug-in configuration in order to determine whether to allow the operation and which actions to take during the operation processing. Plug-in identity is passed to the plug-in initialization function in the SLAPI_PLUGIN_IDENTITY pblock parameter. A plug-in must save this information and pass it to every internal operation issued by the plug-in.
operation_flags Actions taken during operation processing.
Returns

This function returns LDAP_SUCCESS or one of the LDAP error codes if the entry cannot be constructed from the specified attributes due to constraint violation.