Plug-in Programmerís Guide
Red Hat Directory Server                                                            

Previous
Contents
Index
Next

Contents


Preface

What You Should Already Know
Using Directory Server Plug-in APIs
Document Conventions
Where to Find Directory Server Information
Part 1 Introduction to Directory Server Plug-ins

An Overview of Directory Server Plug-ins

What Are Directory Server Plug-ins?
How Directory Server Plug-ins Work
Calling Directory Server Plug-in Functions
The Directory Server Architecture
Types of Directory Server Plug-ins

Writing and Compiling Plug-ins

Writing a Plug-in Function
Including the API Header File
Passing Data with Parameter Blocks
Working with Parameter Blocks
Getting Data from the Parameter Block
Setting Data in the Parameter Block
Calling Front-End Functions
Plug-in Return Values
Writing Plug-in Initialization Functions
Specifying Directory Server Compatibility
Specifying Information about the Plug-in
Registering Your Plug-in Functions
Returning a Value to the Directory Server
Example of an Initialization Function
Compiling a Directory Server Plug-in

Configuring Plug-ins

Creating a Plug-in Configuration File
Plug-in Dependencies
Specific Plug-in Dependencies
Plug-in Type Dependencies
Specifying the Order of Plug-in Directives
Summary of Plug-in Directives
Loading the Plug-in Configuration File
Passing Extra Arguments to Plug-ins
Setting the Log Level of the Server

A Quick Example

An Example Pre-Operation Plug-in
Writing the Plug-in Example
Compiling the Plug-in Example
Registering the Plug-in Example
Running the Plug-in Example
Part 2 Basic Plug-in Programming Techniques

Front-End API Functions

Logging Messages
Adding Notes to Access Log Entries
Sending Data to the Client
Determining If an Operation Was Abandoned
Working with Entries, Attributes, and Values
Creating a New Entry
Converting between Entries and Strings
Getting and Setting the DN of an Entry
Verifying Compliance with the Schema
Getting the Attributes and Values of an Entry
Iterating through the Attributes in an Entry
Finding a Specific Attribute in an Entry
Adding and Removing Values
Working with DNs and RDNs
Determining If a DN Is the Root DN
Working with DN Suffixes
Server Suffixes
Getting the Parent DN of a DN
Normalizing a DN
Working with Search Filters
Determining If an Entry Matches a Filter
Getting the Filter Type
Getting the Search Criteria
Converting a String to a Filter
Creating Complex Filters by Combining Filters
Checking Passwords

Writing Pre/Post-Operation Plug-ins

How Pre/Post-Operation Plug-ins Work
Types of Pre-Operation and Post-Operation Functions
Types of Pre-Operation Functions
Types of Post-Operation Functions
Registering Pre/Post-Operation Functions

Defining Functions for LDAP Operations

Specifying Start and Close Functions
Processing an LDAP Bind Operation
Defining Functions for the Bind Operation
Getting and Setting Parameters for the Bind Operation
Processing an LDAP Unbind Operation
Processing an LDAP Search Operation
Getting the List of Candidates
Iterating through Candidates
Processing an LDAP Compare Operation
Processing an LDAP Add Operation
Processing an LDAP Modify Operation
Processing an LDAP Modify RDN Operation
Processing an LDAP Delete Operation
Processing an LDAP Abandon Operation

Defining Functions for Authentication

Understanding Authentication Methods
How the Directory Server Identifies Clients
How the Authentication Process Works
Writing Your Own Authentication Plug-in
Writing a Pre-Operation Bind Plug-in
Defining Your Authentication Function
Getting and Checking the Bind Parameters
Getting the Entry and Checking the Credentials
What to Do If Authentication Fails
What to Do If Authentication Succeeds
Registering the SASL Mechanism
Example of a Pre-Operation Bind Plug-in
Example of a Pre-Operation Bind Function
Example of an Initialization Function
Registering the Plug-in
Using SASL with an LDAP Client
Part 3 Advanced Programming Techniques

