OpenClovis Logo

clClmTmsCommon.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : gms
21  * File : clClmTmsCommon.h
22  ******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *
27  * This is the viewer API for the Group Membership Service (GMS). It allows
28  * query and asynhronous tracking of GMS groups. It does not provide for
29  * managing groups (creating, deleteing, joining, leaving). For that purpose
30  * separate additional API components are provided.
31  *
32  * There are two types of GMS groups covered by this service:
33  *
34  * - Cluster membership service -- A special type of group membership, where
35  * the members are the [compuing] nodes (processors) in the cluster.
36  *
37  * - Generalized component (or process) groups -- these are groups of
38  * arbitrary software components, running on the various nodes in the
39  * cluster. These components are commonly referred as group members.
40  *
41  * This API is provided by the GMS client library that can be linked to
42  * the application (directly or as part of the EO client environment).
43  *
44  * This API provides a superset of the SA Forum Cluster Membership (CLM)
45  * API, as specified in its B.01.01 version. A separate, SA Forum compliant
46  * API is provided also, as a separate header file supported by a separate
47  * set of API functions.
48  *
49  *
50  ******************************************************************************/
51 
52 
53 /******************************************************************************/
54 /****************************** GMS APIs **************************************/
55 /******************************************************************************/
56 /* */
57 /* clGmsInitialize */
58 /* clGmsFinalize */
59 /* clGmsClusterTrack */
60 /* clGmsClusterTrackStop */
61 /* clGmsClusterMemberGet */
62 /* clGmsClusterMemberGetAsync */
63 /* clGmsGroupTrack */
64 /* clGmsGroupTrackStop */
65 /* clGmsGetGroupInfo */
66 /* clGmsGroupsInfoListGet */
67 /* */
68 /******************************************************************************/
69 
84 #ifndef _CL_CLM_TMS_COMMON_H
85 #define _CL_CLM_TMS_COMMON_H
86 
87 # ifdef __cplusplus
88 extern "C" {
89 # endif
90 
91 #include <clCommon.h>
92 #include <clIocApi.h>
93 
94 /*******************************************************************************
95  * MACROS
96  ******************************************************************************/
97 
101 #define CL_GMS_MAX_ADDRESS_LENGTH 64
102 
106 #define CL_GMS_LOCAL_NODE_ID 0XFFFFFFFF
107 
111 #define CL_GMS_INVALID_HANDLE ((ClGmsHandleT)0)
112 
116 #define CL_GMS_INVALID_NODE_ID 0xffffffff
117 
121 #define CL_GMS_INELIGIBLE_CREDENTIALS 0x0
122 
126 #define CL_GMS_INVALID_GROUP_ID -1
127 
128 /*******************************************************************************
129  * TYPE DEFINITIONS
130  ******************************************************************************/
137 typedef ClHandleT ClGmsHandleT;
138 
139 
143 typedef ClUint32T ClGmsNodeIdT;
144 
145 
150 typedef ClUint32T ClGmsLeadershipCredentialsT;
151 
152 
162 
168 
169 
173 typedef enum ClGmsTrackFlagsT {
178 
184 
190 
191 
196 typedef enum ClGmsClusterChangesT {
201 
206 
211 
217 
218 
222 typedef struct ClGmsNodeAddressT {
228 
232  ClUint16T length;
233 
239 
240 
244 typedef struct ClGmsClusterMemberT {
248  ClGmsNodeIdT nodeId __attribute__((__aligned__(8)));
249 
253  ClIocAddressT nodeAddress __attribute__((__aligned__(8)));
254 
258  ClGmsNodeAddressT nodeIpAddress __attribute__((__aligned__(8)));
259 
263  ClNameT nodeName __attribute__((__aligned__(8)));
264 
269  ClBoolT memberActive __attribute__((__aligned__(8)));
270 
274  ClTimeT bootTimestamp __attribute__((__aligned__(8)));
275 
279  ClUint64T initialViewNumber __attribute__((__aligned__(8)));
280 
288  ClGmsLeadershipCredentialsT credential __attribute__((__aligned__(8)));
289 
293  ClBoolT isCurrentLeader __attribute__((__aligned__(8)));
294 
298  ClBoolT isPreferredLeader __attribute__((__aligned__(8)));
299 
304  ClBoolT leaderPreferenceSet __attribute__((__aligned__(8)));
305 
311  ClVersionT gmsVersion __attribute__((__aligned__(8)));
312 
313 } ClGmsClusterMemberT __attribute__((__aligned__(8)));
314 
315 
324  ClGmsClusterMemberT clusterNode __attribute__((__aligned__(8)));
325 
330 
331 } ClGmsClusterNotificationT __attribute__((__aligned__(8)));
332 
333 
341  ClUint64T viewNumber __attribute__((__aligned__(8)));
342 
346  ClUint32T numberOfItems;
347 
352 
356  ClGmsNodeIdT leader;
357 
361  ClGmsNodeIdT deputy;
362 
367 
369 
370 
375 
376 
380 typedef ClUint32T ClGmsGroupIdT;
381 
388 
392 typedef ClUint32T ClGmsMemberIdT;
393 
394 
402 typedef struct ClGmsGroupParamsT {
403  /* Specifies if the group needs to create IOC multicast address
404  */
405  ClBoolT isIocGroup;
406 
407  /* for future implementations
408  */
409  char unused [256];
411 
412 
416 typedef struct ClGmsGroupMemberT {
420  ClGmsHandleT handle __attribute__((__aligned__(8)));
424  ClGmsMemberIdT memberId __attribute__((__aligned__(8)));
425 
429  ClIocAddressT memberAddress __attribute__((__aligned__(8)));
430 
434  ClGmsMemberNameT memberName __attribute__((__aligned__(8)));
435 
439  ClBoolT memberActive __attribute__((__aligned__(8)));
440 
444  ClTimeT joinTimestamp __attribute__((__aligned__(8)));
445 
449  ClUint64T initialViewNumber __attribute__((__aligned__(8)));
450 
455  ClGmsLeadershipCredentialsT credential __attribute__((__aligned__(8)));
456 
457 } ClGmsGroupMemberT __attribute__((__aligned__(8)));
458 
459 
463 typedef enum ClGmsGroupChangesT {
468 
473 
478 
483 
489 
490 
494 typedef struct ClGmsGroupNotificationT {
498  ClGmsGroupMemberT groupMember __attribute__((__aligned__(8)));
499 
504 
506 
507 
512 
516  ClUint64T viewNumber __attribute__((__aligned__(8)));
517 
521  ClUint32T numberOfItems;
522 
527 
531  ClGmsMemberIdT leader;
532 
536  ClGmsMemberIdT deputy;
537 
542 
543 } ClGmsGroupNotificationBufferT __attribute__((__aligned__(8)));
544 
545 
549 typedef struct ClGmsGroupInfoT {
553  ClGmsGroupNameT groupName;
554 
558  ClGmsGroupIdT groupId;
559 
564 
568  ClUint32T noOfMembers;
569 
573  ClBoolT setForDelete;
574 
579 
584 
589 
591 
592 
596 typedef struct ClGmsGroupInfoListT {
600  ClUint32T noOfGroups;
601 
607 
608 
612 #define LEADER_ELECTION_ALGORITHM "LeaderElectionAlgorithm"
613 
614 /* Default boot election timeout */
615 #define CL_GMS_DEFAULT_BOOT_ELECTION_TIMEOUT 5
616 
620 typedef enum {
631 
636 ClRcT
641  ClGmsHandleT clmHandle,
646  ClSelectionObjectT *pSelectionObject
647  );
648 
652 ClRcT
657  ClGmsHandleT clmHandle,
661  ClDispatchFlagsT dispatchFlags
662  );
663 
664 /*
665  * Funtion called by CPM when the event component comes up
666  */
667 ClRcT clGmsCompUpNotify (
668  ClUint32T compId);
669 
670 /******************************************************************************
671  * Callback Functions:
672  *****************************************************************************/
702 typedef void (*ClGmsClusterTrackCallbackT) (
703  CL_IN const ClGmsClusterNotificationBufferT *notificationBuffer,
704  CL_IN ClUint32T numberOfMembers,
705  CL_IN ClRcT rc);
706 
707 
734  CL_IN ClInvocationT invocation,
735  CL_IN const ClGmsClusterMemberT *clusterMember,
736  CL_IN ClRcT rc);
737 
738 
769 typedef void (*ClGmsGroupTrackCallbackT) (
770  CL_IN ClGmsGroupIdT groupId,
771  CL_IN const ClGmsGroupNotificationBufferT *notificationBuffer,
772  CL_IN ClUint32T numberOfMembers,
773  CL_IN ClRcT rc);
774 
775 
802  CL_IN ClInvocationT invocation,
803  CL_IN const ClGmsGroupMemberT *groupMember,
804  CL_IN ClRcT rc);
805 
806 
810 typedef struct ClGmsCallbacksT {
818 
829 
840 
849 
850 
851 /******************************************************************************
852  * API FUNCTION DECLARATIONS:
853  *****************************************************************************/
854 
898 extern ClRcT clGmsInitialize(
899  CL_OUT ClGmsHandleT *gmsHandle,
900  CL_IN const ClGmsCallbacksT *gmsCallbacks,
901  CL_INOUT ClVersionT *version);
902 
903 
942 extern ClRcT clGmsFinalize(
943  CL_IN ClGmsHandleT gmsHandle);
944 
986 extern ClRcT clGmsClusterTrack(
987  CL_IN ClGmsHandleT gmsHandle,
988  CL_IN ClUint8T trackFlags,
989  CL_INOUT ClGmsClusterNotificationBufferT *notificationBuffer);
990 
1016  CL_IN ClGmsHandleT gmsHandle);
1017 
1060  CL_IN ClGmsHandleT gmsHandle,
1061  CL_IN ClGmsNodeIdT nodeId,
1062  CL_IN ClTimeT timeout,
1063  CL_OUT ClGmsClusterMemberT *clusterMember);
1064 
1104  CL_IN ClGmsHandleT gmsHandle,
1105  CL_IN ClInvocationT invocation,
1106  CL_IN ClGmsNodeIdT nodeId);
1107 
1108 
1109 #ifdef __cplusplus
1110 }
1111 #endif
1112 
1113 #endif /* _CL_CLM_TMS_COMMON_H */
1114 
1115 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen