📄 u_ievn.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1998, All Rights Reserved. *//* *//* MODULE NAME : u_ievn.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains user defined code to service event *//* management indications. These functions are invoked from *//* the 'mms_ind_serve' function, and should perform the request *//* action. *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 08/31/98 EJV 02 Cleaned up printf from escape sequences. *//* 08/15/97 MDE 01 BTOD handling changes *//* 04/15/97 DSF 7.00 MMSEASE 7.0 release. See MODL70.DOC for *//* history. *//************************************************************************/#include "glbtypes.h"#include "sysincs.h"#include "mms_usr.h"#include "mms_pevn.h"#include "userdefs.h"#include "mmsop_en.h"#include "gvaldefs.h"#include "fkeydefs.h"#include "scrndefs.h"static ST_BOOLEAN done; /* used for input loop control */static ST_INT tot_len; /* used for total string len */static ST_INT len; /* used for return lengths */static ST_INT num; /* integer used for input */static ST_LONG lnum; /* long integer used for input *//************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//* EVENT MANAGEMENT *//************************************************************************//* DEFINE EVENT CONDITION *//************************************************************************/#if MMS_DEFEC_EN & RESP_ENST_VOID u_defec_ind (MMSREQ_IND *req_info) {DEFEC_REQ_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Define Event Condition "); ptr = (DEFEC_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Condition Name : "); print_objname (&(ptr->evcon_name)); printf ("\n Event Condition Class : "); switch (ptr->eclass) { case 0 : printf ("0, network triggered"); break; case 1 : printf ("1, monitored"); break; default: printf ("%d, invalid class", ptr->eclass); break; } printf ("\n Priority : %u",ptr->priority); printf ("\n Severity : %u",ptr->severity); printf ("\n Alarm Summary Reports : "); if (ptr->as_reports_pres) { if (ptr->as_reports) printf ("YES"); else printf ("NO"); } else printf ("Not present"); printf ("\n Monitored Variable : "); if (ptr->mon_var_pres) print_var_spec (&ptr->var_ref); else printf ("Not present"); printf ("\n Evaluation Interval : "); if (ptr->eval_int_pres) printf ("%lu ", ptr->eval_interval); else printf ("Not present"); } mp_defec_resp (req_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* DELETE EVENT CONDITION *//************************************************************************/#if MMS_DELEC_EN & RESP_ENST_VOID u_delec_ind (MMSREQ_IND *req_info) {DELEC_REQ_INFO *req_ptr;OBJECT_NAME *obj_ptr;DELEC_RESP_INFO rsp_info;ST_INT j, ch, line; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Delete Event Condition "); req_ptr = (DELEC_REQ_INFO *) req_info->req_info_ptr; printf ("\n Scope of Delete : "); switch (req_ptr->req_tag) { case 0 : printf ("specific"); obj_ptr = (OBJECT_NAME *) (req_ptr + 1); printf ("\n Object Names : %d ", req_ptr->num_of_names); line = 14; for (j = 0; j < req_ptr->num_of_names; j++) { print_objname (obj_ptr); obj_ptr++; line += 2; if (((j+1) < req_ptr->num_of_names) && (line >= 22)) { printf ("\n\n Press return to continue, x to exit"); ch = get_a_char (); if (ch == 'x' || ch == 'X') j = req_ptr->num_of_names; /* exit selected */ line = 14; } } break; case 1 : printf ("AA-Specific"); break; case 2 : printf ("Domain"); printf ("\n Domain Name : %s ", req_ptr->dname); break; case 3 : printf ("VMD"); break; default: printf ("Invalid Scope"); break; } } /* create a default response */ rsp_info.cand_not_deleted = 98765L; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter Number of Candidates not Deleted : "); rsp_info.cand_not_deleted = 0; if (intget (&num)) rsp_info.cand_not_deleted = (unsigned long) num; } mp_delec_resp (req_info, &rsp_info); indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* GET EVENT CONDITION ATTRIBUTES *//************************************************************************/#if MMS_GETECA_EN & RESP_ENST_VOID u_geteca_ind (MMSREQ_IND *req_info) {GETECA_REQ_INFO *req_ptr;GETECA_RESP_INFO rsp_info; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Get Event Condition Attributes "); req_ptr = (GETECA_REQ_INFO *) req_info->req_info_ptr; print_objname (&req_ptr->evcon_name); } /* create a default response */ rsp_info.mms_deletable = SD_FALSE; rsp_info.eclass = 0; rsp_info.priority = 64; rsp_info.severity = 64; rsp_info.as_reports = SD_FALSE; rsp_info.mon_var_pres = SD_TRUE; rsp_info.mon_var_tag = 1; rsp_info.eval_int_pres = SD_TRUE; rsp_info.eval_interval = 32; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter MMS Deletable (y/n) : (default = FALSE) "); tbuf[0] = 'n'; if (strget (tbuf)) { if (tbuf[0] == 'y' || tbuf[0] == 'Y') rsp_info.mms_deletable = SD_TRUE; } printf (" Enter Event Condition Class (0-1) : (default = 0) "); rsp_info.eclass = 0; if (intget (&num)) { if ((num >= 0) && (num <=1)) rsp_info.eclass = num; } printf (" Enter Priority (0-127) : (default = 64) "); rsp_info.priority = 64; if (intget (&num)) { if ((num >= 0) && (num <=127)) rsp_info.priority = (ST_UCHAR) num; } printf (" Enter Severity (0-127) : (default = 64) "); rsp_info.severity = 64; if (intget (&num)) rsp_info.severity = (ST_UCHAR) num; printf (" Enter Alarm Summary Reports (y/n) : (default = FALSE) "); tbuf[0] = 'n'; if (strget (tbuf)) { if (tbuf[0] == 'y' || tbuf[0] == 'Y') rsp_info.as_reports = SD_TRUE; } if (ask (" Enter Monitored Variable : (O) ? ",0)) { rsp_info.mon_var_pres = SD_TRUE; printf (" Enter Monitored Variable Choice (0-1) : (default = 1) "); rsp_info.mon_var_tag = 1; /* default to undefined */ intget (&num); if (num == 0) { init_nxtbuf (); /* initialize next buffer for address and data */ if (get_var_spec (&rsp_info.var_ref)) rsp_info.mon_var_tag = 0; } } else rsp_info.mon_var_pres = SD_FALSE; printf (" Enter Evaluation Interval : "); rsp_info.eval_int_pres = SD_FALSE; if (longget (&lnum)) { rsp_info.eval_int_pres = SD_TRUE; rsp_info.eval_interval = lnum; } } mp_geteca_resp (req_info, &rsp_info); indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* REPORT EVENT CONDITION STATUS *//************************************************************************/#if MMS_REPECS_EN & RESP_ENST_VOID u_repecs_ind (MMSREQ_IND *req_info) {REPECS_REQ_INFO *req_ptr;REPECS_RESP_INFO rsp_info; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Report Event Condition Status "); req_ptr = (REPECS_REQ_INFO *) req_info->req_info_ptr; print_objname (&req_ptr->evcon_name); } /* create a default response */ rsp_info.cur_state = 0; rsp_info.num_of_ev_enroll = 0; rsp_info.enabled_pres = SD_FALSE; rsp_info.tta_time_pres = SD_FALSE; rsp_info.tti_time_pres = SD_FALSE; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter Current State (0-2) : (default = 0) "); rsp_info.cur_state = 0; if (intget (&num)) { if ((num >= 0) && (num <=2)) rsp_info.cur_state = num; } printf (" Enter Number of Event Enrollments : "); rsp_info.num_of_ev_enroll = 0; if (longget (&lnum)) rsp_info.num_of_ev_enroll = lnum; rsp_info.enabled_pres = (ST_BOOLEAN) ask (" Enter Enabled (y/n) : ",0); printf (" Enter Time of Last Transition to Active :\n"); if (get_evtime (&rsp_info.tta_time)) rsp_info.tta_time_pres = SD_TRUE; else rsp_info.tta_time_pres = SD_FALSE; printf (" Enter Time of Last Transition to Idle : \n"); if (get_evtime (&rsp_info.tti_time)) rsp_info.tti_time_pres = SD_TRUE; else rsp_info.tti_time_pres = SD_FALSE; } mp_repecs_resp (req_info, &rsp_info); indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* ALTER EVENT CONDITION MONITORING *//************************************************************************/#if MMS_ALTECM_EN & RESP_ENST_VOID u_altecm_ind (MMSREQ_IND *req_info) {ALTECM_REQ_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Alter Event Condition Monitoring "); ptr = (ALTECM_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Condition Name : "); print_objname (&(ptr->evcon_name)); printf ("\n Enabled : "); if (ptr->enabled_pres) { if (ptr->enabled) printf ("YES"); else printf ("NO"); } else printf ("Not present"); printf ("\n Priority : "); if (ptr->priority_pres) printf ("%u",ptr->priority); else printf ("Not present"); printf ("\n Alarm Summary Reports : "); if (ptr->as_reports_pres) { if (ptr->as_reports) printf ("YES"); else printf ("NO"); } else printf ("Not present"); printf ("\n Evaluation Interval : "); if (ptr->eval_int_pres) printf ("%lu ", ptr->eval_int); else printf ("Not present"); } mp_altecm_resp (req_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* TRIGGER EVENT *//************************************************************************/#if MMS_TRIGE_EN & RESP_ENST_VOID u_trige_ind (MMSREQ_IND *req_info) {TRIGE_REQ_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Trigger Event "); ptr = (TRIGE_REQ_INFO *) req_info->req_info_ptr; printf ("\n Event Condition Name : "); print_objname (&(ptr->evcon_name)); printf ("\n Priority : "); if (ptr->priority_pres) printf ("%u",ptr->priority); else printf ("Not present"); } mp_trige_resp (req_info); /* send the response */ indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* DEFINE EVENT ACTION *//************************************************************************/#if MMS_DEFEA_EN & RESP_ENST_VOID u_defea_ind (MMSREQ_IND *req_info) {DEFEA_REQ_INFO *req_ptr;MODIFIER *mod_ptr;ST_INT j, ch; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Define Event Action "); req_ptr = (DEFEA_REQ_INFO *) req_info->req_info_ptr; printf ("\n"); if (req_ptr->modlist_pres) { if (req_ptr->num_of_modifiers > 0) { printf ("\n Press return to display continue"); ch = get_a_char (); CLEARSCR; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -