GetInternetAddress

Returns a connection’s Internet address

Local Servers:nonblocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Server-Based Connection

Syntax

  #include <nwconn.h>  
   
  int GetInternetAddress (  
     WORD   connectionNumber,  
     char   *networkNumber,  
     char   *nodeAddress); 
  

Parameters

connectionNumber
(IN) Specifies the connection number of the workstation or NLM for which an internetwork address is requested (1 to maximum number of connections).
networkNumber
(OUT) Receives the network number (4 bytes).
nodeAddress
(OUT) Receives the physical node address (6 bytes).

Return Values

The following table lists return values and descriptions.

Value

Hex

Name

Description

0

(0x00)

ESUCCESS

 

-1

 

EFAILURE

No network address is using that connection number.

Remarks

The internetwork address is comprised of the networkNumber and the nodeAddress and uniquely identifies an object. The networkNumber is the address of the network to which the object is attached. This is the same type of address as is displayed when the NetWare console command DISPLAY NETWORKS is issued.

The nodeAddress is the address of the object on the network that is returned in the networkNumber parameter. Use this address to send packets directly to the object with IPX/ SPX™.

Print the networkNumber and the nodeAddress using the following format:

     printf ("%08lx", LongSwap (* (long *) networkNumber) );  
     printf ("%08lx%04x", LongSwap (* (long *) nodeAddress),  
        IntSwap (* (int *) nodeAddress + 4) ); 
  

See Also

GetConnectionInformation, GetConnectionNumber, GetMaximumNumberOfStations, GetObjectConnectionNumbers, GetStationAddress, IntSwap, LongSwap

GetInternetAddress Example

  #include <nwconn.h>  
   
  int    completionCode;  
  char   networkNumber[4];  
  char   nodeAddress[6];  
   
  /* return the internet address of the current connection.*/  
  completionCode = GetInternetAddress (GetConnectionNumber(), networkNumber,  
     nodeAddress);