Plug-in Programmer’s Guide Red Hat Directory Server |
Previous |
Contents |
Index |
Next |
Chapter 16
Parameter Block Reference
This chapter describes the parameters available in the Slapi_PBlock parameter block, the type of data associated with each parameter, and the plug-in functions in which those parameters are accessible.
To get the values of these parameters, call the slapi_pblock_get() function. To set the values of these parameters, call the slapi_pblock_set() function. Using these parameters, you can get and set the following information:
- Parameters for Registering Plug-in Functions (page 566)
- Parameters Accessible to All Plug-ins (page 570)
- Parameters for the Bind Function (page 582)
- Parameters for the Search Function (page 583)
- Parameters that Convert Strings to Entries (page 586)
- Parameters for the Add Function (page 587)
- Parameters for the Compare Function (page 588)
- Parameters for the Delete Function (page 588)
- Parameters for the Modify Function (page 589)
- Parameters for the Modify RDN Function (page 589)
- Parameters for the Abandon Function (page 590)
- Parameters for the Matching Rule Function (page 591)
- Parameters for LDBM Backend Pre- and Post-Operation Functions (page 593)
- Parameters for the Database (page 594)
- Parameters for LDAP Functions (page 596)
- Parameters for Error Logging (page 599)
- Parameters for Filters (page 600)
- Parameters for Password Storage (page 602)
- Parameters for Resource Limits (page 603)
- Parameters for the Virtual Attribute Service (page 603)
Parameters for Registering Plug-in Functions
The parameters listed in this section identify plug-in functions recognized by the server. To register your plug-in function, set the value of the appropriate parameter to the name of your function.
With the exception of the parameters for matching rule plug-in functions, you do not need to get the value of any of these parameters.
The parameters for registering plug-in functions are organized in the following sections:
- Pre-Operation/Data Validation Plug-ins
- Post-Operation/Data Notification Plug-ins
- Matching Rule Plug-ins
- Entry Plug-ins
Database plug-ins are not supported in current releases of Directory Server. Please use the pre-operation, post-operation, and/or extended operation API to register plug-in functions.
Pre-Operation/Data Validation Plug-ins
The parameters listed in this section are used to register pre-operation/data validation plug-in functions.
To register your plug-in function, write an initialization function that sets the values of the following parameters to your functions.
Post-Operation/Data Notification Plug-ins
The parameters listed in this section are used to register post-operation/data notification plug-in functions.
Matching Rule Plug-ins
The parameters listed below are used with matching rule plug-in functions that can be registered.
Entry Plug-ins
The parameters listed below are used for entry store and entry fetch plug-in functions. These plug-in functions are called by the server before writing an entry to disk and after reading an entry from disk. Entry store and entry fetch plug-in functions are passed using the string representation (in LDIF) of the entry.
Parameters Accessible to All Plug-ins
The parameters listed in this section are accessible to all types of plug-ins. The parameters in this section are organized in the following sections:
- Information about the Database
- Information about the Connection
- Information about the Operation
- Information about Extended Operations
- Information about the Transaction
- Information about Access Control Lists
- Notes in the Access Log
- Information about the Plug-in
- Information about Command-Line Arguments
- Information about Attributes
- Information about Targets
Information about the Database
The parameters listed below specify information about the backend database. These parameters are available for all types of plug-ins. These specific parameters cannot be set by calling slapi_pblock_set(). You can, however, get these parameters by calling slapi_pblock_get().
Information about the Connection
The parameters listed below specify information about the connection. These parameters are available for all types of plug-ins.
Parameter ID Data Type Description SLAPI_CONN_CERT CERTCertificate *This is an NSS database. See http://mozilla.org/projects/security/pki/nss/ The client certificate associated with the connection; may be absent. SLAPI_CONN_IS_REPLICATION_
SESSION char * Indicates the current connection is a replication session. SLAPI_CONN_IS_SSL_
CONNECTION char * Indicates the current connection is through SSL. SLAPI_CONNECTION Slapi_Connection * Information about the current client connection. SLAPI_CONN_ID int * ID identifying the current connection. SLAPI_CONN_DN char * DN of the user authenticated on the current connection. If you call slapi_pblock_get() to get this DN, you should call slapi_ch_free_string() to free the resulting DN when done. SLAPI_CONN_AUTHMETHOD char * Method used to authenticate the current user. If you call slapi_pblock_get() to get this value, you should call slapi_ch_free_string() to free the resulting value when done. This parameter can have one of the following values:
- SLAPD_AUTH_NONE specifies that no authentication mechanism was used (for example, in cases of anonymous authentication).
- SLAPD_AUTH_SIMPLE specifies that simple authentication (user name and password) was used to authenticate the current user.
- SLAPD_AUTH_SSL specifies that SSL (certificate-based authentication) was used to authenticate the current user.
- SLAPD_AUTH_SASL specifies that a SASL (Simple Authentication and Security Layer) mechanism was used to authenticate the current user.
SLAPI_CONN_AUTHTYPE char * This parameter has been deprecated for current releases. Use SLAPI_CONN_AUTHMETHOD instead. SLAPI_CONN_CLIENTIP struct in_addr IP address of the client requesting the operation. This parameter has been replaced by SLAPI_CONN_CLIENTNETADDR but is provided here for backward compatibility. SLAPI_CONN_SERVERIP struct in_addr IP address to which the client is connecting. You might want to use this parameter if, for example, your server accepts connections on multiple IP addresses.This parameter has been replaced by SLAPI_CONN_SERVERADDR but is provided here for backward compatibility SLAPI_CONN_CLIENTNETADDR* PRNetAddr IP address of the client requesting the operation. SLAPI_CONN_SERVERNETADDR* PRNetAddr IP address to which the client is connecting. You might want to use this parameter if, for example, your server accepts connections on multiple IP addresses.
*These parameters use an NSPR structure. See http://www.mozilla.org/projects/nspr for more information.
Information about the Operation
The parameters listed below specify information about the current operation. These parameters are available for all types of plug-ins.
Information about Extended Operations
The following table lists the parameters in the parameter block passed to extended operation functions. If you are writing your own plug-in function for performing this work, you can get these values by calling the slapi_pblock_get() function.
Information about the Transaction
The parameters listed below specify information about the current transaction. These parameters are available for all types of plug-ins.
Parameter ID Data Type Description SLAPI_PARENT_TXN void * Parent transaction. SLAPI_TXN void * ID for current transaction.
Information about Access Control Lists
The parameters listed below are used with the access control list (ACL) plug-in functions to determine access control levels.
Notes in the Access Log
The parameters listed below specify notes that can be appended to access log entries. These parameters are available for all types of plug-ins.
Information about the Plug-in
The parameters listed below specify information about the plug-in that is available to all plug-in functions defined in the current library. These parameters are available for all types of plug-ins.
Parameter ID Data Type Description SLAPI_PLUGIN void * Pointer to the internal server representation of this plug-in. SLAPI_PLUGIN_PRIVATE void * Private data that you want passed to your plug-in functions. SLAPI_PLUGIN_TYPE int Specifies the type of plug-in function (see "Types of Plug-ins," on page 578) SLAPI_PLUGIN_ARGV char ** NULL-terminated array of command-line arguments specified for the plugin directive in the server configuration file. SLAPI_PLUGIN_ARGC int Number of command-line arguments specified for the plugin directive in the server configuration file. SLAPI_PLUGIN_VERSION char * Specifies the version of the plug-in function (see "Version Information," on page 579). SLAPI_PLUGIN_OPRETURN int Specifies the return value of the LDAP operation that has just been processed. SLAPI_PLUGIN_OBJECT void * Reserved for internal use only; used with filter processing. SLAPI_PLUGIN_DESTROY_FN void * Reserved for internal use only; used with filter processing. SLAPI_PLUGIN_DESCRIPTION char * Provides a description of this plug-in function. SLAPI_PLUGIN_IDENTITY char * Identifies this plug-in function.
Types of Plug-ins
The SLAPI_PLUGIN_TYPE parameter can have one of the following values, which identifies the type of the current plug-in:
Version Information
To set the value of the SLAPI_PLUGIN_VERSION parameter, you can specify one of the following values:
Information about Command-Line Arguments
The parameters listed below are used to determine the command-line arguments with which a plug-in was invoked.
Information about Attributes
The parameters listed below provide the following information about attributes:
Attribute Names
The parameters listed below are used to check for commonly-used attribute names. These are not pblock parameters but macros that define strings; for example, SLAPI_ATTR_OBJECTCLASS is objectclass.
Attribute Flags
The parameters listed below are used by the slapi_attr_get_flags()function to get the flags associated with the specified attribute. These flags can identify an attribute as a single-valued attribute, an operational attribute, or as a read-only attribute.
Attribute Comparisons
The parameters listed below are used with the slapi_attr_type_cmp() plug-in function to compare two components of an attribute.
Information about Targets
The parameters listed below provide information about targets. These parameters are available for all types of plug-ins.
Parameters for the Bind Function
The following table lists the parameters in the parameter block passed to the database bind function. If you are writing a pre-operation, database, or post-operation bind function, you can get these values by calling the slapi_pblock_get() function.
Parameter ID Data Type Description SLAPI_BIND_TARGET char * DN of the entry to which to bind. SLAPI_BIND_METHOD int Authentication method used; for example, LDAP_AUTH_SIMPLE or LDAP_AUTH_SASL. SLAPI_BIND_CREDENTIALS struct berval * Credentials from the bind request. SLAPI_BIND_RET_SASLCREDS struct berval * Simple Authentication and Security Layer (SASL) credentials that you want to send back to the client. Set this before calling slapi_send_ldap_result(). SLAPI_BIND_SASLMECHANISM char * Simple Authentication and Security Layer (SASL) mechanism that is used (for example, LDAP_SASL_EXTERNAL).
See "Processing an LDAP Bind Operation," on page 86, for more information on these parameters.
Parameters for the Search Function
The following parameters are used with the search function:
- Parameters Passed to the Search Function
- Parameters for Executing the Search
- Parameters for the Search Results
Parameters Passed to the Search Function
The following table lists the parameters in the parameter block passed to the database search function. If you are writing a pre-operation, database, or post-operation search function, you can get these values by calling the slapi_pblock_get() function.
Parameter ID Data Type Description SLAPI_SEARCH_TARGET char * DN of the base entry in the search operation; the starting point of the search. SLAPI_ORIGINAL_TARGET_DN char * The original DN sent by the client (this DN is normalized by SLAPI_SEARCH_TARGET); read-only parameter. SLAPI_SEARCH_SCOPE int The scope of the search. The scope can be one of the following values: SLAPI_SEARCH_DEREF int Method for handling aliases in a search. This method can be one of the following values: SLAPI_SEARCH_SIZELIMIT int Maximum number of entries to return in the search results. SLAPI_SEARCH_TIMELIMIT int Maximum amount of time (in seconds) allowed for the search operation. SLAPI_SEARCH_FILTER Slapi_Filter * Slapi_Filter structure (an opaque data structure) representing the filter to be used in the search. SLAPI_SEARCH_STRFILTER char * String representation of the filter to be used in the search. SLAPI_SEARCH_ATTRS char ** Array of attribute types to be returned in the search results. SLAPI_SEARCH_ATTRSONLY int Specifies whether the search results return attribute types only or attribute types and values. 0 means return both attributes and values; 1 means return attribute types only.
Parameters for Executing the Search
The following parameters are set by the front-end and backend database as part of the process of executing the search.
See "Processing an LDAP Search Operation," on page 88, and "Iterating through Candidates," on page 91, for more information on these parameters.
Parameters for the Search Results
The entry and referrals options listed below are set/read by both the front-end and backend database while stepping through the search results.
Parameters that Return Data Types
The parameters listed below return data types.
Parameters that Convert Strings to Entries
The parameters listed below are pblock parameters; they are flags that can be passed to the slapi_str2entry() function.
Parameters for the Add Function
The following table lists the parameters in the parameter block passed to the database add function. If you are writing a pre-operation, database, or post-operation add function, you can get these values by calling the slapi_pblock_get() function.
Parameter ID Data Type Description SLAPI_ADD_TARGET char * DN of the entry to be added. SLAPI_ADD_ENTRY Slapi_Entry * The entry to be added (specified as the opaque Slapi_Entry datatype). SLAPI_ADD_EXISTING_DN_ENTRY Slapi_Entry * Internal only; used by the multi-master replication update resolution procedure code. If adding an entry that already exists, this is the entry which has the same DN. SLAPI_ADD_PARENT_ENTRY Slapi_Entry * Internal only; used by the multi-master replication update resolution procedure code. This is the parent entry of the entry to add. SLAPI_ADD_PARENT_UNIQUEID char * Internal only; used by the multi-master replication update resolution procedure code. This is the unique ID of the parent entry of the entry to add. SLAPI_ADD_EXISTING_UNIQUEID_ENTRY Slapi_Entry * Internal only; used by the multi-master replication resolution procedure code. If adding an entry that already exists, this is the entry which has the same unique ID.
See "Processing an LDAP Add Operation," on page 92, for more information on these parameters.
Parameters for the Compare Function
The following table lists the parameters in the parameter block passed to the database compare function. If you are writing a pre-operation, database, or post-operation compare function, you can get these values by calling the slapi_pblock_get() function.
See "Processing an LDAP Compare Operation," on page 92, for more information on these parameters.
Parameters for the Delete Function
The following table lists the parameters in the parameter block passed to the database delete function. If you are writing a pre-operation, database, or post-operation delete function, you can get these values by calling the slapi_pblock_get() function.
See "Processing an LDAP Delete Operation," on page 97, for more information on these parameters.
Parameters for the Modify Function
The following table lists the parameters in the parameter block passed to the database modify function. If you are writing a pre-operation, database, or post-operation modify function, you can get these values by calling the slapi_pblock_get() function.
See "Processing an LDAP Modify Operation," on page 94, for more information on these parameters.
Parameters for the Modify RDN Function
The following table lists the parameters in the parameter block passed to the database modify RDN function. If you are writing a pre-operation, database, or post-operation modify RDN function, you can get these values by calling the slapi_pblock_get() function.
See "Processing an LDAP Modify RDN Operation," on page 95, for more information on these parameters.
Parameters for the Abandon Function
The following table lists the parameters in the parameter block passed to the database abandon function. If you are writing a pre-operation, database, or post-operation abandon function, you can get these values by calling the slapi_pblock_get() function.
Parameter ID Data Type Description SLAPI_ABANDON_MSGID unsigned long Message ID of the operation to abandon.
See "Processing an LDAP Abandon Operation," on page 97, for more information on these parameters.
Parameters for the Matching Rule Function
The following table lists the parameters in the parameter block passed to the database matching rule function.
The following extended filter argument parameters are used with LDAPv3 only:
- SLAPI_MR_FILTER_ENTRY
- SLAPI_MR_FILTER_TYPE
- SLAPI_MR_FILTER_VALUE
- SLAPI_MR_FILTER_OID
- SLAPI_MR_FILTER_DNATTRS
The following function sets all three parameters:
Query Operators in Extensible Match Filters
The server checks the value of the SLAPI_PLUGIN_MR_QUERY_OPERATOR parameter to determine which operator is specified. The following parameters are defined values for the SLAPI_PLUGIN_MR_QUERY_OPERATOR:
Parameters for LDBM Backend Pre- and Post-Operation Functions
The section describes the parameters that are used with the LDBM Backend plug-in functions:
These functions are called by the LDBM Backend, for example, the SLAPI_PLUGIN_BE_PRE_DELETE_FN is called by the LDBM Backend before a delete operation is carried out but after the all of the more general SLAPI_PLUGIN_PRE_DELETE_FN functions have been called.
Pre-Operation Plug-ins
The parameters listed in this section are used with pre-operation database plug-in functions.
Post-Operation Plug-ins
The parameters listed in this section are used with post-operation database plug-in functions.
Parameters for the Database
The parameters listed in this section can be used to get and set information about the database itself, database connections, and database operations.
Information about the Database
The following parameters can be used as the second argument to the slapi_pblock_get() and slapi_pblock_set() functions to get and set information about the database.
Information about Operations
The following parameters can be used as the second argument to the slapi_pblock_get() and slapi_pblock_set() functions to get and set information about operations.
Information about Backend State Change
The following parameters can be used in the slapi_register_backend_state_change() and slapi_unregister_backend_state_change() functions to register and unregister callbacks when a backend state changes.
Parameter ID Data Type Description MTN_BE_ON int The backend is on. MTN_BE_OFFLINE int The backend is offline (import process). MTN_BE_DELETE int The backend has been deleted.
Parameters for LDAP Functions
The parameters listed in this section can be used with functions that you can call to perform LDAP operations from a plug-in. These internal operations do not return any data to a client.
Parameters for LDAP Operations
Parameter ID Data Type Description SLAPI_PLUGIN_INTOP_RESULT int Result code of the internal LDAP operation. SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES Slapi_Entry ** Array of entries found by an internal LDAP search operation. See slapi_search_internal_pb() for details. SLAPI_PLUGIN_INTOP_SEARCH_REFERRALS char ** Array of referrals (in the form of LDAP URLs) found by an internal LDAP search operation. See slapi_search_internal_pb() for details.
The following function sets all three parameters:
slapi_search_internal_pb()The following functions set only the SLAPI_PLUGIN_INTOP_RESULT parameter:
- slapi_add_internal_pb()
- slapi_delete_internal_pb()
- slapi_modify_internal_pb()
- slapi_modrdn_internal_pb()
Parameters for LDAP Control
The parameters listed below provide information about LDAP controls that are used in LDAP operations.
Parameters for Generating LDIF Strings
The parameters listed below are used to generate a description of an entry as an LDIF string. These are not pblock parameters but flags that are passed to the slapi_entry2str_with_options() function.
Parameter ID Description SLAPI_DUMP_MINIMAL_ ENCODING Use the base-64 encoding as little as possible, only when it is required to produce an LDIF fragment that can be parsed. This option is useful for some international data to avoid excessive base-64 encoding. Using this option may produce LDIF that does not conform to the standard. SLAPI_DUMP_NOOPATTRS A flag used to suppress the operational attributes. See SLAPI_ATTR_FLAG_OPATTR. SLAPI_DUMP_NOWRAP By default, lines will be wrapped as defined in the LDIF specification. This flag disables line wrapping. SLAPI_DUMP_STATEINFO This flag is only used internally by replication. This flag allows access to the internal data used by multi-master replication. SLAPI_DUMP_UNIQUEID This flag is used when creating an LDIF file that will be used to initialize a replica. Each entry will contain the nsUniqueID operational attribute.
Parameters for Error Logging
The parameters listed below are used with the slapi_log_error() function to write error messages to the error log, which is by located by default in server_root/slapd-instance_id/logs/errors.
The severity level of the message is determined by the administrator and determines whether the message is written to the error log. The severity level can have one of the following values:
Parameters for Filters
This section lists the parameters used for manipulating LDAP filters, including with functions such as slapi_filter_join(). These are not pblock parameters.
Parameters for Comparison Filters
The parameters listed below are filters that are used to compare a value against an attribute.
Parameters for Filter Operations
The parameters listed below return status information about a filter operation. These are values that slapi_filter_apply() and programmer-defined filter apply functions may return.
Parameters for Password Storage
The following plug-in functions and parameters access password storage schemes to encode, decode, and compare passwords:
Password Storage Plug-ins
The parameters listed below are used with functions that you can call to store passwords.
Parameters for Password Storage
The parameters listed below apply to password storage schemes.
Parameters for Resource Limits
The following parameters are used to provide information about resource limits:
Parameter for Binder-Based Resource Limits
The following parameter is a valid value for the slapi_reslimit_register() function.
Parameter ID Data Type Description SLAPI_RESLIMIT_TYPE_INT int Valid values for the type parameter for slapi_reslimit_register().
Status Codes for Resource Limits
The status codes are used with functions that extract attribute values from a binder entry that corresponds to resource limits. Typically, operational attributes are used to hold binder-specific search size limits.
Any resource limits found in the binder entry are cached in the connection structure by a connection object extension. This means that if the attributes that correspond to the binder entry is changed, the resource limit is not effected until the next bind occurs as that entry.
The status codes are the possible return values for the slapi_reslimit_register() and slapi_reslimit_get_integer_limit() functions. A plug-in or server subsystem that wants to use the resource limit subsystem should call the slapi_reslimit_register() plug-in function once for each limit to be tracked. slapi_reslimit_register() should be called before any client connections are accepted.
Parameters for the Virtual Attribute Service
The parameters listed in the tables below are used with the virtual attribute service to return information about virtual and real attributes.
These identifiers are flags that can be passed to various slapi_vattr_values_XXX() functions in the flags parameter:
These are buffer disposition flags that are returned in the buffer_flags parameter:
These are attribute type name disposition values that are returned in the type_name_disposition parameter:
Previous |
Contents |
Index |
Next |