OpenClovis Logo

saAmf.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 /*
21 
22  Header file of SA Forum AIS AMF APIs (SAI-AIS-B.01.00.09)
23  compiled on 21SEP2004 by sayandeb.saha@motorola.com.
24 
25 */
26 
27 #ifndef _SA_AMF_H_
28 #define _SA_AMF_H_
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <saAis.h>
35 #include <saNtf.h>
36 
37 typedef SaUint64T SaAmfHandleT;
38 
39 #define SA_AMF_PM_ZERO_EXIT 0x1
40 #define SA_AMF_PM_NON_ZERO_EXIT 0x2
41 #define SA_AMF_PM_ABNORMAL_END 0x4
42 
43 typedef SaUint32T SaAmfPmErrorsT;
44 
45 typedef enum {
46  SA_AMF_PM_PROC = 1,
47  SA_AMF_PM_PROC_AND_DESCENDENTS = 2,
48  SA_AMF_PM_ALL_PROCESSES = 3
49 } SaAmfPmStopQualifierT;
50 
51 typedef enum {
52  SA_AMF_HEALTHCHECK_AMF_INVOKED = 1,
53  SA_AMF_HEALTHCHECK_COMPONENT_INVOKED= 2
54 } SaAmfHealthcheckInvocationT;
55 
56 #define SA_AMF_HEALTHCHECK_KEY_MAX 32
57 
58 typedef struct {
59  SaUint8T key[SA_AMF_HEALTHCHECK_KEY_MAX];
60  SaUint16T keyLen;
61 } SaAmfHealthcheckKeyT;
62 
63 typedef enum {
64  SA_AMF_HA_ACTIVE = 1,
65  SA_AMF_HA_STANDBY = 2,
66  SA_AMF_HA_QUIESCED = 3,
67  SA_AMF_HA_QUIESCING = 4
68 } SaAmfHAStateT;
69 
70 #define SA_AMF_CSI_ADD_ONE 0X1
71 #define SA_AMF_CSI_TARGET_ONE 0X2
72 #define SA_AMF_CSI_TARGET_ALL 0X4
73 
74 typedef SaUint32T SaAmfCSIFlagsT;
75 
76 typedef enum {
77  SA_AMF_CSI_NEW_ASSIGN = 1,
78  SA_AMF_CSI_QUIESCED = 2,
79  SA_AMF_CSI_NOT_QUIESCED = 3,
80  SA_AMF_CSI_STILL_ACTIVE = 4
81 } SaAmfCSITransitionDescriptorT;
82 
83 typedef struct {
84  SaAmfCSITransitionDescriptorT transitionDescriptor;
85  SaNameT activeCompName;
86 } SaAmfCSIActiveDescriptorT;
87 
88 typedef struct {
89  SaNameT activeCompName;
90  SaUint32T standbyRank;
91 } SaAmfCSIStandbyDescriptorT;
92 
93 typedef union {
94  SaAmfCSIActiveDescriptorT activeDescriptor;
95  SaAmfCSIStandbyDescriptorT standbyDescriptor;
96 } SaAmfCSIStateDescriptorT;
97 
98 typedef struct {
99  SaUint8T *attrName;
100  SaUint8T *attrValue;
101 } SaAmfCSIAttributeT;
102 
103 typedef struct {
104  SaAmfCSIAttributeT *attr;
105  SaUint32T number;
106 } SaAmfCSIAttributeListT;
107 
108 typedef struct {
109  SaAmfCSIFlagsT csiFlags;
110  SaNameT csiName;
111  SaAmfCSIStateDescriptorT csiStateDescriptor;
112  SaAmfCSIAttributeListT csiAttr;
113 } SaAmfCSIDescriptorT;
114 
115 typedef struct {
116  SaNameT compName;
117  SaAmfHAStateT haState;
118  SaUint32T rank;
119 } SaAmfProtectionGroupMemberT;
120 
121 typedef enum {
122  SA_AMF_PROTECTION_GROUP_NO_CHANGE = 1,
123  SA_AMF_PROTECTION_GROUP_ADDED = 2,
124  SA_AMF_PROTECTION_GROUP_REMOVED = 3,
125  SA_AMF_PROTECTION_GROUP_STATE_CHANGE = 4
126 } SaAmfProtectionGroupChangesT;
127 
128 typedef struct {
129  SaAmfProtectionGroupMemberT member;
130  SaAmfProtectionGroupChangesT change;
131 } SaAmfProtectionGroupNotificationT;
132 
133 typedef struct {
134  SaUint32T numberOfItems;
135  SaAmfProtectionGroupNotificationT *notification;
136 } SaAmfProtectionGroupNotificationBufferT;
137 
138 typedef enum {
139  SA_AMF_NO_RECOMMENDATION = 1,
140  SA_AMF_COMPONENT_RESTART = 2,
141  SA_AMF_COMPONENT_FAILOVER = 3,
142  SA_AMF_NODE_SWITCHOVER = 4,
143  SA_AMF_NODE_FAILOVER = 5,
144  SA_AMF_NODE_FAILFAST = 6,
145  SA_AMF_CLUSTER_RESET =7
146 } SaAmfRecommendedRecoveryT;
147 
148 typedef void
149 (*SaAmfHealthcheckCallbackT)(SaInvocationT invocation,
150  const SaNameT *compName,
151  SaAmfHealthcheckKeyT *healthcheckKey);
152 
153 typedef void
154 (*SaAmfComponentTerminateCallbackT)(SaInvocationT invocation,
155  const SaNameT *compName);
156 
157 typedef void
158 (*SaAmfCSISetCallbackT)(SaInvocationT invocation,
159  const SaNameT *compName,
160  SaAmfHAStateT haState,
161  SaAmfCSIDescriptorT csiDescriptor);
162 
163 typedef void
164 (*SaAmfCSIRemoveCallbackT)(SaInvocationT invocation,
165  const SaNameT *compName,
166  const SaNameT *csiName,
167  SaAmfCSIFlagsT csiFlags);
168 
169 typedef void
170 (*SaAmfProtectionGroupTrackCallbackT)(const SaNameT *csiName,
171  SaAmfProtectionGroupNotificationBufferT *notificationBuffer,
172  SaUint32T numberOfMembers,
173  SaAisErrorT error);
174 
175 typedef void
176 (*SaAmfProxiedComponentInstantiateCallbackT)(SaInvocationT invocation,
177  const SaNameT *proxiedCompName);
178 
179 typedef void
180 (*SaAmfProxiedComponentCleanupCallbackT)(SaInvocationT invocation,
181  const SaNameT *proxiedCompName);
182 
183 typedef struct {
184  SaAmfHealthcheckCallbackT saAmfHealthcheckCallback;
185  SaAmfComponentTerminateCallbackT saAmfComponentTerminateCallback;
186  SaAmfCSISetCallbackT saAmfCSISetCallback;
187  SaAmfCSIRemoveCallbackT saAmfCSIRemoveCallback;
188  SaAmfProtectionGroupTrackCallbackT saAmfProtectionGroupTrackCallback;
189  SaAmfProxiedComponentInstantiateCallbackT saAmfProxiedComponentInstantiateCallback;
190  SaAmfProxiedComponentCleanupCallbackT saAmfProxiedComponentCleanupCallback;
191 } SaAmfCallbacksT;
192 
193 
194  extern SaAisErrorT
195 saAmfInitialize(SaAmfHandleT *amfHandle, const SaAmfCallbacksT *amfCallbacks,
196  SaVersionT *version);
197  extern SaAisErrorT
198 saAmfSelectionObjectGet(SaAmfHandleT amfHandle,
199  SaSelectionObjectT *selectionObject);
200  extern SaAisErrorT
201 saAmfDispatch(SaAmfHandleT amfHandle, SaDispatchFlagsT dispatchFlags);
202  extern SaAisErrorT
203 saAmfFinalize(SaAmfHandleT amfHandle);
204 
205  extern SaAisErrorT
206 saAmfComponentRegister(SaAmfHandleT amfHandle,
207  const SaNameT *compName, const SaNameT *proxyCompName);
208  extern SaAisErrorT
209 saAmfComponentUnregister(SaAmfHandleT amfHandle,
210  const SaNameT *compName,
211  const SaNameT *proxyCompName);
212 
213  extern SaAisErrorT
214 saAmfComponentNameGet(SaAmfHandleT amfHandle, SaNameT *compName);
215 
216  extern SaAisErrorT
217 saAmfPmStart(SaAmfHandleT amfHandle,
218  const SaNameT *compName,
219  SaUint64T processId,
220  SaInt32T descendentsTreeDepth,
221  SaAmfPmErrorsT pmErrors,
222  SaAmfRecommendedRecoveryT recommendedRecovery);
223 
224  extern SaAisErrorT
225 saAmfPmStop(SaAmfHandleT amfHandle,
226  const SaNameT *compName,
227  SaAmfPmStopQualifierT stopQualifier,
228  SaInt64T processId,
229  SaAmfPmErrorsT pmErrors);
230 
231  extern SaAisErrorT
232 saAmfHealthcheckStart(SaAmfHandleT amfHandle,
233  const SaNameT *compName,
234  const SaAmfHealthcheckKeyT *healthcheckKey,
235  SaAmfHealthcheckInvocationT invocationType,
236  SaAmfRecommendedRecoveryT recommendedRecovery);
237 
238  extern SaAisErrorT
239 saAmfHealthcheckConfirm(SaAmfHandleT amfHandle,
240  const SaNameT *compName,
241  const SaAmfHealthcheckKeyT *healthcheckKey,
242  SaAisErrorT healthcheckResult);
243 
244  extern SaAisErrorT
245 saAmfHealthcheckStop(SaAmfHandleT amfHandle,
246  const SaNameT *compName,
247  const SaAmfHealthcheckKeyT *healthcheckKey);
248 
249  extern SaAisErrorT
250 saAmfCSIQuiescingComplete(SaAmfHandleT amfHandle,
251  SaInvocationT invocation,
252  SaAisErrorT error);
253 
254  extern SaAisErrorT
255 saAmfHAStateGet(SaAmfHandleT amfHandle,
256  const SaNameT *compName,
257  const SaNameT *csiName,
258  SaAmfHAStateT *haState);
259 
260  extern SaAisErrorT
261 saAmfProtectionGroupTrack(SaAmfHandleT amfHandle,
262  const SaNameT *csiName,
263  SaUint8T trackFlags,
264  SaAmfProtectionGroupNotificationBufferT *notificationBuffer);
265 
266  extern SaAisErrorT
267 saAmfProtectionGroupTrackStop(SaAmfHandleT amfHandle,
268  const SaNameT *csiName);
269 
270  extern SaAisErrorT
271 saAmfComponentErrorReport(SaAmfHandleT amfHandle,
272  const SaNameT *erroneousComponent,
273  SaTimeT errorDetectionTime,
274  SaAmfRecommendedRecoveryT recommendedRecovery,
275  SaNtfIdentifierT ntfIdentifier);
276  extern SaAisErrorT
277 saAmfComponentErrorClear(SaAmfHandleT amfHandle,
278  const SaNameT *compName,
279  SaNtfIdentifierT ntfIdentifier);
280 
281  extern SaAisErrorT
282 saAmfResponse(SaAmfHandleT amfHandle,
283  SaInvocationT invocation,
284  SaAisErrorT error);
285 
286 #ifdef __cplusplus
287 }
288 #endif
289 
290 #endif /* _SA_AMF_H_ */
291 

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