14.10. send_ldap_result_fn_ptr_t
send_ldap_result_fn_ptr_t specifies the prototype for a callback function that you can write to send LDAP result codes back to the client. You can register your function so that it is called whenever the slapi_send_ldap_result() function is called.
#include "slapi-plugin.h" typedef void (*send_ldap_result_fn_ptr_t)( Slapi_PBlock *pb, int err, char *matched, char *text, int nentries, struct berval **urls );
The function has the following parameters:
| pb | Parameter block. |
| err | LDAP result code that you want sent back to the client; for example, LDAP_SUCCESS. |
| matched | When sending back an LDAP_NO_SUCH_OBJECT result code, use this argument to specify the portion of the target DN that could be matched. |
| text | Error message that you want sent back to the client. Use NULL if you do not want an error message sent back. |
| nentries | When sending back the result code for an LDAP search operation, use this argument to specify the number of matching entries found. |
| urls | When sending back an LDAP_PARTIAL_RESULTS result code to an LDAPv2 client or an LDAP_REFERRAL result code to an LDAPv3 client, use this argument to specify the array of berval structures containing the referral URLs. |
The slapi_send_ldap_result() function is responsible for sending LDAP result codes back to the client. You can replace the function that sends LDAP result codes to the client with your own function. To do this:
- Write a function with the prototype specified by
send_ldap_result_fn_ptr_t. - In your plug-in initialization function, register your function for sending results to the client by setting the SLAPI_PLUGIN_PRE_RESULT_FN or SLAPI_PLUGIN_POST_RESULT_FN parameter, depending on the type of plug-in and if it is a pre-operation or post-operation, respectively, in the parameter block to the name of your function.
See slapi_send_ldap_result() for information on the default function that sends LDAP result codes to clients.

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.