⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmsaevn.c

📁 ICCP Toolkit 是在 Tru64下开发Tase.2通信协议的开发包
💻 C
📖 第 1 页 / 共 4 页
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//*   (c) Copyright Systems Integration Specialists Company, Inc.,	*//*      	  1986 - 1997, All Rights Reserved.		        *//*									*//* MODULE NAME : mmsaevn.c						*//* PRODUCT(S)  : MMSEASE						*//*									*//* MODULE DESCRIPTION : 						*//*	This module contains functions to initiate the MMS event	*//*	management services.  These functions are called from the	*//*	mainloop (check_key).						*//*									*//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE :				*//*									*//* MODIFICATION LOG :							*//*  Date     Who   Rev			Comments			*//* --------  ---  ------   -------------------------------------------	*//* 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"#if	(SYSTEM_SEL & (MSOFT | OS2))#include <conio.h>#endif#include "mms_usr.h"#include "mms_pevn.h"#include "mmsop_en.h"#include "userdefs.h"#include "fkeydefs.h"#include "gvaldefs.h"/************************************************************************/ST_RET get_as_req_info (GETAS_REQ_INFO *info);ST_BOOLEAN get_service_err (ERR_INFO *info);/************************************************************************//* For debug version, use a static pointer to avoid duplication of 	*//* __FILE__ strings.							*//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//*			do_defec					*//* create and send a define event condition request			*//************************************************************************/ST_VOID do_defec (ST_VOID)  {#if MMS_DEFEC_EN & REQ_ENDEFEC_REQ_INFO req_info;ST_INT chan;ST_BOOLEAN data_entered;ST_INT num;ST_LONG	big;ST_CHAR	temp [100];  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  nxt_buf = source_buf;		/* for VA functions input functions	*/  printf ("\n Enter Event Condition Name :\n");  data_entered = get_objname (&req_info.evcon_name);  if (data_entered)    {    req_info.eclass = 0;    printf (" Enter Class (0-1) : (R) (default = 0)");    if (intget (&num))      {      if ((num >= 0) && (num <= 1))        req_info.eclass = num;      }    }  if (data_entered)    {    req_info.priority = 64;    printf (" Enter Priority (0-127) : (R) (default = 64)");    if (intget (&num))      {      if ((num >= 0) && (num <= 127))        req_info.priority = (ST_UCHAR) num;      }    }  if (data_entered)    {    printf (" Enter Severity : (R) (default = 64)");    req_info.severity = 64;    if (intget (&num))      {      if ((num >= 0) && (num <= 127))        req_info.severity = (ST_UCHAR) num;      }    }  if (data_entered)    {    req_info.as_reports_pres = SD_FALSE;     printf (" Enter Alarm Summary Reports (y/n) : (O) ");    if (strget (temp))      {      if ((temp[0] == 'y') || (temp[0] == 'Y'))        {        req_info.as_reports_pres = SD_TRUE;        req_info.as_reports      = SD_TRUE;	}      if ((temp[0] == 'n') || (temp[0] == 'N'))        {        req_info.as_reports_pres = SD_TRUE;         req_info.as_reports      = SD_FALSE; 	}      }    }  if (data_entered)    {    printf (" Enter Monitored Variable (O) :\n");    if (get_var_spec (&req_info.var_ref))      req_info.mon_var_pres = SD_TRUE;    else      req_info.mon_var_pres = SD_FALSE;    }  if (data_entered)    {    printf (" Enter Evaluation Interval (O) :");    if (longget (&big))      {      req_info.eval_int_pres = SD_TRUE;      req_info.eval_interval = (ST_UINT) big;      }    else      req_info.eval_int_pres = SD_FALSE;    }  if (data_entered)    {    if (! mp_defec (chan,&req_info))      print_req_error ();    if (num_reps)			/* if this an auto repeat -	*/      {      if (start_cont ())		/* wait for 1st to complete	*/	return;      num_outstanding = 1;      while (rep_count < num_reps)	/* if enough done -		*/	{	if (! mp_defec (chan, &req_info))	  break;	num_outstanding++;	if (cont_serve ())			/* if user hit a key	*/	  return;	}      cont_done ();			/* display results		*/      }    }  else    wait_msg ("\n Must enter all required information ");  (*menu_set_fun) ();#endif  }/************************************************************************//*			do_delec					*//* create and send a delete event condition request			*//************************************************************************/ST_VOID do_delec (ST_VOID)  {#if MMS_DELEC_EN & REQ_ENDELEC_REQ_INFO *req_info;OBJECT_NAME    *obj_ptr;ST_INT chan;ST_BOOLEAN data_entered;ST_INT num;ST_BOOLEAN done;ST_CHAR	temp [100];  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  req_info = (DELEC_REQ_INFO *) dest_buffer;  obj_ptr  = (OBJECT_NAME *) (req_info + 1);  printf ("\n   (0:specific, 1:aa-specific, 2:domain, 3:vmd)");  printf ("\n Enter Scope of Delete (0-3) (R) : ");  if (data_entered = intget (&num))    {    switch (num)      {      case  (0) :        req_info->req_tag = 0;        req_info->num_of_names = 0;        done = SD_FALSE;	while (!done)	  {          printf (" Enter Object Name : \n");          if (get_objname (obj_ptr))	    {            req_info->num_of_names++;	    obj_ptr++;	    }	  else	    done = SD_TRUE;	  }        break;                                                                                case  (1) :        req_info->req_tag = 1;        break;      case  (2) :        printf (" Enter Domain Name : (R) ");        if (strget (temp))          {          req_info->req_tag = 2;          temp [MAX_IDENT_LEN] = '\x00';          strcpy (req_info->dname,temp);          }        else          data_entered = SD_FALSE;        break;      case  (3) :        req_info->req_tag = 3;        break;      default   :        data_entered = SD_FALSE;        break;      }    }  if (data_entered)    {    if (! mp_delec (chan,req_info))      print_req_error ();    if (num_reps)			/* if this an auto repeat -	*/      {      if (start_cont ())		/* wait for 1st to complete	*/	return;      num_outstanding = 1;      while (rep_count < num_reps)	/* if enough done -		*/	{	if (! mp_delec (chan, req_info))	  break;	num_outstanding++;	if (cont_serve ())			/* if user hit a key	*/	  return;	}      cont_done ();			/* display results		*/      }    }  else    wait_msg ("\n Must enter all required information ");  (*menu_set_fun) ();#endif  }/************************************************************************//*			do_geteca					*//* create and send a get event condition attributes request		*//************************************************************************/ST_VOID do_geteca (ST_VOID)  {#if MMS_GETECA_EN & REQ_ENGETECA_REQ_INFO req_info;ST_INT chan;ST_BOOLEAN data_entered;  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  printf ("\n Enter Event Condition Name :\n");  data_entered = get_objname (&req_info.evcon_name);  if (data_entered)    {    if (! mp_geteca (chan,&req_info))      print_req_error ();    if (num_reps)			/* if this an auto repeat -	*/      {      if (start_cont ())		/* wait for 1st to complete	*/	return;      num_outstanding = 1;      while (rep_count < num_reps)	/* if enough done -		*/	{	if (! mp_geteca (chan, &req_info))	  break;	num_outstanding++;	if (cont_serve ())			/* if user hit a key	*/	  return;	}      cont_done ();			/* display results		*/      }    }  else    wait_msg ("\n Must enter all required information ");  (*menu_set_fun) ();#endif  }/************************************************************************//*			do_repecs					*//* create and send a report event condition status request		*//************************************************************************/ST_VOID do_repecs (ST_VOID)  {#if MMS_REPECS_EN & REQ_ENREPECS_REQ_INFO req_info;ST_INT chan;ST_BOOLEAN data_entered;  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  printf ("\n Enter Event Condition Name :\n");  data_entered = get_objname (&req_info.evcon_name);  if (data_entered)    {    if (! mp_repecs (chan,&req_info))      print_req_error ();    if (num_reps)			/* if this an auto repeat -	*/      {      if (start_cont ())		/* wait for 1st to complete	*/	return;      num_outstanding = 1;      while (rep_count < num_reps)	/* if enough done -		*/	{	if (! mp_repecs (chan, &req_info))	  break;	num_outstanding++;	if (cont_serve ())			/* if user hit a key	*/	  return;	}      cont_done ();			/* display results		*/      }    }  else    wait_msg ("\n Must enter all required information ");  (*menu_set_fun) ();#endif  }/************************************************************************//*			do_altecm					*//* create and send an alter event condition monitoring request 		*//************************************************************************/ST_VOID do_altecm (ST_VOID)  {#if MMS_ALTECM_EN & REQ_ENALTECM_REQ_INFO req_info;ST_INT	chan;ST_BOOLEAN data_entered;ST_INT	num;ST_LONG	big;ST_CHAR    temp [100];  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  printf ("\n Enter Event Condition Name :\n");  data_entered = get_objname (&req_info.evcon_name);  if (data_entered)    {    req_info.enabled_pres = SD_FALSE;     printf (" Enter Enabled (y/n) : (O) ");    if (strget (temp))      {      if ((temp[0] == 'y') || (temp[0] == 'Y'))        {        req_info.enabled_pres = SD_TRUE;        req_info.enabled      = SD_TRUE;	}      if ((temp[0] == 'n') || (temp[0] == 'N'))        {        req_info.enabled_pres = SD_TRUE;         req_info.enabled      = SD_FALSE; 	}      }    }  if (data_entered)    {    req_info.priority_pres = SD_FALSE;    printf (" Enter Priority (0-127) : (O) ");    if (intget (&num))      {      if ((num >= 0) && (num <= 127))        {        req_info.priority_pres = SD_TRUE;        req_info.priority      = (ST_UCHAR) num;	}      }    }  if (data_entered)    {    req_info.as_reports_pres = SD_FALSE;     printf (" Enter Alarm Summary Reports (y/n) : (O) ");    if (strget (temp))      {      if ((temp[0] == 'y') || (temp[0] == 'Y'))        {        req_info.as_reports_pres = SD_TRUE;        req_info.as_reports      = SD_TRUE;	}      if ((temp[0] == 'n') || (temp[0] == 'N'))        {        req_info.as_reports_pres = SD_TRUE;         req_info.as_reports      = SD_FALSE; 	}      }    }  if (data_entered)    {    printf (" Enter Evaluation Interval (O) :");    if (longget (&big))      {      req_info.eval_int_pres = SD_TRUE;      req_info.eval_int      = (ST_UINT) big;      }    else      req_info.eval_int_pres = SD_FALSE;    }  if (data_entered)    {    if (! mp_altecm (chan,&req_info))      print_req_error ();    if (num_reps)			/* if this an auto repeat -	*/      {      if (start_cont ())		/* wait for 1st to complete	*/	return;      num_outstanding = 1;      while (rep_count < num_reps)	/* if enough done -		*/	{	if (! mp_altecm (chan, &req_info))	  break;	num_outstanding++;	if (cont_serve ())			/* if user hit a key	*/	  return;	}      cont_done ();			/* display results		*/      }    }  else    wait_msg ("\n Must enter all required information ");  (*menu_set_fun) ();#endif  }/************************************************************************//*			do_trige					*//* create and send a trigger event request 				*//************************************************************************/ST_VOID do_trige (ST_VOID)  {#if MMS_TRIGE_EN & REQ_ENTRIGE_REQ_INFO req_info;ST_INT chan;ST_BOOLEAN data_entered;ST_INT num;  if (!get_chan (&chan))    {    (*menu_set_fun) ();    return;    }  printf ("\n Enter Event Condition Name :\n");  data_entered = get_objname (&req_info.evcon_name);  if (data_entered)    {    req_info.priority_pres = SD_FALSE;    printf (" Enter Priority (0-127) : (O) ");    if (intget (&num))      {      if ((num >= 0) && (num <= 127))        {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -