OpenClovis Logo

saClm.h
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 : saClm.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  *******************************************************************************/
27 
28 /*
29  * Copyright (c) 2002-2005 MontaVista Software, Inc.
30  *
31  * All rights reserved.
32  *
33  * Author: Steven Dake (sdake@mvista.com)
34  *
35  * This software licensed under BSD license, the text of which follows:
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions are met:
39  *
40  * - Redistributions of source code must retain the above copyright notice,
41  * this list of conditions and the following disclaimer.
42  * - Redistributions in binary form must reproduce the above copyright notice,
43  * this list of conditions and the following disclaimer in the documentation
44  * and/or other materials provided with the distribution.
45  * - Neither the name of the MontaVista Software, Inc. nor the names of its
46  * contributors may be used to endorse or promote products derived from this
47  * software without specific prior written permission.
48  *
49  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
50  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
53  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
54  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
55  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
56  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
57  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
58  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
59  * THE POSSIBILITY OF SUCH DAMAGE.
60  */
61 
62 #ifndef _SA_CLM_H_
63 #define _SA_CLM_H_
64 
65 # ifdef __cplusplus
66 extern "C" {
67 # endif
68 
69 #include "saAis.h"
70 
71 typedef SaUint64T SaClmHandleT;
72 
73 typedef SaUint32T SaClmNodeIdT;
74 
75 #define SA_CLM_LOCAL_NODE_ID 0xffffffff
76 
77 #define SA_CLM_MAX_ADDRESS_LENGTH 64
78 
79 typedef enum {
80  SA_CLM_AF_INET = 1,
81  SA_CLM_AF_INET6 = 2
82 } SaClmNodeAddressFamilyT;
83 
84 typedef struct {
85  SaClmNodeAddressFamilyT family;
86  SaUint16T length;
87  SaUint8T value[SA_CLM_MAX_ADDRESS_LENGTH];
88 } SaClmNodeAddressT;
89 
90 typedef struct {
91  SaClmNodeIdT nodeId;
92  SaClmNodeAddressT nodeAddress;
93  SaNameT nodeName;
94  SaBoolT member;
95  SaTimeT bootTimestamp __attribute__((__aligned__(8)));
96  SaUint64T initialViewNumber __attribute__((__aligned__(8)));
97 } SaClmClusterNodeT __attribute__((__aligned__(8)));
98 
99 typedef enum {
100  SA_CLM_NODE_NO_CHANGE = 1,
101  SA_CLM_NODE_JOINED = 2,
102  SA_CLM_NODE_LEFT = 3,
103  SA_CLM_NODE_RECONFIGURED = 4
104 } SaClmClusterChangesT;
105 
106 typedef struct {
107  SaClmClusterNodeT clusterNode;
108  SaClmClusterChangesT clusterChange;
109 } SaClmClusterNotificationT;
110 
111 typedef struct {
112  SaUint64T viewNumber;
113  SaUint32T numberOfItems;
114  SaClmClusterNotificationT *notification;
115 } SaClmClusterNotificationBufferT;
116 
117 typedef void (*SaClmClusterNodeGetCallbackT)(
118  SaInvocationT invocation,
119  const SaClmClusterNodeT *clusterNode,
120  SaAisErrorT error);
121 
122 typedef void (*SaClmClusterTrackCallbackT) (
123  const SaClmClusterNotificationBufferT *notificationBuffer,
124  SaUint32T numberOfMembers,
125  SaAisErrorT error);
126 
127 typedef struct {
128  SaClmClusterNodeGetCallbackT saClmClusterNodeGetCallback;
129  SaClmClusterTrackCallbackT saClmClusterTrackCallback;
130 } SaClmCallbacksT;
131 
132 
133 SaAisErrorT
134 saClmInitialize (
135  SaClmHandleT *clmHandle,
136  const SaClmCallbacksT *clmCallbacks,
137  SaVersionT *version);
138 
139 
140 SaAisErrorT
141 saClmSelectionObjectGet (
142  SaClmHandleT clmHandle,
143  SaSelectionObjectT *selectionObject);
144 
145 SaAisErrorT
146 saClmDispatch (
147  SaClmHandleT clmHandle,
148  SaDispatchFlagsT dispatchFlags);
149 
150 SaAisErrorT
151 saClmFinalize (
152  SaClmHandleT clmHandle);
153 
154 SaAisErrorT
155 saClmClusterTrack (
156  SaClmHandleT clmHandle,
157  SaUint8T trackFlags,
158  SaClmClusterNotificationBufferT *notificationBuffer);
159 
160 SaAisErrorT
161 saClmClusterTrackStop (
162  SaClmHandleT clmHandle);
163 
164 SaAisErrorT
165 saClmClusterNodeGet (
166  SaClmHandleT clmHandle,
167  SaClmNodeIdT nodeId,
168  SaTimeT timeout,
169  SaClmClusterNodeT *clusterNode);
170 
171 SaAisErrorT
172 saClmClusterNodeGetAsync (
173  SaClmHandleT clmHandle,
174  SaInvocationT invocation,
175  SaClmNodeIdT nodeId);
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif /* _SA_CLM_H_ */
182 
183 

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