Complete Contents
Getting Started
Chapter 1 Understanding Server Plug-Ins
Chapter 2 Writing and Compiling Plug-Ins
Chapter 3 Calling the Front-End API Functions
Chapter 4 Quick Start
Chapter 5 Writing Database Plug-Ins
Chapter 6 Writing Pre/Post-Operation Plug-Ins
Chapter 7 Defining Functions for LDAP Operations
Chapter 8 Defining Functions for Database Operations
Chapter 9 Defining Functions for Authentication
Chapter 10 Writing Entry Store/Fetch Plug-Ins
Chapter 11 Writing Extended Operation Plug-Ins
Chapter 12 Writing Matching Rule Plug-Ins
Chapter 13 Data Type and Structure Reference
Chapter 14 Function Reference
Chapter 15 Parameter Reference
Glossary
Previous Next Contents Bookshelf Function List



 slapi_ldap_init()
Initializes an LDAP session with another LDAP server.

Syntax

#include "slapi-plugin.h"
LDAP *slapi_ldap_init( char *ldaphost, int ldapport, int secure, int shared );

Parameters

The function has the following parameters:
ldaphost

Space-delimited list of one or more host names (or IP address in dotted notation, such as "141.211.83.36") of the LDAP servers that you want to connect to.
The names can be in hostname:portnumber format (in which case, portnumber overrides the port number specified by the ldapport argument).
ldapport

Port number of the LDAP server.
secure

Determines whether or not to establish the connection over SSL. Set this to a non-zero value to establish the connection over SSL.
shared

Determines whether or not the LDAP session (the LDAP structure) can be shared by different threads. Set this to a non-zero value to allow multiple threads to share the session.

Returns. One of the following values:

Description. This function initializes an LDAP session with another LDAP server. If you want to connect to another LDAP server over SSL or if you want to allow multiple threads to use the same connection, call this function instead of the ldap_init() function provided with the Netscape Directory SDK.

This function allocates an LDAP structure containing information about the session, including the host name and port of the LDAP server, preferences for the session (such as the maximum number of entries to return in a search), and the error code of the last LDAP operation performed.

You can specify a list of LDAP servers that you want to attempt to connect to. Your client will attempt to connect to the first LDAP server in the list. If the attempt fails, your client will attempt to connect to the next LDAP server in the list.

If you specify a non-zero value for the secure argument, this function initializes the plug-in for SSL and installs the I/O routines for SSL.

If you specify a non-zero value for the shared argument, this function installs the server's threading functions and allows multiple threads to share this session (the returned LDAP structure). Note that the Netscape Directory Server processes each request in a separate thread. When handling multiple requests, it is possible for the server to call your plug-in function concurrently for different threads.

If you initialize a session by calling this function, make sure to call the slapi_ldap_unbind() function (not the ldap_unbind() or ldap_unbind_s() functions provided with the Netscape Directory SDK) when you are done with the session.

Example

[To be added]

See Also

 

© Copyright 1998 Netscape Communications Corporation