Allow libconfdb to run standalone (without aisexec)
[openais.git] / include / saAmf.h
blob7ae2a756da327278d5f0cb0c70fbee33c2dab24f
1 /*
2 * Copyright (c) 2002-2003 MontaVista Software, Inc.
4 * All rights reserved.
6 * Author: Steven Dake (sdake@mvista.com)
8 * This software licensed under BSD license, the text of which follows:
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
13 * - Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * - Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * - Neither the name of the MontaVista Software, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived from this
20 * software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 * THE POSSIBILITY OF SUCH DAMAGE.
35 #ifndef AIS_AMF_H_DEFINED
36 #define AIS_AMF_H_DEFINED
38 #include "saAis.h"
40 typedef SaUint64T SaAmfHandleT;
42 #define SA_AMF_PM_ZERO_EXIT 0x1
43 #define SA_AMF_PM_NON_ZERO_EXIT 0x2
44 #define SA_AMF_PM_ABNORMAL_END 0x4
45 #define SA_AMF_PM_ALL_ERRORS (SA_AMF_PM_ZERO_EXIT | SA_AMF_PM_NON_ZERO_EXIT | SA_AMF_PM_ABNORMAL_END)
47 typedef SaUint32T SaAmfPmErrorsT;
49 typedef enum {
50 SA_AMF_PM_PROC = 1,
51 SA_AMF_PM_PROC_AND_DESCENDENTS = 2,
52 SA_AMF_PM_ALL_PROCESSES =3
53 } SaAmfPmStopQualifierT;
55 typedef enum {
56 SA_AMF_HEALTHCHECK_AMF_INVOKED = 1,
57 SA_AMF_HEALTHCHECK_COMPONENT_INVOKED =2
58 } SaAmfHealthcheckInvocationT;
60 #define SA_AMF_HEALTHCHECK_KEY_MAX 32
61 typedef struct {
62 SaUint8T key[SA_AMF_HEALTHCHECK_KEY_MAX];
63 SaUint16T keyLen;
64 } SaAmfHealthcheckKeyT;
66 typedef enum {
67 SA_AMF_HA_ACTIVE = 1,
68 SA_AMF_HA_STANDBY = 2,
69 SA_AMF_HA_QUIESCED = 3,
70 SA_AMF_HA_QUIESCING = 4
71 } SaAmfHAStateT;
73 typedef enum {
74 SA_AMF_READINESS_OUT_OF_SERVICE = 1,
75 SA_AMF_READINESS_IN_SERVICE = 2,
76 SA_AMF_READINESS_STOPPING = 3
77 } SaAmfReadinessStateT;
79 typedef enum {
80 SA_AMF_PRESENCE_UNINSTANTIATED = 1,
81 SA_AMF_PRESENCE_INSTANTIATING = 2,
82 SA_AMF_PRESENCE_INSTANTIATED = 3,
83 SA_AMF_PRESENCE_TERMINATING = 4,
84 SA_AMF_PRESENCE_RESTARTING = 5,
85 SA_AMF_PRESENCE_INSTANTIATION_FAILED = 6,
86 SA_AMF_PRESENCE_TERMINATION_FAILED = 7
87 } SaAmfPresenceStateT;
89 typedef enum {
90 SA_AMF_OPERATIONAL_ENABLED = 1,
91 SA_AMF_OPERATIONAL_DISABLED = 2
92 } SaAmfOperationalStateT;
94 typedef enum {
95 SA_AMF_ADMIN_UNLOCKED = 1,
96 SA_AMF_ADMIN_LOCKED = 2,
97 SA_AMF_ADMIN_LOCKED_INSTANTIATION = 3,
98 SA_AMF_ADMIN_SHUTTING_DOWN = 4
99 } SaAmfAdminStateT;
101 typedef enum {
102 SA_AMF_ASSIGNMENT_UNASSIGNED = 1,
103 SA_AMF_ASSIGNMENT_FULLY_ASSIGNED = 2,
104 SA_AMF_ASSIGNMENT_PARTIALLY_ASSIGNED = 3
105 } SaAmfAssignmentStateT;
107 typedef enum {
108 SA_AMF_PROXY_STATUS_UNPROXIED = 1,
109 SA_AMF_PROXY_STATUS_PROXIED = 2
110 } SaAmfProxyStatusT;
112 typedef enum {
113 SA_AMF_READINESS_STATE = 1,
114 SA_AMF_HA_STATE = 2,
115 SA_AMF_PRESENCE_STATE = 3,
116 SA_AMF_OP_STATE = 4,
117 SA_AMF_ADMIN_STATE = 5,
118 SA_AMF_ASSIGNMENT_STATE = 6,
119 SA_AMF_PROXY_STATUS = 7
120 } SaAmfStateT;
122 #define SA_AMF_CSI_ADD_ONE 0x1
123 #define SA_AMF_CSI_TARGET_ONE 0x2
124 #define SA_AMF_CSI_TARGET_ALL 0x4
126 typedef SaUint32T SaAmfCSIFlagsT;
129 typedef enum {
130 SA_AMF_CSI_NEW_ASSIGN = 1,
131 SA_AMF_CSI_QUIESCED = 2,
132 SA_AMF_CSI_NOT_QUIESCED = 3,
133 SA_AMF_CSI_STILL_ACTIVE = 4,
134 } SaAmfCSITransitionDescriptorT;
136 typedef struct {
137 SaAmfCSITransitionDescriptorT transitionDescriptor;
138 SaNameT activeCompName;
139 } SaAmfCSIActiveDescriptorT;
141 typedef struct {
142 SaNameT activeCompName;
143 SaUint32T standbyRank;
144 } SaAmfCSIStandbyDescriptorT;
146 typedef union {
147 SaAmfCSIActiveDescriptorT activeDescriptor;
148 SaAmfCSIStandbyDescriptorT standbyDescriptor;
149 } SaAmfCSIStateDescriptorT;
151 typedef struct {
152 SaUint8T *attrName;
153 SaUint8T *attrValue;
155 } SaAmfCSIAttributeT;
157 typedef struct {
158 SaAmfCSIAttributeT *attr;
159 SaUint32T number;
160 } SaAmfCSIAttributeListT;
162 typedef struct {
163 SaAmfCSIFlagsT csiFlags;
164 SaNameT csiName;
165 SaAmfCSIStateDescriptorT csiStateDescriptor;
166 SaAmfCSIAttributeListT csiAttr;
167 } SaAmfCSIDescriptorT;
169 typedef struct {
170 SaNameT compName;
171 SaAmfHAStateT haState;
172 SaUint32T rank;
173 } SaAmfProtectionGroupMemberT;
176 typedef enum {
177 SA_AMF_PROTECTION_GROUP_NO_CHANGE = 1,
178 SA_AMF_PROTECTION_GROUP_ADDED = 2,
179 SA_AMF_PROTECTION_GROUP_REMOVED = 3,
180 SA_AMF_PROTECTION_GROUP_STATE_CHANGE = 4
181 } SaAmfProtectionGroupChangesT;
184 typedef struct {
185 SaAmfProtectionGroupMemberT member;
186 SaAmfProtectionGroupChangesT change;
187 } SaAmfProtectionGroupNotificationT;
189 typedef struct {
190 SaUint32T numberOfItems;
191 SaAmfProtectionGroupNotificationT *notification;
192 } SaAmfProtectionGroupNotificationBufferT;
194 typedef enum {
195 SA_AMF_NO_RECOMMENDATION = 1,
196 SA_AMF_COMPONENT_RESTART = 2,
197 SA_AMF_COMPONENT_FAILOVER = 3,
198 SA_AMF_NODE_SWITCHOVER = 4,
199 SA_AMF_NODE_FAILOVER = 5,
200 SA_AMF_NODE_FAILFAST = 6,
201 SA_AMF_CLUSTER_RESET = 7,
202 SA_AMF_APPLICATION_RESTART = 8
203 } SaAmfRecommendedRecoveryT;
205 #define SA_AMF_COMP_SA_AWARE 0x0001
206 #define SA_AMF_COMP_PROXY 0x0002
207 #define SA_AMF_COMP_PROXIED 0x0004
208 #define SA_AMF_COMP_LOCAL 0x0008
209 typedef SaUint32T saAmfCompCategoryT;
211 typedef enum {
212 SA_AMF_2N_REDUNDANCY_MODEL = 1,
213 SA_AMF_NPM_REDUNDANCY_MODEL = 2,
214 SA_AMF_N_WAY_REDUNDANCY_MODEL = 3,
215 SA_AMF_N_WAY_ACTIVE_REDUNDACY_MODEL = 4,
216 SA_AMF_NO_REDUNDANCY_MODEL= 5
217 } saAmfRedundancyModelT;
219 typedef enum {
220 SA_AMF_COMP_X_ACTIVE_AND_Y_STANDBY = 1,
221 SA_AMF_COMP_X_ACTIVE_OR_Y_STANDBY = 2,
222 SA_AMF_COMP_ONE_ACTIVE_OR_Y_STANDBY = 3,
223 SA_AMF_COMP_ONE_ACTIVE_OR_ONE_STANDBY = 4,
224 SA_AMF_COMP_X_ACTIVE = 5,
225 SA_AMF_COMP_1_ACTIVE = 6,
226 SA_AMF_COMP_NON_PRE_INSTANTIABLE = 7
227 } saAmfCompCapabilityModelT;
229 typedef enum {
230 SA_AMF_NODE_NAME = 1,
231 SA_AMF_SI_NAME = 2
232 } SaAmfAdditionalInfoIdT;
234 typedef void (*SaAmfHealthcheckCallbackT) (
235 SaInvocationT invocation,
236 const SaNameT *compName,
237 SaAmfHealthcheckKeyT *healthcheckKey);
239 typedef void (*SaAmfComponentTerminateCallbackT) (
240 SaInvocationT invocation,
241 const SaNameT *compName);
243 typedef void (*SaAmfCSISetCallbackT) (
244 SaInvocationT invocation,
245 const SaNameT *compName,
246 SaAmfHAStateT haState,
247 SaAmfCSIDescriptorT *csiDescriptor);
249 typedef void (*SaAmfCSIRemoveCallbackT) (
250 SaInvocationT invocation,
251 const SaNameT *compName,
252 const SaNameT *csiName,
253 SaAmfCSIFlagsT csiFlags);
255 typedef void (*SaAmfExternalComponentInstantiateCallbackT) (
256 SaInvocationT invocation,
257 const SaNameT *proxiedCompName);
259 typedef void (*SaAmfExternalComponentCleanupCallbackT) (
260 SaInvocationT invocation,
261 const SaNameT *proxiedCompName);
263 typedef void (*SaAmfProtectionGroupTrackCallbackT) (
264 const SaNameT *csiName,
265 SaAmfProtectionGroupNotificationBufferT *notificationBuffer,
266 SaUint32T numberOfMembers,
267 SaAisErrorT error);
269 typedef struct {
270 SaAmfHealthcheckCallbackT
271 saAmfHealthcheckCallback;
272 SaAmfComponentTerminateCallbackT
273 saAmfComponentTerminateCallback;
274 SaAmfCSISetCallbackT
275 saAmfCSISetCallback;
276 SaAmfCSIRemoveCallbackT
277 saAmfCSIRemoveCallback;
278 SaAmfProtectionGroupTrackCallbackT
279 saAmfProtectionGroupTrackCallback;
280 SaAmfExternalComponentInstantiateCallbackT
281 saAmfExternalComponentInstantiateCallback;
282 SaAmfExternalComponentCleanupCallbackT
283 saAmfExternalComponentCleanupCallback;
284 } SaAmfCallbacksT;
287 * Interfaces
289 #ifdef __cplusplus
290 extern "C" {
291 #endif
293 SaAisErrorT
294 saAmfInitialize (
295 SaAmfHandleT *amfHandle,
296 const SaAmfCallbacksT *amfCallbacks,
297 SaVersionT *version);
299 SaAisErrorT
300 saAmfSelectionObjectGet (
301 SaAmfHandleT amfHandle,
302 SaSelectionObjectT *selectionObject);
304 SaAisErrorT
305 saAmfDispatch (
306 SaAmfHandleT amfHandle,
307 SaDispatchFlagsT dispatchFlags);
309 SaAisErrorT
310 saAmfFinalize (
311 SaAmfHandleT amfHandle);
313 SaAisErrorT
314 saAmfComponentRegister (
315 SaAmfHandleT amfHandle,
316 const SaNameT *compName,
317 const SaNameT *proxyCompName);
319 SaAisErrorT
320 saAmfComponentUnregister (
321 SaAmfHandleT amfHandle,
322 const SaNameT *compName,
323 const SaNameT *proxyCompName);
325 SaAisErrorT
326 saAmfComponentNameGet (
327 SaAmfHandleT amfHandle,
328 SaNameT *compName);
330 SaAisErrorT
331 saAmfPmStart (
332 SaAmfHandleT amfHandle,
333 const SaNameT *compName,
334 SaUint64T processId,
335 SaInt32T descendentsTreeDepth,
336 SaAmfPmErrorsT pmErrors,
337 SaAmfRecommendedRecoveryT recommendedRecovery);
339 SaAisErrorT
340 saAmfPmStop (
341 SaAmfHandleT amfHandle,
342 const SaNameT *compName,
343 SaAmfPmStopQualifierT stopQualifier,
344 SaInt64T processId,
345 SaAmfPmErrorsT pmErrors);
347 SaAisErrorT
348 saAmfHealthcheckStart (
349 SaAmfHandleT amfHandle,
350 const SaNameT *compName,
351 const SaAmfHealthcheckKeyT *healthcheckKey,
352 SaAmfHealthcheckInvocationT invocationType,
353 SaAmfRecommendedRecoveryT recommendedRecovery);
355 SaAisErrorT
356 saAmfHealthcheckConfirm (
357 SaAmfHandleT amfHandle,
358 const SaNameT *compName,
359 const SaAmfHealthcheckKeyT *healthcheckKey,
360 SaAisErrorT healthcheckResult);
362 SaAisErrorT
363 saAmfHealthcheckStop (
364 SaAmfHandleT amfHandle,
365 const SaNameT *compName,
366 const SaAmfHealthcheckKeyT *healthcheckKey);
368 SaAisErrorT
369 saAmfHAStateGet (
370 SaAmfHandleT amfHandle,
371 const SaNameT *compName,
372 const SaNameT *csiName,
373 SaAmfHAStateT *haState);
376 SaAisErrorT
377 saAmfCSIQuiescingComplete(
378 SaAmfHandleT amfHandle,
379 SaInvocationT invocation,
380 SaAisErrorT error);
382 SaAisErrorT
383 saAmfProtectionGroupTrack (
384 SaAmfHandleT amfHandle,
385 const SaNameT *csiName,
386 SaUint8T trackFlags,
387 SaAmfProtectionGroupNotificationBufferT *notificationBuffer);
389 SaAisErrorT
390 saAmfProtectionGroupTrackStop (
391 SaAmfHandleT amfHandle,
392 const SaNameT *csiName);
394 SaAisErrorT
395 saAmfComponentErrorReport (
396 SaAmfHandleT amfHandle,
397 const SaNameT *erroneousComponent,
398 SaTimeT errorDetectionTime,
399 SaAmfRecommendedRecoveryT recommendedRecovery,
400 SaNtfIdentifierT ntfIdentifier);
402 SaAisErrorT
403 saAmfComponentErrorClear (
404 SaAmfHandleT amfHandle,
405 const SaNameT *compName,
406 SaNtfIdentifierT ntfIdentifier);
409 SaAisErrorT
410 saAmfResponse (
411 SaAmfHandleT amfHandle,
412 SaInvocationT invocation,
413 SaAisErrorT error);
415 #ifdef __cplusplus
417 #endif
419 #endif /* AIS_AMF_H_DEFINED */