HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
/* Specify the function that the server should call */
slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void*)extended_op ) != 0 ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "extended_init" , "An error occurred.\n" );
return( -1 );
}
slapi_log_error( SLAPI_LOG_PLUGIN, "extended_init" ,
"Plug-unsuccessfully registered.\n" );
return(0); }
Depending on the Directory Server version, add a directive in the appropriate form to specify
the name and location of your plug-in function and to specify the object identification (OID) of
the operation.
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 ExtendedOp,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Test ExtendedOp
nsslapd-pluginPath: /opt/dirsrv/devel/example/libtest-plugin.so
nsslapd-pluginInitfunc: testexop_init
nsslapd-pluginType: extendedop
nsslapd-pluginEnabled: on
nsslapd-plugin-depends-on-type: database
nsslapd-pluginId: test-extendedop
nsslapd-pluginarg0: 1.2.3.4
Refer to the following source file for an example plug-in function that implements an extended
operation:
/opt/dirsrv/devel/example/testextendedop.c
10.4 Specifying start and close functions
For each extended operation plug-in, you can specify the name of a function to be called after
the server starts and before the server is shut down.
Use the following parameters to specify these functions:
SLAPI_PLUGIN_START_FN
Specifies the function called after the Directory Server starts.
SLAPI_PLUGIN_CLOSE_FN
Specifies the function called before the Directory Server shuts down.
If you register multiple plug-ins with different start and close functions, the functions are called
in the order that the plug-ins are registered (that is, in the order that the plugin directives appear
in the server configuration file).
10.4 Specifying start and close functions 85