NWCCTranAddr

Defines the transport address for the specified connection

Service:Connection
Defined In:nwclxcon.h and clxwin32

Structure

  typedef struct 
     nuint32        type ; 
     nuint32        len ; 
     pnuint8        buffer ; 
  } NWCCTranAddr;
  

Delphi Structure

  Defined in nwclxcon.inc 
   
  NWCCTranAddr = packed Record 
      tranType : nuint32;  
      len : nuint32;  
      buffer : pnuint8 
    End;
  

Fields

type
(IN/OUT) Specifies the type of the transport address (see Section 5.12, Transport Type Values).
len
(IN/OUT) Specifies the length of the buffer to hold the transport address upon input. Specifies the amount of the buffer that was actually used upon output.
buffer
(OUT) Points to a buffer containing the transport address.

Remarks

If the value returned in the len field is greater than the original value passed to the len field, the returned value specifies the total length of the buffer needed to return all the information.

Addresses using this structure are in printable order, and have a format that is the same as the format for the NWFSE_NETWORK_ADDRESS (Server Management) structure. The table below describes the address format:

Table 4-1 Address Format

TranType

Length

Address Format

IPX

12 bytes

Network (4 bytes) - The server’s IPX Internal Network Number (ServerID)

Node (6 bytes) - 0x00 0x00 0x00 0x00 0x00 0x01

Socket (2 bytes) - 0x04 0x51

TCP or UDP

6 bytes

For Windows NT/2000

  • Socket (2 bytes) - 0x02 0x0C
  • IP Address (4 bytes), network (printable) order

For Windows 95/98 and NLM

  • IP Address (4 bytes), network (printable) order
  • Socket (2 bytes) - 0x02 0x0C (omit on NLM, see note below)

NOTE:For the NLM platform, specifying the socket after an IP address is allowed but not necessary. It is recommended that you simply omit the socket value and specify a length of 4.

This information is clearer to understand with the following examples.

Suppose a server has an IPX Internal Network Number of 01012493. The NWCCTranAddr structure would be filled out as follows (an IP address would be filled out similarly, using the order from the table above):

  NWCCTranAddr tranAddr;
  nuint8 networkAddress[12];
  
  tranAddr.type = NWCC_TRAN_TYPE_IPX;
  tranAddr.len = 12;
  tranAddr.buffer = networkAddress;
  
  networkAddress[0] = 0x01;   /* Network Address */
  networkAddress[1] = 0x01;
  networkAddress[2] = 0x24;
  networkAddress[3] = 0x93;
  networkAddress[4] = 0x00;   /* Node */
  networkAddress[5] = 0x00;
  networkAddress[6] = 0x00;
  networkAddress[7] = 0x00;
  networkAddress[8] = 0x00;
  networkAddress[9] = 0x01;
  networkAddress[10] = 0x04;  /* Socket - Always 0x04, 0x51 for IPX */
  networkAddress[11] = 0x51;
  

To connect to a server at the IP address 10.4.3.22, the NWCCTranAddr structure would be filled out as follows (Windows 95/98):

  NWCCTranAddr tranAddr;
  nuint8 networkAddress[6];
  tranAddr.tranType = NWCC_TRAN_TYPE_TCP;
  tranAddr.len = 6;
  tranAddr.buffer = networkAddress;
  
  /* Windows 95/98 Version */
  networkAddress[0] = 10;   /* Network Address */
  networkAddress[1] = 4;
  networkAddress[2] = 3;
  networkAddress[3] = 22;
  networkAddress[4] = 0x02;  /* Socket - Always 0x02, 0x0C */
  networkAddress[5] = 0x0C;
  

For NLM, the structure is filled out in the same way, but the length is shortened and the socket is not specified:

  NWCCTranAddr tranAddr;
  nuint8 networkAddress[4];
  
  tranAddr.tranType = NWCC_TRAN_TYPE_TCP;
  tranAddr.len = 4;
  tranAddr.buffer = networkAddress;
  
  /* NLM Version */
  networkAddress[0] = 10;   /* Network Address */
  networkAddress[1] = 4;
  networkAddress[2] = 3;
  networkAddress[3] = 22;
  

To connect to a server at the IP address 10.4.3.22, the NWCCTranAddr structure would be filled out as follows (Windows NT/2000):

  NWCCTranAddr tranAddr;
  nuint8 networkAddress[6];
  
  tranAddr.tranType = NWCC_TRAN_TYPE_TCP;
  tranAddr.len = 6;
  tranAddr.buffer = networkAddress;
  
     /* Windows NT/2000 Version */
  networkAddress[0] = 0x02;  /* Socket - Always 0x02, 0x0C */
  networkAddress[1] = 0x0C;
  networkAddress[2] = 10;    /* Network Address */
  networkAddress[3] = 4;
  networkAddress[4] = 3;
  networkAddress[5] = 22;