HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
14.9 send_ldap_referral_fn_ptr_t
send_ldap_referral_fn_ptr_t specifies the prototype for a callback function that you can
write to send LDAPv3 referrals (search result references) back to the client. You can register your
function so that it is called whenever the slapi_send_ldap_result() function is called.
Syntax
#include "slapi-plugin.h"
typedef int (*send_ldap_referral_fn_ptr_t)( Slapi_PBlock *pb,
Slapi_Entry *e, struct berval **refs, struct berval ***urls);
Parameters This function takes the following parameters:
Parameter block.
pb
Pointer to the Slapi_Entry structure representing the entry with which you
are working.
e
Pointer to the NULL-terminated array of berval structures containing the
LDAPv3 referrals (search result references) found in the entry.
refs
Pointer to the array of berval structures used to collect LDAP referrals for
LDAPv2 clients.
urls
Returns This function returns 0 if successful, or -1 if an error occurs.
Description The slapi_send_ldap_result() function is responsible for sending LDAPv3
referrals (search result references) back to the client. You can replace the function that sends
LDAPv3 referrals to the client with your own function. To do this:
1. Write a function with the prototype specified by send_ldap_result_fn_ptr_t.
2. In your plug-in initialization function, register your function by setting the
SLAPI_PLUGIN_PRE_REFERRAL_FN parameter in the parameter block to the name of your
function if you are using the preoperation plug-in. If you are using the postoperation plug-in,
register your function by setting the SLAPI_PLUGIN_POST_REFERRAL_FN parameter in
the parameter block to the name of your function.
See “slapi_send_ldap_result()” for information on the default function that sends LDAPv3
referrals to clients.
See also send_result()
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.
Syntax
#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 );
Parameters The function has the following parameters:
Parameter block.
pb
LDAP result code that you want sent back to the client; for example,
LDAP_SUCCESS.
err
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.
matched
Error message that you want sent back to the client. Use NULL if you do
not want an error message sent back.
text
14.9 send_ldap_referral_fn_ptr_t 123