📄 u_iprg.c
字号:
RESUME_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;EXTERN_INFO ext;ST_INT chan; ptr = (RESUME_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Resume "); printf ("\n Program Invocation Name : %s", ptr->piname); printf ("\n Resume Argument : "); if (ptr->resume_arg_pres) { if (ptr->resume_arg_type == ARG_TYPE_ENCODED) { printf (" ENCODED resume ARG"); if (ask ("\n Decode & List EXTERNAL (N) ? ",0)) { if (!ms_decode_extern (ptr->resume_arg, ptr->resume_arg_len,&ext)) list_external (stdout,&ext); else { printf ("\n EXTERNAL decode error\n"); list_bytes (ptr->resume_arg, ptr->resume_arg_len); } } else list_bytes (ptr->resume_arg, ptr->resume_arg_len); } else printf ("%s", ptr->resume_arg); } else printf ("Not present"); }#ifndef USE_MV_RESUME_RESP /* -- fill in primitive data */ mp_resume_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_RESUME, 0xff); if (!err) err = u_resume_pi (ptr); chan = req_info->chan; if (mv_resume_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* RESUME PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_resume_pi (RESUME_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* RESET *//************************************************************************//*#define USE_MV_RESET_RESP */ /* define to use the VM Reset Program resp*/#if MMS_RESET_EN & RESP_ENST_VOID u_reset_ind (MMSREQ_IND *req_info) {RESET_REQ_INFO *ptr;#if defined (USE_MV_RESET_RESP)VMD_CTRL *vmd_save;ST_RET err;ST_INT chan;#endif ptr = (RESET_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Reset "); printf ("\n Program Invocation Name : %s", ptr->piname); }#ifndef USE_MV_RESET_RESP /* -- fill in primitive data */ mp_reset_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, MMSRESET, 0xff); if (!err) err = u_reset_pi (ptr); chan = req_info->chan; if (mv_reset_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* RESET PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_reset_pi (RESET_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* KILL *//************************************************************************/#define USE_MV_KILL_RESP /* define to use the VM Kill Program resp*/#if MMS_KILL_EN & RESP_ENST_VOID u_kill_ind (MMSREQ_IND *req_info) {KILL_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;ST_INT chan; ptr = (KILL_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Kill "); printf ("\n Program Invocation Name : %s", ptr->piname); }#ifndef USE_MV_KILL_RESP /* -- fill in primitive data */ mp_kill_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_KILL, 0xff); if (!err) err = u_kill_pi (ptr); chan = req_info->chan; if (mv_kill_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }/************************************************************************//* KILL PROGRAM INVOCATION CUSTOMIZATION FUNCTION *//************************************************************************/ST_RET u_kill_pi (KILL_REQ_INFO *ptr) { return (SD_SUCCESS); }#endif/************************************************************************//* GET PROGRAM INVOCATION ATTRIBUTE *//************************************************************************/#define USE_MV_GETPI_RESP /* define to use the VM Kill Program resp*/#if MMS_GET_PI_EN & RESP_ENST_VOID u_getpi_ind (MMSREQ_IND *req_info) {GETPI_REQ_INFO *ptr;VMD_CTRL *vmd_save;ST_RET err;ST_INT chan;#if !defined (USE_MV_GETPI_RESP)ST_CHAR *strt_arg;GETPI_RESP_INFO *rsp_info;ST_INT i;ST_UCHAR ext_buf[100];ST_CHAR **dn_ptr;ST_CHAR *dn_str;#endif ptr = (GETPI_REQ_INFO *) req_info->req_info_ptr; if (mms_debug_sel & MMS_LOG_USR_IND) { indic_info_print (req_info,"Get Program Invocation Attribute "); printf ("\n Program Invocation Name : %s", ptr->piname); }#ifndef USE_MV_GETPI_RESP /* -- fill in primitive data */ /* create a default response */ rsp_info = (GETPI_RESP_INFO *) dest_buffer; dn_ptr = (ST_CHAR **) (rsp_info + 1); dn_str = dest_buffer + 2048; /* use 2 - 4K for domain namse */ strt_arg = dest_buffer +8192; /* use rest for start arg */ rsp_info->state = 5; rsp_info->mms_deletable = SD_FALSE; rsp_info->reusable = SD_FALSE; rsp_info->monitor = SD_FALSE; rsp_info->start_arg_type = ARG_TYPE_SIMPLE; rsp_info->start_arg = (ST_UCHAR *) strt_arg; strcpy ((ST_CHAR *) rsp_info->start_arg,"GetPI Start Argument"); rsp_info->num_of_dnames = 2; strcpy (dn_str, "domain_name_1"); *(dn_ptr++) = dn_str; dn_str += strlen (dn_str) + 1; strcpy (dn_str, "domain_name_2"); *dn_ptr = dn_str; if (mms_debug_sel & MMS_LOG_USR_IND) { printf ("\n\n Enter State : (default 0) "); rsp_info->state = 0; if (intget (&num)) rsp_info->state = num; if (ask (" Deletable ? ",0)) rsp_info->mms_deletable = SD_TRUE; else rsp_info->mms_deletable = SD_FALSE; if (ask (" Reusable ? ",0)) rsp_info->reusable = SD_TRUE; else rsp_info->reusable = SD_FALSE; if (ask (" Monitor ? ",0)) rsp_info->monitor = SD_TRUE; else rsp_info->monitor = SD_FALSE; if (ask ("\n Send ENCODED Execution Argument (N) ? ",0)) { rsp_info->start_arg_type = ARG_TYPE_ENCODED; get_external_asn1 (ext_buf,&(rsp_info->start_arg_len)); rsp_info->start_arg = ext_buf; } else { rsp_info->start_arg_type = ARG_TYPE_SIMPLE; printf (" Enter Start Arg : "); strget ((ST_CHAR *)rsp_info->start_arg); } tot_len = sizeof (GETPI_RESP_INFO); dn_ptr = (ST_CHAR **) (rsp_info + 1); /* reinitialize buffer pointers */ dn_str = dest_buffer + 2048; rsp_info->num_of_dnames = 0; done = SD_FALSE; while (!done) { printf (" Enter Domain Name : (R) "); if (strget (tbuf)) { tbuf[MAX_IDENT_LEN] = '\x00'; if ((tot_len += strlen (tbuf) + 1) < 8192) { rsp_info->num_of_dnames++; strcpy (dn_str, tbuf); *(dn_ptr++) = dn_str; dn_str += strlen (dn_str) + 1; } else { done = SD_TRUE; wait_msg ("\n Domain Name List too ST_INT32, last string was lost "); } } else done = SD_TRUE; /* set exit condition */ } } mp_getpi_resp (req_info, rsp_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_GET_PI_ATTR, 0xff); chan = req_info->chan; if (mv_getpi_resp (req_info, err)) mp_abort (chan,1); m_vmd_select = vmd_save;#endif indic_info_wait (); /* allow user to see indic info */ }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -