Returns the network interface address of the interface
with the specified cluster ID and network interface name. This routine
is capable of handling only IPv4 addresses.
Syntax
CL_ifaddr CL_netif::CL_getifaddr (CL_status s)
Required input object data
| Item |
Description |
| CL_netif::cli_clusterid |
The cluster ID of the desired network interface. |
| CL_netif::cli_name |
The name of the desired network interface. |
Return value
| Item |
Description |
| CL_ifaddr |
The network interface address desired. |
Status value
| Item |
Description |
| CL_status s |
Status passed by reference. Output parameter that holds the
return code. |
| CLE_OK |
The request completed successfully. |
| CLE_SYSERR |
System error. Check the AIX® global errno variable
for additional information. |
| CLE_BADARGS |
Missing or invalid parameters. Usually indicates that a NULL
pointer was specified for an output parameter address. |
| CLE_IVCLUSTERID |
The request specified an invalid cluster ID. |
| CLE_IVNETIFNAME |
The request specified an invalid network interface name. |
Example
CL_status status;
CL_ifaddr ifaddr;
CL_netif netif;
char cbuf[CL_ERRMSG_LEN];
netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
ifaddr = netif.CL_getifaddr(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("ifaddr = %s\n", inet_ntoa(ifaddr.sin_addr));
}