HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
NOTE:
The initialization function should not do anything more than these three steps. To perform
additional configuration or initialization, use a start function. This function is specified by using
“slapi_pblock_set()” with the SLAPI_PLUGIN_START_FN parameter in the initialization function.
Your initialization function should have a prototype similar to the following:
int my_init_function( Slapi_PBlock pb );
In the initialization function, the Directory Server passes a single argument of type Slapi_PBlock
2.2.1 Specifying Directory Server compatibility
You need to specify the compatibility version of the plug-in so that the Directory Server can
determine whether it supports the plug-in.
To specify the plug-in compatibility version, call the “slapi_pblock_set()” function, and set the
SLAPI_PLUGIN_VERSION parameter to the version number associated with the plug-in. For
example:
slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03);
Plug-in version 1 (SLAPI_PLUGIN_VERSION_01) is compatible with versions 3.x and 4.x
of the Directory Server.
Plug-in version 2 (SLAPI_PLUGIN_VERSION_02) is compatible with version 4.x of the
Directory Server.
Plug-in version 3 (SLAPI_PLUGIN_VERSION_03) is compatible with versions 6.x and later
of the Directory Server.
2.2.2 Specifying information about the plug-in
You specify information about the plug-in, such as a description, with the Slapi_PluginDesc
structure. For details on this data structure, see “Slapi_PluginDesc”.
It is recommended that you include a plug-in description because the Console displays this
information as part of the server configuration information.
To specify plug-in information, call the “slapi_pblock_set()” function, and set the
SLAPI_PLUGIN_DESCRIPTION parameter to this structure. For example:
Specifying Plug-in Information
/* Specify information about the plug-in */
Slapi_PluginDesc mypdesc = { "test-plugin" , "example.com" "0.5" ,
"sample preoperation plugin" };
...
/* Set this information in the parameter block */
slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void*)&mypdesc );
This example code specifies the following plug-in information:
The unique identifier for the server plug-in is test-plugin.
The vendor of the server plug-in is example.com.
The version of the server plug-in is 0.5.
This version is intended to be used for tracking purposes only; it is not the same as the server
compatibility version number specified by the SLAPI_PLUGIN_VERSION parameter (see
“Specifying Directory Server compatibility” for details on this parameter). As you make
changes to the plug-in code, you can track the version distributed using the number contained
in the Slapi_PluginDesc structure.
The description of the server plug-in is contained in the data structure value sample
preoperation plug-in.
34 Writing and compiling plug-ins