31 #ifndef _CL_CPM_API_H_
32 #define _CL_CPM_API_H_
45 #include <clCksmApi.h>
52 #include <clAmsTypes.h>
60 #define CL_CPM_RELEASE_CODE 'B'
64 #define CL_CPM_MAJOR_VERSION 0x01
68 #define CL_CPM_MINOR_VERSION 0x01
75 #define CL_CPM_EVENT_CHANNEL_NAME "CPM_EVENT_CHANNEL"
80 #define CL_CPM_NODE_EVENT_CHANNEL_NAME "CPM_NODE_EVENT_CHANNEL"
86 #define CL_CPM_EO_ALIVE (ClUint32T)0
92 #define CL_CPM_EO_DEAD (ClUint32T)0xFFFFFFF
97 #define CL_CPM_IOC_SLOT_BITS 16
98 #define CL_CPM_IOC_SLOT_BITS_HEX 0x0000ffff
103 #define CL_CPM_IOC_ADDRESS_GET(myCh, mySl, address) \
104 (address) = (myCh) << CL_CPM_IOC_SLOT_BITS; \
110 #define CL_CPM_IOC_ADDRESS_SLOT_GET(address, mySl) \
111 (mySl) = (address) & CL_CPM_IOC_SLOT_BITS_HEX;
116 #define CL_CPM_IOC_ADDRESS_CHASSIS_GET(address, myCh) \
117 (myCh) = (address) >> CL_CPM_IOC_SLOT_BITS;
130 #define ClCpmSchedFeedBackT ClEoSchedFeedBackT
135 #define CL_CPM_COMP_ARRIVAL_PATTERN (1 << 0)
139 #define CL_CPM_COMP_DEPART_PATTERN (1 << 1)
143 #define CL_CPM_COMP_DEATH_PATTERN (1 << 2)
147 #define CL_CPM_NODE_ARRIVAL_PATTERN (1 << 3)
151 #define CL_CPM_NODE_DEPART_PATTERN (1 << 4)
155 #define CL_CPM_NODE_DEATH_PATTERN (1 << 5)
202 #define ClCpmCompEventT2Str(x) (((x) == CL_CPM_COMP_ARRIVAL) ? "CL_CPM_COMP_ARRIVAL" : ((x) == CL_CPM_COMP_DEPARTURE) ? "CL_CPM_COMP_DEPARTURE" : ((x) == CL_CPM_COMP_DEATH) ? "CL_CPM_COMP_DEATH" : "Invalid")
204 #define ClHaState2Str(S) \
205 ( ((S) == SA_AMF_HA_ACTIVE) ? "Active" : \
206 ((S) == SA_AMF_HA_STANDBY) ? "Standby" : \
207 ((S) == SA_AMF_HA_QUIESCED) ? "Quiesced" : \
208 ((S) == SA_AMF_HA_QUIESCING) ? "Quiescing" : \
277 typedef struct ClCpmCompCSI
279 ClAmsHAStateT haState;
280 ClAmsCSIDescriptorT csiDescriptor;
284 typedef struct ClCpmCompCSIRef
287 ClCpmCompCSIT *pCSIList;
306 ClUint32T maxDuration;
307 ClAmsLocalRecoveryT recovery;
331 CL_IN ClAmsCompHealthcheckKeyT
367 CL_IN ClAmsHAStateT haState,
368 CL_IN ClAmsCSIDescriptorT csiDescriptor);
391 CL_IN ClAmsCSIFlagsT csiFlags);
414 CL_IN ClAmsPGNotificationBufferT
415 *pNotificationBuffer,
416 CL_IN ClUint32T numberOfMembers,
417 CL_IN ClUint32T error);
778 CL_IN ClInvocationT invocation,
818 CL_OUT ClAmsHAStateT *haState);
859 CL_IN ClInvocationT invocation,
903 CL_IN ClAmsLocalRecoveryT recommendedRecovery,
904 CL_IN ClUint32T alarmHandle);
980 CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck,
981 CL_IN ClAmsCompHealthcheckInvocationT invocationType,
982 CL_IN ClAmsRecoveryT recommondedRecovery);
1021 CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck,
1056 CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck);
1101 CL_IN ClUint8T trackFlags,
1102 CL_INOUT ClAmsPGNotificationBufferT
1103 *pNotificationBuffer);
1169 CL_OUT ClUint32T *pCompId);
1268 CL_OUT ClAmsPresenceStateT *pPresenceState,
1269 CL_OUT ClAmsOperStateT *pOperationalState);
1296 ClInt32T numRetries,
1383 CL_IN ClBoolT graceful);
1425 extern ClRcT clCpmMiddlewareRestart(
ClIocNodeAddressT iocNodeAddress, ClBoolT graceful, ClBoolT nodeReset);
Typical defines found in any software project.
Common Error Codes shared across multiple Clovis ASP Components.
Header file for definitions of configuration parameters used by the CPM.
Header file of error Messages that are CPM specific.
Header file of Clovis Container Related APIs.
Header file of EO related APIs.
Header file of Ioc Data Structures and APIs.
Header file of extended APIs supported by IOC.
Operating System Abstraction Layer API.
Header file of RMD Interface.
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
#define CL_INOUT
CL_INOUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:108
ClInt64T ClTimeT
Time duration specified in nanoseconds.
Definition: clCommon.h:154
#define CL_OUT
CL_OUT macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:110
ClDispatchFlagsT
Dispatch flags.
Definition: clCommon.h:260
ClStatusT
These define all the possible states that a component/node can be in.
Definition: clCommon.h:76
#define CL_IN
CL_IN macro assists in clearly defining arguments of an API, but has no actual meaning.
Definition: clCommon.h:106
ClRcT clCpmComponentIdGet(CL_IN ClCpmHandleT cpmHandle, CL_IN ClNameT *pCompName, CL_OUT ClUint32T *pCompId)
Other utility APIs exposed by CPM.
ClRcT clCpmHealthcheckConfirm(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck, CL_IN ClRcT healthCheckResult)
Inform AMF the status of component invoked healthcheck.
ClRcT clCpmComponentNameGet(CL_IN ClCpmHandleT cpmHandle, CL_OUT ClNameT *pCompName)
Returns the component name.
ClUint32T clCpmIsMaster(void)
Informs if the node is master of the cluster.
void(* ClCpmNotificationFuncT)(CL_IN ClIocNotificationIdT event, CL_IN ClPtrT pArg, CL_IN ClIocAddressT *pAddress)
This is the type of the callback fuction, which will be called when an node/component arrival/departu...
Definition: clCpmApi.h:465
ClRcT clCpmHAStateGet(CL_IN ClCpmHandleT cpmHandle, CL_IN ClNameT *compName, CL_IN ClNameT *csiName, CL_OUT ClAmsHAStateT *haState)
Returns the HA state of the component.
ClRcT(* ClCpmTerminateCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pCompName)
Component Manager requests the component, identified by compName, to gracefully shutdown [Asynchronou...
Definition: clCpmApi.h:344
ClRcT clCpmComponentAddressGetFast(CL_IN ClIocNodeAddressT nodeAddress, CL_IN ClNameT *pCompName, CL_OUT ClIocAddressT *pCompAddress)
Returns the IOC address of a component.
ClRcT clCpmMasterAddressGet(CL_OUT ClIocNodeAddressT *pIocAddress)
Returns the IOC address of the master.
ClCpmNodeEventT
Flags that can be used by subscriber to distinguish diffrent events related to node.
Definition: clCpmApi.h:163
ClRcT clCpmComponentAddressGet(CL_IN ClIocNodeAddressT nodeAddress, CL_IN ClNameT *pCompName, CL_OUT ClIocAddressT *pCompAddress)
Returns the IOC address of a component.
ClRcT clCpmClientInitialize(CL_OUT ClCpmHandleT *pCpmHandle, CL_IN const ClCpmCallbacksT *pCallback, CL_INOUT ClVersionT *pVersion)
Initializes the client Component Manager library.
ClRcT clCpmSelectionObjectGet(CL_IN ClCpmHandleT cpmHandle, CL_OUT ClSelectionObjectT *pSelectionObject)
Returns an operating system handle for detecting pending callbacks.
void(* ClCpmProtectionGroupTrackCallbackT)(CL_IN const ClNameT *pCsiName, CL_IN ClAmsPGNotificationBufferT *pNotificationBuffer, CL_IN ClUint32T numberOfMembers, CL_IN ClUint32T error)
Requested information gets delivered to notificationBuffer.
Definition: clCpmApi.h:413
ClRcT clCpmCompInfoGet(const ClNameT *compName, const ClIocNodeAddressT nodeAddress, CL_OUT ClCpmCompSpecInfoT *compInfo)
The API returns component specific information.
ClRcT clCpmComponentFailureReport(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN ClTimeT errorDetectionTime, CL_IN ClAmsLocalRecoveryT recommendedRecovery, CL_IN ClUint32T alarmHandle)
Notifies about the failed component.
ClRcT clCpmNotificationCallbackInstall(ClIocPhysicalAddressT compAddr, ClCpmNotificationFuncT pFunc, ClPtrT pArg, ClHandleT *pHandle)
This API installs the callback function when the node/component arrival/departure events are to be in...
ClRcT(* ClCpmCSIRmvCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pCompName, CL_IN const ClNameT *pCsiName, CL_IN ClAmsCSIFlagsT csiFlags)
Removes one or all the assigned CSIs.
Definition: clCpmApi.h:388
ClRcT clCpmLocalNodeNameGet(CL_IN ClNameT *nodeName)
Returns the name of the local node.
ClRcT clCpmNodeShutDown(CL_IN ClIocNodeAddressT iocNodeAddress)
Shuts down the node.
ClRcT clCpmProtectionGroupTrack(CL_IN ClCpmHandleT cpmHandle, CL_IN ClNameT *pCsiName, CL_IN ClUint8T trackFlags, CL_INOUT ClAmsPGNotificationBufferT *pNotificationBuffer)
Track the protection group for the given CSI.
ClRcT clCpmNodeSwitchover(CL_IN ClIocNodeAddressT iocNodeAddress)
Switch over the node.
ClRcT clCpmCompStatusGet(ClIocAddressT compAddr, ClStatusT *pStatus)
Returns the status of any component in a system.
ClRcT clCpmClientFinalize(CL_IN ClCpmHandleT cpmHandle)
Cleans up the client Component Manager library.
ClRcT(* ClCpmCSISetCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pCompName, CL_IN ClAmsHAStateT haState, CL_IN ClAmsCSIDescriptorT csiDescriptor)
Component Manager requests the component, identified by compName, to assume a particular HA state,...
Definition: clCpmApi.h:365
ClRcT clCpmNotificationCallbackUninstall(ClHandleT *pHandle)
The API uninstalls the callback, which would have been installed through the clCpmNotificationCallbac...
ClRcT(* ClCpmProxiedComponentCleanupCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pProxiedCompName)
Component Manager requests the proxy component to cleanup the component, identified by proxiedCompNam...
Definition: clCpmApi.h:448
ClRcT clCpmNodeRestart(CL_IN ClIocNodeAddressT iocNodeAddress, CL_IN ClBoolT graceful)
Restarts the node.
ClRcT clCpmCompCSIList(const ClNameT *pCompName, ClCpmCompCSIRefT *pCSIRef)
The API gets the comp CSI List from the component CSI cache maintained per-process.
ClHandleT ClCpmHandleT
The type of the handle supplied by the CPM to the process which calls the clCpmClientInitialize() API...
Definition: clCpmApi.h:124
ClCpmCompEventT
Flags that can be used by subscriber to distinguish diffrent component events.
Definition: clCpmApi.h:186
ClRcT clCpmNodeStatusGet(ClIocNodeAddressT nodeAddr, ClStatusT *pStatus)
Returns the status of any ASP node in a system.
ClRcT clCpmHealthcheckStop(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck)
Stops the component healthcheck.
ClRcT clCpmComponentFailureClear(CL_IN ClCpmHandleT cpmHandle, CL_IN ClNameT *pCompName)
Notifies about the restoration of the failed component.
ClCpmHandleT clCpmHandle
This component's handle.
ClRcT clCpmCSIQuiescingComplete(CL_IN ClCpmHandleT cpmHandle, CL_IN ClInvocationT invocation, CL_IN ClRcT retCode)
Respond to AMF whether it was able to successfully service all pending requests for a particular comp...
ClRcT clCpmResponse(CL_IN ClCpmHandleT cpmHandle, CL_IN ClInvocationT invocation, CL_IN ClRcT rc)
Respond to AMF with the result of components execution of a particular request by AMF.
ClRcT clCpmHealthcheckStart(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN const ClAmsCompHealthcheckKeyT *pCompHealthCheck, CL_IN ClAmsCompHealthcheckInvocationT invocationType, CL_IN ClAmsRecoveryT recommondedRecovery)
Starts the component healthcheck.
ClRcT clCpmComponentStatusGet(CL_IN ClNameT *pCompName, CL_IN ClNameT *pNodeName, CL_OUT ClAmsPresenceStateT *pPresenceState, CL_OUT ClAmsOperStateT *pOperationalState)
Returns the component presence and operational state.
ClBoolT clCpmIsSC(void)
The API returns whether this node is system controller or not.
ClRcT clCpmProtectionGroupTrackStop(CL_IN ClCpmHandleT cpmHandle, CL_IN ClNameT *pCsiName)
Stop tracking the protection group for the given CSI.
ClRcT clCpmDispatch(CL_IN ClCpmHandleT cpmHandle, CL_OUT ClDispatchFlagsT dispatchFlags)
Invoke pending callbacks.
ClRcT(* ClCpmHealthCheckCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pCompName, CL_IN ClAmsCompHealthcheckKeyT *pHealthCheckKey)
SAF compliant APIs and data types of CPM.
Definition: clCpmApi.h:329
ClRcT(* ClCpmProxiedComponentInstantiateCallbackT)(CL_IN ClInvocationT invocation, CL_IN const ClNameT *pProxiedCompName)
Component Manager requests the proxy component to instantiate the component, identified by proxiedCom...
Definition: clCpmApi.h:431
ClRcT clCpmComponentRegister(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN const ClNameT *pProxyCompName)
Registers a component with CPM.
struct ClCpmCompSpecInfo ClCpmCompSpecInfoT
Component specific data which is maintained by CPM.
ClRcT clCpmComponentUnregister(CL_IN ClCpmHandleT cpmHandle, CL_IN const ClNameT *pCompName, CL_IN const ClNameT *pProxyCompName)
Un-registers a component.
@ CL_CPM_NODE_ARRIVAL
Indicates a node's arrival.
Definition: clCpmApi.h:167
@ CL_CPM_NODE_DEATH
Indicates a node's sudden/ungraceful departure.
Definition: clCpmApi.h:177
@ CL_CPM_NODE_DEPARTURE
Indicates a node's graceful departure.
Definition: clCpmApi.h:172
@ CL_CPM_COMP_DEATH
Indicates that component was terminated ungracefully, i.e.
Definition: clCpmApi.h:199
@ CL_CPM_COMP_DEPARTURE
Indicates that component was terminated gracefully.
Definition: clCpmApi.h:194
@ CL_CPM_COMP_ARRIVAL
Indicates that component is ready to provide service.
Definition: clCpmApi.h:190
ClUint64T ClEoIdT
The type of the EOId, assigned to an EO as part of registration to the Component Manager.
Definition: clEoConfigApi.h:63
ClUint32T ClIocPortT
The IOC communication port.
Definition: clIocApi.h:348
enum ClIocNotificationId ClIocNotificationIdT
The port close notification payload.
ClUint32T ClIocNodeAddressT
The IOC node address.
Definition: clIocApi.h:343
A name.
Definition: clCommon.h:197
Version Information for various services.
Definition: clCommon.h:250
Payload data for the component death event published by the CPM.
Definition: clCpmApi.h:215
ClUint32T compId
Component ID.
Definition: clCpmApi.h:227
ClCpmCompEventT operation
Indication of whether component is:
Definition: clCpmApi.h:247
ClNameT nodeName
Node name containing the component.
Definition: clCpmApi.h:223
ClIocNodeAddressT nodeIocAddress
IOC address of the node containing the component.
Definition: clCpmApi.h:236
ClIocPortT eoIocPort
IOC port of the node containing the component.
Definition: clCpmApi.h:240
ClNameT compName
Component which failed/lost heartbeat to the CPM.
Definition: clCpmApi.h:219
ClEoIdT eoId
EO ID.
Definition: clCpmApi.h:231
Payload data for the node arrival/departure event published by the CPM.
Definition: clCpmApi.h:257
ClNameT nodeName
Name of the node for which this event is published.
Definition: clCpmApi.h:261
ClIocNodeAddressT nodeIocAddress
Node IOC Address, where this component is located.
Definition: clCpmApi.h:265
ClCpmNodeEventT operation
Indication for whether the node is starting up, i.e., CL_CPM_NODE_ARRIVAL or shutting down gracefully...
Definition: clCpmApi.h:271
Component specific data which is maintained by CPM.
Definition: clCpmApi.h:294
ClUint32T period
Healthcheck related information.
Definition: clCpmApi.h:305
ClUint32T numArgs
Arguments of a component.
Definition: clCpmApi.h:299
The structure ClCpmCallbacksT contains the various callback functions that the Component Manager can ...
Definition: clCpmApi.h:474
ClCpmProtectionGroupTrackCallbackT appProtectionGroupTrack
Callback invoked when the component registers for tracking changes in protection group and protection...
Definition: clCpmApi.h:498
ClCpmProxiedComponentInstantiateCallbackT appProxiedComponentInstantiate
Callback for instantiating a proxied component.
Definition: clCpmApi.h:502
ClCpmTerminateCallbackT appTerminate
Callback for gracefully shutting down the component.
Definition: clCpmApi.h:482
ClCpmCSISetCallbackT appCSISet
Callback for assigning the component service instance to the component.
Definition: clCpmApi.h:487
ClCpmHealthCheckCallbackT appHealthCheck
Callback for checking the health of the component.
Definition: clCpmApi.h:478
ClCpmProxiedComponentCleanupCallbackT appProxiedComponentCleanup
Callback for cleaning up a proxied component.
Definition: clCpmApi.h:506
ClCpmCSIRmvCallbackT appCSIRmv
Callback for removing the component service instance assigned to the component.
Definition: clCpmApi.h:492
The IOC Physical address of an application's communication end point.
Definition: clIocApi.h:383
IOC address.
Definition: clIocApi.h:401
The timeout value in seconds and milliseconds.
Definition: clTimerApi.h:87