Defines, Structures, Typedefs, Functions. More...
Files | |
file | clAlarmApi.h |
Header file of Alarm Service related APIs. | |
file | clAlarmDefinitions.h |
Header File of Alarm related Definitions. | |
file | clAlarmErrors.h |
Header file of Alarm Service related Error codes. | |
file | clAlarmUtils.h |
Header File containing functions and structures used for alarm payload for traps. |
Classes | |
struct | ClAlarmComponentResAlarms |
The structure captures the alarm profile of all alarms that are modeled for each resource in the component. More... | |
struct | ClAlarmHandleInfoT |
The ClAlarmHandleInfoT data structure is used to store the handle and the information of the alarm. More... | |
struct | ClAlarmInfoT |
The ClAlarmInfoT data structure is used to store the entire list of alarm attributes that include probable cause, MOID, category, sub-category, severity, and event time along with additional information of the alarm. More... | |
struct | ClAlarmPendingAlmInfo |
Structure to contain the pending alarm information. More... | |
struct | ClAlarmPendingAlmList |
Structure to contain the information about the pending alarms. More... | |
struct | ClAlarmProfile |
This structure is used to store the alarm related attributes including the category, sub-category, severity, soaking time for assert and clear, probable cause of alarm, and the generation and suppression rule for alarm. More... | |
struct | ClAlarmRuleEntryT |
This structure contains the information about the alarm configured. More... | |
struct | ClAlarmRuleInfoT |
This structure specifies the alarm rule relation and the alarms IDs (probable cause) that participate in the alarm rule. More... | |
struct | ClAlarmUtilPayLoad |
This structure holds the information about the attributes that need to be provided in the alarm payload. More... | |
struct | ClAlarmUtilPayLoadList |
The stucture is used to specify the alarm payload information. More... | |
struct | ClAlarmUtilTlv |
The structure is used to store the information about the variables to be used in the trap. More... | |
struct | ClAlarmUtilTlvInfo |
This structure holds the information about the attributes that needs to be provided in the alarm payload. More... |
Macros | |
#define | CL_ALARM_ERR_EVT_CHANNEL_CLOSE 0x10c |
The event channel close failure while unsubscribing for the event. | |
#define | CL_ALARM_ERR_EVT_CHANNEL_OPEN 0x109 |
The event channel open failure for alarm event channel. | |
#define | CL_ALARM_ERR_EVT_FINALIZE 0x10d |
The event finalize failure while unsubscribing for the event. | |
#define | CL_ALARM_ERR_EVT_INIT 0x108 |
The event initialization failure. | |
#define | CL_ALARM_ERR_EVT_SUBSCRIBE 0x10a |
Failed while subscribing for the event. | |
#define | CL_ALARM_ERR_EVT_SUBSCRIBE_AGAIN 0x10b |
The event initialization had been done already. | |
#define | CL_ALARM_ERR_GEN_RULE_NOT_VALID 0x104 |
The Generation Rule of alarm is invalid. | |
#define | CL_ALARM_ERR_INTERNAL_ERROR 0x107 |
Internal error related to alarms. | |
#define | CL_ALARM_ERR_INVALID_CAT 0x100 |
Alarm service related error codes. | |
#define | CL_ALARM_ERR_INVALID_MOID 0x10e |
The managed object Identifier is invalid. | |
#define | CL_ALARM_ERR_INVALID_PARAM CL_ERR_INVALID_PARAMETER |
The parameter passed in invalid. | |
#define | CL_ALARM_ERR_INVALID_SEVERITY 0x102 |
The alarm severity is invalid. | |
#define | CL_ALARM_ERR_NO_MEMORY CL_ERR_NO_MEMORY |
There is no memory left with the application. | |
#define | CL_ALARM_ERR_NO_OWNER 0x10f |
The managed object doesn't have any owner registered in COR. | |
#define | CL_ALARM_ERR_NULL_POINTER CL_ERR_NULL_POINTER |
The pointer passed is NULL. | |
#define | CL_ALARM_ERR_OM_CREATE_FAILED 0x106 |
The OM class creation of alarm failed. | |
#define | CL_ALARM_ERR_PROB_CAUSE_NOT_PRESENT 0x103 |
The probable cause of alarm is not present. | |
#define | CL_ALARM_ERR_SUPP_RULE_NOT_VALID 0x105 |
The Suppression Rule of alarm is invalid. | |
#define | CL_ALARM_ERR_VERSION_UNSUPPORTED 0x101 |
Client Library version error. | |
#define | CL_ALARM_EVENT 1 |
Event Type to be specifed while subscribing for the events published by alarm server. | |
#define | CL_ALARM_RC(ERROR_CODE) CL_RC(CL_CID_ALARMS, (ERROR_CODE)) |
It appends the component ID with the error code. | |
#define | ClAlarmEventName "CL_ALARM_EVENT_CHANNEL" |
ID to specify whether the alarm is invalid or not. |
Typedefs | |
typedef struct ClAlarmComponentResAlarms | ClAlarmComponentResAlarmsT |
The structure captures the alarm profile of all alarms that are modeled for each resource in the component. | |
typedef ClRcT(* | ClAlarmEventCallbackFuncPtrT )(CL_IN const ClAlarmHandleInfoT *pAlarmInfo) |
Informs the consumer of the event about the events published by the alarm server. | |
typedef ClUint32T | ClAlarmHandleT |
The type of the handle for identifying the raised alarm. | |
typedef ClAlarmInfoT * | ClAlarmInfoPtrT |
Pointer type for ClAlarmInfoT. | |
typedef ClAlarmPendingAlmInfoT * | ClAlarmPendingAlmInfoPtrT |
Pointer type for ClAlarmPendingAlmInfoT. | |
typedef struct ClAlarmPendingAlmInfo | ClAlarmPendingAlmInfoT |
Structure to contain the pending alarm information. | |
typedef ClAlarmPendingAlmListT * | ClAlarmPendingAlmListPtrT |
Pointer type for ClAlarmPendingAlmListT. | |
typedef struct ClAlarmPendingAlmList | ClAlarmPendingAlmListT |
Structure to contain the information about the pending alarms. | |
typedef struct ClAlarmProfile | ClAlarmProfileT |
This structure is used to store the alarm related attributes including the category, sub-category, severity, soaking time for assert and clear, probable cause of alarm, and the generation and suppression rule for alarm. | |
typedef ClUint32T | ClAlarmSpecificProblemT |
The type of an identifier to the specific problem of the alarm. | |
typedef struct ClAlarmUtilPayLoadList | ClAlarmUtilPayLoadListT |
The stucture is used to specify the alarm payload information. | |
typedef struct ClAlarmUtilPayLoad | ClAlarmUtilPayLoadT |
This structure holds the information about the attributes that need to be provided in the alarm payload. | |
typedef struct ClAlarmUtilTlvInfo | ClAlarmUtilTlvInfoT |
This structure holds the information about the attributes that needs to be provided in the alarm payload. | |
typedef struct ClAlarmUtilTlv | ClAlarmUtilTlvT |
The structure is used to store the information about the variables to be used in the trap. |
Functions | |
ClRcT | clAlarmEventDataGet (CL_IN ClUint8T *pData, CL_IN ClSizeT size, CL_OUT ClAlarmHandleInfoT *pAlarmHandleInfo) |
This function is used to get the decoded data in host format of the alarm data obtained after receiving the event. | |
ClRcT | clAlarmEventSubscribe (CL_IN const ClAlarmEventCallbackFuncPtrT pAlarmEvtCallbackFuncFP) |
This function is used to subscribe for the events published by the alarm server. | |
ClRcT | clAlarmEventUnsubscribe () |
This function is used to unsubscribe for the events published by the alarm server. | |
ClRcT | clAlarmLibFinalize () |
Cleans up the Alarm Library. | |
ClRcT | clAlarmLibInitialize () |
Initializes the Alarm Library. | |
ClRcT | clAlarmPendingAlarmListFree (CL_INOUT ClAlarmPendingAlmListPtrT const pPendingAlmList) |
Function to free the pending alarm list populated by clAlarmPendingAlarmsQuery. | |
ClRcT | clAlarmPendingAlarmsQuery (CL_IN ClCorMOIdPtrT const pMoId, CL_OUT ClAlarmPendingAlmListPtrT const pPendingAlmList) |
Function to get the pending alarms on a specific object or in the whole system. | |
ClRcT | clAlarmRaise (CL_IN ClAlarmInfoT *pAlarmInfo, CL_OUT ClAlarmHandleT *pAlarmHandle) |
Raises an alarm on a component. | |
ClRcT | clAlarmStateQuery (CL_IN const ClAlarmInfoT *pAlarmInfo, CL_OUT ClAlarmStateT *const pAlarmState) |
Function to get the current state of the alarm. | |
void | clAlarmUtilPayloadBufFree (ClUint8T *pBuf) |
The function to free the buffer obtained after flattening the payload information. | |
ClRcT | clAlarmUtilPayLoadExtract (ClUint8T *pBuf, ClUint32T size, ClAlarmUtilPayLoadListT **ppPayloadList) |
The function to extract the payload information sent at the time of alarm raise. | |
ClRcT | clAlarmUtilPayloadFlatten (ClAlarmUtilPayLoadListPtrT pPayLoadList, ClUint32T *pSize, ClUint8T **ppBuf) |
Function to convert the payload information into a flat buffer. | |
void | clAlarmUtilPayloadListFree (ClAlarmUtilPayLoadListT *pPayloadList) |
Function used to free the payload data-structure allocated during alarm reporting or receive. | |
ClRcT | clAlarmVersionVerify (CL_INOUT ClVersionT *pVersion) |
This function is used to verify if a version of the function is supported by AM. |
Defines, Structures, Typedefs, Functions.
#define CL_ALARM_ERR_INVALID_CAT 0x100 |
Alarm service related error codes.
The alarm category is invalid.
#define ClAlarmEventName "CL_ALARM_EVENT_CHANNEL" |
ID to specify whether the alarm is invalid or not.
Alarm event channel name. This is the channel on which the subscriber will be waiting for notifications.
typedef ClRcT(* ClAlarmEventCallbackFuncPtrT)(CL_IN const ClAlarmHandleInfoT *pAlarmInfo) |
Informs the consumer of the event about the events published by the alarm server.
pAlarmInfo | (in) pointer to the ClAlarmInfoT structure. This structure will populated by the alarm client upon receiving the event on CL_ALARM_EVENT_CHANNEL and then the callback function will called. |
CL_OK | The callback function successfully executed. |
typedef ClUint32T ClAlarmSpecificProblemT |
The type of an identifier to the specific problem of the alarm.
This information is not configured but is assigned a value at run-time for segregation of alarms that have the same category and probable cause but are different in their manifestation.
typedef struct ClAlarmUtilPayLoadList ClAlarmUtilPayLoadListT |
The stucture is used to specify the alarm payload information.
The number of resources for which the payload information should be given is specified as the value of numPayLoadEnteries. The different entries corresponding to different resources should be specified in the pPayload array after allocating it. For each resource there can be multiple attributes whose information should be specified in the array of pTlv element of the ClAlarmUtilTlvPtrT.
typedef struct ClAlarmUtilPayLoad ClAlarmUtilPayLoadT |
This structure holds the information about the attributes that need to be provided in the alarm payload.
This payload is then used by the SNMP subagent for reporting the trap. This is a structure which contains the information about the traps. This structure is similar to the ClAlarmUtilTlvInfoT but this has the MOId of the resource as an extra field. The SNMP subagent extracts the payload information using this structure So a user planning to report an alarm as trap he/she should provide the attribute information in this structure only.
typedef struct ClAlarmUtilTlvInfo ClAlarmUtilTlvInfoT |
This structure holds the information about the attributes that needs to be provided in the alarm payload.
This payload is then used by the SNMP subagent for reporting the trap after receiving the event published by alarm server. The structure is used to store the number of attributes and pointer to the array of structure containing information about attributes that needs to be part of the trap information. The pointer to the array of the structure ClAlarmUtilTlvT has to be allocated which has the number of elements equal to the value of numTlvs element.
typedef struct ClAlarmUtilTlv ClAlarmUtilTlvT |
The structure is used to store the information about the variables to be used in the trap.
This takes the type of the attribute which is one of the value from the enum ClCorTypeT, the length of the atttribute and the value of the variable. The element value is a pointer which should be allocated of size equal to value of the element length.
enum ClAlarmCategoryTypeT |
Enumeration defining the categories of alarms support by alarm server.
enum ClAlarmFetchModeT |
This enumeration defines all the probable causes of the alarm based on the categories.
enum ClAlarmRuleRelationT |
The enum enumerates the possible relationships between two alarms.
enum ClAlarmSeverityTypeT |
Enumeration to depict the severity of the alarm which is specified while modeling and also while publishing the alarm.
enum ClAlarmStateT |
The enumeration to depict the state of the alarm that is into.
It can be in any of the following state that is cleared, assert, suppressed or under soaking.
ClRcT clAlarmEventDataGet | ( | CL_IN ClUint8T * | pData, |
CL_IN ClSizeT | size, | ||
CL_OUT ClAlarmHandleInfoT * | pAlarmHandleInfo | ||
) |
This function is used to get the decoded data in host format of the alarm data obtained after receiving the event.
pData | (in)The data received through the event on the alarm event channel. |
size | (in)The size of pData. |
pAlarmHandleInfo | (out)This parameter is filled with the decoded data into alarm info. |
CL_OK | The function executed successfully. |
CL_ALARM_ERR_NULL_POINTER | On passing null pointer in pData or pAlarmHandleInfo. |
ClRcT clAlarmEventSubscribe | ( | CL_IN const ClAlarmEventCallbackFuncPtrT | pAlarmEvtCallbackFuncFP | ) |
This function is used to subscribe for the events published by the alarm server.
pAlarmEvtCallbackFuncFP | (in) Pointer to the function which would be called once the event is published by the alarm server. |
CL_OK | The function executed successfully. |
CL_ALARM_ERR_NULL_POINTER | The pointer to the function passed is NULL. |
CL_ALARM_ERR_EVT_INIT | Failed while initializing the event handle. |
CL_ALARM_ERR_EVT_CHANNEL | Failed while opening the alarm event channel. |
CL_ALARM_ERR_EVT_SUBSCRIBE | Failed while setting the alarm event patten in subscribe. |
CL_ALARM_ERR_EVT_SUBSCRIBE_AGAIN | Failed while doing duplicate subscription. |
ClRcT clAlarmEventUnsubscribe | ( | ) |
This function is used to unsubscribe for the events published by the alarm server.
CL_OK | The function executed successfully. |
CL_ALARM_ERR_EVT_CHANNEL_CLOSE | The function failed while closing the event channel. |
CL_ALARM_ERR_EVT_FINALIZE | The function failed while doing event finalize. |
ClRcT clAlarmLibFinalize | ( | ) |
Cleans up the Alarm Library.
CL_OK | The function executed successfully. |
CL_ALARM_CLIENT_ERR_FINALIZE_FAILED | If alarm service finalization failed. |
ClRcT clAlarmLibInitialize | ( | ) |
Initializes the Alarm Library.
CL_OK | The function executed successfully. |
CL_ALARM_CLIENT_ERR_INIT_FAILED | If alarm service initialization failed. |
ClRcT clAlarmPendingAlarmListFree | ( | CL_INOUT ClAlarmPendingAlmListPtrT const | pPendingAlmList | ) |
Function to free the pending alarm list populated by clAlarmPendingAlarmsQuery.
CL_OK | : The function exection was successful. |
CL_ERR_NULL_POINTER | : The pointer is passed to the function. |
ClRcT clAlarmPendingAlarmsQuery | ( | CL_IN ClCorMOIdPtrT const | pMoId, |
CL_OUT ClAlarmPendingAlmListPtrT const | pPendingAlmList | ||
) |
Function to get the pending alarms on a specific object or in the whole system.
pMoId | (in) : It is the pointer to the resource MOID for which the query for all the alarms needs to be done. If NULL is passed, then the function will return all the pending alarms in the system. |
pPendingAlmList | (out) : It is a pointer to the structure of type ClAlarmPendingAlmListT. After the api returns successfully, this parameter will contain the count and the array of pending alarms information which is of type ClAlarmInfoT. |
CL_OK | : The function got executed successfully. |
CL_ALARM_ERR_NO_OWNER | : There is no registered owner for the alarm resource. |
CL_ERR_NULL_POINTER | : NULL pointer passed for either pMoId or pPendingAlmList. |
CL_ERR_NO_MEMORY | : No memory avaible. |
A pending alarm is the one which is either in assert state (or after soaking), under soaking state, or in suppressed state. The ClAlarmStateT describes all the possible state of an alarm.
ClRcT clAlarmRaise | ( | CL_IN ClAlarmInfoT * | pAlarmInfo, |
CL_OUT ClAlarmHandleT * | pAlarmHandle | ||
) |
Raises an alarm on a component.
alarmInfo | (in)Pointer to the structure that contains the alarm information. |
pAlarmHandle | (out)Pointer to the alarm handle. The alarm handle is used by Fault Manager(FM) to query alarm information and pass the alarm information to the fault repair handlers configured by the user. |
CL_OK | The function executed successfully. |
CL_ALARM_ERR_INVALID_MOID | On passing invalid MoId, the Managed Object Idetifier. |
CL_ALARM_ERR_NO_OWNER | The Managed object passed to the alarm raise doen't have any owner registered in COR. |
CL_ALARM_ERR_NULL_POINTER | On passing either pAlarmInfo or the pAlarmHandle as NULL. |
CL_ALARM_ERR_INVALID_PARAM | On passing the length of the user buffer (pAlarmInfo->len) as negative or the probable cause (pAlarmInfo->probCause) is not configured. |
CL_ALARM_ERR_NO_MEMORY | There is no memory left in this appication to raise the alarm. |
There are certain optional fields of the ClAlarmInfoT structure which can be provided while publishing the alarm:
A unique alarm handle is generated by the alarm server and provided back to the component that raises the alarm. The alarm handle is used by FM to query alarm information and pass the alarm information to the repair handlers configured while modeling.
ClRcT clAlarmStateQuery | ( | CL_IN const ClAlarmInfoT * | pAlarmInfo, |
CL_OUT ClAlarmStateT *const | pAlarmState | ||
) |
Function to get the current state of the alarm.
pAlarmInfo | (in) : Pointer to the structure of type ClAlarmInfoT. This structure should be populated with the resource MOID and the alarm information like probable cause, category, severity and specific problem of the alarm. |
pAlarmState | (out) : Pointer to the ClAlarmStateT. On successful return, the function would populate the current state of the alarm in this parameter. |
CL_OK | : The function completed successfully. |
CL_ERR_NOT_EXIST | : The alarm information doesn't exit on the managed resource. |
CL_ALARM_ERR_INVALID_MOID | : The MOID passed is invalid that is no object exist for this MOID in COR. |
CL_ALARM_ERR_NO_OWNER | : There is no registered owner for the alarm resource. |
CL_ERR_NULL_POINTER | : NULL pointer passed for either pAlarmInfo or pAlarmState. |
CL_ERR_NO_MEMORY | : No memory avaible. |
void clAlarmUtilPayloadBufFree | ( | ClUint8T * | pBuf | ) |
The function to free the buffer obtained after flattening the payload information.
pBuf | (in) : The pointer containing the payload information. |
None |
ClRcT clAlarmUtilPayLoadExtract | ( | ClUint8T * | pBuf, |
ClUint32T | size, | ||
ClAlarmUtilPayLoadListT ** | ppPayloadList | ||
) |
The function to extract the payload information sent at the time of alarm raise.
pBuf | (in) : The pointer containing the payload information. This is the pointer of the payload (buff) obtained from the ClAlarmHandleInfoT of the alarm event delivery callback function. |
size | (in) : Size of the payload. This is also obtained from the len element of the alarmInfo element of the ClAlarmHandleInfoT structure provided in the event delivery callback function. |
ppPayloadList | (out) : This is the pointer to the ClAlarmUtilPayLoadListT structure which is populated by the function with the payload information sent by the application reported alarm. |
CL_ERR_NULL_POINTER | : The pointer passed to pBuf or ppPayLoadListare NULL. |
CL_ERR_NO_MEMORY | : Failed while allocating the memory for the payload information. |
CL_OK | : The function completed successfully. |
ClRcT clAlarmUtilPayloadFlatten | ( | ClAlarmUtilPayLoadListPtrT | pPayLoadList, |
ClUint32T * | pSize, | ||
ClUint8T ** | ppBuf | ||
) |
Function to convert the payload information into a flat buffer.
pPayLoadList | (in) : The structure containing the payload information. |
pSize | (out) : The size of payload information. The value of this field has to be provided to the len element of the ClAlarmInfoT structure. |
ppBuf | (out) : The pointer is allocated by the function after flattening the alarm payload information filled in the pPayLoadList. This pointer has to be copied to the buff element of the ClAlarmInfoT structure. |
CL_ERR_NULL_POINTER | : The pointer passed to pPayLoadList, pSize or ppBuf is NULL. |
CL_OK | : The function completed successfully. |
void clAlarmUtilPayloadListFree | ( | ClAlarmUtilPayLoadListT * | pPayloadList | ) |
Function used to free the payload data-structure allocated during alarm reporting or receive.
pPayloadList | (in) : This is the pointer to the ClAlarmUtilPayLoadListT structure which is allocated after calling clAlarmUtilPayLoadExtract(). |
None |
ClRcT clAlarmVersionVerify | ( | CL_INOUT ClVersionT * | pVersion | ) |
This function is used to verify if a version of the function is supported by AM.
version | (in/out) As an input parameter, this contains the version you require to query or the current version. The output parameter is the Version supported. |
CL_OK | The function executed successfully. |
CL_ALARM_ERR_NULL_POINTER | The null pointer is passed for the version parameter. |
CL_ALARM_ERR_VERSION_UNSUPPORTED | If current version of this function is not supported. |