CL_netif::CL_getnodeaddr routine

Returns the IP address associated with the specified cluster ID and network interface name. This routine is capable of handling only IPv4 addresses.

Syntax

CL_ifaddr CL_netif::CL_getnodeaddr(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 Network interface address.

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. This status 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_netif netif;
CL_ifaddr ifaddr;
char cbuf[CL_ERRMSG_LEN];

netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
ifaddr = netif.CL_getnodeaddr(status);
if (status < 0) {
  cl_errmsg(status);
} else {
  printf("ifaddr = %s\n", inet_ntoa(ifaddr.sin_addr));
}