PreviousNext

Modifying Directory Entries

This topic describes a modification and subsequent listing of the DIT by using the ds_add_entry( ), ds_list( ), and ds_remove_entry( ) function calls. It includes a description of tasks directly related to these operations and does not include service-related tasks. It does not include a ds_modify_entry( ) function call. The modify operation is used in the context of the X.500 Abstract Service Definition.

A typical operation to add, remove, or list an entry involves following the same basic steps that were defined previously for the read and search operations:

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

2. Declare the variables that will contain the output from the XDS functions you will use in your application.

3. Build public objects (descriptor lists) for the name parameters to the function calls.

4. Create descriptor lists for the attributes to be added, removed, or listed.

5. Perform the operations.

These steps are demonstrated in the following code fragments. The program adds two entries to the directory, then a list operation is performed on their superior entry, and finally the two entries are removed from the directory. The directory tree shown in the following figure is used in the program.


A Sample Directory Tree