This function retrieves the workstation's IP addresses.
Context
Windows client,
Windows server,
Java client,
Java server,
Adelia Web client,
Adelia Cloud client,
Event Adelia client.
Parameters
ALPHA(n) [I] |
IPAddress |
IP address. |
NUM_BIN_2 [I] |
IPAddressLgth |
IPAddress buffer length. |
NUM_BIN_2 [I/O] |
IPNum |
Number of the requested IP address. Note: set the value 1 for the first call. IPNum returns the value of a new index: 0: the workstation has no other IP address. >0: the workstation has another IP address; the function must be called again using this index in order to retrieve the value of the alternative IP address. |
NUM_BIN_4 [O] |
ReturnCode |
Return code for the operation: 0: Operation completed successfully. -1: Error determining the host. -3: IPAddress buffer too small. -4: Invalid IPNum index.
[C platform] > 0: Winsock error.
[Java platform] 1: Security error. |
Notes:
- The IP address returned by the function may be either an IPv4 or IPv6 address.
IPv4 addresses are expressed in the form "w.x.y.z", where w, x, y and z are values between 0 and 255.
IPv6 addresses are formatted in accordance with the text representation defined in the standard RFC 2373 (eight 32-bit integer positions; hexadecimal notation; values separated by the ":" character; 0 sequences may be represented in shorthand; partial dot-notation for an IPV4 address included in an IPv6 address).
Unlike IPv4 addresses, IPv6 addresses contain a ":" character. - This function may return different sets of results on different platforms. In Java, the function returns two results for a given IP address, corresponding to the two possible address formats (IPv4 and IPv6). With C for Windows generation, only one of the two representations is returned.
- The text representation of an IPv4 address has a maximum length of 15 characters.
The text representation of an IPv6 address has a maximum length of 45 characters.
Example
ALPHA(15) |
IPAddress |
NUM_BIN_2 |
IPNum |
NUM_BIN_4 |
ReturnCode |
|
|
NumIP |
= 1 |
|
|
CALL_DLL |
'VATOOLBX' 'VaToolBxGetLocalIP' IPAddress 15 IPNum ReturnCode |
Result:
ReturnCode |
= 0 /* the operation was completed successfully. |
IPNum |
= 0 /* no other IP address on the workstation. |
IPAddress |
= '192.168.137.206' |