NWDSReadClassDef(3nw)


NWDSReadClassDef -- retrieves information about Directory Schema object class definitions

Synopsis

   #include <nwnet.h> 
   or 
   #include <nwdssch.h> 
   

NWDSCCODE N_API NWDSReadClassDef (NWDSContextHandle context, nuint32 infoType, nbool8 allClasses, pBuf_T classNames, pnint32 iterationHandle, pBuf_T classDefs);

Description

The parameters are as follows:

context
(IN) Specifies the Directory context for the request.

infoType
(IN) Specifies the information type desired (names only, or names and definitions).

allClasses
(IN) Specifies whether information for every object class should be returned.

classNames
(IN) Points to a request buffer containing the names of the object classes whose information is to be returned.

iterationHandle
(IN/OUT) Points to information needed to resume subsequent iterations of NWDSReadClassDef.

classDefs
(OUT) Points to a result buffer containing the requested object-class names and/or definitions.

Return values

0x0000
SUCCESSFUL

Negative Value
Negative values indicate errors. For errors returned by Directory Services, see ``Directory Services OS Errors'' (-001 to -255), ``Directory Services Client Library Errors'' (-301 to -399), or ``Directory Services Agent in the Server Errors'' (-601 to -699).

0x8996
SERVER_OUT_OF_MEMORY

0x89E2
TOO_FEW_FRAGMENTS

0x89E3
TOO_MANY_FRAGMENTS

0x89E4
PROTOCOL_VIOLATION

0x89E5
SIZE_LIMIT_EXCEEDED

0x89FD
UNKNOWN_REQUEST

0x89FD
INVALID_PACKET_LENGTH

0x89FE
BAD_PACKET

0x89FF
Failure not related to Directory Services

Notices

infoType, allClasses, and classNames indicate the type of object-class information requested.

infoType specifies whether both class name and class definitions are requested. It also specifies whether to return information about class definitions or expanded class-definitions. The valid values for infoType are as follows:

0
DS_CLASS_DEF_NAMES returns class names only.

1
DS_CLASS_DEFS returns both class names and definitions.

2
DS_EXPANDED_CLASS_DEFS returns expanded class definitions.

3
DS_INFO_CLASS_DEFS returns class definitions only.

If allClasses is TRUE, information about all classes in the Directory schema is requested and classNames is ignored and can be set to NULL. If allClasses is FALSE, only the class definitions specified in the request buffer pointed to be by classNames are requested.

classNames is an request buffer specifying the names of the object-classes whose information you want to return. This can be set to NULL, as mentioned in the previous paragraph.

iterationHandle controls retrieval of results larger than the result buffer pointed to by classDefs.

Before the initial call to NWDSReadClassDef, set the contents of the iteration handle pointed to by iterationHandle to NO_MORE_ITERATIONS.

When NWDSReadClassDef returns from its initial call, if the result buffer holds the complete results, the location pointed by iterationHandle is set to NO_MORE_ITERATIONS. If the iteration handle is not set to NO_MORE_ITERATIONS, use the iteration handle for subsequent calls to NWDSReadClassDef in order to obtain further portions of the results. When the results are completely retrieved, the contents of the iteration handle will be set to NO_MORE_ITERATIONS.


NOTE: To end the Read operation before the complete results have been retrieved, call NWDSCloseIteration with a value of DSV_READ_CLASS_DEFS to free memory and states associated with NWDSReadClassDef.

The level of granularity for partial results in an individual class definition.

classDefs points to a result buffer containing the requested information. This buffer contains either a list of class names, or a sequence of class names and definitions, or a sequence of class definitions. The type of information returned depends on infoType.

Take the following steps to retrieve information about object-class definitions in the Directory Schema

  1. Allocate a request buffer by calling NWDSAllocBuf. (If you are retrieving information about all class definitions, you do not need a request buffer and can skip steps 1 through 3.)

  2. Initialize the request buffer for a DSV_READ_CLASS_DEF operation by calling NWDSInitBuf.

  3. For each object class you want to receive information about, store the object-class name in the request buffer by calling NWDSPutClassName.

  4. Allocate a result buffer by calling NWDSAllocBuf. (It does not need to be initialized since it is a result buffer.)

  5. Set the contents of the iteration handle to NO_MORE_ITERATIONS.

  6. Retrieve the object-class information by calling NWDSReadClassDef.

  7. Determine the number of object classes whose information is in the result buffer by calling NWDSGetClassDefCount.

  8. If you have chosen object names and definitions, retrieve each object-class definition from the buffer by using the steps in the list following this list.

  9. If the iteration handle is not set to NO_MORE_ITERATIONS, loop to step 6 to retrieve more information about object classes. Otherwise, go to step 10.

  10. Free the request buffer by calling NWDSFreeBuf.

  11. Free the result buffer by calling NWDSFreeBuf.

For each object-class definition in the buffer, take the following steps to remove the information:

  1. Read the name (and other information) of the current object class whose definition is in the buffer by calling NWDSGetClassDef. (If you called NWDSReadClassDefs with infoType being DS_CLASS_DEF_NAMES, skip the rest of the following steps.)

  2. Move to the result buffer's Super Class Names list and determine the number of super-class names in the list by calling NWDSGetClassItemCount. (Moving to the list and determining the number of class names is accomplished with one call to NWDSGetClassItemCount.

  3. For each super-class name in the Super Class Names list, retrieve the super-class name by calling NWDSGetClassItem.

  4. Move to the result buffer's Containment Class Names list and determine the number of containment-class names in the list by calling NWDSGetClassItemCount.

  5. For each containment class name in the Containment Class Names list, retrieve the containment-class name by calling NWDSGetClassItem.

  6. Move to the result buffer's Naming Attribute Names list and determine the number of naming-attribute names in the list by calling NWDSGetClassItemCount.

  7. For each naming-attribute name in the Naming Attribute Names list, retrieve the naming-attribute name by calling NWDSGetClassItem.

  8. Move to the result buffer's Mandatory Attribute Names list and determine the number of mandatory-attribute names in the list by calling NWDSGetClassItemCount.

  9. For each mandatory-attribute name in the Mandatory Attribute Names list, retrieve the naming attribute name by calling NWDSGetClassItem.

  10. Move to the result buffer's Optional Attribute Names list and determine the number of optional-attribute names in the list by calling NWDSGetClassItemCount.

  11. For each optional-attribute name in the Optional Attribute Names list, retrieve the optional-attribute name by calling NWDSGetClassItem.

Services

Directory

NCP calls

0x2222 23 17
Get File Server Information

0x2222 23 22
Get Station's Logged Info (old)

0x2222 23 28
Get Station's Logged Info

0x2222 104 01
Ping for NDS NCP

0x2222 104 02
Send NDS Fragmented Request/Reply

References

NWDSReadAttrDef(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.