HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
In order to add your plug-in to that internal list, you need to write an initialization function. The
initialization function takes a single Slapi_PBlock argument. The function should set the following
parameters:
The SLAPI_PLUGIN_MR_FILTER_CREATE_FN parameter should be set to the filter factory
function.
Refer to “How the server handles the filter, and “Writing a filter factory function”, for
details.
The SLAPI_PLUGIN_MR_INDEXER_CREATE_FN parameter should be set to the indexer
factory function if you have defined one. [Optional]
Refer to “How the server sets up the index”, and “Writing the indexer factory function”, for
details.
The SLAPI_PLUGIN_CLOSE_FN parameter should be set to the close function if you have
defined one. [Optional]
Refer to “Specifying start and close functions”, for details.
The SLAPI_PLUGIN_PRIVATE parameter should be set to any private data you want made
accessible to the plug-in functions. [Optional]
You need to register the initialization function so that the server runs the function when starting.
For how to register matching rule functions, refer to “Registering matching rule functions”.
The following table summarizes the different parameters that the initialization function should
get and set in the parameter block that is passed in.
Table 11-7 Input and output parameters available to a matching rule plug-in initialization function
DescriptionData typeParameter name
Input parameter. Number of arguments in the
plugin directive, not including the library name and
initialization function name.
intSLAPI_PLUGIN_ARGC
Input parameter. Array of string arguments in the
plugin directive, not including the library name and
initialization function name.
char **SLAPI_PLUGIN_ARGV
Output parameter. The factory function used for
creating filters.
void * (function
pointer)
SLAPI_PLUGIN_MR_FILTER_CREATE_FN
Output parameter. The factory function used for
creating indexers.
void * (function
pointer)
SLAPI_PLUGIN_MR_INDEXER_CREATE_FN
Output parameter. The close function, which the
server calls before shutting down.
void * (function
pointer)
SLAPI_PLUGIN_CLOSE_FN
Output parameter. Pointer to any private data you
want passed to your plug-in functions.
void *SLAPI_PLUGIN_PRIVATE
11.8 Registering matching rule functions
Depending on the Directory Server version, add the appropriate information for your plug-in
function.
In current releases of Directory Server, shut down the server, add the plug-in parameters to the
dse.ldif file, and restart the server. Refer to Chapter 3 “Configuring plug-ins”.
For example, your plug-in entry might appear as follows:
dn: cn=Test MatchineRule,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Test MatchingRule
11.8 Registering matching rule functions 99