Writing Entry Store/Fetch Plug-ins

How Entry Store/Fetch Plug-ins Work
Writing Entry Store/Fetch Functions
Registering Entry Store/Fetch Functions

Writing Extended Operation Plug-ins

How Extended Operation Plug-ins Work
Writing Extended Operation Functions
Registering Extended Operation Functions
Specifying Start and Close Functions

Writing Matching Rule Plug-ins

Understanding Matching Rules
Extensible Match Filters
Extensible Match Filters in the Directory Server
Understanding Matching Rule Plug-ins
Functions Defined in Matching Rule Plug-ins
How Matching Rules Are Identified
How the Server Associates Plug-ins with OIDs
Finding a Plug-in for Indexing
Finding a Plug-in for Searching
How the Server Uses Parameter Blocks
Indexing Based on Matching Rules
How the Server Sets Up the Index
How the Server Updates the Index
Writing the Indexer Factory Function
Getting and Setting Parameters in Indexer Factory Functions
Writing the Indexer Function
Getting and Setting Parameters in Indexer Functions
Handling Extensible Match Filters
How the Server Handles the Filter
Query Operators in Matching Rules
Writing a Filter Factory Function
Getting and Setting Parameters in Filter Factory Functions
Writing a Filter Index Function
Getting and Setting Parameters in Filter Index Functions
Writing a Filter Matching Function
Handling Sorting by Matching Rules
Writing a Destructor Function
Writing an Initialization Function
Registering Matching Rule Functions
Specifying Start and Close Functions

Using the Custom Distribution Logic

About Distributing Flat Namespaces
Creating a Distribution Function
Adding the Distribution Function to Your Directory
Adding Multiple Databases to a Single Suffix
Using the Console
From the Command-Line
Adding Distribution Logic to a Suffix
Using the Console
From the Command-Line
Using the Distribution Logic Examples
Custom Distribution Checklist

Using Data Interoperability Plug-ins

Installing Directory Server
Understanding Deployment Configuration
Installing Two Instances of Directory Server
Enabling the DIOP Feature in Directory Server
Using the DIOP Feature
Sample DIOP Plug-in
Debugging the Plug-in
Plug-in API Reference
Preserving the Default Behavior of the Server
Bypassing Access Control Checks
Part 4 Reference

Data Type and Structure Reference

Summary of Data Types and Structures
berval
computed_attr_context
LDAPControl
LDAPMod
mrFilterMatchFn
plugin_referral_entry_callback
plugin_result_callback
plugin_search_entry_callback
send_ldap_referral_fn_ptr_t
send_ldap_result_fn_ptr_t
send_ldap_search_entry_fn_ptr_t
Slapi_Attr
Slapi_Backend
slapi_backend_state_change_fnptr
Slapi_ComponentID
slapi_compute_callback_t
slapi_compute_output_t
Slapi_Connection
Slapi_CondVar
Slapi_DN
Slapi_Entry
Slapi_Filter
Slapi_MatchingRuleEntry
Slapi_Mod
Slapi_Mods
Slapi_Mutex
Slapi_Operation
Slapi_PBlock
Slapi_PluginDesc
Slapi_RDN
Slapi_UniqueID
Slapi_Value
Slapi_ValueSet

Function Reference

