Program PDF
Program PDF
Standard Edition
Version 7.2
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
109.
This edition applies to IBM® PowerHA® SystemMirror® 7.2 Standard Edition for AIX® and to all subsequent releases and
modifications until otherwise indicated in new editions.
© Copyright International Business Machines Corporation 2017, 2018.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
iii
cl_getnet routine.................................................................................................................................. 44
cl_getnetbyname routine.....................................................................................................................45
cl_getnetmap routine...........................................................................................................................46
cl_getnetsbyattr routine...................................................................................................................... 47
cl_getnetsbytype routine..................................................................................................................... 48
cl_getnetstatebynode routine............................................................................................................. 49
cl_getnode routine............................................................................................................................... 50
cl_getnodeaddr routine........................................................................................................................50
cl_getnodeaddr6 routine..................................................................................................................... 51
cl_getnodemap routine........................................................................................................................52
cl_getnodenamebyifaddr routine........................................................................................................ 53
cl_getnodenamebyifaddr6 routine...................................................................................................... 54
cl_getnodenamebyifname routine...................................................................................................... 54
cl_getprimary routine...........................................................................................................................55
cl_getsite routine................................................................................................................................. 56
cl_getsitebyname routine.................................................................................................................... 57
cl_getsitebypriority routine..................................................................................................................58
cl_getsitemap routine.......................................................................................................................... 58
cl_isaddravail routine...........................................................................................................................59
cl_isaddravail6 routine.........................................................................................................................60
cl_isclusteravail routine....................................................................................................................... 61
cl_isnodeavail routine.......................................................................................................................... 62
cl_model_release routine.................................................................................................................... 62
cl_node_free routine............................................................................................................................ 62
cl_registereventnotify routine............................................................................................................. 63
cl_unregistereventnotify routine......................................................................................................... 67
Clinfo C++ API............................................................................................................................................67
Clinfo C++ object classes..................................................................................................................... 68
Using the Clinfo C++ API in an application.......................................................................................... 68
Requests............................................................................................................................................... 74
CL_cluster::CL_getallinfo routine........................................................................................................ 76
CL_getlocalid routine........................................................................................................................... 77
CL_cluster::CL_getallinfo routine........................................................................................................ 78
CL_cluster::CL_getclusterid routine.................................................................................................... 79
CL_group::CL_getinfo routine..............................................................................................................80
CL_cluster::CL_getprimary routine......................................................................................................81
CL_cluster::CL_isavail routine............................................................................................................. 82
CL_cluster::CL_getgroupinfo routine...................................................................................................83
CL_group::CL_getinfo routine..............................................................................................................84
CL_netif::CL_getclusterid routine........................................................................................................85
CL_netif::CL_getclusterid6 routine..................................................................................................... 86
CL_netif::CL_getifaddr routine............................................................................................................ 87
CL_netif::CL_getifaddr6 routine.......................................................................................................... 88
CL_netif::CL_getifname routine...........................................................................................................89
CL_netif::CL_getifname6 routine........................................................................................................ 90
CL_netif::CL_getnodeaddr routine...................................................................................................... 92
CL_netif::CL_getnodeaddr6 routine.................................................................................................... 93
CL_netif::CL_getnodenamebyif routine.............................................................................................. 94
CL_netif::CL_getnodenamebyif6 routine............................................................................................ 95
CL_netif::CL_isavail routine................................................................................................................. 96
CL_netif::CL_isavail6 routine...............................................................................................................97
CL_node::CL_bestroute routine...........................................................................................................98
CL_node::CL_bestroute6 routine........................................................................................................ 99
CL_node::CL_getinfo routine.............................................................................................................100
CL_node::CL_isavail routine.............................................................................................................. 101
Sample Clinfo client program.................................................................................................................. 102
Sample customized clinfo.rc script....................................................................................................102
cl_status.c sample program.............................................................................................................. 104
iv
Implementation specifics........................................................................................................................105
Cluster Manager and Clinfo................................................................................................................105
SNMP community name and Clinfo................................................................................................... 107
Notices..............................................................................................................109
Privacy policy considerations.................................................................................................................. 110
Trademarks.............................................................................................................................................. 111
Index................................................................................................................ 113
v
vi
About this document
This document describes the Cluster Information Program (Clinfo) client application programming
interfaces (APIs) and the Management Information Base (MIB) supplied with the PowerHA SystemMirror
software.
Highlighting
The following highlighting conventions are used in this document:
Bold Identifies commands, subroutines, keywords, files, structures, directories, and other
items whose names are predefined by the system. Also identifies graphical objects
such as buttons, labels, and icons that the user selects.
Italics Identifies parameters whose actual names or values are to be supplied by the user.
Identifies examples of specific data values, examples of text similar to what you
Monospace
might see displayed, examples of portions of program code similar to what you
might write as a programmer, messages from the system, or information you should
actually type.
Case-sensitivity in AIX
Everything in the AIX operating system is case-sensitive, which means that it distinguishes between
uppercase and lowercase letters. For example, you can use the ls command to list files. If you type LS,
the system responds that the command is not found. Likewise, FILEA, FiLea, and filea are three
distinct file names, even if they reside in the same directory. To avoid causing undesirable actions to be
performed, always ensure that you use the correct case.
ISO 9000
ISO 9000 registered quality systems were used in the development and manufacturing of this product.
Related information
• The PowerHA SystemMirror Version 7.2 for AIX PDF documents are available in the PowerHA
SystemMirror 7.2 PDFs topic.
• The PowerHA SystemMirror Version 7.2 for AIX release notes are available in the PowerHA
SystemMirror 7.2 release notes topic.
Getting started
The Clinfo API and its associated components are installed and configured when you install PowerHA
SystemMirror .
There are a few things to consider before you begin using Clinfo:
1. In order to use Clinfo you must specify that the Clinfo agent be started when you start PowerHA
SystemMirror cluster services. This is the Startup cluster information Daemon option in smitty
clstart.
2. Clinfo will recognize and use SNMP community names other than public. If your installation is using a
non-public name or if you want to specify a specific name, see Implementation specifics.
3. Clinfo will run on each node where you install PowerHA SystemMirror . It can also run on other
machines provided they have TCP/IP connectivity to one of the PowerHA SystemMirror nodes. For
additional information about this capability, see Implementation Specifics.
Related reference
Implementation specifics
Clinfo APIs
An application accesses cluster information through the Clinfo API functions. Developers can use either
the Clinfo C API or the Clinfo C++ API to access the cluster status information, which is then available
locally for clients running the Clinfo program.
PowerHA SystemMirror for AIX includes two versions of the Clinfo C and C++ API libraries: one for single-
threaded (non-threaded) applications (libcl.a and libclpp.a ) and one for multi-threaded applications
(libcl_r.a and libclpp_r.a ). Be sure to link with the appropriate version for your application. The libcl_r.a
is a thread-safe version of the libcl.a ; the libclpp_r.a is a thread-safe version of the libclpp.a .
Each of these libraries contain 32-bit and 64-bit objects, which are loaded at runtime depending on the
AIX operating environment.
See Clinfo C API and Clinfo C++ API, for detailed descriptions of the routines in these APIs.
Related concepts
Clinfo C API
The Clinfo C Application Programming Interface (API) is a high-level interface that you can use in an
application to get status information about an PowerHA SystemMirror cluster. These topics describe the
specific C language routines and utilities available in the Clinfo C API.
Clinfo C++ API
The Clinfo C++ API is an object-oriented interface that you can use in a C++ application to get status
information about an PowerHA SystemMirror for AIX cluster. These topics describe the specific C++
language objects and methods available in the Clinfo C++ API.
2 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Cluster information tracked by Clinfo
Some cluster information is maintained by Clinfo.
Clusters
An PowerHA SystemMirror cluster is a group of processors that cooperate to provide a highly available
environment.
Cluster name
A cluster name uniquely identifies a cluster. The administrator specifies the name when the cluster is
configured.
Cluster ID
A cluster ID identifies each cluster. The cluster ID is a numeric value assigned by PowerHA SystemMirror
(this is not user-defined) at the time the cluster is configured.
Cluster state
A cluster can be in one of the following defined states:
Item Description
CLS_UP At least one node in the cluster is up, and a primary is defined.
CLS_DOWN No nodes are up.
CLS_UNKNOWN Clinfo is unable to communicate, or is not yet communicating with an SNMP
process on any active cluster.
CLS_ NOTCONFIGURED The cluster is not yet configured.
Cluster substate
A cluster can be in one of several defined substates:
Item Description
CLSS_ERROR An error occurred and manual intervention is required.
CLSS_RECONFIG A dynamic reconfiguration of the cluster is in progress.
CLSS_STABLE The cluster is stable (no reconfiguration is occurring).
CLSS_UNSTABLE The cluster is unstable. The event history will show what events are
happening.
CLSS_UNKNOWN Clinfo is unable to communicate with an SNMP process on a cluster node
CLSS_ NOTCONFIGURED The cluster is not yet configured.
CLSS_NOTSYNCHED Some basic cluster configuration information exists, but the cluster has not
yet been verified and synchronized.
Nodes
A node is one of the processors that make up the cluster. Each node in the cluster runs the clstrmgr ,
clinfo , and clsmuxpd daemons.
Cluster ID
The ID of the cluster to which this node belongs.
Node name
The node name is a user-assigned string. The node name can contain up to 32 characters, and cannot
begin with a leading numeric.
Node state
A node can be in one of following defined states:
Item Description
CLS_UP The node is up and running
CLS_DOWN The node is down
CLS_JOINING The node is in the process of joining the cluster
CLS_LEAVING The node is in the process of leaving the cluster.
Network interfaces
The number and addresses of service interfaces attached to the node.
4 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Network interfaces
A network interface is the physical connection between a node and a network.
An PowerHA SystemMirror cluster can support multiple networks and point-to-point connections, as well
as an RS232 serial line point-to-point connection. Each network will have one or more network interfaces
on each cluster node.
Cluster ID
The ID of the cluster to which this interface belongs.
Node name
The name of the node to which this interface is attached.
Active node ID
ID of the node where the address is currently active.
Interface name
An interface's name is the same as the name in the /etc/hosts file for the interface (that is, the name
associated with the IP address of the host).
Interface ID
The network ID of the network to which this interface is connected.
Interface address
The IP address for the interface as defined in the /etc/hosts file.
Interface state
An interface can be in one of several defined states. The following values describe the state of a network
interface:
Item Description
CLS_UP The interface is up and running.
CLS_DOWN The network interface or network is down.
CLS_INVALID This interface is not defined for this node.
Interface role
An interface can be in one of several defined roles. The following values describe the roles of a network
interface:
Item Description
CL_INT_ROLE_INVALID The network interface is invalid.
CL_INT_ROLE_SERVICE The network interface is defined as a service interface.
Resource group
A resource group contains all the resources associated with an instance of an application that PowerHA
SystemMirror is keeping highly available.
Resource groups are brought online as nodes join the cluster. Resource groups are moved between
cluster nodes as failures occur. The groups' state and location are available through Clinfo.
Cluster ID
The ID of the cluster to which this resource group belongs.
Group name
This is the name given to the resource group when it is first defined.
Group ID
The numeric ID associated with the group.
6 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Group site policy
When the group contains replicated resources, the following policies are used for resource group startup,
fallover, and fallback as it occurs between two sites:
• Prefer primary site
• Online on either site
• Online on both sites
Number of nodes
The number of nodes participating in the resource group.
Item Description
CL_RGNS_INVALID The node is not part of this resource group.
CL_RGNS_ONLINE The group and all its resources are up and available on the node.
CL_RGNS_OFFLINE The group is currently not active on the node.
CL_RGNS_ACQUIRING The group is in the process of being acquired on this node.
CL_RGNS_RELEASING The group is being released from this node.
CL_RGNS_ERROR An error occurred when trying to bring the group online or offline.
Resources for this group are not active. Manual intervention is
required.
Note: This list does not include all possible resource group states: if sites are defined, a primary and
a secondary instance of the resource group could be online, offline, in the error state, or unmanaged.
In addition, the resource group instances could be in the process of acquiring or releasing. The
corresponding resource group states are not listed here, but have descriptive names that explain which
actions take place.
Cluster networks
The PowerHA SystemMirror cluster might contain both TCP/IP and non-IP-based networks. Typically,
non-IP based networks are used for disk heartbeating traffic.
Network name
The name that is associated with the network. You can supply this name or PowerHA SystemMirror can
generate it.
Network type
The physical type of the network, such as Ethernet.
Network attribute
The network attribute for IP-based networks can be set to Public or Private. Setting the attribute to
Private identifies this network for use by Oracle as a private network. The default is Public.
Item Description
Node ID The node ID of each node.
Node State The state of the network on the node. This value might be different from the
global network state.
Network state
The network state, including the global state and the per node state, can be one of several predefined
values:
Item Description
CLS_UP The network is up. If the network is up on any node, the global state is also
set up.
CLS_DOWN The network is not up. A network can be down on one or more nodes (that is
the per node state is CLS_DOWN ) and still have a global state of CLS_UP .
Cluster site(s)
When sites are configured, nodes in the cluster are grouped into cluster sites. The state of the cluster
sites is tracked and cluster events are generated.
Site ID
The PowerHA SystemMirror generated ID for the site.
Site name
The site name specified when the site was created.
Site priority
Site priority determines the precedence and direction for data mirroring between sites. A cluster site can
have a priority of one of the following:
8 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
CL_SITE_PRIMARY This is the site where the application runs. Data is mirrored from this
site to the backup site.
CL_SITE_SECONDARY This site serves as a backup.
CL_SITE_TERTIARY This site is mirroring data sent from the secondary site. This value is
reserved for future use.
Item Description
CL_SITE_BACKUP_DBFS Dial Back Fail Safe
CL_SITE_BACKUP_SGN Serial Global Network
CL_SITE_BACKUP_NONE No backup communications are configured
Site state
The global state of the site:
Item Description
CLS_UP One or more node(s) in the site is up
CLS_DOWN All the nodes in the site are down
Clinfo C API
The Clinfo C Application Programming Interface (API) is a high-level interface that you can use in an
application to get status information about an PowerHA SystemMirror cluster. These topics describe the
specific C language routines and utilities available in the Clinfo C API.
Note: Use application monitoring instead of the cl_registerwithclsmuxpd() routine. See the section
about Initial cluster planning in the Planning Guide.
Before reading this topic, you should read Cluster information program, which describes the types of
information Clinfo maintains about an PowerHA SystemMirror cluster.
Related concepts
Cluster information program
These topics provide an overview of the Cluster Information Program (Clinfo) and a description of the
status information that Clinfo receives and maintains about an PowerHA SystemMirror for AIX cluster.
Related information
Initial cluster planning
Header files
You must specify the necessary include directives in each source module that uses the Clinfo C API.
These directives include:
#include <sys/types.h>
#include <netinet/in.h>
#include <cluster/clinfo.h>
In addition to this list of include directives, specify the following include directive in each source module
that uses the cl_registereventnotify routine:
#include <signal.h>
-lcl
You must add the following directives to the object load command of a multi-threaded application that
uses the Clinfo C API:
-lcl_r
The libcl.a and libcl_r.a libraries contain the routines that support the Clinfo C API.
Constants
The Clinfo C API routines use the constants that are defined in the clinfo.h file.
These constants include:
Item Description
CL_MAXNAMELEN The maximum length of a character string naming a cluster, node,
or interface (256). The value of CL_MAXNAMELEN is the same as
MAXHOSTNAMELEN , defined in the sys/param.h file.
CL_MAX_EN_REQS The maximum number of event notification requests allowed (10).
CL_ERRMSG_LEN Maximum error message length (128 characters).
10 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
CL_MAXCLUSTERS Provides current size of space in data structures for the array holding
information about the number of clusters.
CL_MAXNODES Provides current size of space in data structures for the array holding
information about the number of nodes in a cluster.
CL_MAXNETIFS Provides current size of space in data structures for the array holding
information about the number of interfaces attached to a node.
CL_MAXGROUPS Provides current size of space in data structures for the array holding
information about the number of resource groups.
enum cls_state {
CLS_INVALID,
CLS_VALID,
CLS_UP,
CLS_DOWN,
CLS_UNKNOWN,
CLS_GRACE,
CLS_JOINING,
CLS_LEAVING,
CLS_IN_USE,
CLS_PRIMARY
};
enum cls_substate {
CLSS_UNKNOWN,
CLSS_STABLE,
CLSS_UNSTABLE,
CLSS_ERROR,
CLSS_RECONFIG
CLSS_NOT_CONFIGURED
};
enum cl_resource_states{
CL_RGNS_INVALID=1,
CL_RGNS_ONLINE=2,
CL_RGNS_OFFLINE=4,
CL_RGNS_ACQUIRING=16,
CL_RGNS_RELEASING=32,
CL_RGNS_ERROR=64
};
enum cl_rg_policies {
CL_RGP_INVALID = 0,
CL_RGP_ONLINE_ON_HOME_NODE = 1,
CL_RGP_ONLINE_ONFIRST_AVAILBLE_NODE = 2,
CL_RGP_ONLINE_USING_DISTRIBUTION_POLICY = 3,
CL_RGP_ONLINE_ALL_NODES = 4,
CL_RGP_FALLOVER_TO_PRIORITY_NODE = 5,
enum cl_interface_role {
CL_INT_ROLE_INVALID = 0,
CL_INT_ROLE_SERVICE = 16,
CL_INT_ROLE_STANDBY = 32, /* deprecated */
CL_INT_ROLE_BOOT = 64,
CL_INT_ROLE_SH_SERVICE = 128, /* deprecated */
};
/*
* Enumeration of Network attributes. Note that the public/private
attribute is for use by Oracle only - PowerHA SystemMirror does not use this attribute.
*/
enum cl_network_attribute
{
CL_NET_ATTR_INVALID = 0, /* IP networks can be public or private */
CL_NET_TYPE_PUBLIC = 1,
CL_NET_TYPE_PRIVATE = 2, /* non-IP (serial) networks are always */
CL_NET_TYPE_SERIAL = 4
};
/*
* Enumeration of Site Priorities
*/
enum cl_site_priority
{
CL_SITE_PRI_NONE = 0,
CL_SITE_PRI_PRIMARY = 1,
CL_SITE_PRI_SECONDARY = 2,
CL_SITE_PRI_TERTIARY = 4
};
/*
* Enumeration of Site Backup Communication Options
*/
enum cl_site_backup
{
CL_SITE_BACKUP_NONE = 0,
CL_SITE_BACKUP_DBFS = 1,
CL_SITE_BACKUP_SGN = 2
};
12 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Data structure representing a resource group
This structure contains all information available for each resource group.
struct cl_group {
int clg_clusterid;
int clg_group_id;
char clg_name[CL_MAXNAMELEN];
enum cl_rg_policies clg_policy; /* deprecated */
enum cl_rg_policies clg_startup_policy;
enum cl_rg_policies clg_fallover_policy;
enum cl_rg_policies clg_fallback_policy;
enum cl_rg_policies clg_site_policy;
char clg_user_policy_name[CL_MAXNAMELEN];
int clg_num_nodes;
int clg_node_ids[MAXNODES];
/* list of nodes (ids) in this group */
enum cl_resource_states clg_node_states[MAXNODES];
/* state on each */
int clg_num_resources;
int clg_resource_id[MAXRESOURCES];
/* list of resources (id) group */
enum cl_resource_states clg_res_state[MAXRESOURCES]; /* state
*/ int clg_vrmf; /* version of this client */
};
struct cl_netif {
int cli_clusterid; /* Cluster Id */
int cli_nodeid; /* Cluster node Id - used internally only */
char cli_nodename[CL_MAXNAMELEN]; /* Cluster node name */
int cli_interfaceid; /* Cluster Node Interface Id */
enum cls_state cli_state; /* Cluster Node Interface State */
char cli_name[CL_MAXNAMELEN]; /* Cluster Node Interface Name */
int cli_active_nodeid; /* Cluster node Id where addr is up */
enum cl_interface_role cli_role; /* Role of interface (boot/service)*/
int cli_networkid; /* Cluster Network ID for this Interface */
int cli_vrmf;
struct sockaddr_storage cli_addr_v6; /*Cluster Node Interface IP Address */
};
#define cli_addr (*((struct sockaddr_in*)&cli_addr_v6)) /* For backward compatibility*/
struct cl_node {
int cln_clusterid; /* Cluster Id */
int cln_nodeid; /* Cluster node Id */
char cln_nodename[CL_MAXNAMELEN]; /* Cluster node name */
enum cls_state cln_state; /* node state */
int cln_nif; /* number of interfaces */
struct cl_netif *cln_if; /* interfaces */
int cln_glidle; /* CPU.glidle */
int cln_real_mem_free; /* Paging space utilitization */
int cln_disk_busy; /* disk busy */
int cln_vrmf; /* version of this client */
};
struct cl_cluster{
int clc_clusterid; /* cluster id*/
enum cls_state clc_state; /* Cluster State */
enum cls_substate clc_substate; /* Cluster Substate */
char clc_primary[CL_MAXNAMELEN]; /* Cluster Primary Node */
char clc_name[CL_MAXNAMELEN]; /* Cluster Name */
int clc_number_of_nodes; /* number of cluster nodes */
int clc_number_of_groups; /* number of resource groups */
int clc_number_of_networks; /* number of networks */
int clc_number_of_sites; /* number of sites */
struct cli_enr_req_t {
int event_id; /* event id */
int cluster_id; /* cluster id */
int node_id; /* node id(internal use only)*/
char node_name[CL_MAXNAMELEN]; /* node name */
int net_id; /* network id */
int signal_id; /* signal id */
int vrmf;
};
struct cli_en_msg_t {
int event_id; /* event id */
int cluster_id; /* cluster id */
int node_id; /* node id(internal use only)*/
char node_name[CL_MAXNAMELEN]; /* node name */
int net_id; /* network id */
int vrmf;<
};
/*
* Structure containing information relating to a network.
*/
struct cl_net {
int clnet_clusterid; /* Cluster Id */
char clnet_name[CL_MAXNAMELEN]; /* Cluster network name */
int clnet_id; /* Cluster Network Id */
char clnet_type[CL_MAXNAMELEN]; /* ether, token, etc */
enum cl_network_attribute clnet_attr; /* public/serial */
enum cls_state clnet_state; /* Cluster Network State */
/* Note that this is the cluster wide or "global" network state */
/* which may be different than the state of the network on any */
/* particular node */
int clnet_numnodes;
/* Number of nodes connected to this Network */
int clnet_node_ids[MAXNODES];
/* Node ids connected to this Network */
enum cls_state clnet_node_states[MAXNODES];
/* Network State per Node */
int clnet_vrmf; /* version of this client */
enum cl_net_family clnet_type; /* v4/v6 */
};
enum cl_net_family {
CL_INET_INVALID = 0,
CL_INET4 = 1,
CL_INET6 = 2,
};
/*
* Structure containing information relating to a site
*/
struct cl_site {
int clsite_clusterid; /* Cluster ID */
int clsite_id;
char clsite_name[CL_MAXNAMELEN];
enum cl_site_priority clsite_priority;
enum cl_site_backup clsite_backup;
14 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
enum cls_state clsite_state; /* Cluster Site State */
int clsite_numnodes;
int clsite_nodeids[MAXNODES]; /* List of nodes (IDs) in this group */
int clsite_vrmf; /* version of this client */
};
cl_getlocalid
These are examples of the cl_getlocalid routine from an earlier release and from a newer version.
The following is an example of the cl_getlocalid routine from an earlier release that uses node ID:
In the new version of the example of the C API cl_getlocalid routine, note the change in the declaration
statement. Where previously all variables were declared as int, now you must declare nodename as a
character string and make the corresponding changes to the printf statements.
In the new version of the example of the C API cl_getnodeidbyifname routine, note that the name of
the routine itself has changed to cl_getnodenamebyifname. You must change the declaration to include
nodename as a string, instead of nodeid as an int; then make the corresponding changes to the printf
statements.
cl_getprimary
These are examples of the cl_getprimary routine from an earlier release and from a newer version.
Here is an example of the cl_getprimary routine, from an earlier release, using node ID:
In the new version of the C API cl_getprimary routine example, note the change in the declaration to
nodename as a string instead of nodeid as an int, and the corresponding changes to the printf statements.
Moreover, the if statement must be changed since the previous version depended on the fact that the
desired information ( nodeid) was an int; now it is a string (nodename).
16 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
cl_isaddravail
These are examples of the cl_isaddravail routine from an earlier release and from a newer version.
The following is an example of the cl_isaddravail routine from an earlier release that uses node ID:
In the new version of the C API cl_isaddravail routine example, the declaration statement changes to
use nodename instead of nodeid. See the corresponding changes to the printf statements. Moreover, the
assignment statement changes to use strcpy for the nodename.
Item Description
cl_alloc_clustermap Allocates storage for a list of four clusters of 32 nodes with 32
interfaces each.
cl_alloc_groupmap Allocates storage for a list of 64 resource groups.
cl_alloc_netmap Allocates storage for a list of networks.
cl_alloc_nodemap Allocates storage for a list of 32 nodes with 32 interfaces each.
cl_alloc_sitemap Allocates storage for a list of sites.
cl_free_clustermap Frees the storage for a list of clusters that was allocated by calling
cl_alloc_clustermap.
cl_free_groupmap Frees storage for a list of resource groups allocated with
cl_alloc_groupmap.
cl_free_netmap Frees the storage for a list of networks that was allocated by calling
cl_alloc_netmap.
cl_free_nodemap Frees the storage for a list of nodes that was allocated by calling
cl_alloc_nodemap.
The following example illustrates how to use these routines. Note that you no longer use CL_MAXNODES
to allocate storage for the returned information on the nodes in the cluster. For additional examples, see
the reference pages for the cl_getclusters and cl_getnodemap routines.
int status;
struct cl_cluster *clustermap;
cl_alloc_clustermap (&clustermap);
status = cl_getclusters(clustermap);
if (status < 0) {
cl_perror(status, "Can't get cluster information");
} else {
printf("There are currently %d running clusters", status);
}
...
cl_free_clustermap (clustermap);
There is an additional new API cl_node_free() , which frees storage associated with a single cl_node
struct. Consider the following example:
After the call to cl_getnode(), the cln_if field is completed with the list of network interface structs
associated with the node. This list is dynamically allocated by cl_getnode() and must be freed to avoid a
memory leak in a long-running program.
cl_node_free() frees the network interface storage field of the cl_node structure. See the subsequent API
description for cl_node_free() for more information.
Requests
The Clinfo C API has several types of requests.
Item Description
cl_getcluster Returns all known information about the cluster with the specified cluster
ID.
cl_getclusterid Returns the cluster ID of the cluster with the specified cluster name.
cl_getclusteridbyifaddr Returns the cluster ID of the cluster with the specified network interface
address. This routine is capable of handling only IPv4 addresses.
cl_getclusteridbyifaddr6 Returns the cluster ID of the cluster with the specified network interface
address. This routine is capable of handling both IPv4 addresses and
IPv6 addresses.
cl_getclusteridbyifname Returns the cluster ID of the cluster with the specified network interface
name.
cl_getclusters Returns information about all operational clusters.
cl_isclusteravail Returns the status of the cluster with the specified cluster ID.
18 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Node information requests
The node information requests return information about the nodes in the cluster.
Item Description
cl_bestroute Returns the local or remote IP address pair that indicates the most direct
route to the specified node from the local machine.
cl_bestroute6 Returns the local or remote IP address pair that indicates the most
direct route to the specified node from the local machine. This routine
is capable of handling both IPv4 addresses and IPv6 addresses.
cl_getlocalid Returns the cluster ID and node name of the host making the request.
cl_getnode Returns information about the node specified by a cluster ID or node
name pair.
cl_getnodeaddr Returns the IPv4 address associated with the specified cluster ID or node
name pair.
cl_getnodeaddr6 Returns the IPv4 address or IPv6 address associated with the specified
cluster ID/node name pair.
cl_getnodenamebyifaddr Returns the name of the node with the specified cluster ID or interface
address pair. This routine returns only IPv4 addresses.
cl_getnodenamebyifaddr6 Returns the name of the node with the specified cluster ID or interface
address pair. This routine is capable of handling both IPv4 addresses and
IPv6 addresses.
cl_getnodenamebyifname Returns the name of the node with the specified cluster ID/interface
name pair.
cl_getnodemap Returns all known information about all of the nodes in a specified
cluster.
cl_getprimary Returns the node name of the primary Cluster Manager for the specified
cluster.
cl_isnodeavail Returns the status of the specified node.
Item Description
cl_getifaddr Returns the IPv4 interface address of the interface with the specified
cluster ID and name.
cl_getifaddr6 Returns the IPv4 or IPv6 interface address of the interface with the
specified cluster ID and name.
cl_getifname Returns the interface name of the IPv4 interface with the specified
cluster ID and address.
cl_getifname6 Returns the interface name of the IPv4 or IPv6 interface with the
specified cluster ID and address.
cl_isaddravail Returns the status of the specified network interface. This routine
returns only IPv4 addresses.
cl_isaddravail6 Returns the status of the specified network interface. This routine is
capable of handling both IPv4 addresses and IPv6 addresses.
Item Description
cl_getnetmap Returns all known information about all the networks in the cluster
cl_getnet Returns information about a specific network
cl_getnetbyname Returns information about a specific, named network
cl_getnetsbytype Returns information about any networks configured with the specified type
cl_getnetsbyattr Returns information about any networks configured with the specified
attribute
cl_getnetstatebynode Returns the state of the specified network on the specified node
Item Description
cl_getevent Gets information when an event signal is received, and returns an event
notification message received from Clinfo
cl_registereventnotify Registers a list of event notification requests with Clinfo, and returns a
signal to the calling process when a registered event occurs
cl_unregistereventnotify Unregisters a list of event notification requests with Clinfo
Item Description
cl_getgroupmap Returns all known information about all the resource groups in the
specified cluster
cl_getgroup Returns all information about the specific resource group in the specified
cluster
cl_getgroupsbynode Returns all the resource groups in which the specified node is a member
cl_getgroupnodestate Returns the state of the specified group on the specified node
Item Description
cl_getsitemap Returns all known information about all the sites in the cluster
cl_getsite Returns information about a specific site
cl_getsitebyname Returns information about a specific, named site
cl_getsitebypriority Returns information about any sites configured with the specified priority
20 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Utilities
The Clinfo C API has several utility routines.
cl_initialize routine
The cl_initialize() routine was used in prior releases to attach to shared memory.
The cl_initialize() routine no longer has any function and always returns CLE_OK. cl_initialize() is
provided for backward compatibility only. Do not use this routine for new programs.
cl_errmsg routine
The cl_errmsg routine takes a status code returned by Clinfo and returns the text for that error code.
Syntax
char *cl_errmsg (int status)
Parameters
Item Description
status A cluster information error status.
Status codes
A null-terminated error string.
For example, the string:
"Invalid status"
if the status parameter does not describe a valid cluster error code.
Example
char *msg;
msg = cl_errmsg(CLE_BADARGS);
if (strcmp(msg, "Invalid status") != 0) {
printf("CLE_BADARGS means %s", msg);
} else {
printf("Can't lookup CLE_BADARGS");
}
cl_errmsg_r routine
The cl_errmsg_r routine takes a status code returned by Clinfo and returns the text for that error code.
This is a thread-safe version of the cl_errmsg routine. If you have a multi-threaded application, you must
use this routine.
Syntax
char *cl_errmsg_r (int status, char cbuf)
Status codes
A null-terminated error string.
For example, the string:
"Invalid status"
if the status parameter does not describe a valid cluster error code.
Example
char *msg;
char cbuf[CL_ERRMSG_LEN];
msg = cl_errmsg_r(CLE_BADARGS, cbuf);
if (strcmp(msg, "Invalid status") != 0) {
printf("CLE_BADARGS means %s", msg);
} else {
printf("Can't lookup CLE_BADARGS");
}
cl_perror routine
The cl_perror routine writes a message that describes a specified error code to standard error. cl_perror
places the supplied error string before the error message, and places a colon following the error message.
Syntax
void cl_perror (int status, char *message)
The cl_perror routine is useful for generating an error message from the status code returned by a Clinfo
request. If a status is provided that is not a valid cluster error code, the cl_perror routine writes the
string:
Error n
Parameters
Item Description
status A cluster error code.
message The message that will proceed the status description.
22 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Example
struct cl_node nodebuf;
int clusterid = 99999999; /* invalid cluster id */
int status;
char nodename[CL_MAXNAMELEN];
cl_alloc_clustermap routine
The cl_alloc_clustermap routine allocates storage for a list of clusters. This routine must be called before
calling the cl_getclusters routine.
After calling the cl_getclusters routine, call the cl_free_clustermap routine to free the storage.
Syntax
int cl_alloc_clustermap (struct cl_cluster **clustermap)
Parameters
Item Description
clustermap The base pointer for the clustermap.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters. This status usually indicates that a NULL pointer
was specified for the clustermap argument.
Example
See the example for the see cl_getclusters routine.
Related reference
cl_getcluster routine
The cl_getcluster returns information about the cluster specified by the cluster ID.
cl_alloc_groupmap routine
The cl_alloc_groupmap routine allocates storage for a list of resource group descriptors. This routine
must be called before calling the cl_getgroups routine.
After calling the cl_getgroups routine, free the storage when you are done by calling the
cl_free_groupmap routine.
Syntax
int cl_alloc_groupmap (struct cl_group **groupmap);
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters. This status usually indicates that a NULL pointer was
specified for the groupmap argument.
Example
See the example for the cl_getgroupmap routine.
Related reference
cl_getgroupmap routine
The cl_getgroupmap routine returns information about the resource groups in a cluster. You should call
the cl_alloc_groupmap before calling this routine to reserve the storage in memory. You should call
cl_free_groupmap after calling this routine.
cl_alloc_netmap routine
Allocates storage for a series of network information structures.
Syntax
int cl_alloc_netmap (struct cl_site **netmap)
Parameters
Item Description
netmap A pointer to a structure cl_net pointer where a pointer to the newly allocated
storage is returned.
Status codes
Item Description
CLE_OK The request complete successfully.
CLE_BADARGS Missing or invalid parameters. This status usually indicates that a NULL pointer
was specified for the netmap parameter.
Example
See the example for the cl_getnetmap routine.
Related reference
cl_getnetmap routine
24 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Returns information about all the networks in the cluster.
cl_alloc_netmap6 routine
Allocates storage for a series of site information structures.
Syntax
int cl_alloc_netmap6(struct cl_net_v6** netmap)
Parameters
Item Description
netmap A pointer to a structure cl_net_v6 pointer where a pointer to the newly allocated
storage is returned.
Status codes
Item Description
CLE_OK The request complete successfully.
CLE_BADARGS Missing or invalid parameters.
cl_alloc_nodemap routine
The cl_alloc_nodemap routine allocates storage for a list of nodes and the interfaces associated with
each node. This routine should be called before calling the cl_getnodemap routine.
After calling the cl_getnodemap routine, free the storage by calling the cl_free_nodemap routine when
you are done.
Syntax
int cl_alloc_nodemap (struct cl_node **nodemap)
Parameters
Item Description
nodemap The base pointer for the nodemap.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters.
Example
See the example for the cl_getnodemap routine.
Related reference
cl_getnodemap routine
cl_alloc_nodemap6 routine
Allocates storage for a series of site information structures.
Syntax
int cl_alloc_nodemap6(struct cl_node_v6** nodemap)
Parameters
Item Description
nodemap A pointer to a structure cl_net_v6 pointer where a pointer to the newly allocated
storage is returned.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters.
cl_alloc_sitemap routine
Allocates storage for a series of site information structures.
Syntax
int cl_alloc_sitemap (struct cl_net **sitemap)
Parameters
Item Description
sitemap A pointer to a structure cl_site pointer where a pointer to the newly
allocated storage is returned.
Status codes
Item Description
CLE_OK The request complete successfully.
CLE_BADARGS Missing or invalid parameters. This status usually indicates that a NULL
pointer was specified for the sitemap parameter.
Example
See the example for the cl_getsitemap routine.
Related reference
cl_getsitemap routine
26 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Returns all known information about all the sites in the cluster.
cl_bestroute routine
The cl_bestroute routine returns the local/remote IP address pair for the most direct route to the
specified node. This routine relies on the netmask value to match network interface pairs. This routine is
capable of handling only IPv4 addresses.
The route returned by the cl_bestroute routine depends on the host making the request. Clinfo first
builds a list of all working network interfaces on the local node, and then compares this list to the
available interfaces on the specified node. The routine sorts interfaces by network and attempts to match
the first working interface on the network with the first working interface on the network on the remote
node. If private networks are defined, these networks are considered before non-private networks are
considered.
If a pair of local and remote interfaces exist that are on the same network, they are returned in the laddr
and raddr parameters. Otherwise, an interface on the specified node is chosen as the remote interface,
and the first local interface found is returned as the local end of the route.
Syntax
int cl_bestroute (int clusterid, char *nodename,
struct sockaddr_in *laddr, struct sockaddr_in *raddr)
Parameters
Item Description
clusterid The cluster ID of the desired node.
nodename The name of the desired node.
laddr Storage for the returned local network interface address.
raddr Storage for the returned remote network interface address.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters.
CLE_NOROUTE No route is available.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
Example
int clusterid = 1113325332;
int status;
char nodename[CL_MAXNAMELEN] = "node1";
struct sockaddr_in laddr, raddr;
cl_bestroute6 routine
The cl_bestroute6 routine returns the local/remote IP address pair for the most direct route to the
specified node. This routine relies on the netmask value to match network interface pairs.
The route returned by the cl_bestroute6 routine depends on the host making the request. Clinfo first
builds a list of all working network interfaces on the local node, and then compares this list to the
available interfaces on the specified node. The routine sorts interfaces by network and attempts to match
the first working interface on the network with the first working interface on the network on the remote
node. If private networks are defined, these networks are considered before non-private networks are
considered.
If a pair of local and remote interfaces exist that are on the same network, they are returned in the laddr
and raddr parameters. Otherwise, an interface on the specified node is chosen as the remote interface,
and the first local interface found is returned as the local end of the route.
Syntax
int cl_bestroute6 (int clusterid, char *nodename,
struct sockaddr *laddr, size_t size_of_laddr,
struct sockaddr *raddr, size_t size_of_raddr)
Parameters
Item Description
clusterid The cluster ID of the desired node.
nodename The name of the desired node.
laddr Storage for the returned local network interface address.
size_of_laddr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for IPv4
socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
raddr Storage for the returned remote network interface address.
size_of_raddr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for IPv4
socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_BADARGS Missing or invalid parameters.
CLE_NOROUTE No route is available.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
28 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
cl_free_clustermap routine
The cl_free_clustermap routine frees the storage previously allocated for the list of clusters by calling
cl_alloc_clustermap.
Syntax
void cl_free_clustermap (struct cl_cluster *clustermap)
Parameters
Item Description
clustermap A pointer to the clustermap to be freed.
Example
See the example for the cl_getclusters routine.
Related reference
cl_getcluster routine
The cl_getcluster returns information about the cluster specified by the cluster ID.
cl_free_groupmap routine
The cl_free_groupmap routine frees the storage previously allocated by a call to cl_alloc_groupmap.
Syntax
void cl_free_groupmap (struct cl_group *groupmap);
Parameters
Item Description
groupmap A pointer to the group map to be freed.
Example
See the example for the cl_getgroupmap routine.
Related reference
cl_getgroupmap routine
The cl_getgroupmap routine returns information about the resource groups in a cluster. You should call
the cl_alloc_groupmap before calling this routine to reserve the storage in memory. You should call
cl_free_groupmap after calling this routine.
cl_free_netmap routine
Frees the storage previously allocated by a call to cl_alloc_netmap.
Syntax
void cl_free_netmap (struct cl_net *netmap)
Status codes
None.
Example
See the example for the cl_getnetmap routine.
Related reference
cl_getnetmap routine
Returns information about all the networks in the cluster.
cl_free_netmap6 routine
Frees the storage previously allocated by a call to cl_alloc_netmap6.
Syntax
void cl_free_netmap6 (struct cl_net *netmap)
Parameters
Item Description
netmap A pointer to the netmap to be freed.
Status codes
None.
cl_free_nodemap routine
The cl_free_nodemap routine frees the storage previously allocated by calling the cl_alloc_nodemap
routine.
Syntax
int cl_free_nodemap (struct cl_node *nodemap)
Parameters
Item Description
nodemap A pointer to the nodemap to be freed.
Example
See the example for the cl_getnodemap routine.
Related reference
cl_getnodemap routine
30 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
The cl_getnodemap routine returns information about the nodes in a cluster. You should call
cl_alloc_nodemap before calling this routine to reserve the storage in memory. You should call
cl_free_nodemap after calling this routine.
cl_free_sitemap routine
Frees the storage previously allocated by a call to cl_alloc_sitemap.
Syntax
void cl_free_sitemap (struct cl_site *sitemap)
Parameters
Item Description
sitemap A pointer to the sitemap to be freed.
Status codes
None.
Example
See the example for the cl_getsitemap routine.
Related reference
cl_getsitemap routine
Returns all known information about all the sites in the cluster.
cl_getcluster routine
The cl_getcluster returns information about the cluster specified by the cluster ID.
Syntax
int cl_getcluster (int clusterid, struct cl_cluster *clusterbuf)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
clusterbuf Storage for the returned cluster information.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Related reference
cl_alloc_clustermap routine
The cl_alloc_clustermap routine allocates storage for a list of clusters. This routine must be called before
calling the cl_getclusters routine.
cl_free_clustermap routine
The cl_free_clustermap routine frees the storage previously allocated for the list of clusters by calling
cl_alloc_clustermap.
cl_getclusterid routine
The cl_getclusterid routine returns the cluster ID of the cluster with the specified name.
Syntax
int cl_getclusterid (char *clustername)
Parameter
Item Description
clustername The name of the desired cluster.
Status codes
A non-negative number, which represents the cluster ID, signifies success. Otherwise, one of the following
error status codes:
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERNAME The request specified an invalid cluster name.
Example
int clusterid = 1113325332;
char clustername[CL_MAXNAMELEN] = "site1";
32 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
clusterid = cl_getclusterid (clustername);
if (clusterid < 0) {
cl_perror (clusterid, "can't get cluster ID");
} else {
printf ("cluster %s has id %d\n", clustername, clusterid);
}
cl_getclusteridbyifaddr routine
Returns the cluster ID of the cluster with the specified network interface address. This routine is capable
of handling only IPv4 addresses.
Syntax
int cl_getclusteridbyifaddr (struct sockaddr_in *addr)
Parameters
Item Description
addr The network interface address whose cluster ID is desired.
Status codes
A non-negative number, which represents the cluster ID, signifies success. Otherwise, one of the following
error status codes:
Item Description
CLE_SYSERR System error. Check the AIX global variable errno 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_IVADDRESS The request specified an invalid network interface address.
Example
char ifaddr[CL_MAXNAMELEN] = "9.57.28.23";
int clusterid;
struct sockaddr_in addr;
/*
* inet_addr converts addrs to
* Internet numbers.
*/
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr (ifaddr);
clusterid = cl_getclusteridbyifaddr (&addr);
if (clusterid < 0) {
cl_perror (clusterid,"can't get cluster ID");
} else {
printf("cluster id w/ interface address %s is %d\n",
inet_ntoa (addr.sin_addr.s_addr), clusterid);
}
Syntax
int cl_getclusteridbyifaddr6 (struct sockaddr *addr, size_t size_of_addr)
Parameters
Item Description
addr The network interface address whose cluster ID is desired.
size_of_addr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for IPv4
sockets) and ‘struct sockaddr6_in’ (for IPv6 sockets)
Status codes
A non-negative number, which represents the cluster ID, signifies success. Otherwise, one of the following
error status codes:
Item Description
CLE_SYSERR System error. Check the AIX global variable errno 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_IVADDRESS The request specified an invalid network interface address.
cl_getclusteridbyifname routine
Returns the cluster ID of the cluster with the specified network interface name.
Syntax
int cl_getclusteridbyifname (char *interfacename)
Parameters
Item Description
interfacename The network interface name whose cluster ID is desired.
Status codes
A non-negative number, which represents the cluster ID, signifies success. Otherwise, one of the following
error status codes:
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVNETIFNAME The request specified an invalid network interface name.
34 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Example
int clusterid;
char interfacename[CL_MAXNAMELEN] = "geotest9";
cl_getclusters routine
Returns information about all working clusters.
Syntax
int cl_getclusters (struct cl_cluster *clustermap)
Parameters
Item Description
clustermap Returned cluster information. You should allocate storage for this information
by calling cl_alloc_clustermap before calling this routine. Then free this
storage space by calling cl_free_clustermap when you are done.
Status codes
The routine returns the number of active clusters. If the routine is unsuccessful, it returns one of the
following error status codes:
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional information.
CLE_BADARGS Missing or invalid parameters.
Example
This example uses the cl_errmsg routine to illustrate proper programming for a single-threaded
application. If your program is multi-threaded, you must use the cl_errmsg_r routine.
int i;
int numClusters = -1;
char cbuf[CL_ERRMSG_LEN];
struct cl_cluster *clustermap;
cl_alloc_clustermap (&clustermap);
numClusters = cl_getclusters(clustermap);
if(numClusters < 0)
{
printf("cl_getclusters: (failed) %s\n",
cl_errmsg(numClusters));
/*
** for threadsafe compilation use:
cl_errmsg_r(numClusters,cbuf));
*/
}
else
printf("there are currently %d running clusters\n", numClusters);
for(i=0; i < numClusters; i++)
{
printf("\n cluster id:
printf(" cluster name:
cl_getevent routine
The cl_getevent routine returns an event notification message. The caller should issue this request only
after a signal, as specified in a previous cl_registereventnotify request, is received.
Syntax
int cl_getevent (struct cli_en_msg_t * en_msg)
Parameters
Item Description
en_msg An event notification message buffer, large enough to hold one event notification
message. Upon successful return, this buffer contains the received event, cluster,
and, if applicable, the network and node identifications.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional information.
Example
See the example for the cl_registereventnotify routine.
Related reference
cl_registereventnotify routine
The cl_registereventnotify routine registers a list of event notification requests with Clinfo.
cl_getgroup routine
The cl_getgroup routine returns information about the specified resource group in the specified cluster.
Syntax
int cl_getgroup (int clusterid, char *groupname,
struct cl_group *groupbufp);
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
groupname The name of the resource group.
36 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
groupbufp A pointer to a cl_group 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_IVNODENAME Invalid resource group name.
Example
int clusterid = 1113325332;
int status, j;
char* groupname = "rg01";
struct cl_group group;
cl_getgroupmap routine
The cl_getgroupmap routine returns information about the resource groups in a cluster. You should call
the cl_alloc_groupmap before calling this routine to reserve the storage in memory. You should call
cl_free_groupmap after calling this routine.
Syntax
int cl_getgroupmap (int clusterid, struct cl_group *groupmap)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
groupmap Storage for the returned resource group information.
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Example
int i,j;
int clusterid = 1113325332;
int groups;
char cbuf[CL_ERRMSG_LEN];
struct cl_group *groupmap;
cl_alloc_groupmap(&groupmap);
if (groupmap==NULL){
printf("unable to allocate storage: cl_alloc_groupmap = NULL\n");
exit(-1);
}
groups = cl_getgroupmap(clusterid, groupmap);
if(groups < 0) {
cl_perror(groups, "can't get resource group map");
} else {
printf("cluster %d has %d resource groups\n", clusterid, groups);
for(i=0; i < groups; i++){
printf("resource group %d [%s] has %d nodes\n",
groupmap[i].clg_group_id,
groupmap[i].clg_name,
groupmap[i].clg_num_nodes);
printf("policies:\n");
printf("\tstartup %d \n",groupmap[i].clg_startup_policy);
printf("\tfallover %d \n",groupmap[i].clg_fallover_policy);
printf("\tfallback %d \n",groupmap[i].clg_fallback_policy);
printf("\tsite %d \n",groupmap[i].clg_site_policy);
printf("\tuser %d \n",groupmap[i].clg_user_policy_name);
printf("node states:\n");
for(j=0; j < groupmap[i].clg_num_nodes; j++){
printf("\tnode %d is in state %d \n",
groupmap[i].clg_node_ids[j],
groupmap[i].clg_node_states[j]);
}
printf("resources
for(j=0; j < groupmap[i].clg_num_resources; j++){
printf("\tresource %d is in state %d\n",
groupmap[i].clg_resource_id[j],
groupmap[i].clg_res_state[j]);
}
}
}
Related reference
cl_alloc_groupmap routine
The cl_alloc_groupmap routine allocates storage for a list of resource group descriptors. This routine
must be called before calling the cl_getgroups routine.
cl_free_groupmap routine
38 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
The cl_free_groupmap routine frees the storage previously allocated by a call to cl_alloc_groupmap.
cl_getgroupnodestate routine
The cl_getgroupnodestate routine returns the state of the specified group on the specified node.
Syntax
enum cl_resource_states cl_getgroupnodestate (int clusterid,
char *groupname, int nodeid);
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
groupname Name of the resource group.
nodeid The ID of the cluster node.
Status codes
Returns one of the enumerated values in cl_resource_states. This enumeration is described in
Enumerated type containing resource group state.
Example
enum cl_resource_states state;
int clusterid = 1113325332;
int nodeid = 1;
char groupname[CL_MAXNAMELEN] = "rg01";
Related reference
Enumerated type containing resource group state
This enumerated data type contains all states a resource group can be in on a node.
cl_getgroupsbynode routine
The cl_getgroupsbynode routine returns information for all resource groups of which the specified node
is a member. Note that this routine allocates storage for the return information—the caller must free this
storage.
Syntax
int cl_getgroupsbynode (int clusterid, int nodeid,
struct cl_group **groupbufp, int *groupcountp);
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
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_IVNODENAME Invalid node ID.
Example
int clusterid = 1113325332;
int nodeid = 1;
int status;
int groupcount;
int j;
struct cl_group *groups;
cl_getifaddr routine
Returns the address of the interface with the specified cluster ID and interface name. This routine is
capable of handling only IPv4 addresses.
Syntax
int cl_getifaddr (int clusterid, char *interfacename,
struct sockaddr_in *addr)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
interfacename The name of the desired network interface.
addr Storage for the returned network interface address.
40 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNETIFNAME The request specified an invalid network interface name.
Example
int clusterid = 1113325332;
int status;
char* interfacename = "geotest9";
struct sockaddr_in addr;
cl_getifaddr6 routine
Returns the address of the interface with the specified cluster ID and interface name.
Syntax
int cl_getifaddr6(int clusterid, char *interfacename,
struct sockaddr *addr, size_t size_of_addr)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
interfacename The name of the desired network interface.
addr Storage for the returned network interface address.
size_of_addr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for
IPv4 socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
cl_getifname routine
Returns the name of the interface with the specified cluster ID and IP address. This routine is capable of
handling only IPv4 addresses.
Syntax
int cl_getifname (int clusterid, struct sockaddr_in *addr,
char *interfacename)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
addr The IP address of the desired network interface.
interfacename Storage for the returned network interface name.
The interfacename parameter should be no more
than CL_MAXNAMELEN characters long.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno
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_IVADDRESS The request specified an invalid network interface
address.
Example
int clusterid = 1113325332;
int status;
struct sockaddr_in addr;
char interfacename[CL_MAXNAMELEN] = "9.57.28.23";
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr (interfacename);
status = cl_getifname (clusterid, &addr, interfacename);
if (status != CLE_OK) {
cl_perror (status, "can't find interface name");
}
else {
printf ("interface name w/ address %s is %s\n",
inet_ntoa (addr.sin_addr.s_addr), interfacename);
}
42 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
cl_getifname6 routine
Returns the name of the interface with the specified cluster ID and IP address.
Syntax
int cl_getifname6 (int clusterid, struct sockaddr *addr, size_t size_of_addr,
char *interfacename)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
addr The IP address of the desired network interface.
interfacename Storage for the returned network interface name.
The interfacename parameter should be no more
than CL_MAXNAMELEN characters long.
size_of_addr Size of ‘addr’ buffer. It must be at least of size
‘struct sockaddr_in’ (for IPv4 socket) and ‘struct
sockaddr6_in’ (for IPv6 socket)
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno
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_IVADDRESS The request specified an invalid network interface
address.
cl_getlocalid routine
Returns the cluster ID and the node name of the node making the request. This request returns an error
status code for nodes not currently active in the cluster.
Syntax
int cl_getlocalid (int *clusterid, char *nodename)
Parameters
Item Description
clusterid Storage for the returned cluster ID.
nodename Storage for the returned node name.
Example
int clusterid, status;
char nodename[CL_MAXNAMELEN] = "node1";
cl_getnet routine
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.
44 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Example
int clusterid = 1113325332;
int netid = 1;
int status, j;
struct cl_net netmap;
Related reference
cl_getnetstatebynode routine
Returns the state of the specified network on the specified node.
cl_getnetbyname routine
Returns information about a specific, named network.
Syntax
int cl_getnetbyname (int clusterid, char *netname,
struct cl_net *netbuf)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
netname The name 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_IVNETNAME Invalid network name.
status = cl_getnetbyname(clusterid,netname,&netmap);
if (status != CLE_OK) {
display_error(status,cmd);
} else {
printf("network %s is type %s: connected to %d nodes\n",
netmap.clnet_name,
netmap.clnet_type,
netmap.clnet_numnodes);
}
cl_getnetmap routine
Returns information about all the networks in the cluster.
Syntax
int cl_getnetmap (int clusterid, struct cl_net *netmap)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
netmap Storage for the returned network information.
Status codes
The request completed successfully if it returns a non-negative number (number of networks in the
cluster).
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Example
int clusterid = 1113325332;
int num_nets;
int i,j;
struct cl_net *nm;
cl_alloc_netmap(&nm);
num_nets = cl_getnetmap(clusterid, nm);
printf("\n\ndumping netmap with %d nets for cluster %d\n\n",
num_nets, nm->clnet_clusterid);
for (i=0; i<num_nets; i++)
{
printf("info for network: %s (%d)\n", nm[i].clnet_name,
nm[i].clnet_id);
printf(" type = %s\n", nm[i].clnet_type);
printf(" attribute = %d\n", nm[i].clnet_attr);
printf(" state = %d\n", nm[i].clnet_state);
printf(" number of nodes = %d\n", nm[i].clnet_numnodes);
for (j=0; j<nm[i].clnet_numnodes; j++)
46 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
{
printf(" node id = %d , state = %d\n",
nm[i].clnet_node_ids[j],
nm[i].clnet_node_states[j]);
}
}
cl_free_netmap(nm);
Related reference
cl_alloc_netmap routine
Allocates storage for a series of network information structures.
cl_free_netmap routine
Frees the storage previously allocated by a call to cl_alloc_netmap.
cl_getnetsbyattr routine
Returns information about any networks configured with the specified attribute (public, private or non-IP
(serial)).
Syntax
int cl_getnetsbyattr (int clusterid, int *netattr,
struct cl_net **netbuf, int *netcount)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
netattr Network attribute for list of networks to be retrieved.
netbuf A pointer to a cl_net structure where the information is returned.
netcount A pointer to an integer where the number of networks matching
the specified type is returned.
Status codes
Item Description
CLE_OK Success. Note that this code may return even if no networks are
returned, that is, no networks with the specified attribute exist.
CLE_BADARGS Missing or invalid argument(s).
CLE_SYSERR System error.
CLE_NOCLINFO No cluster information available.
CLE_IVCLUSTERID Invalid cluster ID.
CLE_IVNETATTR Invalid network attribute.
Example
int status,i;
int netcount;
int clusterid = 1;
struct cl_net *netmap;
enum cl_network_attribute attr;
attr = CL_NET_TYPE_PRIVATE;
status = cl_getnetsbyattr(clusterid, attr, &netmap,&netcount);
if (status != CLE_OK) {
cl_getnetsbytype routine
Returns information about any networks that are configured with a specified network type.
Syntax
int cl_getnetsbytype (int clusterid, char *nettype,
struct cl_net **netbuf, int *netcount)
Parameters
Item Description
clusterid The cluster ID of the wanted cluster.
nettype Network type for list of networks to be retrieved. The types of networks
are retrieved from the list of Network Interface Modules (NIMs)
currently defined to PowerHA SystemMirror .
netbuf A pointer to a cl_net structure where the information is returned.
netcount A pointer to an integer where the number of networks that match the
specified type is returned.
Status codes
Item Description
CLE_OK Success. This code might return even if no networks are returned, that
is, no networks of the specified type exist.
CLE_BADARGS Missing or invalid arguments.
CLE_SYSERR System error.
CLE_NOCLINFO No cluster information available.
CLE_IVCLUSTERID Invalid cluster ID.
CLE_IVNETTYPE Invalid network type.
Example
char net_type[CL_MAXNAMELEN] = "ether";
int status,i,j;
int netcount;
int clusterid = 1113325332;
struct cl_net *netmap;
48 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
status = cl_getnetsbytype(clusterid, net_type, &netmap, &netcount);
if (status != CLE_OK) exit(status);
printf("there are %d networks of type:
for (i=0; i<netcount; i++)
{
struct cl_net network;
status = cl_getnetbyname(clusterid, netmap[i].clnet_name, &network);
if (status != CLE_OK) exit(status);
printf("network %s has attribute %d and is connected to %d nodes\n",
network.clnet_name,
network.clnet_attr,
network.clnet_numnodes);
}
cl_getnetstatebynode routine
Returns the state of the specified network on the specified node.
Syntax
int cl_getnetstatebynode (int clusterid, int netid,
int nodeid, enum cls_state *state)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
netid The network ID for the network state to be retrieved.
nodeid The node ID for the network state to be retrieved.
netstate A pointer to an integer where the state of the specified network on
the specified node 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.
CLE_IVNODEID Invalid node ID. Note that this return can indicate that the ID is
simply invalid (it is not a valid node ID for this cluster) or that the
node is not connected (has no interfaces on) the specified network.
Example
See the example for the cl_getnet routine.
Related reference
cl_getnet routine
cl_getnode routine
Returns information about the node specified by a cluster ID/node name pair.
Syntax
int cl_getnode (int clusterid, char *nodename,
struct cl_node *nodebuf);
Parameters
Item Description
clusterid The cluster ID of the desired node.
nodename The node name of the desired node.
nodebuf Storage for the returned node information.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
Example
int clusterid = 1113325332;
int status;
char* nodename = "node1";
struct cl_node nodebuf;
cl_getnodeaddr routine
Returns the IP address associated with the specified cluster ID/network interface name pair. This routine
is capable of handling only IPv4 addresses.
Syntax
int cl_getnodeaddr (int clusterid, char *interfacename,
struct sockaddr_in *addr)
50 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
interfacename The name of the desired network interface.
addr Storage for the returned network interface address.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno 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
int clusterid = 1113325332;
int status;
char* interfacename = "geotest9";
struct sockaddr_in addr;
cl_getnodeaddr6 routine
Returns the IP address associated with the specified cluster ID/network interface name pair.
Syntax
int cl_getnodeaddr6 (int clusterid, char *interfacename,
struct sockaddr *addr, size_t size_of_addr)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
interfacename The name of the desired network interface.
addr Storage for the returned network interface address.
size_of_addr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for
IPv4 socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
cl_getnodemap routine
The cl_getnodemap routine returns information about the nodes in a cluster. You should call
cl_alloc_nodemap before calling this routine to reserve the storage in memory. You should call
cl_free_nodemap after calling this routine.
Syntax
int cl_getnodemap (int clusterid, struct cl_node *nodemap)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
nodemap Storage for the returned node information.
Status codes
The request completed successfully if it returns a non-negative number (number of nodes in the cluster).
Item Description
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Example
int clusterid = 1113325332;
int i;
int nodes;
struct cl_node *nodemap;
cl_alloc_nodemap (&nodemap);
if (nodemap==NULL){
printf("unable to allocate storage: cl_alloc_nodemap = NULL\n");
exit(-1);
}
nodes = cl_getnodemap(clusterid, nodemap);
if(nodes < 0)
{
cl_perror(nodes,"can't get node map");
} else {
printf("cluster %d has %d nodes:\n", clusterid, nodes);
52 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
for(i=0; i < nodes; i++){
printf("node %s in state %d has %d interfaces\n",
nodemap[i].cln_nodename,
nodemap[i].cln_state,
nodemap[i].cln_nif);
if(clusterid != nodemap[i].cln_clusterid){
printf("structure has invalid cluster ID: %d",
nodemap[i].cln_clusterid);
}
}
}
cl_free_nodemap(nodemap);
Related reference
cl_alloc_nodemap routine
The cl_alloc_nodemap routine allocates storage for a list of nodes and the interfaces associated with
each node. This routine should be called before calling the cl_getnodemap routine.
cl_free_nodemap routine
The cl_free_nodemap routine frees the storage previously allocated by calling the cl_alloc_nodemap
routine.
cl_getnodenamebyifaddr routine
Returns the name of the node with the specified interface address. Clinfo scans the network interfaces on
each node in the cluster. If a match is found, the node name for the node associated with that interface
address is returned.
Syntax
int cl_getnodenamebyifaddr (int clusterid, struct sockaddr_in *addrp,
char *nodename)
Parameters
Item Description
clusterid The cluster ID of the desired node.
addr The network interface address of the desired node.
nodename The name of the desired node.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVADDRESS The request specified an invalid network interface address.
Example
int clusterid = 1113325332;
int status;
char nodename[CL_MAXNAMELEN];
struct sockaddr_in addr;
cl_getnodenamebyifaddr6 routine
Returns the name of the node with the specified interface address. Clinfo scans the network interfaces on
each node in the cluster. If a match is found, the node name for the node associated with that interface
address is returned.
Syntax
int cl_getnodenamebyifaddr6 (int clusterid, struct sockaddr *addrp, size_t size_of_addr, char *nodename)
Parameters
Item Description
clusterid The cluster ID of the desired node.
addr The network interface address of the desired node.
size_of_addr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for
IPv4 socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
nodename The name of the desired node.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVADDRESS The request specified an invalid network interface address.
cl_getnodenamebyifname routine
Returns the node name of the node with the specified interface name. Clinfo scans the network interfaces
on each node in the cluster. If a match is found, the node name for that node is returned.
Syntax
int cl_getnodenamebyifname (int clusterid, char *interfacename,
char *nodename)
54 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Parameters
Item Description
clusterid The cluster ID of the desired node.
interfacename The network interface name of the desired node.
nodename The name of the desired node.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNETIFNAME The request specified an invalid network interface name.
Example
int clusterid = 1113325332;
int status;
char nodename[CL_MAXNAMELEN];
char interfacename[CL_MAXNAMELEN] = "geotest9";<
cl_getprimary routine
Returns the node name of the user-designated primary Cluster Manager for the specified cluster.
Syntax
int cl_getprimary (int clusterid, char *nodename)
Parameters
Item Description
clusterid The cluster ID whose primary node name is desired.
nodename The name of the node designated as the primary Cluster Manager node is
returned in this argument.
Example
int clusterid = 1113325332;
int status;
char nodename[CL_MAXNAMELEN] = "node1";
cl_getsite routine
Returns information about a specific site.
Syntax
Parameters
Item Description
clusterid The desired cluster.
siteid The ID of the cluster.
sitebuf Holds the returned cl_site structure.
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_IVSITEID Invalid site ID
56 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Example
int clusterid = 1113325332;
int status;
int siteid = 1;
struct cl_site site;
cl_getsitebyname routine
Returns information about a specific, named site.
Syntax
int cl_getsitebyname (int clusterid, char *sitename, struct cl_site *sitebuf)
Parameters
Item Description
clusterid The desired cluster.
sitename The name of the site to be returned.
sitebuf Holds the returned cl_site structure.
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_IVSITENAME Invalid site ID
Example
int clusterid = 1113325332;
int status;
char sitename[CL_MAXNAMELEN] = "geo9";
struct cl_site site;
Syntax
int cl_getsitebypriority (int clusterid, enum cl_site_priority,
priority, struct cl_site *sitebuf)
Parameters
Item Description
clusterid The desired cluster.
priority One of the enumerated site priority values.
site_buf Holds the returned site information.
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_IVSITEPRIORITY Invalid site priority.
Example
enum cl_site_priority priority = CL_SITE_PRI_PRIMARY;
int clusterid = 1113325332;
int status;
struct cl_site site;
cl_getsitemap routine
Returns all known information about all the sites in the cluster.
Syntax
int cl_getsitemap (int clusterid, struct cl_site *sitemap)
Parameters
Item Description
clusterid The desired cluster.
58 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
sitemap Storage must be allocated prior to the cl_getsitemap call
using cl_alloc_sitemap(&sitemap). Storage must be freed using
cl_free_sitemap(sitemap).
Status codes
The request completed successfully if it returns a non-negative number (number of sites in the cluster).
Item Description
CLE_BADARGS Missing or invalid argument(s).
CLE_SYSERR System error.
CLE_NOCLINFO No cluster information available.
CLE_IVCLUSTERID Invalid cluster ID.
Example
int clusterid = 1113325332;
int status;
int i,j;
int nbr_sites;
struct cl_site *sitemap;
cl_alloc_sitemap(&sitemap);
nbr_sites = cl_getsitemap(clusterid, sitemap);
printf("dumping sitemap with %d sites for cluster %d\n\n",
nbr_sites, sitemap->clsite_clusterid);
for (i=0; i<nbr_sites; i++)
{
printf("info for site %s (%d)\n",
sitemap[i].clsite_name, sitemap[i].clsite_id);
printf(" priority = %d \n", sitemap[i].clsite_priority);
printf(" backup = %d \n", sitemap[i].clsite_backup);
printf(" state = %d \n", sitemap[i].clsite_state);
printf(" number of nodes = %d\n", sitemap[i].clsite_numnodes);
for (j=0; j<sitemap[i].clsite_numnodes; j++)
{
printf(" node id = %d\n",
sitemap[i].clsite_nodeids[j]);
}
}
cl_free_sitemap(sitemap);
Related reference
cl_alloc_sitemap routine
Allocates storage for a series of site information structures.
cl_free_sitemap routine
Frees the storage previously allocated by a call to cl_alloc_sitemap.
cl_isaddravail routine
Returns the status of the specified network interface. This routine is capable of handling only IPv4
addresses.
Syntax
int cl_isaddravail (int clusterid, char *nodename,
struct sockaddr_in *addr)
Status codes
Item Description
CLE_OK The specified address is available from the given node.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
CLE_IVADDRESS The request specified an invalid interface address.
CLE_IVNETIF The network interface is not available.
Example
int clusterid = 1113325332;
int status;
char ifaddr[CL_MAXNAMELEN] = "9.57.28.23";
char nodename[CL_MAXNAMELEN] = "node1";
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr (ifaddr);
status = cl_isaddravail (clusterid, nodename, &addr);
if (status != CLE_OK) {
cl_perror(status,"interface not available");
} else {
printf ("interface address for %s is available\n",
inet_ntoa (addr.sin_addr.s_addr));
}
cl_isaddravail6 routine
Returns the status of the specified network interface.
Syntax
int cl_isaddravail6 (int clusterid, char *nodename,
struct sockaddr *addr, size_t size_of_addr)
Parameters
Item Description
clusterid The cluster ID of the desired network interface.
nodename The node name of the desired network interface.
addr The address of the desired network interface.
60 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
size_of_addr Size of ‘addr’ buffer. It must be at least of size ‘struct sockaddr_in’ (for IPv4
socket) and ‘struct sockaddr6_in’ (for IPv6 socket)
Status codes
Item Description
CLE_OK The specified address is available from the given node.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_BADARGS Missing or invalid parameters.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
CLE_IVADDRESS The request specified an invalid interface address.
CLE_IVNETIF The network interface is not available.
cl_isclusteravail routine
Returns status of the cluster with the specified cluster ID.
Syntax
int cl_isclusteravail (int clusterid)
Parameters
Item Description
clusterid The cluster ID of the desired cluster.
Status codes
Item Description
CLE_OK The cluster is available.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_IVCLUSTER The specified cluster is not available.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Example
int clusterid = 1113325332;
int status;
Syntax
int cl_isnodeavail (int clusterid, char *nodename)
Parameters
Item Description
clusterid The cluster ID of the desired node.
nodename The node name of the desired node.
Status codes
Item Description
CLE_OK The node is available from the specified cluster.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
CLE_IVNODE The node is not available.
Example
int clusterid = 1113325332;
int status;
char nodename[CL_MAXNAMELEN] = "node1";
cl_model_release routine
The cl_model_release() routine was used in prior releases to detach shared memory.
The cl_model_release() routine no longer has any function and always returns CLE_OK.
cl_model_release() is provided for backward compatibility only. Do not use this routine for new
programs.
cl_node_free routine
Deletes the storage previously allocated for the network interfaces associated with the node returned by a
previous call to the cl_getnode routine. The member cln_if will be set to null.
Syntax
int cl_node_free
62 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Parameters
Item Description
nodebifp node buffer
Status codes
Item Description
CLE_OK The request completed successfully.
Sample source
int clusterid;
struct cl_node nodebuf;
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr("9.57.28.8");
Sample output
node id: 1 has 5 interfaces
after cl_node_free, node id: 1 has 0 interfaces
cl_registereventnotify routine
The cl_registereventnotify routine registers a list of event notification requests with Clinfo.
Each request specifies an event ID, a cluster ID, a signal ID, and if applicable, a node name and/ or a
network ID. If the routine is successful, Clinfo signals the calling process when an event occurs, which
fits the specified description. When this signal is received, the cl_getevent routine may be called to get
information about the event that just occurred.
You can register to receive notification of all network and cluster events by specifying -1 as the event
ID. If you register to receive notification of all such events, you cannot unregister notification of specific
events; you must unregister all.
Note that you cannot use the -1 event ID for events that include node name identification. Specify a NULL
string to register for all node names. Currently you cannot specify an individual network ID. Use -1 as the
event ID.
This routine does not work with a cluster ID of 0. Assign another number as the cluster ID.
Syntax
#include <signal.h>
int cl_registereventnotify (int num_reqs, struct cli_enr_req_t*enr_list)
64 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
SIGNALS You may specify any appropriate UNIX signal; familiarity with signals is
assumed. SIGUSR1 and SIGUSR2 are suggested.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
CLE_IVREQNUM An invalid number of event notification registration requests was
specified (more than 10).
CLE_IVNETID An invalid network identification was specified.
CLE_IVEVENTID An invalid event identification was specified.
Example
The following example illustrates the use of the cl_registereventnotify, cl_unregistereventnotify, and
cl_getevent routines in a simple test program.
In this example, the application registers to be notified by a SIGUSR1 signal when any network connected
to node2 of cluster 83 experiences problems serious enough to cause a FAILING_NETWORK event. After
registering, the application waits for the event. When the event occurs, Clinfo sends the SIGUSR1 signal
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include <cluster/clinfo.h>
volatile int no_signal = 1;
int
main(int argc, char *argv[])
{
int ret_code, i;
struct cli_enr_req_t en_req; /* Event notification request */
struct cli_en_msg_t en_msg; /* Event notification message */
en_req.event_id = CL_FAILING_NETWORK; /* specify a failing
network event */
en_req.cluster_id = 83;
strcpy (en_req.node_name,"node2");
en_req.net_id = 1; /* no net id necessary
for this event */
en_req.signal_id = SIGUSR1;/* Request to register for event
notification */
Related reference
cl_getevent routine
66 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
The cl_getevent routine returns an event notification message. The caller should issue this request only
after a signal, as specified in a previous cl_registereventnotify request, is received.
cl_unregistereventnotify routine
The cl_unregistereventnotify routine unregisters a list of event notification requests with Clinfo. Each
request specifies an event identification, a cluster identification, a signal identification, and if applicable,
a node and/or network identification. If the routine is successful, Clinfo deletes registration of all events
that fit the specified description.
cl_unregistereventnotify routine
The cl_unregistereventnotify routine unregisters a list of event notification requests with Clinfo. Each
request specifies an event identification, a cluster identification, a signal identification, and if applicable,
a node and/or network identification. If the routine is successful, Clinfo deletes registration of all events
that fit the specified description.
If you registered to receive notification of all network or cluster events by specifying -1 as the event ID,
you must unregister all. You cannot register for all, then unregister individual events. If you registered for
specific events, then unregister for those events individually.
Syntax
int cl_unregistereventnotify (int num_reqs,
struct cli_enr_req_t *enr_list)
Parameters
See parameters for the cl_registereventnotify routine.
Status codes
See status codes for the cl_registereventnotify routine.
Example
See the example for the cl_registereventnotify routine).
Related reference
cl_registereventnotify routine
The cl_registereventnotify routine registers a list of event notification requests with Clinfo.
See the AIX XL C++/6000 V1.1.1 Language Reference for more information.
Linkage directives that allow C++ programs to call the Clinfo C API are included in clinfo.h. However, if
you want a C++ API that is more object oriented, you may use the Clinfo C++ API.
The Clinfo C++ API defines object classes for cluster, node, and network interface. All Clinfo C++ functions
that retrieve data from these objects are member functions (sometimes called methods) of these classes.
Header files
You must specify the include directive in each source module that uses the Clinfo C++ API.
This include directive is as follows:
68 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
#include <cluster/clinfo.H>
You must add the following directive to the object load command of a multi-threaded application that uses
the Clinfo C API:
The libclpp.a and libclpp_r.a libraries hold the routines that support the Clinfo C++ API; the libcl.a and
libcl_r.a libraries contain the routines that support the Clinfo C API.
To compile a C++ program under AIX, use the xlC compiler.
Note: Clinfo's cluster.es.client.lib library now contains the libcl.a with both 32- and 64-bit objects. You
must recompile/relink your application in a 64-bit environment to get a 64-bit application using the Clinfo
API.
Constants
The Clinfo C++ API routines use the constants defined in the clinfo.h file.
Item Description
CL_MAXNAMELEN The maximum length of a character string naming a cluster, node,
or interface (256). The value of CL_MAXNAMELEN is the same as
MAXHOSTNAMELEN, defined in the sys/param.h file.
CL_MAX_EN_REQS The maximum number of event notification requests allowed (10).
CL_ERRMSG_LEN Maximum error message length (128 characters).
CLSMUXPD_SVC_PORT The constants CL_MAXCLUSTERS, CL_MAXNODES, and
CL_MAXNETIFS used in previous versions of the software are replaced
by macros that provide the current sizes of the various arrays in the
data structure. The macros have the same name as the constants they
replace. These macros cannot be used as array bounds in declaration
statements, as the constants were used.
CL_MAXCLUSTERS Provides current size of space in shared memory for the array holding
information about the number of clusters.
CL_MAXNODES Provides current size of space in shared memory for the array holding
information about the number of nodes in a cluster.
CL_MAXNETIFS Provides current size of space in shared memory for the array holding
information about the number of interfaces attached to a node.
CL_MAXGROUPS Provides current size of space in shared memory for the array holding
information about the number of resource groups.
As an example, the following code fragment illustrates use of the constant CL_MAXNODES to size an
array of cluster objects. An example of how to replace this with a call to the routine of the same name
follows.
CL_cluster clusters[8];
CL_cluster *ret = &clusters[0];
int numclus;
numclus = CL_getallinfo(ret, s);
if (s < 0)
cl_perror(s, progname);
printf("number of clusters found: %d", numclus);
for (int i=0; i<numclus; i++) {
printf("[%d] cl %d", i, ret[i].clc_clusterid);
printf(" st %d", ret[i].clc_state);
printf(" su %d", ret[i].clc_substate);
printf(" pr %s", ret[i].clc_primary);
printf(" na %s", ret[i].clc_name.name);
}
class CL_cluster {
public:
CL_clusterid clc_clusterid;// Cluster Id
CL_state clc_state;// Cluster State
CL_substate clc_substate;// Cluster Substate
CL_nodename clc_primary; // Cluster Primary Node
CL_clustername clc_name; // Cluster Name
CL_node *clc_node; // Pointer to child node array
CL_group *clc_group; // pointer to child resource group array
70 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
int CL_getallinfo(CL_node*, CL_status&);
int CL_getgroupinfo(CL_group*, CL_status&);
CL_clusterid CL_getclusterid(CL_status&);
CL_cluster CL_getinfo(CL_status&);
CL_status CL_getprimary(CL_status&, CL_nodename);
CL_status CL_isavail();
CL_cluster& operator=(const struct cl_cluster&);
};
class CL_netif {
public:
CL_clusterid cli_clusterid; // Cluster Id
CL_nodeid cli_nodeid; // Cluster node Id
CL_nodename cli_nodename; // Cluster node name
CL_ifid cli_interfaceid; // Cluster Node Interface Id
CL_state cli_state; // Cluster Node Interface State
CL_ifname cli_name; // Cluster Node Interface Name
CL_ifaddr cli_addr; // Cluster Node Interface IP Address
CL_node *cli_pnode; // pointer to parent Node object
CL_ifaddr6 cli_addr6; // Cluster Node Interface IP Address
CL_clusterid CL_getclusterid(CL_status&);
CL_clusterid CL_getclusterid6(CL_status&);
CL_ifaddr CL_getifaddr(CL_status&);
CL_ifaddr6 CL_getifaddr6(CL_status &s);
CL_ifname CL_getifname(CL_status&);
CL_ifname CL_getifname6(CL_status &);
CL_ifaddr CL_getnodeaddr(CL_status&);
CL_ifaddr6 CL_getnodeaddr6(CL_status&);
CL_nodename CL_getnodenamebyif(CL_status&);
CL_nodename CL_getnodenamebyif6(CL_status &);
CL_status CL_isavail();
CL_status CL_isavail6();
CL_netif& operator=(const struct cl_netif&);
};
class CL_node {
public:
CL_clusterid cln_clusterid; // Cluster Id
CL_nodeid cln_nodeid; // Cluster node id - used internally
CL_nodename cln_nodename; // Cluster node name
CL_state cln_state; // Cluster Node State
int cln_nif; // Cluster Node Number of Interfaces
CL_netif *cln_if; // Cluster Node interfaces
CL_cluster *cln_pcluster; // pointer to parent cluster object
CL_route CL_bestroute(CL_status&);
CL_route6 CL_bestroute6(CL_status&);
CL_node CL_getinfo(CL_status&);
CL_status CL_isavail();
CL_node& operator=(const struct cl_node&);
};
Note: The pointers to parent objects included in the object class data are provided in case you want to set
up a tree structure of objects. These pointers are not filled by the Clinfo C++ API.
class CL_group {
public:
CL_clusterid clg_clusterid; // Cluster Id
CL_groupid clg_group_id // Resource Group Id
CL_groupname clg_name; // Resource group name
/* The following field is deprecated in PowerHA SystemMirror 5.2 and will not be
* used. The data field itself is not removed from the data
* structures to maintain the backward compatibility */
int clg_num_nodes;
int clg_node_ids[MAXNODES]; // Node ids in this group
CL_resource_states clg_node_states[MAXNODES];
//and their state
CL_cluster *cln_pcluster;
// pointer to parent cluster object
CL_group CL_getinfo(CL_status&);
CL_group& operator=(const struct cl_group&);
};
Note: The pointers to parent objects included in the object class data are provided in case you want to set
up a tree structure of objects. These pointers are not filled by the Clinfo C++ API.
This function is not a member function of class CL_cluster, since it returns the number of clusters, as well
as information about all clusters rather than a particular cluster object.
CL_node CL_getlocalid(CL_status&);
This function is not a member function of class CL_node, since it returns information about the local host.
netif.cli_addr.sin_family = AF_INET;
netif.cli_addr.sin_addr.s_addr = inet_addr(addr);
To assign a cli_name:
strcpy(netif.cli_name.name, "node_name");
Event functions
72 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
int cl_registereventnotify(int, struct cli_enr_req_t *);
int cl_unregistereventnotify(int, struct cli_enr_req_t *);
int cl_getevent(cli_en_msg_t *);
Utility functions
void cl_perror(int, char *);
char *cl_errmsg (int status);
/*for single-threaded applications*/
char *cl_errmsg_r(int status, char cbuf);
/*for multi-threaded applications*/
CL_getlocalid
These are examples of the CL_getlocalid routine from an earlier release and a newer version.
The following is an example of the CL_getlocalid routine from an earlier release that uses node ID.
CL_status s;
CL_node lnode;lnode = node.CL_getlocalid(s);
if (s < 0)
cl_errmsg(s);
printf("cluster id = %d, node id = %d", lnode.cln_clusterid,
lnode.cln_nodeid);
In the new version of the example of the C++ API CL_getlocalid routine, note the change in the printf
statement.
CL_status s;
CL_node lnode;
char cbuf[CL_ERRMSG_LEN];
lnode = CL_getlocalid(s);
if (s < 0)
cl_errmsg_r(s, cbuf);
printf("cluster id = %d, node name = %s", lnode.cln_clusterid,
lnode.cln_nodename.name);
CL_isavail
These are examples of the CL_isavail routine from an earlier release and a newer version.
The following is an example of the CL_isavail routine from an earlier release that uses node ID.
CL_status s;
CL_netif netif;
netif.cli_clusterid = 2;
netif.cli_nodeid = 2;
netif.cli_addr.sin_family = AF_INET;
netif.cli_addr.sin_addr.s_addr = inet_addr(addr);
s = netif.CL_isavail();
The new version of the example of the C++ API CL_isavail routine changes the assignment statement,
since the previous version used cli_nodeid; now it is cln_name.name.
CL_status s;
CL_netif netif;
CL_getprimary
These are examples of the CL_getprimary routine from an earlier release and a newer version.
The following is an example of the CL_getprimary routine from an earlier release that uses node ID:
CL_cluster clus;
CL_status s;
CL_nodeid nid;
clus.clc_clusterid = 2;
nid = clus.CL_getprimary(s);
if (s < 0)
cl_errmsg(s);
printf("nodeid = %d", nid);
The new version of the example of the C++ API CL_getprimary routine changes because a primary node
is now recognized by its name (a string) rather than by an integer.
CL_clusterid clusterid;
CL_cluster clus;
CL_status status;
CL_nodename name;
CL_node node;
char cbuf[CL_ERRMSG_LEN];
clus.clc_clusterid = 2;
status = clus.CL_getprimary(cluster.clc_clusterid);
if (status < 0)
cl_errmsg_r(status, cbuf);
printf( "Cluster %d's primary node is %s",
cluster.clc_clusterid, cluster.clc_primary.name);
Requests
The Clinfo C++ API has different types of requests.
Item Description
CL_getallinfo Calls the C function cl_getnodemap. This request is a member function
associated with the cl_cluster class. The request returns information about
all nodes in a cluster, given a cluster ID. A pointer to an array of node objects is
passed as a reference argument to the function.
CL_getallinfo Calls the C function cl_getclusters. Returns the number of clusters found. A
pointer to an array of cluster objects is passed as a reference argument to the
function. (When CL_getallinfo is called to get info on all clusters, the function
is not a member function of the class CL_cluster .)
CL_getclusterid Calls the C function cl_getclusterid. Returns the cluster ID given a cluster
name.
CL_getinfo Calls the C function cl_getcluster. Returns information about the cluster with
the specified cluster ID.
CL_getprimary Calls the C function cl_getprimary. Returns the node name of the user-
defined primary Cluster Manager in the specified cluster.
74 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
CL_isavail Calls the C function cl_isclusteravail. Returns the status of the cluster with
the specified cluster ID.
CL_getgroupinfo Calls the C function cl_getgroupmap. Returns the number of resource groups
found. A pointer to an array of resource group objects is passed as a reference
object.
Item Description
CL_bestroute Calls the cl_bestroute C function. Returns the local or remote IPv4 address pair
that offers the most direct route to the specified node.
CL_bestroute6 Calls the cl_bestroute6 C function. Returns the local/remote IPv4 or IPv6
address pair that offers the most direct route to the specified node.
CL_getinfo Calls the cl_getnode C function. Returns information about the node specified
by a cluster ID or node name pair.
CL_getlocalid Calls the cl_getlocalid C function. Returns a CL_node object that contains the
cluster ID and node name of the host making the request. (This function is not a
member function of the CL_node class)
CL_isavail Calls the cl_isnodeavail C function. Returns the status of the specified node,
given its cluster ID and node name.
Item Description
CL_getclusterid Calls the cl_getclusteridbyifaddr or cl_getclusteridbyifname C
function. Returns the cluster's network interface name if the IPv4
address is specified; returns its IPv4 network interface address if the
name is specified.
CL_getclusterid6 Calls the cl_getclusteridbyifaddr6 or cl_getclusteridbyifname C
function. Returns the cluster's network interface name if the IPv4 or
IPv6 address is specified; returns its IPv4 or IPv6 network interface
address if the name is specified.
CL_getifaddr Calls the cl_getifaddr C function. Returns the IPv4 network interface
address of the interface with the specified cluster ID and network
interface name.
CL_getifaddr6 Calls the cl_getifaddr6 C function. Returns the IPv4 or IPv6 network
interface address of the interface with the specified cluster ID and
network interface name.
CL_getifname Calls the cl_getifname C function. Returns the interface name of the
interface with the specified cluster ID and IPv4 network interface
address.
CL_getifname6 Calls the cl_getifname6 C function. Returns the interface name of
the interface with the specified cluster ID and IPv4 or IPv6 network
interface address.
Item Description
CL_getinfo Returns all information about the specific resource group in the specified
cluster.
Item Description
cl_getevent Gets information when an event signal is received, and returns an event
notification message received from Clinfo.
cl_registereventnotify Registers a list of event notification requests with Clinfo, and returns a
signal to the calling process when a registered event occurs.
cl_unregistereventnotify Unregisters a list of event notification requests with Clinfo.
CL_cluster::CL_getallinfo routine
Returns information about all the nodes in a cluster.
Syntax
int *CL_cluster::CL_getallinfo (CL_node *nodes, CL_status s)
76 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Required input object data
Item Description
CL_cluster::clc_clusterid The cluster ID of the desired cluster.
Return value
Item Description
nodes A pointer to an array of node objects is passed as a reference
argument to the function.
int The number of nodes in the cluster.
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the
return code.
CLE_SYSERR System error. Check the AIX global variable errno 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.
Example
CL_cluster cluster;
CL_status status;
CL_node nodes[8];
CL_node *ret = &nodes[0];
int numnodes;
cluster.clc_clusterid = 1113325332;
numnodes = cluster.CL_getallinfo(ret, status);
if (status < 0) {
cl_perror(status, progname);
} else {
printf("number of nodes in cluster: %d\n", numnodes);
for (int i=0; i<numnodes; i++) {
printf("[%d] clusterid %d", i, ret[i].cln_clusterid);
printf(" nodeid %d", ret[i].cln_nodeid);
printf(" state %d", ret[i].cln_state);
printf(" interfaces %d\n", ret[i].cln_nif);
}
}
CL_getlocalid routine
Returns a CL_node object that contains the cluster ID and the node name of the host making the request.
This request returns an error status on nodes not currently active in the cluster.
Syntax
CL_node CL_getlocalid (CL_status s)
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 variable errno 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_IVNODE Node is not a cluster node.
Example
This example uses the cl_errmsg routine to illustrate proper programming for a single-threaded
application. If your program is multi-threaded, you must use the cl_errmsg_r routine.
CL_status status;
CL_node lnode;
lnode = CL_getlocalid(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("cluster id = %d, node name = %s\n", lnode.cln_clusterid,
lnode.cln_nodename.name);
}
CL_cluster::CL_getallinfo routine
Returns information about all the nodes in a cluster.
Syntax
int *CL_cluster::CL_getallinfo (CL_node *nodes, CL_status s)
Return value
Item Description
nodes A pointer to an array of node objects is passed as a reference
argument to the function.
int The number of nodes in the cluster.
78 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the
return code.
CLE_SYSERR System error. Check the AIX global variable errno 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.
Example
CL_cluster cluster;
CL_status status;
CL_node nodes[8];
CL_node *ret = &nodes[0];
int numnodes;
cluster.clc_clusterid = 1113325332;
numnodes = cluster.CL_getallinfo(ret, status);
if (status < 0) {
cl_perror(status, progname);
} else {
printf("number of nodes in cluster: %d\n", numnodes);
for (int i=0; i<numnodes; i++) {
printf("[%d] clusterid %d", i, ret[i].cln_clusterid);
printf(" nodeid %d", ret[i].cln_nodeid);
printf(" state %d", ret[i].cln_state);
printf(" interfaces %d\n", ret[i].cln_nif);
}
}
CL_cluster::CL_getclusterid routine
The CL_getclusterid routine returns the cluster ID of the cluster with the specified name.
Syntax
CL_clusterid CL_cluster::CL_getclusterid(CL_status s)
Return value
Item Description
CL_clusterid The desired cluster ID.
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the
return code.
Example
CL_cluster cluster;
CL_status status;
CL_clusterid clusterid;
char cbuf[CL_ERRMSG_LEN];
strcpy(cluster.clc_name.name, "site1");
clusterid = cluster.CL_getclusterid(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("clusterid = %d\n", clusterid);
}
}
CL_group::CL_getinfo routine
Returns a group object that contains information about the group, given a group object with the cluster ID
and group name.
Syntax
CL_Group::CL_getinfo (CL_status s);
Return value
Item Description
CL_group The desired resource group and its full information.
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 variable errno for additional
information.
80 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
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_IVNODENAME The request specified an invalid node name.
Example
CL_status status;
CL_group group;
CL_group ret;
group.clg_clusterid = 1113325332;
strcpy(group.clg_name.name, "rg01");
ret = group.CL_getinfo(status);
if (status < 0) {
cl_perror(status, progname);
} else {
printf("There are %d nodes in group %s\n",
ret.clg_num_nodes, ret.clg_name.name);
}
CL_cluster::CL_getprimary routine
Returns the node name of the user-designated primary Cluster Manager for the specified cluster.
Syntax
CL_nodename CL_cluster::CL_getprimary (CL_status s)
Return value
Item Description
CL_nodename The node name of the primary Cluster Manager.
Status value
Item Description
CL_status status Status passed by reference. Output parameter for the return codes.
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_NOPRIMARY No primary information is available. This status usually indicates that
the user has not designated a primary cluster manager.
CLE_IVCLUSTER The cluster is not available.
cluster.clc_clusterid = 1;
name = cluster.CL_getprimary(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf( "cluster %d's primary node is %s\n",
cluster.clc_clusterid, cluster.clc_primary.name);
}
CL_cluster::CL_isavail routine
Returns the status code CLE_OK if the specified cluster is available.
Syntax
CL_status CL_cluster::CL_isavail()
Return value
Item Description
CL_status Status of the specified cluster.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_IVCLUSTER The request specified an invalid cluster.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
Example
CL_status status;
CL_cluster cluster;
cluster.clc_clusterid = 1113325332;
status = cluster.CL_isavail();
printf("status = %d\n", status);
82 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
CL_cluster::CL_getgroupinfo routine
Returns information about all the resource groups in the cluster.
Syntax
int CL_cluster::CL_getgroupinfo (CL_group *groups, CL_status&);
Return value
Item Description
groups A pointer to a group of resource group objects is passed as a
reference argument to the function.
int The number of resource groups in the cluster
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the return
code.
CLE_SYSERR System error. Check the AIX global variable errno 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.
Example
CL_status status;
CL_cluster cluster;
CL_group groups[MAXGROUPS];
int numgroups;
cluster.clc_clusterid = 1113325332;
numgroups = cluster.CL_getgroupinfo(&groups[0], status);
if (status < 0) {
cl_perror(status, progname);
} else {
printf("There are %d groups in cluster %d\n", numgroups,
cluster.clc_clusterid);
for (int i=0; i<numgroups; i++) {
printf("Group %d is id %d\n", i, groups[i].clg_group_id);
printf("Group %d is %s and has %d nodes\n",
i, groups[i].clg_name.name, groups[i].clg_num_nodes);
}
}
Syntax
CL_Group::CL_getinfo (CL_status s);
Return value
Item Description
CL_group The desired resource group and its full information.
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 variable errno 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_IVNODENAME The request specified an invalid node name.
Example
CL_status status;
CL_group group;
CL_group ret;
group.clg_clusterid = 1113325332;
strcpy(group.clg_name.name, "rg01");
ret = group.CL_getinfo(status);
if (status < 0) {
cl_perror(status, progname);
} else {
printf("There are %d nodes in group %s\n",
ret.clg_num_nodes, ret.clg_name.name);
}
84 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
CL_netif::CL_getclusterid routine
Returns the name of the cluster with the specified network interface address. Alternatively, returns the
network interface address of a cluster given its network interface name.
Syntax
CL_clusterid CL_netif::CL_getclusterid (CL_status s)
or
Item Description
CL_netif::cli_name The network interface name whose cluster ID is desired.
Return value
Item Description
CL_clusterid The cluster ID (a non-negative integer).
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the return code.
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_IVADDRESS The request specified an invalid network interface address.
CLE_IVNETIFNAME The request specified an invalid network interface name.
Example
// example using interface name
CL_status status;
CL_clusterid clid;
CL_netif netif;
strcpy(netif.cli_name.name, "geotest9");
netif.cli_addr.sin_addr.s_addr = NULL;
clid = netif.CL_getclusterid(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("clusterid = %d\n", clid);
}
CL_status status;
CL_clusterid clusterid;
CL_netif netif;
char *addr = "1.1.1.7";
CL_netif::CL_getclusterid6 routine
Returns the name of the cluster with the specified network interface address. Alternatively, returns
the network interface address of a cluster given its network interface name. This routine is capable of
handling both IPv4 addresses and IPv6 addresses.
Syntax
CL_clusterid CL_netif::CL_getclusterid6(CL_status s)
or
Item Description
CL_netif::cli_name The network interface name whose cluster ID is desired.
Return value
Item Description
CL_clusterid The cluster ID (a non-negative integer).
Status value
Item Description
CL_status s Status passed by reference. Output parameter that holds the return code.
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_IVADDRESS The request specified an invalid network interface address.
CLE_IVNETIFNAME The request specified an invalid network interface name.
Example
CL_status status;
CL_clusterid clid;
CL_netif netif;
strcpy(netif.cli_name.name, "geotest9");
netif.cli_addr6.sin6_addr.s6_addr = NULL;
clid = netif.CL_getclusterid6(status);
if (status < 0)
86 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
{
cl_errmsg(status);
}
else
{
printf("clusterid = %d\n", clid);
}
CL_status status;
CL_clusterid clusterid;
CL_netif netif;
char *addr = "fe80::1”;
CL_netif::CL_getifaddr routine
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)
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.
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));
}
CL_netif::CL_getifaddr6 routine
Returns the network interface address of the interface with the specified cluster ID and network interface
name. This routine is capable of handling both IPv4 addresses and IPv6 addresses.
Syntax
CL_ifaddr6 CL_netif::CL_getifaddr6 (CL_status s)
Return value
Item Description
CL_ifaddr6 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.
88 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Example
CL_status status;
CL_ifaddr6 ifaddr;
CL_netif netif;
char cbuf[CL_ERRMSG_LEN];
char *addr;
netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
ifaddr = netif.CL_getifaddr6(status);
if (status < 0)
{
cl_errmsg(status);
}
else
{
printf("ifaddr = %s\n", inet_ntop(AF_INET6,
&((struct sockaddr_in6 *)&ifaddr->sin6_addr), addr, INET6_ADDRSTRLEN);
}
CL_netif::CL_getifname routine
Returns the network interface name, given a cluster ID and network interface address; or, given a cluster
ID and node name, returns a network interface name. This routine is capable of handling only IPv4
addresses.
If the request specifies a cli_addr parameter, Clinfo examines the network portion of the address and
seeks an interface on the same network. If a match is found, the CL_getifname routine returns the name
associated with that interface.
If the cli_addr parameter is NULL, Clinfo selects the interface on the specified node that is the most
easily accessed from the local host, and the CL_getifname routine returns the name associated with that
interface. If both interfaces are equally accessible from the local node, Clinfo chooses one and returns the
name associated with that interface.
In all cases, the CL_getifname routine returns the name as a NULL-terminated string.
Syntax
CL_ifname CL_netif::CL_getifname (CL_status s)
or
Item Description
CL_netif::cli_clusterid, cli_nodename The cluster ID and node name of the desired network
interface.
Return value
Item Description
CL_ifname The network interface name.
Example
// CL_netif::CL_getifname get interfacename given clusterid and nodename
CL_status status;
char cbuf[CL_ERRMSG_LEN];
CL_ifname ifname;
CL_netif netif;
netif.cli_addr.sin_addr.s_addr = NULL;
netif.cli_clusterid = 1113325332;
strcpy (netif.cli_nodename.name, "node1");
ifname = netif.CL_getifname(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("ifname = %s\n", ifname.name);
}
CL_netif::CL_getifname6 routine
Returns the network interface name, given a cluster ID and network interface address; or, given a cluster
ID and node name, returns a network interface name. This routine is capable of handling both IPv4
addresses and IPv6 addresses.
If the request specifies a cli_addr6 parameter, Clinfo examines the network portion of the address and
seeks an interface on the same network. If a match is found, the CL_getifname6 routine returns the
name associated with that interface.
If the cli_addr6 parameter is NULL, Clinfo selects the interface on the specified node that is the most
easily accessed from the local host, and the CL_getifname6 routine returns the name associated with
that interface. If both interfaces are equally accessible from the local node, Clinfo chooses one and
returns the name associated with that interface.
In all cases, the CL_getifname6 routine returns the name as a NULL-terminated string.
Syntax
CL_ifname CL_netif::CL_getifname6 (CL_status s)
90 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Required input object data
Item Description
CL_netif::cli_clusterid, cli_addr6 The cluster ID of the desired network interface and the
network interface address.
or
Item Description
CL_netif::cli_clusterid, cli_nodename The cluster ID and node name of the desired network
interface.
Return value
Item Description
CL_ifname The network interface name.
Status values
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_IVADDRESS The request specified an invalid network interface address.
CLE_IVNODENAME The request specified an invalid node name.
Example
// CL_netif::CL_getifname get interfacename given clusterid and nodename
CL_status status;
char cbuf[CL_ERRMSG_LEN];
CL_ifname ifname;
CL_netif netif;
netif.cli_addr6.sin6_addr.s6_addr = NULL;
netif.cli_clusterid = 1113325332;
strcpy (netif.cli_nodename.name, "node1");
ifname = netif.CL_getifname6(status);
if (status < 0)
{
cl_errmsg(status);
}
else
{
printf("ifname = %s\n", ifname.name);
}
Syntax
CL_ifaddr CL_netif::CL_getnodeaddr(CL_status s)
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));
}
92 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
CL_netif::CL_getnodeaddr6 routine
Returns the IP address associated with the specified cluster ID and network interface name. This routine
is capable of handling both IPv4 addresses and IPv6 addresses.
Syntax
CL_ifaddr6 CL_netif::CL_getnodeaddr6(CL_status s)
Return value
Item Description
CL_ifaddr6 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_ifaddr6 ifaddr;
char cbuf[CL_ERRMSG_LEN];
char *addr;
netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
ifaddr = netif.CL_getnodeaddr6(status);
if (status < 0)
{
cl_errmsg(status);
}
else
{
printf("ifaddr = %s\n", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)
&ifaddr->sin6_addr), addr, INET6_ADDRSTRLEN);
}
Syntax
CL_nodename CL_netif::CL_getnodenamebyif (CL_status s)
or
Item Description
CL_netif::cli_clusterid, cli_name The cluster ID of the desired node, and the name of the network
interface.
Return value
Item Description
CL_nodename The node name.
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_IVADDRESS The request specified an invalid network interface address.
CLE_IVNETIFNAME The request specified an invalid network interface name.
Example
CL_status status;
char cbuf[CL_ERRMSG_LEN];
CL_nodename nname;
CL_netif netif;
94 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
char *addr = "9.57.28.23";
netif.cli_clusterid = 1113325332;
netif.cli_addr.sin_family = AF_INET;
netif.cli_addr.sin_addr.s_addr = inet_addr(addr);
netif.cli_name.name[0] = NULL;
nname = netif.CL_getnodenamebyif(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("node name = %s\n", nname.name);
}
CL_netif::CL_getnodenamebyif6 routine
Returns the node name when given either a cluster ID and a network interface address or a cluster ID and
a network interface name. This routine is capable of handling both IPv4 addresses and IPv6 addresses.
If the network interface address is specified and cli_name is NULL, then cli_name is returned.
Conversely, if cli_name is given and cli_addr6 is NULL, cli_addr6 is returned. If both cli_name and
cli_addr6 are non-NULL, cli_addr6 takes precedence. If both are NULL, the error code CLE_ BADARGS is
returned.
Note: This routine replaces the CL_getnodename routine, which was available in previous releases.
Syntax
CL_nodename CL_netif::CL_getnodenamebyif6 (CL_status s)
or
Item Description
CL_netif::cli_clusterid, cli_name The cluster ID of the desired node, and the name of the network
interface.
Return value
Item Description
CL_nodename The node name.
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.
Example
CL_status status;
char cbuf[CL_ERRMSG_LEN];
CL_nodename nname;
CL_netif netif;
char *addr = "fe80::1";
netif.cli_clusterid = 1113325332;
netif.cli_addr6.sin6_family = AF_INET6;
inet_pton (AF_INET6, addr,
&(((struct sockaddr_in6 *)&netif.cli_addr6)->sin6_addr));
netif.cli_name.name[0] = NULL;
nname = netif.CL_getnodenamebyif6(status);
if (status < 0)
{
cl_errmsg(status);
}
else
{
printf("node name = %s\n", nname.name);
}
CL_netif::CL_isavail routine
Returns the status code CLE_OK if the specified network interface is available. This routine is capable of
handling only IPv4 addresses.
Syntax
CL_status CL_netif::CL_isavail()
Return value
Item Description
CL_status Status of the specified network interface.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global errno variable for additional information.
96 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Item Description
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_IVNODENAME The request specified an invalid node name.
CLE_IVADDRESS The request specified an invalid interface address.
CLE_IVNETIF The network interface is not available.
Example
CL_status status;
CL_netif netif;
char *addr = "9.57.28.23";
netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
netif.cli_addr.sin_family = AF_INET;
netif.cli_addr.sin_addr.s_addr = inet_addr(addr);
strcpy(netif.cli_nodename.name, "node1");
status = netif.CL_isavail();
if (status < 0) {
cl_perror(status,"netif.CL_isavail failed");
}
printf("status = %d\n", status);
CL_netif::CL_isavail6 routine
Returns the CLE_OK status code if the specified network interface is available. This routine is capable of
handling both IPv4 addresses and IPv6 addresses.
Syntax
CL_status CL_netif::CL_isavail6()
Return value
Item Description
CL_status Status of the specified network interface.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global errno variable for additional information.
Example
CL_status status;
CL_netif netif;
char *addr = "fe80::1";
netif.cli_clusterid = 1113325332;
strcpy(netif.cli_name.name, "geotest9");
netif.cli_addr6.sin6_family = AF_INET6;
inet_pton (AF_INET6, addr,
&(((struct sockaddr_in6 *)&netif.cli_addr6)->sin6_addr));
strcpy(netif.cli_nodename.name, "node1");
status = netif.CL_isavail6();
if (status < 0)
{
cl_perror(status,"netif.CL_isavail6 failed");
}
printf("status = %d\n", status);
CL_node::CL_bestroute routine
The CL_bestroute routine returns the local/remote IP address pair for the most direct route to the node
specified in the object. This routine is capable of handling only IPv4 addresses.
The route returned by the CL_bestroute routine depends on the node making the request. Clinfo first
builds a list of all working network interfaces on the local node, and then compares this list to the
available interfaces on the specified node. The routine first compares PowerHA SystemMirror-defined
private interfaces (such as a serial optical channel) to local interfaces. If no match is found, the routine
then compares PowerHA SystemMirror-defined public interfaces to local interfaces. If there is still no
match, the routine selects the first defined interface on the local node and the first defined interface on
the remote node.
If a pair of local and remote interfaces exist that are on the same network, they are returned in CL_route.
Otherwise, an interface on the specified node is chosen as the remote interface, and the primary local
interface is returned as the local end of the route.
Syntax
CL_route CL_node::CL_bestroute(CL_status s)
98 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Return value
Item Description
CL_route Local/remote IP address pair that indicates the most direct route to
the specified node.
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_BADARGS Missing or invalid parameters. This status usually indicates that a NULL
pointer was specified for an output parameter address.
CLE_NOROUTE No route available.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
Example
CL_status status;
CL_node node;
CL_route route;
char cbuf[CL_ERRMSG_LEN];
node.cln_clusterid = 1113325332;
strcpy(node.cln_nodename.name, "node1");
route = node.CL_bestroute(status);
if (status < 0) {
cl_errmsg(status);
} else {
// don't call inet_ntoa twice in one printf!
printf("local = %s ", inet_ntoa(route.localaddr.sin_addr));
printf("remote = %s\n", inet_ntoa(route.remoteaddr.sin_addr));
}
CL_node::CL_bestroute6 routine
The CL_bestroute6 routine returns the local or remote IP address pair for the most direct route to the
node specified in the object. This routine is capable of handling both IPv4 addresses and IPv6 addresses.
The route returned by the CL_bestroute6 routine depends on the node making the request. Clinfo first
builds a list of all working network interfaces on the local node, and then compares this list to the
available interfaces on the specified node. The routine first compares PowerHA SystemMirror-defined
private interfaces (such as a serial optical channel) to local interfaces. If no match is found, the routine
then compares PowerHA SystemMirror-defined public interfaces to local interfaces. If there is still no
match, the routine selects the first defined interface on the local node and the first defined interface on
the remote node.
If a pair of local and remote interfaces exist on the same network, they are returned in CL_route6.
Otherwise, an interface on the specified node is chosen as the remote interface, and the primary local
interface is returned as the local end of the route.
Syntax
CL_route CL_node::CL_bestroute6(CL_status s)
Return value
Item Description
CL_route6 Local or remote IP address pair that indicates the most direct route to
the specified node.
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_BADARGS Missing or invalid parameters. This status usually indicates that a NULL
pointer was specified for an output parameter address.
CLE_NOROUTE No route available.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
Example
CL_status status;
CL_node node;
CL_route6 route;
char cbuf[CL_ERRMSG_LEN];
char *addr;
node.cln_clusterid = 1113325332;
strcpy(node.cln_nodename.name, "node1");
route = node.CL_bestroute6(status);
if (status < 0)
{
cl_errmsg(status);
}
else
{
// don't call inet_ntop twice in one
printf("local = %s ", inet_ntop(AF_INET6,
&(((struct sockaddr_in6 *)&(route.localaddr))->sin6_addr), addr, INET6_ADDRSTRLEN);
printf("remote = %s\n", inet_ntop(AF_INET6,
&(((struct sockaddr_in6 *)&(route.remoteaddr))->sin6_addr), addr, INET6_ADDRSTRLEN);
}
CL_node::CL_getinfo routine
Returns a node object that contains information about the node, given a node object with a cluster ID and
node name.
Syntax
CL_node CL_node::CL_getinfo(CL_status s)
100 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Required input object data
Item Description
CL_node::cln_clusterid Cluster ID of target node.
CL_node::cln_nodename Node name of target node.
Return value
Item Description
CL_node The desired node and its information.
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 variable errno 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_IVNODENAME The request specified an invalid node name.
Example
CL_status status;
CL_node node;
CL_node ret;
char cbuf[CL_ERRMSG_LEN];
node.cln_clusterid = 1113325332;
strcpy(node.cln_nodename.name, "node1");
ret = node.CL_getinfo(status);
if (status < 0) {
cl_errmsg(status);
} else {
printf("clusterid %d ", ret.cln_clusterid);
printf("nodename %s ", ret.cln_nodename.name);
printf("state %d ", ret.cln_state);
printf("nif %d\n", ret.cln_nif);
}
CL_node::CL_isavail routine
Returns the status code CLE_OK if the specified node is available.
Syntax
CL_status CL_node::CL_isavail()
Return value
Item Description
CL_status Status of the specified node.
Status codes
Item Description
CLE_OK The request completed successfully.
CLE_SYSERR System error. Check the AIX global variable errno for additional
information.
CLE_IVCLUSTERID The request specified an invalid cluster ID.
CLE_IVNODENAME The request specified an invalid node name.
CLE_IVNODE The node is not available.
Example
CL_status status;
CL_node node;
node.cln_clusterid = 1113325332;
strcpy(node.cln_nodename.name, "node1");
status = node.CL_isavail();
printf("status = %d\n", status);
#!/bin/ksh
##############################################################################
# Filename: /usr/sbin/cluster/etc/clinfo.rc
#
# Description: clinfo.rc is run by clinfo on clients following cluster
# topology changes. This particular example demonstrates
# user process management for a highly available database in a
# two-node primary/standby configuration. Most database
# client programs are state-dependent, and require
#restart following a node failure. This example provides
# user notification and application shutdown during
# appropriate topology changes.
#
#############################################################################
##############################################################################
# Grab Parameters Passed
##############################################################################
EVENT=$1 # action, one of {join, fail, swap}
INTERFACE=$2 # target address label
102 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
CLUSTERNAME="cluster1" # cluster name
NODENAME="victor"# primary node name
WATCHIF="svc_en0"# interface to monitor
##############################################################################
# Name: _arp_flush
# This function flushes the entire arp cache.
# Arguments: none
# Return value: none
##############################################################################
_arp_flush()
{
for IPADDR in $(/etc/arp -a |/bin/sed -e 's/^.*(.*).*$//' -e /incomplete/d)
do
/etc/arp -d $IPADDR
done
}
##############################################################################
#
# Name: _kill_user_procs
#
# This function kills user processes associated with the specified
# interface.
#
# Arguments: interface
# Return value: none
##############################################################################
_kill_user_procs()
{
print _kill_user_procs
# place commands appropriate to the database in use here
}
# The main if statement disregards status changes for all interfaces except
# WATCHIF, which in this example is svc_en0.
if [[ "$INTERFACE" = "WATCHIF" ]]
then
case "$EVENT" in
"join") # interface label $INTERFACE has joined the cluster
# perform necessary activity here, such as user notification, restoration of
# user access, and arp cache flushing.
exit 0
;;
case "$CLSTAT_RETURN" in
0) # Node UP
# Notify users of application availability
wall "Primary database is now available."
# flush arp cache
_arp_flush
;;
1) # Node DOWN
# Notify users of topology change and restart requirement
touch /etc/nologin # prevent new logins
wall "Primary database node failure. Please login again
2 minutes"
sleep 10
# Kill all processes attached to WATCHIF interface
_kill_user_procs $WATCHIF
# flush arp cache
_ arp_flush
rm -f /etc/nologin # enable logins
;;
/*
* Program: cl_status.c
*
* Purpose: For systems running the clinfo daemon as a client, cl_status
* will determine if the node for the network interface passed
* to it is active in the cluster.
*
* Usage: [path/]cl_status clustername nodename
*
* Returns: 0 = Node up
* 1 = Node down
* 2 = ERROR - Status Unavailable
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <cluster/clinfo.h>
#include <strings.h>
void usage()
{
printf("usage: cl_status clustername nodename");
printf("Returns status of node in PowerHA SystemMirror cluster.");
}
int main(int argc, char *argv[])
{
int clusterid, node_status;
char *clustername, *nodename;
if(argc < 3)
{
/* incorrect syntax to cl_status call */
usage();
exit(2);
}
clustername = strdup(argv[1]);
if (strlen(clustername) > CL_MAXNAMELEN)
{
printf("error: clustername exceeds maximum length of %i characters",
CL_MAXNAMELEN);
exit(2);
}
nodename = strdup(argv[2]);
if (strlen(nodename) > CL_MAXNAMELEN)
{
printf("error: nodename exceeds maximum length of %i characters",
CL_MAXNAMELEN);
exit(2);
}
/* convert clustername (string) to clusterid (non-negative integer) */
clusterid = cl_getclusterid(clustername);
switch(clusterid)
{
case CLE_SYSERR: perror("system error");
exit(5);
break;
case CLE_BADARGS:
case CLE_IVCLUSTERNAME: /* typically a usage error */
cl_perror(clusterid, "error");
usage();
104 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
exit(2);
default:
cl_perror(node_status, "node unavailable");
exit(1);
}
}
Implementation specifics
There are two key components to Clinfo: the clinfo daemon and the API library.
The clinfo daemon is an SNMP-based monitor. SNMP is a industry-wide set of standards for monitoring
and managing TCP/IP-based networks. SNMP includes a protocol, a database specification, and sets of
data objects.
The sets of data objects form a Management Information Base (MIB). SNMP provides a standard MIB that
includes information such as IP addresses and the number of active TCP connections. The actual MIB
definitions are encoded into the agents running on a system. The standard SNMP agent in AIX is the SNMP
daemon, snmpd.
Programmers use SNMP operations to implement programs that will monitor and manage networks.
These programs can receive information about the state of a network from snmpd, and pass the
information on to clients and applications.
SNMP can be extended using the SNMP Multiplexing (SMUX) protocol to include enterprise-specific MIBs
that contain information relating to a discrete environment or application. A management agent (a SMUX
peer daemon) retrieves and maintains information about the objects defined in its MIB, and makes this
information available to a specialized network monitor or network management station.
The PowerHA SystemMirror software provides this SMUX peer function through the Cluster manager
daemon. The clinfo daemon retrieves this information from the PowerHA SystemMirror MIB (and
indirectly) through the Cluster Manager.
The Clinfo API library (in all its variations) interacts with the clinfo daemon to provide access to the
cluster information. Although the same information is available directly through SNMP, the Clinfo library
provides a greatly simplified programming model allowing client programs to avoid the complexities of the
SNMP API. The Clinfo API provides routines to retrieve all information related to cluster entities like nodes
or resource groups (SNMP requires you to fetch these items one at a time) and routines to register for
specific cluster events (SNMP requires traps to implement similar function). Variations of the library—C,
C++, thread safe, and so forth—provide a consistent model for a variety of runtime environments.
The clinfo daemon and library can run on PowerHA SystemMirror cluster nodes or on a non-cluster node,
provided the daemon can access SNMP on a cluster node through TCP/IP.
For Clinfo to work as expected, the clhosts file must contain the IP addresses of all PowerHA
SystemMirror server and client nodes to which Clinfo can communicate. The Clinfo daemon retrieves
its information through SNMP from an PowerHA SystemMirror server node - a node on which the Cluster
Manager daemon (clstrmgr) is running. During startup, the clinfo daemon reads in the clhosts file to
determine which nodes can communicate through SNMP as follows:
• For clinfo daemons running on the same server as the clstrmgr daemon, it reads in the local server-
based /usr/es/sbin/cluster/etc/clhosts file, which only contains the IP address associated with the
loopback address.
106 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
• For clinfo daemons running on client nodes, that is, nodes on which the clstrmgr daemon is not
running, for highest availability, the client-based /usr/es/sbin/cluster/etc/clhosts file should contain
the IP addresses of all of the PowerHA SystemMirror server nodes. In this way, if a particular PowerHA
SystemMirror server node is unavailable (for example, powered off), then the clinfo daemon on the
client node can attempt to connect to another PowerHA SystemMirror server node through SNMP.
If Clinfo does not succeed in communicating with a local SNMP process at startup, it does not get the
cluster map and therefore cannot try to connect to another SNMP process.
Related information
Concepts and facilities guide
For license inquiries regarding double-byte character set (DBCS) information, contact the IBM Intellectual
Property Department in your country or send inquiries, in writing, to:
Such information may be available, subject to appropriate terms and conditions, including in some cases,
payment of a fee.
Portions of this code are derived from IBM Corp. Sample Programs.
© Copyright IBM Corp. _enter the year or years_.
110 Notices
For more information about the use of various technologies, including cookies, for these purposes,
see IBM’s Privacy Policy at http://www.ibm.com/privacy and IBM’s Online Privacy Statement at http://
www.ibm.com/privacy/details the section entitled “Cookies, Web Beacons and Other Technologies”
and the “IBM Software Products and Software-as-a-Service Privacy Statement” at http://www.ibm.com/
software/info/product-privacy.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the web at
Copyright and trademark information at www.ibm.com/legal/copytrade.shtml.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Notices 111
112 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Index
Index 113
cl_getnodenamebyifname routine (continued) cl_unregistereventnotify routine
Clinfo C API 54 Clinfo C API 67
cl_getprimary routine Clinfo
Clinfo C API 55 clstrmgr 105
cl_getsite routine Cluster Manager 105
Clinfo C API 56 sample client program 102
cl_getsitebyname routine SNMP 107
Clinfo C API 57 Clinfo C 17
cl_getsitebypriority routine Clinfo C API
Clinfo C API 58 cl_alloc_clustermap routine 23
cl_getsitemap routine cl_alloc_groupmap routine 23
Clinfo C API 58 cl_alloc_netmap routine 24
CL_group::CL_getinfo routine cl_alloc_netmap6 routine 25
Clinfo C++ API 80, 84 cl_alloc_nodemap routine 25
cl_initialize routine cl_alloc_nodemap6 routine 26
Clinfo C API 21 cl_alloc_sitemap routine 26
cl_isaddravail routine cl_bestroute routine 27
Clinfo C API 59 cl_bestroute6 routine 28
cl_isaddravail6 routine cl_free_clustermap routine 29
Clinfo C API 60 cl_free_groupmap routine 29
cl_isclusteravail routine cl_free_netmap routine 29
Clinfo C API 61 cl_free_netmap6 routine 30
cl_isnodeavail routine cl_free_nodemap routine 30
Clinfo C API 62 cl_free_sitemap routine 31
cl_model_release routine cl_getcluster routine 31
Clinfo C API 62 cl_getclusterid routine 32
CL_netif::CL_getclusterid routine cl_getclusteridbyifaddr routine 33
Clinfo C++ API 85 cl_getclusteridbyifaddr6 routine 34
CL_netif::CL_getclusterid6 routine cl_getclusteridbyifname routine 34
Clinfo C++ API 86 cl_getclusters routine 35
CL_netif::CL_getifaddr routine cl_getevent routine 36
Clinfo C++ API 87 cl_getgroup routine 36
CL_netif::CL_getifaddr6 routine cl_getgroupmap routine 37
Clinfo C++ API 88 cl_getgroupnodestate routine 39
CL_netif::CL_getifname routine cl_getgroupsbynode routine 39
Clinfo C++ API 89 cl_getifaddr routine 40
CL_netif::CL_getifname6 routine cl_getifaddr6 routine 41
Clinfo C++ API 90 cl_getifname routine 42
CL_netif::CL_getnodeaddr routine cl_getifname6 routine 43
Clinfo C++ API 92 cl_getlocalid routine 43
CL_netif::CL_getnodeaddr6 routine cl_getnet routine 44
Clinfo C++ API 93 cl_getnetbyname routine 45
CL_netif::CL_getnodenamebyif routine cl_getnetmap routine 46
Clinfo C++ API 94 cl_getnetsbyattr routine 47
CL_netif::CL_getnodenamebyif6 routine cl_getnetsbytype routine 48
Clinfo C++ API 95 cl_getnetstatebynode routine 49
CL_netif::CL_isavail routine cl_getnode routine 50
Clinfo C++ API 96 cl_getnodeaddr routine 50
CL_netif::CL_isavail6 routine cl_getnodeaddr6 routine 51
Clinfo C++ API 97 cl_getnodemap routine 52
cl_node_free routine cl_getnodenamebyifaddr routine 53
Clinfo C API 62 cl_getnodenamebyifaddr6 routine 54
CL_node::CL_bestroute routine cl_getnodenamebyifname routine 54
Clinfo C++ API 98 cl_getprimary routine 55
CL_node::CL_bestroute6 routine cl_getsite routine 56
Clinfo C++ API 99 cl_getsitebyname routine 57
CL_node::CL_getinfo routine cl_getsitebypriority routine 58
Clinfo C++ API 100 cl_getsitemap routine 58
CL_node::CL_isavail routine cl_isaddravail routine 59
Clinfo C++ API 101 cl_isaddravail6 routine 60
cl_perror routine cl_isclusteravail routine 61
Clinfo C API 22 cl_isnodeavail routine 62
cl_registereventnotify routine cl_model_release routine 62
Clinfo C API 63 cl_node_free routine 62
114 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
Clinfo C API (continued) E
cl_registereventnotify routine 63
cl_unregistereventnotify routine 67 events
compiler 10 tracked by Clinfo 2
constants 10
data structures 11
data types 11
H
header files 10 header files
utilities Clinfo C API 10
cl_errmsg routine 21 Clinfo C++ API 68
cl_errmsg_r routine 21
cl_initialize routine 21
cl_perror routine 22 L
Clinfo C++
libcl_r.a 10
object class 70
libcl.a 10
Clinfo C++ API
libclpp_r.a 69
CL_cluster::CL_getallinfo routine 76, 78
libclpp.a 69
CL_cluster::CL_getclusterid routine 79
libraries
CL_cluster::CL_getgroupinfo routine 83
Clinfo C 10
CL_cluster::CL_getprimary routine 81
Clinfo C++ 69
CL_cluster::CL_isavail routine 82
CL_getlocalid routine 77
CL_group::CL_getinfo routine 80, 84 M
CL_netif::CL_getclusterid routine 85, 86
CL_netif::CL_getifaddr routine 87, 88 memory allocation
CL_netif::CL_getifname routine 89, 90 Clinfo C 17
CL_netif::CL_getnodeaddr routine 92, 93
CL_netif::CL_getnodenamebyif routine 94, 95 N
CL_netif::CL_isavail routine 96, 97
CL_node::CL_bestroute routine 98, 99 network interfaces
CL_node::CL_getinfo routine 100 active node ID 5
CL_node::CL_isavail routine 101 address 5
constants 69 ID 5
data structures 70 name 5
data types 70 role 5
header files 68 state 5
clstrmgr node information
Clinfo 105 tracked by Clinfo 3
cluster
ID 3
information 3 O
name 3 object class
network Clinfo C++ 70
tracked by Clinfo 7
site
tracked by Clinfo 8 R
state 3
substate 3 resource group
Cluster Manager tracked by Clinfo 6
Clinfo 105
constants S
Clinfo C API 10
Clinfo C++ API 69 SNMP
Clinfo 107
D
data structures
Clinfo C API 11
Clinfo C++ API 70
data types
Clinfo C API 11
Clinfo C++ API 70
Index 115
116 IBM PowerHA SystemMirror for AIX Standard Edition Version 7.2: Programming client applications for
PowerHA SystemMirror
IBM®