HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
1 An overview of Directory Server plug-ins
This document describes the HP-UX Directory Server plug-ins.
This chapter introduces you to HP-UX Directory Server plug-ins and discusses the different
types of plug-ins that you can write.
If you have already written a plug-in for Directory Server, refer to “Using Directory Server plug-in
APIs” for information on migrating your plug-in to the latest version of Directory Server.
1.1 What Are Directory Server plug-ins?
If you want to extend the capabilities of the Directory Server, you can write your own Directory
Server plug-in. A server plug-in is a shared object or library that contains custom functions that
you write.
By writing your own plug-in functions, you can extend the functionality of the Directory Server.
The following are some examples of what you can do with Directory Server plug-ins:
You can design an action that the Directory Server performs before the server processes an
LDAP action. For example, you can write a custom function to validate data before the server
performs an LDAP operation on the data.
You can design an action that the Directory Server performs after the server successfully
completes an LDAP operation. For example, you can send mail to a client after an LDAP
operation is successfully completed.
You can define extended operations, as defined in the LDAP v3 protocol.
You can provide alternative matching rules when comparing certain attribute values.
1.2 How Directory Server plug-ins work
You can configure Directory Server to load your plug-ins when Directory Server is started. After
the plug-in has loaded, the Directory Server will resolve calls made to your plug-in functions as
it processes the LDAP requests contained in your applications.
Internally, the Directory Server has hooks that allow you to register your own functions to be
called when specific events occur. For example, the Directory Server has hooks to call a registered
plug-in in the following situations:
Before preforming an LDAP operation (for example, before an entry is added to the directory).
When adding, modifying, removing, renaming, or searching for entries in the database.
After performing an LDAP operation (for example, after an entry is added to the directory).
Before writing an entry to the database.
After reading an entry from the database.
When processing an extended operation.
When indexing an attribute.
When filtering search result candidates based on an attribute.
When you register your plug-in functions, you specify the function type and the plug-in type.
Together, these specifications indicate when the function is called. Refer to “Types of Directory
Server plug-ins”.
1.2.1 Calling Directory Server plug-in functions
At specific LDAP events, the Directory Server calls all plug-in functions that are registered for
that event. For example, before performing an LDAP add operation (an add event), the server
calls all plug-in functions registered as preoperation add functions. When the add operation is
completed, the server will call all registered postoperation add functions.
1.1 What Are Directory Server plug-ins? 23