Distribution Routines
distribution_plugin_entry_point()
Functions for Access Control
slapi_access_allowed()
slapi_acl_check_mods()
slapi_acl_verify_aci_syntax()
Functions for Internal Operations and Plug-in Callback
slapi_add_internal_pb()
slapi_delete_internal_pb()
slapi_free_search_results_internal()
slapi_modify_internal_pb()
slapi_modrdn_internal_pb()
slapi_search_internal_callback_pb()
slapi_search_internal_get_entry()
slapi_search_internal_pb()
Functions for Setting Internal Operation Flags
slapi_add_entry_internal_set_pb()
slapi_add_internal_set_pb()
slapi_delete_internal_set_pb()
slapi_modify_internal_set_pb()
slapi_rename_internal_set_pb()
slapi_search_internal_set_pb()
slapi_seq_internal_callback_pb()
slapi_seq_internal_set_pb()
Functions for Handling Attributes
slapi_attr_add_value()
slapi_attr_basetype()
slapi_attr_dup()
slapi_attr_first_value()
slapi_attr_flag_is_set()
slapi_attr_free()
slapi_attr_get_bervals_copy()
slapi_attr_get_flags()
slapi_attr_get_numvalues()
slapi_attr_get_oid_copy()
slapi_attr_get_type()
slapi_attr_get_valueset()
slapi_attr_init()
slapi_attr_new()
slapi_attr_next_value()
slapi_attr_set_valueset()
slapi_attr_syntax_normalize()
slapi_attr_type2plugin()
slapi_attr_type_cmp()
slapi_attr_types_equivalent()
slapi_attr_value_cmp()
slapi_attr_value_find()
slapi_valueset_set_from_smod()
Functions for Managing Backend Operations
slapi_be_addsuffix()
slapi_be_delete_onexit()
slapi_be_exist()
slapi_be_free()
slapi_be_get_instance_info()
slapi_be_get_name()
slapi_be_get_readonly()
slapi_be_getentrypoint()
slapi_be_getsuffix()
slapi_be_gettype()
slapi_be_is_flag_set()
slapi_be_issuffix()
slapi_be_logchanges()
slapi_be_new()
slapi_be_private()
slapi_be_select()
slapi_be_select_by_instance_name()
slapi_be_set_flag()
slapi_be_set_instance_info()
slapi_be_set_readonly()
slapi_be_setentrypoint()
slapi_get_first_backend()
slapi_get_first_suffix()
slapi_get_next_backend()
slapi_get_next_suffix()
slapi_is_root_suffix()
slapi_register_backend_state_change()
slapi_unregister_backend_state_change()
Functions for Dealing with Controls
slapi_build_control()
slapi_build_control_from_berval()
slapi_control_present()
slapi_dup_control()
slapi_get_supported_controls_copy()
slapi_register_supported_control()
Functions for Syntax Plug-in
slapi_call_syntax_assertion2keys_ava_sv()
slapi_call_syntax_assertion2keys_sub_sv()
slapi_call_syntax_values2keys_sv()
Functions for Managing Memory
slapi_ch_array_free()
slapi_ch_bvdup()
slapi_ch_bvecdup()
slapi_ch_calloc()
slapi_ch_free()
slapi_ch_free_string()
slapi_ch_malloc()
slapi_ch_realloc()
slapi_ch_smprintf()
slapi_ch_strdup()
Functions for Managing DNs
slapi_add_auth_response_control()
slapi_dn_beparent()
slapi_dn_ignore_case()
slapi_dn_isbesuffix()
slapi_dn_isparent()
slapi_dn_isroot()
slapi_dn_issuffix()
slapi_dn_normalize()
slapi_dn_normalize_case()
slapi_dn_normalize_to_end()
slapi_dn_parent()
slapi_dn_plus_rdn()
slapi_rdn2typeval()
Functions for Managing Entries
slapi_entry2str()
slapi_entry2str_with_options()
slapi_entry_add_rdn_values()
slapi_entry_add_string()
slapi_entry_add_value()
slapi_entry_add_values_sv()
slapi_entry_add_valueset()
slapi_entry_alloc()
slapi_entry_attr_delete()
slapi_entry_attr_find()
slapi_entry_attr_get_bool()
slapi_entry_attr_get_charptr()
slapi_entry_attr_get_charray()
slapi_entry_attr_get_int()
slapi_entry_attr_get_long()
slapi_entry_attr_get_uint()
slapi_entry_attr_get_ulong()
slapi_entry_attr_has_syntax_value()
slapi_entry_attr_merge_sv()
slapi_entry_attr_replace_sv()
slapi_entry_attr_set_charptr()
slapi_entry_attr_set_int()
slapi_entry_attr_set_long()
slapi_entry_attr_set_uint()
slapi_entry_attr_set_ulong()
slapi_entry_delete_string()
slapi_entry_delete_values_sv()
slapi_entry_dup()
slapi_entry_first_attr()
slapi_entry_free()
slapi_entry_get_dn()
slapi_entry_get_dn_const()
slapi_entry_get_ndn()
slapi_entry_get_sdn()
slapi_entry_get_sdn_const()
slapi_entry_get_uniqueid()
slapi_entry_has_children()
slapi_entry_init()
slapi_entry_merge_values_sv()
slapi_entry_next_attr()
slapi_entry_rdn_values_present()
slapi_entry_schema_check()
slapi_entry_set_dn()
slapi_entry_set_sdn()
slapi_entry_set_uniqueid()
slapi_entry_size()
slapi_is_rootdse()
slapi_str2entry()
Functions Related to Entry Flags
slapi_entry_clear_flag()
slapi_entry_flag_is_set()
slapi_entry_set_flag()
Functions for Dealing with Filters
slapi_filter_apply()
slapi_filter_compare()
slapi_filter_dup()
slapi_filter_free()
slapi_filter_get_attribute_type()
slapi_filter_get_ava()
slapi_filter_get_choice()
slapi_filter_get_subfilt()
slapi_filter_get_type()
slapi_filter_join()
slapi_filter_join_ex()
slapi_filter_list_first()
slapi_filter_list_next()
slapi_filter_test()
slapi_filter_test_ext()
slapi_filter_test_simple()
slapi_find_matching_paren()
slapi_str2filter()
slapi_vattr_filter_test()
Functions Specific to Extended Operation
slapi_get_supported_extended_ops_copy()
Functions Specific to Bind Methods
slapi_get_supported_saslmechanisms_copy()
slapi_register_supported_saslmechanism()
Functions for Thread-Safe LDAP Connections
slapi_ldap_init()
slapi_ldap_unbind()
Functions for Logging
slapi_log_error()
slapi_is_loglevel_set()
Functions for Handling Matching Rules
slapi_berval_cmp()
slapi_matchingrule_free()
slapi_matchingrule_get()
slapi_matchingrule_new()
slapi_matchingrule_register()
slapi_matchingrule_set()
slapi_matchingrule_unregister()
slapi_mr_filter_index()
slapi_mr_indexer_create()
Functions for LDAPMod Manipulation
slapi_entry2mods()
slapi_mod_add_value()
slapi_mod_done()
slapi_mod_dump()
slapi_mod_free()
slapi_mod_get_first_value()
slapi_mod_get_ldapmod_byref()
slapi_mod_get_ldapmod_passout()
slapi_mod_get_next_value()
slapi_mod_get_num_values()
slapi_mod_get_operation()
slapi_mod_get_type()
slapi_mod_init()
slapi_mod_init_byref()
slapi_mod_init_byval()
slapi_mod_init_passin()
slapi_mod_isvalid()
slapi_mod_new()
slapi_mod_remove_value()
slapi_mod_set_operation()
slapi_mod_set_type()
slapi_mods2entry()
slapi_mods_add()
slapi_mods_add_ldapmod()
slapi_mods_add_mod_values()
slapi_mods_add_smod()
slapi_mods_add_modbvps()
slapi_mods_add_string()
slapi_mods_done()
slapi_mods_dump()
slapi_mods_free()
slapi_mods_get_first_mod()
slapi_mods_get_first_smod()
slapi_mods_get_ldapmods_byref()
slapi_mods_get_ldapmods_passout()
slapi_mods_get_next_mod()
slapi_mods_get_next_smod()
slapi_mods_get_num_mods()
slapi_mods_init()
slapi_mods_init_byref()
slapi_mods_init_passin()
slapi_mods_insert_after()
slapi_mods_insert_at()
slapi_mods_insert_before()
slapi_mods_insert_smod_at()
slapi_mods_insert_smod_before()
slapi_mods_iterator_backbone()
slapi_mods_new()
slapi_mods_remove()
Functions for Monitoring Operations
slapi_op_abandoned()
slapi_op_get_type()
Functions for Managing Parameter Block
slapi_pblock_destroy()
slapi_pblock_get()
slapi_pblock_new()
slapi_pblock_set()
Functions for Handling Passwords
slapi_pw_find_sv()
slapi_is_encoded()
slapi_encode()
slapi_add_pwd_control()
slapi_pwpolicy_make_response_control()
Functions for Managing RDN
slapi_rdn_add()
slapi_rdn_compare()
slapi_rdn_contains()
slapi_rdn_contains_attr()
slapi_rdn_done()
slapi_rdn_free()
slapi_rdn_get_first()
slapi_rdn_get_index()
slapi_rdn_get_index_attr()
slapi_rdn_get_next()
slapi_rdn_get_num_components()
slapi_rdn_get_rdn()
slapi_rdn_get_nrdn()
slapi_rdn_init()
slapi_rdn_init_dn()
slapi_rdn_init_rdn()
slapi_rdn_init_sdn()
slapi_rdn_isempty()
slapi_rdn_new()
slapi_rdn_new_dn()
slapi_rdn_new_rdn()
slapi_rdn_new_sdn()
slapi_rdn_remove()
slapi_rdn_remove_attr()
slapi_rdn_remove_index()
slapi_rdn_set_dn()
slapi_rdn_set_rdn()
slapi_rdn_set_sdn()
Functions for Managing Roles
slapi_role_check()
slapi_register_role_check()
Functions for Managing DNs
slapi_moddn_get_newdn()
slapi_sdn_add_rdn()
slapi_sdn_compare()
slapi_sdn_copy()
slapi_sdn_done()
slapi_sdn_dup()
slapi_sdn_free()
slapi_sdn_get_backend_parent()
slapi_sdn_get_dn()
slapi_sdn_get_ndn()
slapi_sdn_get_ndn_len()
slapi_sdn_get_parent()
slapi_sdn_get_rdn()
slapi_sdn_is_rdn_component()
slapi_sdn_isempty()
slapi_sdn_isgrandparent()
slapi_sdn_isparent()
slapi_sdn_issuffix()
slapi_sdn_new()
slapi_sdn_new_dn_byref()
slapi_sdn_new_dn_byval()
slapi_sdn_new_dn_passin()
slapi_sdn_new_ndn_byref()
slapi_sdn_new_ndn_byval()
slapi_sdn_scope_test()
slapi_sdn_set_dn_byref()
slapi_sdn_set_dn_byval()
slapi_sdn_set_dn_passin()
slapi_sdn_set_ndn_byref()
slapi_sdn_set_ndn_byval()
slapi_sdn_set_parent()
slapi_sdn_set_rdn()
Functions for Sending Entries and Results to the Client
slapi_send_ldap_referral()
slapi_send_ldap_result()
slapi_send_ldap_search_entry()
Functions Related to UTF-8
slapi_has8thBit()
slapi_utf8casecmp()
slapi_UTF8CASECMP()
slapi_utf8ncasecmp()
slapi_UTF8NCASECMP()
slapi_utf8isLower()
slapi_UTF8ISLOWER()
slapi_utf8isUpper()
slapi_UTF8ISUPPER()
slapi_utf8StrToLower()
slapi_UTF8STRTOLOWER()
slapi_utf8StrToUpper()
slapi_UTF8STRTOUPPER()
slapi_utf8ToLower()
slapi_UTF8TOLOWER()
slapi_utf8ToUpper()
slapi_UTF8TOUPPER()
Functions for Handling Values
slapi_value_compare()
slapi_value_dup()
slapi_value_free()
slapi_value_get_berval()
slapi_value_get_int()
slapi_value_get_length()
slapi_value_get_long()
slapi_value_get_string()
slapi_value_get_uint()
slapi_value_get_ulong()
slapi_value_init()
slapi_value_init_berval()
slapi_value_init_string()
slapi_value_init_string_passin()
slapi_value_new()
slapi_value_new_berval()
slapi_value_new_string()
slapi_value_new_string_passin()
slapi_value_new_value()
slapi_value_set()
slapi_value_set_berval()
slapi_value_set_int()
slapi_value_set_string()
slapi_value_set_string_passin()
slapi_value_set_value()
Functions for Handling Valueset
slapi_valueset_add_value()
slapi_valueset_add_value_ext()
slapi_valueset_count()
slapi_valueset_done()
slapi_valueset_find()
slapi_valueset_first_value()
slapi_valueset_free()
slapi_valueset_init()
slapi_valueset_new()
slapi_valueset_next_value()
slapi_valueset_set_from_smod()
slapi_valueset_set_valueset()
Functions Specific to Virtual Attribute Service
slapi_vattr_list_attrs()
slapi_vattr_attrs_free()
slapi_vattr_schema_check_type()
slapi_vattr_value_compare()
slapi_vattr_values_free()
slapi_vattr_values_get()
slapi_vattr_values_get_ex()
slapi_vattr_values_type_thang_get()
Functions for Managing Locks and Synchronization
slapi_destroy_condvar()
slapi_destroy_mutex()
slapi_lock_mutex()
slapi_new_condvar()
slapi_new_mutex()
slapi_notify_condvar()
slapi_unlock_mutex()
slapi_wait_condvar()
Functions for Managing Computed Attributes
slapi_compute_add_evaluator()
slapi_compute_add_search_rewriter()
compute_rewrite_search_filter()
Functions for Manipulating Bits
slapi_isbitset_int()
slapi_isbitset_uchar()
slapi_setbit_int()
slapi_setbit_uchar()
slapi_unsetbit_int()
slapi_unsetbit_uchar()
Functions for Registering Object Extensions
slapi_get_object_extension()
slapi_register_object_extension()
slapi_set_object_extension()
Functions Related to Data Interoperability
slapi_op_reserved()
slapi_operation_set_flag()
slapi_operation_clear_flag()
slapi_is_flag_set()
Functions for Registering Additional Plug-ins
slapi_register_plugin()

