his chapter describes the Lightweight Directory Access Protocol (LDAP) Application Programming Interface (API) and the Netscape Directory Server Software Development Kit (SDK).
The chapter contains the following sections:
ldap.h header file.
#include <ldap.h>The
ldap.h header file declares the LDAP API functions.
If your client calls any of the LDAP SSL functions, make sure to include the ldap_ssl.h header file:
#include <ldap_ssl.h>
libldap10.so on Solaris and IRIX, libldap10.sl on HP-UX, and libldap10_shr.a on AIX)
For example, if the libldap10.so shared library is in the /usr/ldap/lib directory, add the following link flags:
-L/usr/ldap/lib -lldap10If you linked to the shared library, you need to make sure that the LDAP client can find the library. Do one of the following:
_CONSOLE (if you are writing a console application) or _WINDOWS (if you are writing a standard Windows application).
You need to link to one of the following files:
nsldap32v10.lib, the LDAP API import library for Win32
NSLDAP.LIB, the LDAP API import library for Win16 in
Microsoft development environments (i.e., Visual C++)
NSLDAPBC.LIB, the LDAP API import library for Win16 in
Borland development environments
winnt\system.)
NSLDAPLib shared library. You need to make sure that the LDAP client can find the shared library. Do one of the following:
ldap_version() function. This function fills an LDAPVersion structure that contains the version information.
The following example illustrates the kinds of version information you can retrieve from this structure.
#include <ldap.h>
#include <stdio.h>
LDAPVersion ver;
double SDKVersion;
/* Print version information */
SDKVersion = ldap_version( &ver );
printf( "SDK Version: %f\n", SDKVersion/100.0 );
printf( "Highest LDAP Protocol Supported: %f\n",
ver.protocol_version/100.0 );
printf( "SSL Level Supported: %f\n", ver.SSL_version/100.0 );
if ( ver.security_level != LDAP_SECURITY_NONE ) {
printf( "Level of encryption: %d bits\n", ver.security_level );
} else {
printf( "SSL not enabled.\n" );
}
Last modified: March 31, 1997
Copyright © 1997 Netscape
Communications Corporation