HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Table 11-4 Input and output parameters available to a filter factory function
DescriptionData typeParameter name
Input parameter. Matching rule OID (if any)
specified in the extensible match filter.
char *SLAPI_PLUGIN_MR_OID
Input parameter. Attribute type (if any) specified
in the extensible match filter.
char *SLAPI_PLUGIN_MR_TYPE
Input parameter. Value specified in the extensible
match filter.
struct berval *SLAPI_PLUGIN_MR_VALUE
Input parameter. Pointer to any private data
originally specified in the initialization function.
Refer to “Writing an initialization function”, for
details.
void *SLAPI_PLUGIN_PRIVATE
Output parameter. Name of the function called by
the server to match an entry's attribute values
against the value in the extensible search filter.
mrFilterMatchFn
(function pointer)
SLAPI_PLUGIN_MR_FILTER_MATCH_FN
Output parameter. Name of the function called by
the server to generate a list of keys used for
indexing a set of values.
void * (function
pointer)
SLAPI_PLUGIN_MR_FILTER_INDEX_FN
Output parameter. Name of the function to be
called to free the filter object.
void * (function
pointer)
SLAPI_PLUGIN_DESTROY_FN
Output parameter. Pointer to the filter object
created by your factory function.
void *SLAPI_PLUGIN_OBJECT
11.4.5 Writing a filter index function
The filter index function takes a single Slapi_PBlock argument. This function will never be called
for the same filter object concurrently. (If you plan to manipulate global variables, remember
that the server can call this function concurrently for different filter objects.)
The filter index function should perform the following tasks:
1. Get the filter object from the SLAPI_PLUGIN_OBJECT parameter (if the parameter is set).
2. Using data from the object, determine and set the values of the following parameters:
SLAPI_PLUGIN_MR_OID - Set to the official OID of the matching rule.
SLAPI_PLUGIN_MR_TYPE - Set to the attribute type in the filter object.
SLAPI_PLUGIN_MR_VALUES - Set to the values in the filter object.
SLAPI_PLUGIN_MR_QUERY_OPERATOR - Set to the query operator that corresponds
to this search filter. Refer to “Query operators in matching rules”, for possible values
for this parameter.
SLAPI_PLUGIN_OBJECT - Set to the filter object.
SLAPI_PLUGIN_MR_INDEX_FN - Set to the indexer function. Refer to “Writing the
indexer function”.
3. Return 0 (or the result code LDAP_SUCCESS) if everything completed successfully.
11.4.6 Getting and setting parameters in filter index functions
The following table summarizes the different parameters that the filter index function should
get and set in the parameter block that is passed in.
96 Writing matching rule plug-ins