Show Table of Contents
6.2. Types of Pre-operation and Post-operation Functions
Pre-operation and post-operation functions are specified in a parameter block that you can set on server startup. Each function corresponds to an ID in the parameter block. In your initialization function, you can call the slapi_pblock_set() function to specify the name of your function that corresponds to the pre-operation or post-operation function. For more information on the parameter block, refer to Section 2.1.3.1, “Getting Data from the Parameter Block”.
6.2.1. Types of Pre-operation Functions
The following table lists the Directory Server pre-operation functions and their purpose.
Table 6.1. Functions Called Before the Directory Server Executes an Operation
| ID in Parameter Block | Description | Further Information |
|---|---|---|
SLAPI_PLUGIN_PRE_BIND_FN | Specifies the function called before the Directory Server executes an LDAP bind operation. | Section 7.2, “Processing an LDAP Bind Operation”. |
SLAPI_PLUGIN_PRE_UNBIND_FN | Specifies the function called before the Directory Server executes an LDAP unbind operation. | Section 7.3, “Processing an LDAP Unbind Operation”. |
SLAPI_PLUGIN_PRE_SEARCH_FN | Specifies the function called before the Directory Server executes an LDAP search operation. | Section 7.4, “Processing an LDAP Search Operation”. |
SLAPI_PLUGIN_PRE_COMPARE_FN | Specifies the function called before the Directory Server executes an LDAP compare operation. | Section 7.5, “Processing an LDAP Compare Operation”. |
SLAPI_PLUGIN_PRE_ADD_FN | Specifies the function called before the Directory Server executes an LDAP add operation. | Section 7.6, “Processing an LDAP Add Operation”. |
SLAPI_PLUGIN_PRE_MODIFY_FN | Specifies the function called before the Directory Server executes an LDAP modify operation. | Section 7.7, “Processing an LDAP Modify Operation”. |
SLAPI_PLUGIN_PRE_MODRDN_FN | Specifies the function called before the Directory Server executes an LDAP modifyRDN operation. | Section 7.8, “Processing an LDAP Modify RDN Operation”. |
SLAPI_PLUGIN_PRE_DELETE_FN | Specifies the function called before the Directory Server executes an LDAP delete operation. | Section 7.9, “Processing an LDAP Delete Operation”. |
SLAPI_PLUGIN_PRE_ABANDON_FN | Specifies the function called before the Directory Server executes an LDAP abandon operation. | Section 7.10, “Processing an LDAP Abandon Operation”. |
SLAPI_PLUGIN_PRE_ENTRY_FN | Specifies the function called before the Directory Server sends an entry to the client (for example, when you call slapi_send_ldap_search_entry(), the pre-operation entry function is called before the entry is sent to the client). | |
SLAPI_PLUGIN_PRE_REFERRAL_FN | Specifies the function called before the Directory Server sends a referral to the client (for example, when you call slapi_send_ldap_referral(), the pre-operation referral function is called before the referral is sent to the client). | |
SLAPI_PLUGIN_PRE_RESULT_FN | Specifies the function called before the Directory Server sends a result code to the client (for example, when you call slapi_send_ldap_result(), the pre-operation result function is called before the result code is sent to the client). |
6.2.2. Types of Post-operation Functions
The following table lists the Directory Server post-operation functions and their purpose.
Table 6.2. Functions Called After the Directory Server Executes an Operation
| ID in Parameter Block | Description | Further Information |
|---|---|---|
SLAPI_PLUGIN_POST_BIND_FN | Specifies the function called after the Directory Server executes an LDAP bind operation. | Section 7.2, “Processing an LDAP Bind Operation”. |
SLAPI_PLUGIN_POST_UNBIND_FN | Specifies the function called after the Directory Server executes an LDAP unbind operation. | Section 7.3, “Processing an LDAP Unbind Operation”. |
SLAPI_PLUGIN_POST_SEARCH_FN | Specifies the function called after the Directory Server executes an LDAP search operation. | Section 7.4, “Processing an LDAP Search Operation”. |
SLAPI_PLUGIN_POST_COMPARE_FN | Specifies the function called after the Directory Server executes an LDAP compare operation. | Section 7.5, “Processing an LDAP Compare Operation”. |
SLAPI_PLUGIN_POST_ADD_FN | Specifies the function called after the Directory Server executes an LDAP add operation. | Section 7.6, “Processing an LDAP Add Operation”. |
SLAPI_PLUGIN_POST_MODIFY_FN | Specifies the function called after the Directory Server executes an LDAP modify operation. | Section 7.7, “Processing an LDAP Modify Operation”. |
SLAPI_PLUGIN_POST_MODRDN_FN | Specifies the function called after the Directory Server executes an LDAP modifyRDN operation. | Section 7.8, “Processing an LDAP Modify RDN Operation”. |
SLAPI_PLUGIN_POST_DELETE_FN | Specifies the function called after the Directory Server executes an LDAP delete operation. | Section 7.9, “Processing an LDAP Delete Operation”. |
SLAPI_PLUGIN_POST_ABANDON_FN | Specifies the function called after the Directory Server executes an LDAP abandon operation. | Section 7.10, “Processing an LDAP Abandon Operation”. |
SLAPI_PLUGIN_POST_ENTRY_FN | Specifies the function called after the Directory Server sends an entry to the client (for example, when you call slapi_send_ldap_search_entry(), the post-operation entry function is called after the entry is sent to the client). | |
SLAPI_PLUGIN_POST_REFERRAL_FN | Specifies the function called after the Directory Server sends a referral to the client (for example, when you call slapi_send_ldap_referral(), the post-operation referral function is called after the referral is sent to the client). | |
SLAPI_PLUGIN_POST_RESULT_FN | Specifies the function called after the Directory Server sends a result code to the client (for example, when you call slapi_send_ldap_result(), the post-operation result function is called after the result code is sent to the client). |

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.