•
If your function cannot handle the extended operation with the specified OID,
your function should return the value
SLAPI_PLUGIN_EXTENDED_NOT_HANDLED
LDAP_PROTOCOL_ERROR
error message") back to the client.
NOTE
Registering Extended Operation Functions
As is the case with other server plug-in functions (see "Passing Data with
Parameter Blocks" on page 28), extended operation functions are specified in a
parameter block that you can set on server startup.
In your initialization function, you can call the
set the
SLAPI_PLUGIN_EXT_OP_OIDLIST
operations supported by your function.
You can write your initialization function so that the OID is passed in from the
directive. (See "Passing Extra Arguments to Plug-Ins" on page 45 for details.) For
example, the following initialization function sets the
SLAPI_PLUGIN_EXT_OP_OIDLIST
Code Example 10-1
int extended_init( Slapi_PBlock *pb )
{
int i;
char **argv;
char **oids;
/* Get the additional arguments specified in the directive */
if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) {
}
if ( argv == NULL ) {
For a sample plug-in function (uncompiled C code) that
implements an extended operation, check this file:
<server_root>/plugins/slapd/slapi/examples/testextended
op.c
SLAPI_PLUGIN_EXT_OP_FN
Sample Initialization Function for Passing an OID
slapi_log_error( SLAPI_LOG_PLUGIN, "extended_init",
"Server could not get argv.\n" );
return( -1 );
slapi_log_error( SLAPI_LOG_PLUGIN, "extended_init",
"Required argument <oiD> is missing\n" );
return( -1 );
. The front-end will send an
result code (with an "unsupported extended operation
slapi_pblock_set()
parameter to your function and the
parameter to the list of OIDs of the extended
parameter to the additional parameters specified.
Chapter 10
Registering Extended Operation Functions
function to
Writing Extended Operation Plug-Ins
119
Need help?
Do you have a question about the NETSCAPE DIRECTORY SERVER 6.2 - PLUG-IN and is the answer not in the manual?
Questions and answers