NWDSGetObjectHostServerAddress(3nw)


NWDSGetObjectHostServerAddress -- returns addresses of server where object is located

Synopsis

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

NWDSCCODE N_API NWDSGetObjectHostServerAddress (NWDSContextHandle context, pnstr8 objectName, pnstr8 serverName, pBuf_T netAddresses);

Description

The parameters are as follows:

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

objectName
(IN) Points to the name of a Directory object.

serverName
(OUT) Points to the name of the server where an object is located.

netAddresses
(OUT) Points to a buffer containing the network addresses of the associated server.

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).

Notices

NWDSGetObjectHostServerAddress works only for objects having ``Host Resource Name'' as an attribute (like Volume). Servers can have more than one address, such as an IPX and an IP address. netAddresses receives these addresses.

The steps for determining the addresses on a server where an object is located are as follows:

  1. Allocate a result buffer by calling NWDSAllocBuf. This buffer does not need to be initialized since it is a result buffer.

  2. Call NWDSGetObjectHostServerAddress.

  3. Determine the number of attributes stored in the result buffer by calling NWDSGetAttrCount.

  4. Call NWDSComputeAttrValSize to find the size of the current address in the result buffer.

  5. Allocate a contiguous block of memory the size of the attribute value, and set a void pointer to point to that block.

  6. Retrieve the current address from the result buffer by calling NWDSGetAttrVal and passing in a pointer to the memory allocated in step 5.

  7. When NWDSGetAttrVal returns, typecast the pointer to be a pointer to Net_Address_T, and remove the information.

  8. Free the allocated memory before retrieving the next address. (Network addresses can be different sizes.)

  9. Loop to step 4 until all addresses have been removed from the result buffer.

Services

Directory

Source Module

GTHSADDR.C

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

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