NWDSGetServerAddresses(3nw)


NWDSGetServerAddresses -- returns the network addresses of the server associated with a connection ID

Synopsis

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

NWDSCCODE N_API NWDSGetServerAddresses (NWDSContextHandle context, NWCONN_HANDLE conn, pnuint32 countNetAddress, pBuf_T netAddresses);

Description

The parameters are as follows:

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

conn
(IN) Specifies the connection ID for the target server.

countNetAddress
(OUT) Points to the number of network addresses contained in netAddresses.

netAddresses
(OUT) Points to a buffer containing the network address associated with the 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).

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

Servers can have more than one address, such as an IPX and an IP address. netAddresses receives these addresses.

To determine the network addresses for a server associated with a connection, follow these steps:

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

  2. Call NWDSGetServerAddresses.

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

  4. Call NWDSComputeAttrValSize to find the size of the address data in the 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. Call NWDSGetAttrVal, passing in the pointer to the allocated memory.

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

  8. Before retrieving the next address, free the allocated memory. (Addresses can be different sizes.)

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

  10. Free the result buffer by calling NWDSFreeBuf.

When all addresses have been retrieved, free the result buffer pointer to by netAddresses.

Services

Directory

NCP calls

0x2222 104 02
Send NDS Fragmented Request/Reply

53
Get Server Address

References

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