 |
Index for Section 3 |
|
 |
Alphabetical listing for I |
|
 |
Bottom of page |
|
imc_getclusterinfo(3)
NAME
imc_getclusterinfo - Gets information about the hosts participating in a
Memory Channel Application Programming Interface (API) cluster
LIBRARY
Memory Channel API library (libimc.a)
SYNOPSIS
#include <sys/imc.h>
int imc_getclusterinfo (
imc_infoType *i_items,
int i_nitems
[,char *io_data,
int i_datalen]... );
PARAMETERS
i_items Points to an array that contains the enumerated type of each item
to be returned. The last element of the array must be zero (0).
Valid types are:
IMC_GET_HOSTS
Returns information on the number of hosts in a Memory
Channel API cluster, and the name of each host, in a
data structure of type imc_hostinfo.
IMC_GET_NRAILS
Returns the number of logical rails in the Memory
Channel API cluster, in a variable of type unsigned
int.
IMC_GET_ACTIVERAILS
Returns the logical rail numbers of the active logical
rails in the Memory Channel API cluster, in a variable
of type imc_railinfo.
i_nitems Specifies the number of items in the array i_items.
io_data Points to a buffer that contains the item of Memory Channel API
cluster information requested.
i_datalen Specifies the length of the buffer identified by the io_data
parameter.
DESCRIPTION
The imc_getclusterinfo() function returns information on items in a Memory
Channel API cluster.
Note
The imc_getclusterinfo() function returns Memory Channel API
cluster information, not TruCluster Server cluster information.
One or more of the following items may be requested:
· A count of the number of hosts participating in the Memory Channel API
cluster, and the name of each host.
· The number of logical rails in the Memory Channel API cluster.
· The active Memory Channel logical rails bitmask, which contains the
numbers of the active logical rails.
A request of zero items is valid and will return nothing.
The request items are returned in data structures, as follows:
imc_hostinfo
The data structure of type imc_hostinfo contains the following
fields:
name [IMC_MAXHOSTS][MAXHOSTNAMELEN]
The host names are returned in the two-dimensional name
array. The string containing the host name is zero-
terminated. The elements in the array are numbered 0
to (num-1).
num The number of hosts in the Memory Channel API cluster
is returned in the num field.
imc_railinfo
The active Memory Channel logical rails bitmask is returned in
the imc_railinfo array (with bit 0 representing logical rail
number 0, bit 1 representing logical rail number 1, and so on).
Note
The imc_getclusterinfo() function lists only those hosts that
have initialized the Memory Channel API library.
EXAMPLES
1. The following program extract requests the names of the members of the
Memory Channel API cluster:
imc_hostinfo hostinfo;
int status,i;
imc_infoType items[2];
items[0] = IMC_GET_HOSTS;
items[1] = 0;
status =
imc_getclusterinfo(items,1,&hostinfo,sizeof(imc_hostinfo));
if (status != IMC_SUCCESS)
imc_perror("imc_getclusterinfo:",status);
else
for (i=0; i<hostinfo.num; i++)
printf("Member: %s\n",hostinfo.name[i]);
2. The following program extract requests the active Memory Channel
logical rails bitmask and prints out the numbers of the active logical
rails:
imc_railinfo mask;
int status,i;
imc_infoType items[2];
items[0] = IMC_GET_ACTIVERAILS;
items[1] = 0;
status = imc_getclusterinfo(items,1,mask,sizeof(imc_railinfo));
if (status != IMC_SUCCESS)
imc_perror("imc_getclusterinfo:",status);
else
for (i=0; i<IMC_MAXRAILS; i++)
if (IMC_IS_RAIL_ACTIVE(mask,i))
printf("Rail %d is ACTIVE\n",i);
3. The following program extract requests the names of the members of the
Memory Channel API cluster, the number of logical rails, and the
active Memory Channel logical rails bitmask:
imc_railinfo mask;
imc_hostinfo hostinfo;
unsigned nrails;
int status;
imc_infoType items[4];
items[0] = IMC_GET_ACTIVERAILS;
items[1] = IMC_GET_HOSTS;
items[2] = IMC_GET_NRAILS;
items[3] = 0;
status = imc_getclusterinfo(items,3,mask,sizeof(imc_railinfo),\
&hostinfo,sizeof(imc_hostinfo),&nrails,sizeof(unsigned));
RETURN VALUES
The imc_getclusterinfo() function returns one of the following values:
IMC_SUCCESS
Normal successful completion.
IMC_BADPARM
An invalid parameter was specified in the call to the
imc_getclusterinfo() function.
IMC_NOTINIT
This host has not been initialized to use the Memory Channel API
library.
RELATED INFORMATION
Introduction: imc(3)
Commands: imc_init(1), imcs(1)
Functions: imc_api_init(3), imc_kill(3), imc_wait_cluster_event(3)
Cluster Highly Available Applications
 |
Index for Section 3 |
|
 |
Alphabetical listing for I |
|
 |
Top of page |
|