cwbCO_GetIPAddress

Use the IBM® i Access for Windows cwbCO_GetIPAddress command.

Purpose

This function gets the IBM i IP address represented by the specified system object. This is the IP address that was used on the IBM i connection (or was set some other way, such as by using cwbCO_SetIPAddress), and will be used for later connections, when using the specified system object.

Syntax

 
UINT CWB_ENTRY cwbCO_GetIPAddress(
                              cwbCO_SysHandle    system,
                              LPSTR              IPAddress,
                              PULONG             length );

Parameters

cwbCO_SysHandle system - input
Handle that previously was returned by cwbCO_CreateSystem or cwbCO_CreateSystemLike. It is the IBM i identification.
LPSTR IPAddress - output
Pointer to a buffer that will contain the NULL-terminated IP address in dotted-decimal notation (in the form "nnn.nnn.nnn.nnn" where each "nnn" is in the range of from 0 to 255).
PULONG length - input/output
Pointer to the length of the IPAddress buffer. If the buffer is too small to hold the output, including room for the terminating NULL, the size of the buffer needed will be filled into this parameter and CWB_BUFFER_OVERFLOW will be returned.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWB_INVALID_API_HANDLE
Invalid system handle.
CWB_INVALID_POINTER
One of the input pointers is NULL.
CWB_BUFFER_OVERFLOW
The IPAddress buffer is not large enough to hold the entire IPAddress string.

Usage

None.