am_defs.h

The following is a partial listing of this file showing you important definitions you need to know:

#ifndef _AM_DEFS_H

#define _AM_DEFS_H

#include <inc_path/rtr_bcst.h>

/***************************************/

/* Internal format of Datagram Address */

/***************************************/

typedef TCHAR AM_DADDR[NODE_ID_LEN+1+OBJECT_NAME_LEN+1];

#define AM_BLANK_MSG _T("                                           ")

/******************************************************************/

/* Interaction between AMRP and process Generating or Updating    */

/* Alarm Status                                                  */

/******************************************************************/

/* Types of responses a process can request. Full implies, wait  */

/* until after processing is complete and sent a response on the  */

/* success or failure of the request.                             */

/******************************************************************/

typedef int AM_RESP_TYPE;

#define AM_FULL_RESP       0

#define AM_CAPTURED_RESP   1

#define AM_NO_RESP         2

/***********************************************************************/

/* Typedef for Key for identifying which segment is being responded to */

/***********************************************************************/

typedef int AM_RESP_KEY;

/*******************************************************************/

/* Alarm States                                                   */

/* WARNING - the order here must not be changed. For efficiency   */

/* the module AM_TERM_INFO assumes the order as specified. If this */

/* is changed, active terminal alarm information will be incorrect */

/*                                                                           */

/* AM_REPEATED is not an actual state, but is used for auto-repeat */

/* updates.                                                                  */

/***********************************************************************/

typedef int AM_STATE_TYPE;

#define AM_GENERATED    0

#define AM_ACKNOWLEDGED 1

#define AM_CLEARED      2

#define AM_DELETED      3

#define AM_NONEXISTENT  4

#define AM_COMMENT_MSG  5

#define AM_NOSTATE      6

#define AM_REPEATED     7

/******************************************************************/

/* number of permanent states - I.E. state in which in an alarm   */

/* can remain                                                    */

/******************************************************************/

#define AM_NUM_PERMANENT_STATES 3 /* gen, ack, clear */

/**********************/

/* Legal Filter Types */

/**********************/

typedef int AM_FILTER_TYPE;

#define AM_TIME_FILTER     0

#define AM_STATE_FILTER    1

#define AM_FR_FILTER       2

#define AM_CLASS_FILTER    3

/******************************************/

/* Type Definitions for Filter Parameters */

/******************************************/

#define SIZEOF_AM_FILTER COR_MAX(CLASS_ID_LEN+1,FR_ID_LEN+1)

typedef union am_filter

    {

       COR_STAMP       start_time;

       TCHAR             class_id[CLASS_ID_LEN+1];

       AM_STATE_TYPE   alarm_state;

       TCHAR             fr_id[FR_ID_LEN+1];

       COR_I1      _pad[DO_ALIGN(SIZEOF_AM_FILTER,4)]; /* alignment data */

    } AM_FILTER;

typedef struct am_filter_parm

    {

          AM_FILTER_TYPE type;

          AM_FILTER filter;

    } AM_FILTER_PARM;

typedef struct am_stacked_info

    {

          COR_STAMP gentime;

          AM_STATE_TYPE alarm_state;

          TCHAR alarm_msg[ALARM_MSG_LEN+1];

   COR_I1 _pad[3];                /* alignment data */

    } AM_STACKED_INFO;

/*********************************************************************/

/* Maximum Number of Stacked Alarms (in addition to the most recent) */

/*********************************************************************/

#define AM_MAX_STACKED 19

/*************************************/

/* Max length of Alarm Comment      */

/*************************************/

#define old_AM_COMMENT_LEN 72

typedef struct old_am_comment_info

    {

          COR_STAMP gentime;

          TCHAR alarm_comment[old_AM_COMMENT_LEN+1];

    COR_I1 _pad[3];                        /* alignment data */

      } old_AM_COMMENT_INFO;

#define AM_COMMENT2_LINE_LEN 72

#define AM_COMMENT2_LEN (AM_COMMENT2_LINE_LEN*10)

typedef struct am_comment_info2

      {

          COR_STAMP gentime;

          TCHAR alarm_comment[AM_COMMENT2_LEN+1];

   COR_I1 _pad[3];                       /* alignment data */

      } AM_COMMENT2_INFO;

#define AM_COMMENT_ACT_ADD           _T('A')

#define AM_COMMENT_ACT_DELETE        _T('D')

/*********************************************************************/

/* Maximum Number of Alarm Comments                                 */

/*********************************************************************/

#define AM_MAX_ALARM_COMMENTS 20

/************************************/

/* Maximum size of a string parameter */

/************************************/

#define AM_MAX_STR 73

/********************************************/

/* Log and Delete Option Character Meanings */

/********************************************/

#define AM_ACK_CHAR  _T('A')

#define AM_CLR_CHAR  _T('R')

#define AM_DEL_CHAR  _T('D')

#define AM_GEN_CHAR  _T('G')

/*******************************************************************/

/* Defines for alarm visibility type                              */

/* WARNING - the order here must not be changed. For efficiency   */

/* the module AM_TERM_INFO assumes the order as specified. If this */

/* is changed, active terminal alarm information will be incorrect */

#define AM_ALL_ALARMS   0  /* all alarms visible by this user */

#define AM_UNACK_ONLY   1  /* all unacknowledged alarms visible by this user  */

#define AM_UNACK_UNCLR  2  /* all unacknowledged, uncleared alarms visible by */

                           /* this user */

/**********************************/

/* Defines for Message Formatting */

/**********************************/

#define AM_DG       _T('D')

#define AM_NON_DG   _T('L')

#define AM_LL       _T('L')

/***************************/

/* Resident Process States */

/***************************/

typedef int AMRP_STATE_TYPE;

/*********************/

/* Legal AMRP States */

/*********************/

#define AMRP_MASTER    0

#define AMRP_SLAVE     1

/***************************/

/* Legal Alarm Field Types */

/***************************/

typedef int AM_FIELD_TYPE;

#define AM_CHAR         0

#define AM_STR          1

#define AM_INT          2

#define AM_COR_I1       3

#define AM_COR_I2       4

#define AM_COR_I4       5

#define AM_COR_BOOLEAN  6

#define AM_COR_U1       7

#define AM_COR_U2       8

#define AM_COR_U4       9

#define AM_FLOAT       10

#define AM_EXP_MSG_LEN  ( ALARM_MSG_LEN ) /* from sc_recs.h */

#define AM_MAX_FIELDS   6 /* warning, if this number is changed, so must */

                         /* the case statement in procedure am_msg_expand */

#define AM_STATE_LEN    3

#define AM_TIME_LEN    22

/************************************************************/

/* Typedefs neccessary to define unformatted message fields */

/************************************************************/

#define SIZEOF_AM_FIELD (AM_MAX_STR+1)

typedef union am_field

{

        COR_I4 cori4_val;

        COR_I2 cori2_val;

        COR_I1 cori1_val;

        COR_U4 coru4_val;

        COR_U2 coru2_val;

        COR_U1 coru1_val;

        COR_BOOLEAN corbool_val;

        int ival;

        float fval;

        TCHAR chval;

        TCHAR str[AM_MAX_STR+1];

        /* This structure must be aligned because it is contained

           * in the AM_GEN_SEG message segment, which may be passed

           * in a hybrid environment. */

           COR_I1 _pad[DO_ALIGN(SIZEOF_AM_FIELD,4)];

     } AM_FIELD;

typedef struct am_msg_field

     {

          AM_FIELD_TYPE ftype;

          AM_FIELD field;

     } AM_MSG_FIELD;

/*************************************/

/* Max length of reference id string */

/*************************************/

#define AM_REF_ID_LEN 32

#define AM_NULL_REF_ID -1

/***********************************/

/* Length of buffer in am_log            */

/***********************************/

#define AM_LOG_BUF_SIZE 156

#define AM_LOG_ALARM_FILE      0

#define AM_LOG_ALTERNATE_FILE  1

#define AM_LOG_BOTH_FILES      2

/* The character that begins a site-wide setup name. */

#define AM_SITE_WIDE_CHAR _T('$')

/* These help us create aligned messages. */

#define SETUP_ID_MFLEN DO_ALIGN(SETUP_ID_LEN+1,4)

#define USER_ID_MFLEN DO_ALIGN(USER_ID_LEN+1,4)

/* The name that is displayed when the user is using an ad hoc

* setup. (This must be SETUP_ID_LEN characters or less). 

                          0123456789ABCDEF

*/ 

#define AMAP_ADHOC_SETUP _T("<AD HOC SETUP>")

#define AM_HELPTEXT_LEN 72

#define AM_HELPTEXT_NUM_LINES 59

/* segment/feature Versioning information */

/* initiated with creation of am_list_ex, am_upd_inf_ex, am_gen_list_ex */

#define AM_VERS_0  0

#define AM_VERS_1  1

#define AM_VERS_2               2

#define AM_VERS_3  3      /*lengthened, perm., comments */

/* If you add a new version, bump the current version, as all code

** using this should be compatible

** with any earlier versions (provided fields are NOT removed.)

*/

#define AM_VERS_CURRENT  AM_VERS_3

More information

Alarm Management definitions header files.