HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
11.2.3 How the server associates plug-ins with OIDs
The server associates plug-ins with OIDs using the following process:
When the server encounters the OID for a matching rule, it attempts to find the plug-in
associated with that matching rule.
If no plug-in is associated with the matching rule, the server calls each matching rule plug-in
to find one that handles the specified matching rule.
When the server finds a plug-in that handles the matching rule, the server creates an
association between the plug-in and the matching rule OID for future reference.
If no matching rule plug-in supports the specified OID, the server returns an
[LDAP_UNAVAILABLE_CRITICAL_EXTENSION] error to the client.
11.2.3.1 Finding a plug-in for indexing
To determine which matching rule plug-in is responsible for indexing an attribute with a given
matching rule (based on its OID), the server does the following for each plug-in:
1. In a new Slapi_PBlock parameter block, the server sets the OID in the
SLAPI_PLUGIN_MR_OID parameter.
2. The server then calls the indexer factory function (specified in the
SLAPI_PLUGIN_MR_INDEXER_CREATE_FN parameter) for the plug-in.
3. The server then checks the SLAPI_PLUGIN_MR_INDEX_FN parameter.
If the parameter is NULL, the plug-in does not handle the matching rule specified by
that OID.
If the parameter returns an indexer function, this plug-in handles the matching rule
specified by that OID.
4. Finally, the server frees the parameter block from memory.
At some point, the server may also call the indexer destructor function (specified in the
SLAPI_PLUGIN_MR_DESTROY_FN parameter) to free the indexer object that was created by the
indexer factory function.
11.2.3.2 Finding a plug-in for searching
To determine which matching rule plug-in is responsible for handling an extensible match filter
for a given matching rule (based on its OID), the server does the following for each plug-in:
1. In a new Slapi_PBlock parameter block, the server sets the following parameters:
Sets the OID in the SLAPI_PLUGIN_MR_OID parameter.
Sets the type (from the filter) in the SLAPI_PLUGIN_MR_TYPE parameter.
Sets the value (from the filter) in the SLAPI_PLUGIN_MR_VALUE parameter.
2. The server then calls the filter factory function (specified in the
SLAPI_PLUGIN_MR_FILTER_CREATE_FN parameter) for the plug-in.
3. The server checks the SLAPI_PLUGIN_MR_FILTER_MATCH_FN parameter.
If the parameter is NULL, the plug-in does not handle the matching rule specified by
that OID.
If the parameter returns a filter matching function, this plug-in handles the matching
rule specified by that OID.
4. Finally, the server gets the following information from the plug-in for future use:
The filter index function specified in the SLAPI_PLUGIN_MR_FILTER_INDEX_FN
parameter.
The value specified in the SLAPI_PLUGIN_MR_FILTER_REUSABLE parameter.
The filter reset function specified in the SLAPI_PLUGIN_MR_FILTER_RESET_FN
parameter.
11.2 Understanding matching rule plug-ins 89