Returns information about a specified network.
Syntax
int cl_getnet (int clusterid, int netid, struct cl_net *netbuf)
Parameters
| Item | Description |
| clusterid |
The cluster ID of the desired cluster. |
| netid |
The ID of the network. |
| netbuf |
A pointer to a cl_net structure where the information
is returned. |
Status codes
| Item | Description |
| CLE_OK |
Success. |
| CLE_BADARGS |
Missing or invalid argument(s). |
| CLE_SYSERR |
System error. |
| CLE_NOCLINFO |
No cluster information available. |
| CLE_IVCLUSTERID |
Invalid cluster ID. |
| CLE_IVNETID |
Invalid network ID. |
Example
int clusterid = 1113325332;
int netid = 1;
int status, j;
struct cl_net netmap;
status = cl_getnet(clusterid, netid, &netmap);
if (status == CLE_OK)
{
printf("information for cluster network %s (id %d):\n",
netmap.clnet_name, netmap.clnet_id);
printf("network is type %s\n", netmap.clnet_type);
printf("network attribute is %d\n", netmap.clnet_attr);
printf("there are %d nodes on this network\n",
netmap.clnet_numnodes);
for (j=0; j<netmap.clnet_numnodes; j++)
{
enum cls_state node_state;
printf(" node id = %d, state = %d,",
netmap.clnet_node_ids[j],
netmap.clnet_node_states[j]);
cl_getnetstatebynode( clusterid, netmap.clnet_id,
netmap.clnet_node_ids[j], &node_state);
printf(" state (cl_getnetstatebynode) = %d\n",
node_state);
}
}