Chapter 17. Functions for Internal Operations and Plug-in Callback

This chapter contains reference information on routines for internal operations and plug-in callbacks. These functions can be used for internal operations based on DN as well as on unique ID. These functions should be used by all new plug-ins, and, preferably, old plug-ins should be changed to use them to take advantage of new plug-in configuration capabilities and to use an extensible interface.

Table 17.1. Internal Operations and Plug-in Callback Routines

Function Description
slapi_add_internal_pb() Performs an LDAP add operation based on a parameter block to add a new directory entry.
slapi_delete_internal_pb() Performs an LDAP delete operation based on a parameter block to remove a directory entry.
slapi_free_search_results_internal() Frees search results.
slapi_modify_internal_pb() Performs an LDAP modify operation based on a parameter block to modify a directory entry.
slapi_modrdn_internal_pb() Performs an LDAP modify RDN operation based on a parameter block to rename a directory entry.
slapi_search_internal_callback_pb() Performs an LDAP search operation based on a parameter block to search the directory.
slapi_search_internal_get_entry() Performs an internal search operation to read one entry.
slapi_search_internal_pb() Performs an LDAP search operation based on a parameter block to search the directory.

17.1. slapi_add_internal_pb()

Description

The function performs an internal LDAP add operation based on a parameter block. The parameter block should be initialized by calling slapi_add_internal_set_pb() or slapi_add_entry_internal_set_pb().

Syntax

 

#include "slapi-plugin.h"
int slapi_add_internal_pb ( Slapi_PBlock *pb );
Parameters

This function takes the following parameter:

pb A parameter block that has been initialized using slapi_add_internal_set_pb().
Returns

This function returns one of the following values:

  • 0 if successful.
  • -1 if an error occurs. If -1 is returned, the SLAPI_PLUGIN_INTOP_RESULT field of the parameter block should be consulted to determine the precise LDAP result code.
Memory Concerns

None of the parameters that are passed slapi_add_internal_set_pb() are altered or consumed by this function. The entry parameter that is passed to slapi_add_entry_internal_set_pb() is consumed by a successful call to this function.