📄 u_iprg.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1997, All Rights Reserved. *//* *//* MODULE NAME : u_iprg.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains user defined code to service program *//* invocation management indications. These functions are invoked *//* from the 'mms_ind_serve' function, & should perform the request *//* action. *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 01/15/99 RKR 01 getpi was reusing a freed control structure *//* 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_pcon.h"#include "mms_pprg.h"#include "mms_vprg.h"#include "mms_vvmd.h"#include "userdefs.h"#include "mmsop_en.h"#include "gvaldefs.h"#include "scrndefs.h"#include "fkeydefs.h"/************************************************************************/static ST_BOOLEAN done; /* used for input loop control */static ST_INT tot_len; /* used for total string len */static ST_INT num; /* integer used for input */ST_RET u_create_pi (CREPI_REQ_INFO *);ST_RET u_delete_pi (DELPI_REQ_INFO *);ST_RET u_start_pi (START_REQ_INFO *);ST_RET u_stop_pi (STOP_REQ_INFO *);ST_RET u_resume_pi (RESUME_REQ_INFO *);ST_RET u_reset_pi (RESET_REQ_INFO *);ST_RET u_kill_pi (KILL_REQ_INFO *);/************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/************************************************************************//************************************************************************//* PROGRAM INVOCATION MANAGEMENT *//************************************************************************//************************************************************************//* CREATE PROGRAM INVOCATION *//************************************************************************/#define USE_MV_CREPI_RESP /* define to use the VM CreatePI resp */#if MMS_CRE_PI_EN & RESP_ENST_VOID u_crepi_ind (MMSREQ_IND *req_info) {CREPI_REQ_INFO *ptr;ST_INT i;ST_CHAR **dn_ptr; ptr = (CREPI_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Create Program Invocation "); dn_ptr = (ST_CHAR **) (ptr + 1); printf ("\n Program Invocation Name : %s", ptr->piname); printf ("\n Number of Domain Names : %d ", ptr->num_of_dnames); for (i = 0; i < ptr->num_of_dnames; i++, dn_ptr++) printf ("\n %d) %s ", i+1, *dn_ptr); if (ptr->reusable) printf ("\n Reusable"); else printf ("\n Not Reusable"); printf ("\n Monitor : "); if (ptr->monitor_pres) { if (ptr->monitor) printf ("Permanent"); else printf ("Current"); } else printf ("Not present"); }#ifndef USE_MV_CREPI_RESP /* -- fill in primitive data */ mp_crepi_resp (req_info);#else mv_crepi_resp (req_info, SD_SUCCESS); /* let the VM respond */#endif indic_info_wait (); /* allow user to see indic info */ }#endif/************************************************************************//* DELETE PROGRAM INVOCATION *//************************************************************************/#define USE_MV_DELPI_RESP /* define to use the VM DeletePI resp */#if MMS_DEL_PI_EN & RESP_ENST_VOID u_delpi_ind (MMSREQ_IND *req_info) {DELPI_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;ST_INT chan; ptr = (DELPI_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Delete Program Invocation "); printf ("\n Program Invocation Name : %s", ptr->piname); }#ifndef USE_MV_DELPI_RESP /* -- fill in primitive data */ mp_delpi_resp (req_info);#else/* Save current VMD; switch to the VMD corresponding to this ass'n. */ vmd_save = m_vmd_select; m_vmd_select = mms_chan_info[req_info->chan].objs.vmd; err = ms_check_pi_state (ptr->piname, MMSOP_DELETE_PI, 0xff); if (!err) err = u_delete_pi (ptr); chan = req_info->chan; if (mv_delpi_resp (req_info, err, SD_TRUE)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* DELETE PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_delete_pi (DELPI_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* START *//************************************************************************/#define USE_MV_START_RESP /* define to use the VM DeletePI resp */#if MMS_START_EN & RESP_ENST_VOID u_start_ind (MMSREQ_IND *req_info) {START_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;EXTERN_INFO ext;ST_INT chan; ptr = (START_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Start "); printf ("\n Program Invocation Name : %s", ptr->piname); printf ("\n Start Argument : "); if (ptr->start_arg_pres) { if (ptr->start_arg_type == ARG_TYPE_ENCODED) { printf (" ENCODED START ARG"); if (ask ("\n Decode & List EXTERNAL (N) ? ",0)) { if (!ms_decode_extern (ptr->start_arg, ptr->start_arg_len,&ext)) list_external (stdout,&ext); else { printf ("\n EXTERNAL decode error\n"); list_bytes (ptr->start_arg, ptr->start_arg_len); } } else list_bytes (ptr->start_arg, ptr->start_arg_len); } else printf ("%s", ptr->start_arg); } else printf ("Not present"); }#ifndef USE_MV_START_RESP /* -- fill in primitive data */ mp_start_resp (req_info);#else/* Save current VMD; switch to the VMD corresponding to this ass'n. */ vmd_save = m_vmd_select; m_vmd_select = mms_chan_info[req_info->chan].objs.vmd; err = ms_check_pi_state (ptr->piname, MMSOP_START, 0xff); if (!err) err = u_start_pi (ptr); if ((ptr->start_arg_pres) && (ptr->start_arg_type == ARG_TYPE_SIMPLE)) { printf ("\n Start with: '%s'", ptr->start_arg); } chan = req_info->chan; if (mv_start_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save; #endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* START PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_start_pi (START_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* STOP *//************************************************************************/#define USE_MV_STOP_RESP /* define to use the VM Stop Program resp*/#if MMS_STOP_EN & RESP_ENST_VOID u_stop_ind (MMSREQ_IND *req_info) {STOP_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;ST_INT chan; ptr = (STOP_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Stop "); printf ("\n Program Invocation Name : %s", ptr->piname); }#ifndef USE_MV_START_RESP /* -- fill in primitive data */ mp_stop_resp (req_info);#else/* Save current VMD; switch to the VMD corresponding to this ass'n. */ vmd_save = m_vmd_select; m_vmd_select = mms_chan_info[req_info->chan].objs.vmd; err = ms_check_pi_state (ptr->piname, MMSOP_STOP, 0xff); if (!err) err = u_stop_pi (ptr); chan = req_info->chan; if (mv_stop_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* STOP PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_stop_pi (STOP_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* RESUME *//************************************************************************/#define USE_MV_RESUME_RESP /* define to use the VM Stop Program resp*/#if MMS_RESUME_EN & RESP_ENST_VOID u_resume_ind (MMSREQ_IND *req_info) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -