This book describes writing server plug-ins to customize and extended the capabilities of the Netscape Directory Server.
If you have already written a server plug-in for Netscape Directory Server 3.x that you want to use in the Netscape Directory Server 4.0, see the section "Updating a Netscape Directory Server Plug-In" on page 35.
Changes to the API
The following changes were made to the API between the Netscape Directory Server 3.x release and the 4.0 release of the server:
The syntax for the plugin directive in the slapd.*.conf files has changed in the 4.0 release. See "Editing the Server Configuration Files" on page 47 for details.
New return codes have been defined for database functions. See "Writing Database Plug-In Functions" on page 89 for more information.
The slapi_entry_dup() function passes in a const Slapi_Entry * argument (rather than an Slapi_Entry * argument).
You can use the following new API functions when working with values of attributes in entries:
slapi_entry_attr_delete()
slapi_entry_attr_get_charptr()
slapi_entry_attr_get_int()
slapi_entry_attr_hasvalue()
slapi_entry_attr_replace()
slapi_entry_attr_set_charptr()
slapi_entry_attr_set_long()
You can use the Slapi_MatchingRuleEntry structure and the following new API functions when working with matching rule plug-ins:
slapi_matchingrule_free()
slapi_matchingrule_get()
slapi_matchingrule_new()
slapi_matchingrule_register()
slapi_matchingrule_set()
slapi_matchingrule_unregister()
The slapi_dn_issuffix() function and the slapi_dn_isparent() function both pass const arguments now.
You can use the following new API functions for locking and working with condition variables:
slapi_new_mutex()
slapi_lock_mutex()
slapi_unlock_mutex()
slapi_destroy_mutex()
slapi_new_condvar()
slapi_wait_condvar()
slapi_notify_condvar()
slapi_destroy_condvar()
The Slapi_Mutex structure (see page 221) represents a mutex and the Slapi_CondVar structure represents a condition variable (see page 217).
If you need to connect to another LDAP server from your plug-in, you can use the following API functions to initialize the LDAP session and to end the LDAP session:
slapi_ldap_init()
slapi_ldap_unbind()
The SLAPI_BE_MONITORDN parameter (used in the Netscape Directory Server 3.x releases to specify the DN for monitoring the back-end) is no longer available for use in the Netscape Directory Server 4.0 release.
If you are integrating your own back-end database with the server, you can define and register a function for generating indexes for the database. See "Generating Indexes for the Database" on page 124 for details.
If you are writing a database import function for your own back-end, you should check the following new parameters that the front-end can specify:
The SLAPI_LDIF2DB_NOATTRINDEXES parameter specifies whether or not indexes for the database should be generated automatically when the database is created.
The SLAPI_LDIF2DB_INCLUDE parameter specifies the suffixes and DNs of entries in the LDIF file that should be included in the database.
The SLAPI_LDIF2DB_EXCLUDE parameter specifies the suffixes and DNs of entries in the LDIF file that should be excluded from the database.
For more information, see the section "Importing an LDIF File into the Database" on page 120.
If you are writing your own back-end database functions, you can use the SLAPI_OPERATION_NOTES parameter to specify notes that you want appended to access log entries when the server sends a result or entry to an LDAP client. For more information, see the section "Adding Notes to Access Log Entries" on page 58.
For more information, see the section "Adding Notes to Access Log Entries" on page 58.
SLAPI_BIND_SUCCESS and SLAPI_BIND_FAIL_OR_ANONYMOUS are values to be returned by the database bind operation.
The database bind function returns SLAPI_BIND_SUCCESS if authentication was successful and the front-end is sending the result code to the client.
The database bind function returns SLAPI_BIND_FAIL_OR_ANONYMOUS if the client was not authenticated or attempted to authenticate anonymously.
For more information, see Chapter 9, "Defining Functions for Authentication".
The SLAPI_CONN_CLIENTIP parameter makes the client's IP address accessible through a parameter block. The SLAPI_CONN_SERVERIP parameters makes available the server IP address that the client is connecting to. (For example, the server may be accepting requests on multiple IP addresses. You can use this parameter to determine which IP address the client is connecting to.) These parameters contain the struct in_addr * that specifies the client and server IP addresses.
These parameters contain the struct in_addr * that specifies the client and server IP addresses.
The following changes were made between the 3.0 version and the 4.0 release of the manual:
Added Chapter 12, "Writing Matching Rule Plug-Ins".
Corrected description of the database search functions and added more material under "Processing an LDAP Search Operation" on page 107.
A general understanding of the Internet and the World Wide Web (WWW).
A general understanding of the Lightweight Directory Access Protocol (LDAP) and the Netscape Directory Server. This book does not duplicate basic information on server administration or LDAP concepts.
Programming experience in C or C++.
If you're going to write a database plug-in, working knowledge of your database and its programming interfaces.
For information on installing, configuring, and managing the Netscape Directory Server, see the Netscape Directory Server Administrator's Guide.
For information on writing LDAP clients with the LDAP C and Java API, see the Netscape Directory SDK for C Programmer's Guide and the Netscape Directory SDK for Java Programmer's Guide.
This book (the Netscape Directory Server Plug-In Programmer's Guide) explains how to write your own server plug-ins to customize the Netscape Directory Server. You can write plug-ins that validate data before the data is stored in the directory, that notify users when data has changed, or that replace the standard database in the Directory Server with your own database.
http://help.netscape.com/
This is Netscape's technical support site. You can read the FAQ on the Netscape Directory Server or search the knowledge base for tips and information.
http://developer.netscape.com/tech/directory/index.html This is LDAP Directory Developer Central. From this page, you can access the documentation online, download the client SDKs, read the release notes, and find support information and additional resources.
This is LDAP Directory Developer Central. From this page, you can access the documentation online, download the client SDKs, read the release notes, and find support information and additional resources.
This book uses Uniform Resource Locators (URLs) of the form
http://server.domain/path/file.html In these URLs, server represents the name of the server on which you run your application, such as research1 or www; domain represents your Internet domain name, such as netscape.com or uiuc.edu; path represents the directory structure on the server; and file.html represents an individual filename. In general, items in italics in URLs are variables and items in normal monospace font are literals. If your server has Secure Sockets Layer (SSL) enabled, you would use https instead of http in the URL.
http://server.domain/path/file.html
This book uses the following font conventions:
The monospace font is used for sample code and code listings, API and language elements (such as function names and class names), filenames, pathnames, directory names, HTML tags, and any text that must be typed on the screen. (Monospace italic font is used for placeholders embedded in code.)
Italic type is used for book titles, emphasis, variables and placeholders, and words used in the literal sense.
Boldface type is used for glossary terms.