HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
7.4.2 Iterating through candidates
In addition to the parameters specified in “Processing an LDAP search operation”, the next
entry function has access to the following parameters (which are set by the front end and the
back end during the course of executing a search operation):
Table 7-3 Information available to the next entry function
DescriptionData typeParameter ID
Set of search results.
void *SLAPI_SEARCH_RESULT_SET
Entry returned from iterating through the results
set. This next entry function actually sets this
parameter.
void *SLAPI_SEARCH_RESULT_ENTRY
Reserved for future use. The context identifying
the last result sent in the results set. This next
entry function actually sets this parameter.
void *SLAPI_SEARCH_RESULT_ENTRY_EXT
Number of search results found.
intSLAPI_NENTRIES
Array of the URLs to other LDAP servers to which
the current server is referring the client.
struct berval **SLAPI_SEARCH_REFERRALS
The next entry function should get the next result specified in the set of results in the
SLAPI_SEARCH_RESULT_SET parameter. The function should set this next entry as the value
of the SLAPI_SEARCH_RESULT_ENTRY parameter in the parameter block, and the next entry
function should return 0 if successful.
The next entry function should set the SLAPI_SEARCH_RESULT_ENTRY parameter to NULL
and return -1 if one of the following situations occurs:
The operation is abandoned (you can check this by calling the “slapi_op_abandoned()”
function).
The time limit has been exceeded.
The maximum number of entries has been exceeded.
If no more entries exist in the set of results, the next entry function should set the
SLAPI_SEARCH_RESULT_ENTRY parameter to NULL and return 0.
7.5 Processing an LDAP compare operation
When the Directory Server receives an LDAP compare request from a client, the front end gets
the DN of the entry being compared and the attribute and value being used in the comparison.
The front end makes this information available to preoperation and postoperation plug-in
functions in the form of parameters in a parameter block.
Table 7-4 Information returned during an LDAP compare operation
DescriptionData typeParameter ID
DN of the entry to be compared.
char *SLAPI_COMPARE_TARGET
Attribute type to use in the comparison.
char *SLAPI_COMPARE_TYPE
Attribute value to use in the comparison.
struct berval *SLAPI_COMPARE_VALUE
The compare function should call “slapi_send_ldap_result()” to send LDAP_COMPARE_TRUE if
the specified value is equal to the value of the entry's attribute or LDAP_COMPARE_FALSE if the
values are not equal.
If successful, the compare function should return 0. If an error occurs (for example, if the specified
attribute doesn't exist), the compare function should call slapi_send_ldap_result() to
send an LDAP error code and should return 1.
64 Defining functions for LDAP operations