📄 u_cevn.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1998, All Rights Reserved. *//* *//* MODULE NAME : u_cevn.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains user confirm functions. These functions *//* are invoked from 'mms_req_serve' when the response to an *//* outstanding request is received. These functions should check *//* the resp_err member of the request control structure before *//* assuming returned data. *//* *//* NOTES ON REQUEST INFORMATION : *//* In the user application, request information structures may be *//* committed when the request is made (e.g. for error recovery). *//* If so, these information buffers could be freed in the confirm *//* functions. In the sample application, all request information *//* structures are automatic or handled when the request is issued. *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 08/24/98 EJV 01 Cleaned up printf from escape sequences. *//* 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 "scrndefs.h"#include "fkeydefs.h"/************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//* EVENT MANAGEMENT *//************************************************************************//************************************************************************//* MP DEFINE EVENT CONDITION *//************************************************************************/#if MMS_DEFEC_EN & REQ_ENST_VOID u_mp_defec_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Define Event Condition "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP DELETE EVENT CONDITION *//************************************************************************/#if MMS_DELEC_EN & REQ_ENST_VOID u_mp_delec_conf (MMSREQ_PEND *req_ptr) {DELEC_RESP_INFO *rsp_ptr; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Delete Event Condition "); if (req_ptr->resp_err) list_err_info (req_ptr); else { rsp_ptr = (DELEC_RESP_INFO *) req_ptr->resp_info_ptr; printf ("\n Canditates Not Deleted : %lu",rsp_ptr->cand_not_deleted); } conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP GET EVENT CONDITION ATTRIBUTES *//************************************************************************/#if MMS_GETECA_EN & REQ_ENST_VOID u_mp_geteca_conf (MMSREQ_PEND *req_ptr) {GETECA_RESP_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Get Event Condition Attributes "); if (req_ptr->resp_err) list_err_info (req_ptr); else { ptr = (GETECA_RESP_INFO *) req_ptr->resp_info_ptr; printf ("\n MMS Deletable : "); if (ptr->mms_deletable) printf ("YES"); else printf ("NO"); printf ("\n Event Condition Class : %d, ", ptr->eclass); if (ptr->eclass == 0) printf ("network triggered"); else if (ptr->eclass == 1) printf ("monitored"); else printf ("not defined"); printf ("\n Priority : %d ", (ptr->priority & 0xff)); printf ("\n Severity : %d ", (ptr->severity & 0xff)); printf ("\n Alarm Summary Reports : "); if (ptr->as_reports) printf ("YES"); else printf ("NO"); printf ("\n Monitored Variable : "); if (ptr->mon_var_pres) { if (ptr->mon_var_tag == 0) { printf ("Variable Specification"); print_var_spec (&ptr->var_ref); } else if (ptr->mon_var_tag == 1) printf ("Undefined"); else printf ("Invalid Tag"); } else printf ("Not present"); printf ("\n Evaluation Interval : "); if (ptr->eval_int_pres) printf ("%lu ", ptr->eval_interval); else printf ("Not present"); } conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP REPORT EVENT CONDITION STATUS *//************************************************************************/#if MMS_REPECS_EN & REQ_ENST_VOID u_mp_repecs_conf (MMSREQ_PEND *req_ptr) {REPECS_RESP_INFO *ptr; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Report Event Condition Status "); if (req_ptr->resp_err) list_err_info (req_ptr); else { ptr = (REPECS_RESP_INFO *) req_ptr->resp_info_ptr; printf ("\n Current State : %d, ", ptr->cur_state); switch (ptr->cur_state) { case 0 : printf ("disabled"); break; case 1 : printf ("idle"); break; case 2 : printf ("active"); break; default : printf ("invalid"); break; } printf ("\n Number of Event Enrollments : %lu ", ptr->num_of_ev_enroll); printf ("\n Enabled : "); if (ptr->enabled_pres) { if (ptr->enabled) printf ("YES"); else printf ("NO"); } else printf ("Not Present"); printf ("\n Transition to Active : "); if (ptr->tta_time_pres) print_evtime (&ptr->tta_time); else printf ("Not Present\n"); printf (" Transition to Idle : "); if (ptr->tti_time_pres) print_evtime (&ptr->tti_time); else printf ("Not Present"); } conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP ALTER EVENT CONDITION MONITORING *//************************************************************************/#if MMS_ALTECM_EN & REQ_ENST_VOID u_mp_altecm_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Alter Event Condition Monitoring "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP TRIGGER EVENT *//************************************************************************/#if MMS_TRIGE_EN & REQ_ENST_VOID u_mp_trige_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Trigger Event "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP DEFINE EVENT ACTION *//************************************************************************/#if MMS_DEFEA_EN & REQ_ENST_VOID u_mp_defea_conf (MMSREQ_PEND *req_ptr) { if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Define Event Action "); if (req_ptr->resp_err) list_err_info (req_ptr); conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP DELETE EVENT ACTION *//************************************************************************/#if MMS_DELEA_EN & REQ_ENST_VOID u_mp_delea_conf (MMSREQ_PEND *req_ptr) {DELEA_RESP_INFO *rsp_ptr; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Delete Event Action "); if (req_ptr->resp_err) list_err_info (req_ptr); else { rsp_ptr = (DELEA_RESP_INFO *) req_ptr->resp_info_ptr; printf ("\n Canditates Not Deleted : %lu",rsp_ptr->cand_not_deleted); } conf_info_wait (); } /* take care of continuous send var */ resp_rcvd = 1; /* set response received flag */ rep_count++; /* increment number of reps counter */ }#endif/************************************************************************//* MP GET EVENT ACTION ATTRIBUTES *//************************************************************************/#if MMS_GETEAA_EN & REQ_ENST_VOID u_mp_geteaa_conf (MMSREQ_PEND *req_ptr) {GETEAA_RESP_INFO *rsp_ptr;MODIFIER *mod_ptr;ST_INT j, ch; if (mms_debug_sel & MMS_LOG_USR_CONF) { conf_info_print (req_ptr,"Get Event Action Attributes "); if (req_ptr->resp_err) list_err_info (req_ptr); else { rsp_ptr = (GETEAA_RESP_INFO *) req_ptr->resp_info_ptr; mod_ptr = (MODIFIER *) (rsp_ptr + 1); printf ("\n MMS Deletable : "); if (rsp_ptr->mms_deletable) printf ("YES"); else printf ("NO"); printf ("\n Confirmed Service Request : "); list_bytes (rsp_ptr->conf_serv_req, rsp_ptr->conf_serv_req_len); printf ("\n CS Request Detail : "); if (rsp_ptr->cs_rdetail_pres) list_bytes (rsp_ptr->cs_rdetail, rsp_ptr->cs_rdetail_len); else printf ("Not present"); printf ("\n Number of Modifiers : %d",rsp_ptr->num_of_modifiers); if (rsp_ptr->num_of_modifiers > 0) { printf ("\n\n Press return to display modifiers"); ch = get_a_char (); CLEARSCR; printf (" Number of Modifiers : %d", rsp_ptr->num_of_modifiers);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -