cwbCO_SetIPAddress
Use the cwbCO_SetIPAddress command.
Purpose
This function sets, for the specified system object, the IP address that will be used for the IBM i connection. It also changes the IP Address Lookup Mode for the system object to CWBCO_IPADDR_LOOKUP_NEVER. These changes will NOT affect any other system object that exists or is created later.
Syntax
UINT CWB_ENTRY cwbCO_SetIPAddress(
cwbCO_SysHandle system,
LPCSTR IPAddress );
Parameters
- cwbCO_SysHandle system - input
- Handle that previously was returned from cwbCO_CreateSystem or cwbCO_CreateSystemLike. It is the IBM i identification.
- LPCSTR IPAddress - input
- Specifies the IP address as a character string, in dotted-decimal notation ("nnn.nnn.nnn.nnn"), where each "nnn" is a decimal value ranging from 0 to 255. The IPAddress must not be longer than CWBCO_MAX_IP_ADDRESS characters, not including the terminating NULL character.
Return Codes
The following list shows common return values:
- CWB_OK
- Successful completion.
- CWB_INVALID_API_HANDLE
- Invalid system handle.
- CWB_INVALID_PARAMETER
- The IPAddress parameter does not contain a valid IP address.
- CWB_RESTRICTED_BY_POLICY
- A policy exists that prohibits the user from changing this value.
- CWB_INV_AFTER_SIGNON
- Signon has successfully occurred by using the specified system object, so this setting no longer may be changed.
Usage
This API cannot be used after a successful signon has occurred for the specified system object. A signon has occurred if either cwbCO_Signon or cwbCO_Connect has been called successfully for this system object.
Use this API to force use of a specific IP address whenever any connection is made using the specified system object. Since the IP Address Lookup Mode is set to NEVER lookup the IP address, the address specified always will be used, unless before a connect or signon occurs, the IP Address Lookup Mode is changed by calling cwbCO_SetIPAddressLookupMode.