> DNU home > code projects page 1
Managing NDS Buffers
DeveloperNet University Article

Every NDS request is composed in an NDS buffer which is then sent to a server participating on the target NDS tree to be handled. NDS buffers are defined as Buf_T.

The definition for a Buf_T data structure is shown below:

 
 typedef struct

 {

    nuint32   operation ;  // DSV_READ, DSV_SEARCH, etc.

    nuint32   flags ;	 	 	 	 

    nuint32   maxLen ;

    nuint32   curLen ;

    pnuint8   lastCount ;

    pnuint8   curPos ;  // the currently selected data component
    pnuint8   data ; // the buffer data

 } Buf_T;

The data portion on an initialized NDS buffer has a very precise construction. For example, in the case of searching for object attributes, NDS would return a DSV_SEARCH operation type buffer that has been initialized with found object and attribute data components in the data portion. There can be only one data component selected at a time, so the buffer must be read sequentially, one data component at a time.

getInitNDSBuffer( ) is the general routine (shown below) that is used throughout these examples to allocate and initialize NDS buffers for various purposes.

The large numbers refer to explanations after the code listing.



PREVIOUSblankTop of PageblankNEXT