Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 17 Data Types and Structures

LDAPVersion

LDAPVersion contains version information about the LDAP C SDK. Call the ldap_version() function to return a pointer to an LDAPVersion structure containing the version information.

LDAPVersion is defined as follows:

typedef struct _LDAPVersion { 
   int sdk_version; 
   int protocol_version; 
   int SSL_version; 
   int security_level; 
} LDAPVersion;
The fields in this structure are described below:

sdk_version

Version number of the LDAP C SDK multiplied by 100 (for example, the value 100 in this field represents version 1.0).

protocol_version

Highest supported LDAP protocol version multiplied by 100 (for example, the value 300 in this field represents LDAP v3).

SSL_version

Supported SSL version multiplied by 100 (for example, the value 300 in this field represents SSL 3.0).

security_level

Level of encryption supported in bits (for example, 128 for domestic or 40 for export). If SSL is not enabled, the value of this field is LDAP_SECURITY_NONE.

The following section of code prints version information about the LDAP C SDK:

#include <ldap.h>
#include <stdio.h>
...
LDAPVersion ver;
double SDKVersion;
...
/* Print version information */
SDKVersion = ldap_version( &ver );
printf( "SDK Version: %1.2f\n", SDKVersion/100.0 );
printf( "Highest LDAP Protocol Supported: %1.2f\n", 
         ver.protocol_version/100.0 );
printf( "SSL Level Supported: %1.2f\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" );
...

Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:05:28