Sun Java System Directory Server Enterprise Edition 6.2 Developer's Guide

send_ldap_result_fn_ptr_t

Specifies a callback triggered before the server sends a result to the client.

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 callback takes the following parameters.

Table 15–12 send_ldap_result_fn_ptr_t Parameters

Parameter 

Description 

pb

Current parameter block for the operation. 

err

Result code. 

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. (Pass NULL in other situations.)

text

Error message that you want sent back to the client. (Pass 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 LDAP v2 client or an LDAP_REFERRAL result code to an LDAP v3 client, use this argument to specify the array of berval structures containing the referral URLs. (Pass NULL in other situations.)

Description

This callback lets you modify the result returned to the client. Register the callback with the server using slapi_search_internal_callback_pb() .

Returns

The callback should return 0 if successful, -1 otherwise.