The predefined static object classes and attributes are shown in the following code fragment:
/*
* To hold the attributes we want to attach to the name being added.
* One attribute is the class of the object (DS_O_ORG_PERSON), the
* rest of the attributes are the surname (required for all objects
* of class DS_O_ORG_PERSON) and phone number. In addition, we need
* an object to hold all this information to pass it into
* ds_add_entry().
*/
static OM_descriptor xdsObjectClass[] = {
/* This object is an attribute -- an object class. */
OM_OID_DESC( OM_CLASS, DS_C_ATTRIBUTE ),
OM_OID_DESC( DS_ATTRIBUTE_TYPE, DS_A_OBJECT_CLASS ),
/* Not only must the class be listed, but also all */
/* its superclasses. */
OM_OID_DESC( DS_ATTRIBUTE_VALUES, DS_O_TOP ),
OM_OID_DESC( DS_ATTRIBUTE_VALUES, DS_O_PERSON ),
OM_OID_DESC( DS_ATTRIBUTE_VALUES, DS_O_ORG_PERSON ),
/* Null terminator */
OM_NULL_DESCRIPTOR
};
static OM_descriptor xdsAttributesToAdd[] = {
/* This object is an attribute list. */
OM_OID_DESC( OM_CLASS, DS_C_ATTRIBUTE_LIST ),
/* These are "pointers" to the attributes in the list. */
{ DS_ATTRIBUTES, OM_S_OBJECT, { 0, xdsObjectClass } },
{ DS_ATTRIBUTES, OM_S_OBJECT, { 0, xdsSurname } },
{ DS_ATTRIBUTES, OM_S_OBJECT, { 0, xdsPhoneNum } },
/* Null terminator */
OM_NULL_DESCRIPTOR
};
/*
* To hold the list of attributes we want to read.
*/
static OM_descriptor xdsAttributeSelection[] = {
/* This is an entry information selection. */
OM_OID_DESC( OM_CLASS, DS_C_ENTRY_INFO_SELECTION ),
/* No, we don't want all attributes. */
{ DS_ALL_ATTRIBUTES, OM_S_BOOLEAN, OM_FALSE },
/* These are the ones we want to read. */
OM_OID_DESC( DS_ATTRIBUTES_SELECTED, DS_A_SURNAME ),
OM_OID_DESC( DS_ATTRIBUTES_SELECTED, DS_A_PHONE_NBR ),
/* Give us both the types and their values. */
{ DS_INFO_TYPE, OM_S_ENUMERATION, { DS_TYPES_AND_VALUES, NULL } },
/* Null terminator */
OM_NULL_DESCRIPTOR
};