Parameter Block Reference

Parameters for Registering Plug-in Functions
Pre-Operation/Data Validation Plug-ins
Post-Operation/Data Notification Plug-ins
Matching Rule Plug-ins
Entry Plug-ins
Parameters Accessible to All Plug-ins
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
Types of Plug-ins
Version Information
Information about Command-Line Arguments
Information about Attributes
Attribute Names
Attribute Flags
Attribute Comparisons
Information about Targets
Parameters for the Bind Function
Parameters for the Search Function
Parameters Passed to the Search Function
Parameters for Executing the Search
Parameters for the Search Results
Parameters that Return Data Types
Parameters that Convert Strings to Entries
Parameters for the Add Function
Parameters for the Compare Function
Parameters for the Delete Function
Parameters for the Modify Function
Parameters for the Modify RDN Function
Parameters for the Abandon Function
Parameters for the Matching Rule Function
Query Operators in Extensible Match Filters
Parameters for LDBM Backend Pre- and Post-Operation Functions
Pre-Operation Plug-ins
Post-Operation Plug-ins
Parameters for the Database
Information about the Database
Information about Operations
Information about Backend State Change
Parameters for LDAP Functions
Parameters for LDAP Operations
Parameters for LDAP Control
Parameters for Generating LDIF Strings
Parameters for Error Logging
Parameters for Filters
Parameters for Comparison Filters
Parameters for Filter Operations
Parameters for Password Storage
Password Storage Plug-ins
Parameters for Password Storage
Parameters for Resource Limits
Parameter for Binder-Based Resource Limits
Status Codes for Resource Limits
Parameters for the Virtual Attribute Service

Glossary

Index




Previous
Contents
Index
Next

© 2001 Sun Microsystems, Inc. Used by permission. © 2005 Red Hat, Inc. All rights reserved.
Read the Full Copyright and Third-Party Acknowledgments.

last updated May 26, 2005