Netscape Directory SDK for C: Source Code Documentation

Last Updated: May 31, 1998


Contents

Overview

The source code for the Directory SDK for C consists of a library that implements the LDAP API. This library defines functions that can establish sessions with LDAP servers, create and send LDAP requests to the servers, and retrieve responses from the servers.

In the LDAP protocol, requests and responses are encoded using the Basic Encoding Rules (BER). The SDK source code include functions for encoding and decoding data, according to these rules.

Source Tree Directory Structure

The source code for the Netscape Directory SDK for C is organized in the following directories:

mozilla/
  cmd/
    winfe/
      mkfiles32/        // Tools used when building the SDK
  config/
  directory/
    c-sdk/              // Main makefile
      ldap/
        build/          // Version information
        include/        // Header files
        libraries/
          liblber/      // Functions for BER-encoding, decoding, and I/O
          libldap/      // Functions implementing the LDAP API
          macintosh/    // MacOS-specific files
          msdos/        // Windows-specific files
            winsock/    // Windows .def files
  dist/			// Contains the built SDK (created 
                        //   when you build the SDK)

Internal Architecture

The following diagram illustrates the internal architecture of the library:

Roadmap of the Source Files

The different sets of functions and source code files are described below.

Header Files. The following header files define the internal structures used in this library:

LDAP Operation API Functions. These API functions are responsible for requesting LDAP operations from the server (such as ldap_search_ext_s() and ldap_add_ext()).

These functions are defined in the following files:

In addition, functions defined in the following files implement other aspects of the LDAP protocol as well as extensions to the protocol:

Parsing Functions. These API functions are responsible for getting data from structures that represent entries, attributes, and other containers (such as ldap_get_dn() and ldap_get_values()).

These functions are defined in the following files:

Utility Functions. These are utility functions in the API.

These functions are defined in the following files:

Request and Result Handling Functions. These functions are responsible for generating and sending requests to an LDAP server and for handling results returned from an LDAP server. The LDAP operation functions call these functions to send LDAP requests and retrieve results from an LDAP server.

These functions are defined in the following files:

Miscellaneous Functions. These are miscellaneous functions.

These functions are defined in the following files:

BER Encoding, Decoding, and I/O Functions. These functions encode requests and decode results, according to the Basic Encoding Rules (BER). The functions are also responsible for sending BER-encoded requests to the server and receiving BER-encoded results from the server.

These functions are defined in the following files, which are located in the liblber directory:

Unused Functions. The following source files are not compiled or used in the library. (ifdefs are used to omit the entire source code in these files.)

The following diagrams illustrate how ldap_search_ext_s() calls other library functions to generate and send an LDAP search request to the server and to get results back from the server. Figure 1 illustrates how the function generates and sends the request, while Figure 2 illustrates how the function gets results back.

Figure 1: How ldap_search_ext_s() generates and sends a search request.

Figure 2: How ldap_search_ext_s() gets search results.


Copyright © 1998 Netscape Communications Corporation