Show Table of Contents
14.29. Slapi_PBlock
Contains name-value pairs, known as parameter blocks, that you can get or set for each LDAP operation.
Syntax
#include "slapi-plugin.h" typedef struct slapi_pblock Slapi_PBlock;
Description
Slapi_PBlock contains name-value pairs that you can use to retrieve information from the server and set information to be used by the server.
For most types of plug-in functions, the server passes in a Slapi_PBlock structure that typically includes data relevant to the operation being processed. You can get the value of a parameter by calling the
slapi_pblock_get() function.
For example, when the plug-in function for an LDAP bind operation is called, the server puts the DN and credentials in the SLAPI_BIND_TARGET and SLAPI_BIND_CREDENTIALS parameters of the Slapi_PBlock structure. You can call
slapi_pblock_get() to get the DN and credentials of the client requesting authentication.
For plug-in initialization functions, you can use the Slapi_PBlock structure to pass information to the server, such as the description of your plug-in and the names of your plug-in functions. You can set the value of a parameter by calling the
slapi_pblock_set() function.
For example, in order to register a pre-operation bind plug-in function, you need to call
slapi_pblock_set() to set the version number, description, and name of the plug-in function as the SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_DESCRIPTION, and SLAPI_PLUGIN_PRE_BIND_FN parameters.
The available parameters that you can use depends on the type of plug-in function you are writing.
The following table summarizes the front-end API functions that you can call to work with block parameters.
| To ... | ... Call this function |
|---|---|
Set up a parameter block so that it can be used by slapi_add_internal_pb() for an internal add operation. | slapi_add_entry_internal_set_pb() |
| Add an LDAP add operation based on a parameter block to add a new directory entry. | slapi_add_internal_pb() |
Set up a parameter block so that it can be used by slapi_add_internal_pb() for an internal add operation; the entry is constructed from a DN and a set of attributes. | slapi_add_internal_set_pb() |
| Perform an LDAP delete operation based on a parameter block to remove a directory entry. | slapi_delete_internal_pb() |
| Delete an internal parameter block set. | slapi_delete_internal_set_pb() |
| Perform an LDAP modify operation based on a parameter block to modify a directory entry. | slapi_modify_internal_pb() |
Set up a parameter block so that it can be used by slapi_modify_internal_pb() for an internal modify operation. | slapi_modify_internal_set_pb() |
| Perform an LDAP modify RDN operation based on a parameter block to rename a directory entry. | slapi_modrdn_internal_pb() |
| Free a pblock from memory. | slapi_pblock_destroy() |
| Get the value from a pblock. | slapi_pblock_get() |
| Initialize an existing parameter block so that it can be reused. | Section 35.3, “slapi_pblock_init()” |
| Create a new pblock. | slapi_pblock_new() |
| Set the value of a pblock. | slapi_pblock_set() |
Set up a parameter block so that it can be used by slapi_modrdn_internal_pb() for an internal rename operation. | slapi_rename_internal_set_pb() |
| Perform an LDAP search operation based on a parameter block to search the directory. | slapi_search_internal_callback_pb() |
| Search for an internal parameter block. | slapi_search_internal_pb() |
Set up a parameter block so that it can be used by slapi_search_internal_pb() for an internal search operation. | slapi_search_internal_set_pb() |
| Perform an internal sequential access operation. | slapi_seq_internal_callback_pb() |
Set up a parameter block for use by slapi_seq_internal_callback_pb() for an internal, sequential-access operation. | slapi_seq_internal_set_pb() |

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.