PreviousNext

Searching the Directory

This topic describes a typical search operation by using the ds_search( ) function call. It only includes the tasks directly related to the search operation and does not include tasks related to the XDS interface or other directory operations.

A typical search operation involves the following steps:

1. Define the necessary object identifier constants for the OM classes and OM attributes that will define public objects for input to ds_search( ) by using the OM_EXPORT macro.

2. Declare the variables that will contain the output from the XDS functions that will be used in the application.

3. Build public objects (descriptor lists) for the name parameter to ds_search( ).

4. Specify the portion of the DIT to be searched.

5. Create a descriptor list for the filter parameter to ds_search( ) that designates which entries are to be eliminated from the search.

6. Create a descriptor list for the selection parameter to ds_search( ) that selects the type and scope of information in your request.

7. Perform the search operation.

These steps are demonstrated in the following code fragments from acl.h. The program includes a search operation. In order to perform the operation, the program assumes the directory contains the subtree shown in the following figure.


Subtree for the acl.h Sample Program