PreviousNext

The Directory Service Package

The directory service package is the default package and as such does not require negotiation. The optional packages have to be negotiated with the directory service by using the ds_version( ) function.

The object identifiers for specific packages are defined in header files that are part of the XDS API and XOM API. An object identifier consists of a string of integers. The header files include #define preprocessor statements that assign names to these constants in order to make them more readable. These assignments alleviate the application programmer from the burden of maintaining these strings of integers. For example, the object identifiers for the directory service package are defined in xds.h. The xds.h header file contains OM class and OM attribute names, OM object constants, and defines prototypes for XDS API functions, as shown in the following code fragment from xds.h:

/* DS package object identifier */

/* {iso(1) identifier-organization(3) icd-ecma(12)

* member-company(2)

* dec(1011) xopen(28) dsp(0) } */

#define OMP_O_DS_SERVICE_PKG "\x2B\x0C\x02\x87\xlC\x00"

A ds_version( ) function call must be included within an application program to negotiate the optional features (packages) with the directory service. The first step is to build an array of object identifiers for the optional packages to be negotiated (the basic directory contents package and the GDS package), as shown in the following code fragment from the acl.h header file:

DS_feature features[] = {

{ OM_STRING(OMP_O_DS_BASIC_DIR_CONTENTS_PKG), OM_TRUE },

{ OM_STRING(OMP_O_DSX_GDS_PKG), OM_TRUE },

{ 0 }

};

The OM_STRING macro is provided for creating a data value of data type OM_string for octet strings and characters. XOM API macros are described in XOM API Macros.

The array of object identifiers is stored in features, and passed as an input parameter to ds_version( ), as shown in the following code fragment from acl.c:

/* Negotiate the use of the BDC and GDS packages. */


if (ds_version(features) != DS_SUCCESS)

printf("ds_version() error\n");