Format
#include <slapi-plugin.h>
int slapi_pblock_set (
Slapi_PBlock * pb,
int arg,
void * value)
Parameters
Input:
- pb
- The plug-in parameter block.
- arg
- The parameter value to be set.
- value
- The address of the parameter value or, for a registration parameter,
the callback function.
Usage
The specified parameter value is set
in the plug-in parameter block. The plug-in must release any storage
allocated for the parameter value since the slapi_pblock_set() routine makes a copy of the parameter value before returning. For
SLAPI_PLUGIN_PRIVATE and SLAPI_CONN_PRIVATE, the parameter value is
an address that is saved in the plug-in parameter block. EINVAL is
returned if the parameter type or value is not valid while EPERM is
returned if the parameter type is not allowed for the current plug-in
invocation.
Suffixes, extended operations, and controls can
only be set during initialization.
Table 1. Registration parameters. Registration parameters
| Name |
Format |
Usage |
| SLAPI_PLUGIN_ABANDON_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client ABANDON request. |
| SLAPI_PLUGIN_ADD_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client ADD request. |
| SLAPI_PLUGIN_BIND_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client BIND request. |
| SLAPI_PLUGIN_CALLBACK_FN |
int (*)(Slapi_PBlock *) |
Routine to process a server callback request.
A callback routine is registered only by a client-operation plug-in. |
| SLAPI_PLUGIN_CLOSE_FN |
void (*)(Slapi_PBlock *) |
Routine to be called during LDAP server termination. |
| SLAPI_PLUGIN_COMPARE_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client COMPARE request. |
| SLAPI_PLUGIN_DELETE_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client DELETE request. |
| SLAPI_PLUGIN_DISCONNECT_FN |
void (*)(Slapi_PBlock *) |
Routine to be called when an LDAP client session
is closed. |
| SLAPI_PLUGIN_EXT_OP_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client EXTENDED OPERATION
request. |
| SLAPI_PLUGIN_MODIFY_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client MODIFY request. |
| SLAPI_PLUGIN_MODRDN_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client MODIFY DN request. |
| SLAPI_PLUGIN_SEARCH_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client SEARCH request. |
| SLAPI_PLUGIN_THREAD_FN |
void (*)(Slapi_PBlock *) |
Routine to be called when an LDAP server worker
thread terminates. |
| SLAPI_PLUGIN_UNBIND_FN |
int (*)(Slapi_PBlock *) |
Routine to process a client UNBIND request. |
Table 2. Operational parameters. Operational parameters
| Name |
Format |
Usage |
| SLAPI_CONN_PRIVATE |
void * |
Private value for the current connection. Each
plug-in can have its own set of private connection values. |
| SLAPI_PLUGIN_CTLLIST |
char ** |
NULL-terminated array of server control object
identifiers supported by the current plug-in. The LDAP server accepts
an unrecognized critical control if the object identifier is registered
by one or more plug-ins. The plug-in is responsible for any processing
required by the server control. |
| SLAPI_PLUGIN_DB_SUFFIX |
char ** |
NULL-terminated array of database suffixes for
the current plug-in. This parameter is set only by a client-operation
plug-in. |
| SLAPI_PLUGIN_EXT_OP_OIDLIST |
char ** |
NULL-terminated array of extended operation
object identifiers for the current plug-in. This parameter is set
only by a client-operation plug-in. |
| SLAPI_PLUGIN_MSG_CAT_NP |
char ** |
The name of the message catalog that is to be
registered by this plug-in. |
| SLAPI_PLUGIN_PRIVATE |
void * |
Private value that is retrieved by the slapi_pblock_get() routine. Each plug-in has its own private value. |
Table 3. Callback parameters. Callback parameters
| Name |
Format |
Usage |
| SLAPI_CALLBACK_ERRMSG |
char * |
An error message is returned to the LDAP client
if an error occurred. Specify NULL if there is no error message. |
| SLAPI_CALLBACK_LIST |
char ** |
A NULL-terminated array of names. This is the
return value for a group list or alternate names callback. Specify
NULL if there are no names. |
| SLAPI_CALLBACK_PASSWORD |
char * |
The user password. This is a return value for
a password callback. Specify NULL if there is no password for the
supplied name. |
| SLAPI_CALLBACK_STATUS |
int |
This is the LDAP result code for the request.
It is set to LDAP_SUCCESS if the callback request was processed, LDAP_UNWILLING_TO_PERFORM
if the plug-in does not recognize the callback type, or an LDAP error
code if an error occurred. The return status is LDAP_SUCCESS if there
is no password, group, or alternate name for the supplied name and
the appropriate return value (SLAPI_CALLBACK_LIST or SLAPI_CALLBACK_PASSWORD)
is set to NULL. |
| SLAPI_CALLBACK_TARGET_DN |
char * |
The entry name associated with the password
returned for the SLAPI_CALLBACK_PASSWORD parameter. This is a return
value for a password callback. Specify NULL if there is no entry. |
Table 4. General result parameters. General result parameters
| Name |
Format |
Usage |
| SLAPI_RETCONTROLS |
LDAPControl ** |
A NULL-terminated array of controls is returned
in the result message. This parameter may be set only by a client-operation
plug-in. |
Table 5. EXTENDED OPERATION result
parameters. EXTENDED OPERATION parameters
| Name |
Format |
Usage |
| SLAPI_EXT_OP_RET_OID |
char * |
Extended operation object identifier. |
| SLAPI_EXT_OP_RET_VALUE |
BerVal * |
Extended operation value. |
Related topics
The return value is 0 if
the request is successful and -1 if there is an error. The
errno variable is set to one of the following values when the function
return value is -1:
- EEXIST
- Value already exists
- EFAULT
- Value address is not valid
- EINVAL
- A parameter is not valid
- ENOMEM
- Insufficient storage is available
- EPERM
- A parameter is not allowed