## The XDS Negotiation Sequence

The interface has an initialization and shutdown sequence that permits the negotiation of optional features. This involves the ds_initialize( ), ds_version( ), and ds_shutdown( ) functions.

Every application program must first call ds_initialize( ) , which returns a workspace. This workspace supports the standard directory service package (see XDS Class Definitions ).

The workspace can be extended to support the optional basic directory contents package (see Basic Directory Contents Package), the strong authentication package (see Strong Authentication Package ), the GDS package (see GDS Package ), or the MHS directory user package (see MHS Directory User Package ). These packages are identified by means of OSI object identifiers, and these object identifiers are supplied to ds_version( ) to incorporate the extensions into the workspace.

After a workspace with the required features is negotiated in this way, the application can use the workspace as required. It can create and manipulate OM objects by using the OM functions, and it can start one or more directory sessions by using ds_bind( ).

After completing its tasks, terminating all its directory sessions by using ds_unbind( ), and releasing all its OM objects by using om_delete( ), the application needs to ensure that resources associated with the interface are freed by calling ds_shutdown( ).

It is possible to retain access to service-generated public objects after ds_shutdown( ) is called, or to start another cycle by calling ds_initialize( ) if so required by the application design.

##