OpenClovis Logo

clAmsTypes.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 : amf
21  * File : clAmsTypes.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  * This header file contains types that are exposed to AMS client, event
27  * and management API users. Some types conform to SAF specs while others
28  * are ASP proprietary.
29  ***************************** Editor Commands ********************************
30  * For vi/vim
31  * :set shiftwidth=4
32  * :set softtabstop=4
33  * :set expandtab
34  *****************************************************************************/
35 
36 #ifndef _CL_AMS_TYPES_H_
37 #define _CL_AMS_TYPES_H_
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /******************************************************************************
44  * Include files needed to compile this file
45  *****************************************************************************/
46 
47 #include <clCommon.h>
48 
49 /******************************************************************************
50  * Different types of states associated with AMS entities. Note, each AMS
51  * entity need not have all of the following states.
52  *****************************************************************************/
53 
54 /*
55  * The management state is defined for all AMS entities. It is akin to the
56  * rowStatus attribute in the AMF MIB and is exposed via the AMS management
57  * API.
58  */
59 
60 typedef enum
61 {
62  CL_AMS_MGMT_STATE_NONE = 0,
63  CL_AMS_MGMT_STATE_DISABLED = 1,
64  CL_AMS_MGMT_STATE_ENABLED = 2,
65 } ClAmsMgmtStateT;
66 
67 /*
68  * The admin state is defined for node, application, sg, su and si entities.
69  * It is exposed via the ams management api and managed by the management
70  * entities.
71  *
72  */
73 
74 typedef enum
75 {
76  CL_AMS_ADMIN_STATE_NONE = 0,
77  CL_AMS_ADMIN_STATE_UNLOCKED = 1,
78  CL_AMS_ADMIN_STATE_LOCKED_A = 2,
79  CL_AMS_ADMIN_STATE_LOCKED_I = 3,
80  CL_AMS_ADMIN_STATE_SHUTTINGDOWN = 4,
81  CL_AMS_ADMIN_STATE_MAX,
82 } ClAmsAdminStateT;
83 
84 /*
85  * The presence state is defined for node, su and component entities. It is
86  * exposed via the AMS event and management apis. Note, the SAF specs do not
87  * define presence state for node entities.
88  */
89 
90 typedef enum
91 {
92  CL_AMS_PRESENCE_STATE_NONE = 0,
93  CL_AMS_PRESENCE_STATE_UNINSTANTIATED = 1,
94  CL_AMS_PRESENCE_STATE_INSTANTIATING = 2,
95  CL_AMS_PRESENCE_STATE_INSTANTIATED = 3,
96  CL_AMS_PRESENCE_STATE_TERMINATING = 4,
97  CL_AMS_PRESENCE_STATE_RESTARTING = 5,
98  CL_AMS_PRESENCE_STATE_INSTANTIATION_FAILED = 6,
99  CL_AMS_PRESENCE_STATE_TERMINATION_FAILED = 7,
100 
101  // The following are not defined by SAF
102 
103  CL_AMS_PRESENCE_STATE_ABSENT = 0,
104  CL_AMS_PRESENCE_STATE_FAULT = 8,
105  CL_AMS_PRESENCE_STATE_FAULT_WTC = 9,
106  CL_AMS_PRESENCE_STATE_FAULT_WTR = 10
107 } ClAmsPresenceStateT;
108 
109 /*
110  * The operational state is defined for node, su and component entities.
111  * It is managed by AMS and exposed via the AMS management api.
112  */
113 
114 typedef enum
115 {
116  CL_AMS_OPER_STATE_NONE = 0,
117  CL_AMS_OPER_STATE_ENABLED = 1,
118  CL_AMS_OPER_STATE_DISABLED = 2
119 } ClAmsOperStateT;
120 
121 /*
122  * The ha state is defined for the si and csi entities. It is exposed via
123  * the AMS client and management apis.
124  */
125 
126 typedef enum
127 {
128  CL_AMS_HA_STATE_NONE = 0,
129  CL_AMS_HA_STATE_ACTIVE = 1,
130  CL_AMS_HA_STATE_STANDBY = 2,
131  CL_AMS_HA_STATE_QUIESCED = 3,
132  CL_AMS_HA_STATE_QUIESCING = 4
133 } ClAmsHAStateT;
134 
135 /*
136  * The readiness state is defined for su and component entities. It is
137  * exposed via the ams management api. It is not exposed via the client
138  * api.
139  */
140 
141 typedef enum
142 {
143  CL_AMS_READINESS_STATE_NONE = 0,
144  CL_AMS_READINESS_STATE_OUTOFSERVICE = 1,
145  CL_AMS_READINESS_STATE_INSERVICE = 2,
146  CL_AMS_READINESS_STATE_STOPPING = 3
147 } ClAmsReadinessStateT;
148 
149 /*
150  * The service state is defined for ams as a whole. It is exposed via
151  * the management api.
152  */
153 
154 typedef enum
155 {
156  CL_AMS_SERVICE_STATE_NONE = 0,
157  CL_AMS_SERVICE_STATE_RUNNING = 1,
158  CL_AMS_SERVICE_STATE_STOPPED = 2,
159  CL_AMS_SERVICE_STATE_STARTINGUP = 3,
160  CL_AMS_SERVICE_STATE_SHUTTINGDOWN = 4,
161  CL_AMS_SERVICE_STATE_UNAVAILABLE = 5,
162  CL_AMS_SERVICE_STATE_HOT_STANDBY = 6,
163 } ClAmsServiceStateT;
164 
165 /******************************************************************************
166  * Node related types
167  *****************************************************************************/
168 
169 /*
170  * Classes of nodes known to AMS as defined in ASP HLA. Use of this
171  * information is RC2+.
172  */
173 
174 typedef enum
175 {
176  CL_AMS_NODE_CLASS_NONE = 0,
177  CL_AMS_NODE_CLASS_A = 1,
178  CL_AMS_NODE_CLASS_B = 2,
179  CL_AMS_NODE_CLASS_C = 3,
180  CL_AMS_NODE_CLASS_D = 4,
181  CL_AMS_NODE_CLASS_MAX,
182 } ClAmsNodeClassT;
183 
184 /*
185  * Cluster Membership Status
186  */
187 
188 typedef enum
189 {
190  CL_AMS_NODE_IS_NOT_CLUSTER_MEMBER = 0,
191  CL_AMS_NODE_IS_CLUSTER_MEMBER = 1,
192  CL_AMS_NODE_IS_LEAVING_CLUSTER = 2,
193 } ClAmsNodeClusterMemberT;
194 
195 /******************************************************************************
196  * Application related types
197  *****************************************************************************/
198 
199 /* nothing for now, to be added in RC2+ */
200 
201 /******************************************************************************
202  * Service Group related types
203  *****************************************************************************/
204 
205 /*
206  * Types of redundancy models
207  */
208 
209 typedef enum
210 {
211  CL_AMS_SG_REDUNDANCY_MODEL_NONE = 0,
212  CL_AMS_SG_REDUNDANCY_MODEL_NO_REDUNDANCY = 1,
213  CL_AMS_SG_REDUNDANCY_MODEL_TWO_N = 2,
214  CL_AMS_SG_REDUNDANCY_MODEL_M_PLUS_N = 3,
215  CL_AMS_SG_REDUNDANCY_MODEL_N_WAY = 4,
216  CL_AMS_SG_REDUNDANCY_MODEL_N_WAY_ACTIVE = 5,
217  CL_AMS_SG_REDUNDANCY_MODEL_CUSTOM = 6, /*user controlled redundancy mode*/
218  CL_AMS_SG_REDUNDANCY_MODEL_MAX,
219 } ClAmsSGRedundancyModelT;
220 
221 /*
222  * Loading strategy to use when deciding how to assign SIs to SUs.
223  *
224  * LEAST_SI_PER_SU (M+N)
225  *
226  * In this strategy, the assignment algorithm tries to maximize the
227  * number of SUs assigned active and standby assignments, thus
228  * resulting in the least possible SI assignments per SU. This
229  * strategy is meaningful for the M+N redundancy model. (2N is a
230  * trivial case). This is the default strategy specified in the
231  * AMF specification.
232  *
233  * LEAST_SU_ASSIGNED (M+N)
234  *
235  * In this strategy, the assignment algorithm tries to minimize the
236  * number of SUs that are assigned the active or standby SIs. This
237  * strategy is meaningful for the M+N redundancy model (2N is a
238  * trivial case) and is useful when assigning more SUs is costlier
239  * than adding new SIs to existing SUs and it is acceptable not to
240  * have the additional resiliency provided by not having the max
241  * possible number of SUs assigned.
242  *
243  * LEAST_LOAD_PER_SU (M+N, N-Way)
244  *
245  * In this strategy, the assignment algorithm picks the SU with the
246  * lowest load to be the next candidate. The definition of load is
247  * intended to be customizable for a particular deployment.
248  *
249  * BY_SI_PREFERENCE (M+N, N-Way)
250  *
251  * In this strategy, the assignment algorithm tries to assign the
252  * SIs to the SUs based on the preference list associated with each
253  * SI. SIs with higher rank have first dibs. The preference is only
254  * for the active assignment and if the preferred nodes are not
255  * available, the algorithm defaults to LEAST_SI_PER_SU.
256  *
257  * USER_DEFINED (M+N, N-Way)
258  *
259  * This is intended to be an user customizable strategy that is
260  * plugged in during system deployment. (RC2+)
261  *
262  */
263 
264 typedef enum
265 {
266  CL_AMS_SG_LOADING_STRATEGY_NONE = 0, /* invalid */
267  CL_AMS_SG_LOADING_STRATEGY_LEAST_SI_PER_SU = 1, /* all models */
268  CL_AMS_SG_LOADING_STRATEGY_LEAST_SU_ASSIGNED = 2, /* all models */
269  CL_AMS_SG_LOADING_STRATEGY_LEAST_LOAD_PER_SU = 3, /* all models */
270  CL_AMS_SG_LOADING_STRATEGY_BY_SI_PREFERENCE = 4, /* n-way-* only */
271  CL_AMS_SG_LOADING_STRATEGY_USER_DEFINED = 5, /* user-callout */
272  CL_AMS_SG_LOADING_STRATEGY_MAX,
273 } ClAmsSGLoadingStrategyT;
274 
275 /******************************************************************************
276  * Component related types
277  *****************************************************************************/
278 
279 /*
280  * Types of component capabilities. These determine how many active and
281  * standby CSIs can be assigned to a component.
282  */
283 
284 typedef enum
285 {
286  CL_AMS_COMP_CAP_X_ACTIVE_AND_Y_STANDBY = 1,
287  CL_AMS_COMP_CAP_X_ACTIVE_OR_Y_STANDBY = 2,
288  CL_AMS_COMP_CAP_ONE_ACTIVE_OR_X_STANDBY = 3,
289  CL_AMS_COMP_CAP_ONE_ACTIVE_OR_ONE_STANDBY = 4,
290  CL_AMS_COMP_CAP_X_ACTIVE = 5,
291  CL_AMS_COMP_CAP_ONE_ACTIVE = 6,
292  CL_AMS_COMP_CAP_NON_PREINSTANTIABLE = 7,
293  CL_AMS_COMP_CAP_MAX,
294 } ClAmsCompCapModelT;
295 
296 #define CL_AMS_COMP_CAP_ONE_HA_STATE(X) \
297 { \
298  ( ( ((X) == CL_AMS_COMP_CAP_X_ACTIVE_OR_Y_STANDBY) || \
299  ((X) == CL_AMS_COMP_CAP_ONE_ACTIVE_OR_ONE_STANDBY) || \
300  ((X) == CL_AMS_COMP_CAP_ONE_ACTIVE_OR_X_STANDBY) ) ? \
301  CL_TRUE : CL_FALSE ) \
302 }
303 
304 /*
305  * Types of component properties.
306  */
307 
308 typedef enum
309 {
310  CL_AMS_COMP_PROPERTY_SA_AWARE = 1,
311  CL_AMS_COMP_PROPERTY_PROXIED_PREINSTANTIABLE = 2,
312  CL_AMS_COMP_PROPERTY_PROXIED_NON_PREINSTANTIABLE = 3,
313  CL_AMS_COMP_PROPERTY_NON_PROXIED_NON_PREINSTANTIABLE = 4,
314  CL_AMS_COMP_PROPERTY_MAX,
315 } ClAmsCompPropertyT;
316 
317 /*
318  * Types of health checks performed by the AMF.
319  */
320 
321 typedef enum
322 {
323  CL_AMS_COMP_HEALTHCHECK_AMF_INVOKED = 1,
324  CL_AMS_COMP_HEALTHCHECK_CLIENT_INVOKED = 2
325 } ClAmsCompHealthcheckInvocationT;
326 
327 #define CL_AMS_HEALTHCHECK_KEY_MAX 32
328 typedef struct
329 {
330  ClUint8T key[CL_AMS_HEALTHCHECK_KEY_MAX];
331  ClUint16T keyLen;
332 } ClAmsCompHealthcheckKeyT;
333 
334 typedef enum
335 {
336  /*
337  * Recommended recovery actions for local components as defined by SAF
338  */
339 
340  CL_AMS_RECOVERY_NONE = 0,
341  CL_AMS_RECOVERY_NO_RECOMMENDATION = 1,
342  CL_AMS_RECOVERY_COMP_RESTART = 2,
343  CL_AMS_RECOVERY_COMP_FAILOVER = 3,
344  CL_AMS_RECOVERY_NODE_SWITCHOVER = 4,
345  CL_AMS_RECOVERY_NODE_FAILOVER = 5,
346  CL_AMS_RECOVERY_NODE_FAILFAST = 6,
347  CL_AMS_RECOVERY_CLUSTER_RESET = 7,
348  CL_AMS_RECOVERY_APP_RESTART = 8,
349 
350  /*
351  * Recommeded recovery actions defined by Clovis
352  */
353 
354  CL_AMS_RECOVERY_INTERNALLY_RECOVERED = 20,
355  CL_AMS_RECOVERY_SU_RESTART = 21,
356  CL_AMS_RECOVERY_NODE_HALT = 22,
357 
358  /*
359  * Recommended recovery actions for external components
360  */
361 
362  CL_AMS_EXTERNAL_RECOVERY_RESET = 30,
363  CL_AMS_EXTERNAL_RECOVERY_REBOOT = 31,
364  CL_AMS_EXTERNAL_RECOVERY_POWER_ON = 32,
365  CL_AMS_EXTERNAL_RECOVERY_POWER_OFF = 33,
366 
367 } ClAmsRecoveryT;
368 
369 typedef ClAmsRecoveryT ClAmsLocalRecoveryT;
370 
371 /******************************************************************************
372  * Component Service Instance related types
373  *****************************************************************************/
374 
375 #define CL_AMS_CSI_FLAG_ADD_ONE 0x1
376 #define CL_AMS_CSI_FLAG_TARGET_ONE 0x2
377 #define CL_AMS_CSI_FLAG_TARGET_ALL 0x4
378 
379 typedef ClUint32T ClAmsCSIFlagsT;
380 typedef ClNameT ClAmsCSITypeT;
381 
382 typedef enum
383 {
384  CL_AMS_CSI_NEW_ASSIGN = 1,
385  CL_AMS_CSI_QUIESCED = 2,
386  CL_AMS_CSI_NOT_QUIESCED = 3,
387  CL_AMS_CSI_STILL_ACTIVE = 4
388 } ClAmsCSITransitionDescriptorT;
389 
390 typedef struct
391 {
392  ClAmsCSITransitionDescriptorT transitionDescriptor;
393  ClNameT activeCompName;
394 } ClAmsCSIActiveDescriptorT;
395 
396 typedef struct
397 {
398  ClNameT activeCompName;
399  ClUint32T standbyRank;
400 } ClAmsCSIStandbyDescriptorT;
401 
402 typedef union
403 {
404  ClAmsCSIActiveDescriptorT activeDescriptor;
405  ClAmsCSIStandbyDescriptorT standbyDescriptor;
406 } ClAmsCSIStateDescriptorT;
407 
408 typedef struct
409 {
410  /* As per the SAF AMF spec:
411  These are UTF-8 encoded, null terminated strings. UTF-8 is the same
412  as 7 bit (printable) ASCII, but the high bit indicates UTF-8 encoding.
413  Normal C strxxx() functions will work if you cast these to char*.
414  */
415  ClUint8T *attributeName;
416  ClUint8T *attributeValue;
417 } ClAmsCSIAttributeT;
418 
419 typedef struct
420 {
421  ClAmsCSIAttributeT *attribute;
422  ClUint32T numAttributes;
423 } ClAmsCSIAttributeListT;
424 
425 typedef struct
426 {
427  ClAmsCSIFlagsT csiFlags;
428  ClNameT csiName;
429  ClAmsCSIStateDescriptorT csiStateDescriptor;
430  ClAmsCSIAttributeListT csiAttributeList;
431 } ClAmsCSIDescriptorT;
432 
433 typedef struct
434 {
435  ClAmsCSIDescriptorT csiDescriptor;
436  ClAmsCSITypeT csiType;
437  ClNameT compName;
438 }ClAmsCSITypeDescriptorT;
439 
440 /******************************************************************************
441  * Protection group related types
442  *****************************************************************************/
443 
444 typedef enum
445 {
446  CL_AMS_PG_TRACK_CURRENT = 1,
447  CL_AMS_PG_TRACK_CHANGES = 2,
448  CL_AMS_PG_TRACK_CHANGES_ONLY = 4
449 } ClAmsPGTrackFlagT;
450 
451 typedef enum
452 {
453  CL_AMS_PG_NO_CHANGE = 1,
454  CL_AMS_PG_ADDED = 2,
455  CL_AMS_PG_REMOVED = 3,
456  CL_AMS_PG_STATE_CHANGE = 4
457 } ClAmsPGChangeT;
458 
459 typedef struct
460 {
461  ClNameT compName; /* component for CSI */
462  ClAmsHAStateT haState; /* ha state for CSI */
463  ClUint32T rank; /* rank, if state is standby */
464 } ClAmsPGMemberT;
465 
466 typedef struct
467 {
468  ClAmsPGMemberT member;
469  ClAmsPGChangeT change;
470 } ClAmsPGNotificationT;
471 
472 typedef struct
473 {
474  ClUint32T numItems;
475  ClAmsPGNotificationT *notification;
476 } ClAmsPGNotificationBufferT;
477 
478 /******************************************************************************
479  * Types for handles used by various AMS APIs
480  *****************************************************************************/
481 typedef ClHandleT ClAmsMgmtCCBHandleT;
482 typedef ClHandleT ClAmsMgmtHandleT;
483 typedef ClHandleT ClAmsClientHandleT;
484 typedef ClHandleT ClAmsEventHandleT;
485 typedef ClHandleT ClAmsFaultHandleT;
486 typedef ClHandleT ClAmsEntityHandleT;
487 typedef ClPtrT ClAmsMgmtDBHandleT;
488 typedef ClPtrT ClAmsMgmtCCBBatchHandleT;
489 
490 /******************************************************************************
491  * Temporary Notes
492  *****************************************************************************/
493 
494 // this is not defined in saAmf.h
495 
496 typedef struct
497 {
498  ClUint32T numberOfItems;
499  ClAmsCSITypeDescriptorT *csiDefinition;
500 }ClAmsSIDescriptorT;
501 
502 
503 
504 #ifdef __cplusplus
505 }
506 #endif
507 
508 #endif /* _CL_AMS_TYPES_H_ */

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