Red Hat DIRECTORY SERVER 7.1 - PLUG-IN PROGRAMMERS Manual page 130

Table of Contents

Advertisement

Registering Extended Operation Functions
Code Example 10-1
}
/* Get the number of additional arguments and copy them. */
for ( i = 0; argv[i] != NULL; i++ )
oids = (char **) slapi_ch_malloc( (i+1) * sizeof(char *) );
for ( i = 0; argv[i] != NULL; i++ ) {
}
oids[i] = NULL;
/* Specify the version of the plug-in */
/* Specify the OID of the extended operation */
/* Specify the function that the server should call */
slapi_log_error( SLAPI_LOG_PLUGIN, "extended_init",
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
"Configuring Plug-ins"). For example, your plug-in entry might look like this:
dn: cn=Test ExtendedOp,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Test ExtendedOp
nsslapd-pluginPath: /opt/redhat-ds/servers/plugins/slapd/slapi/
nsslapd-pluginInitfunc: testexop_init
nsslapd-pluginType: extendedop
128
Red Hat Directory Server Plug-in Programmer's Guide • May 2005
Sample Initialization Function for Passing an OID (Continued)
;
oids[i] = slapi_ch_strdup( argv[i] );
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
SLAPI_PLUGIN_VERSION_01 ) != 0
slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLISTs,
(void*) oids ) != 0
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 );
}
"Plug-in sucessfully registered.\n" );
dse.ldif
examples/libtest-plugin.so
||
||
file, and restart the server (see chapter 3,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 7.1

Table of Contents