📄 mmsavmd.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1997, All Rights Reserved. *//* *//* MODULE NAME : mmsavmd.c *//* PRODUCT(S) : MMSEASE *//* *//* MODULE DESCRIPTION : *//* This module contains functions to initiate the MMS VMD *//* support services. These functions are called from the *//* mainloop (check_key). *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 06/03/97 RKR 01 Changed vmd_ctrl_list to m_vmd_ctrl_list *//* 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_pvmd.h"#include "mms_vvmd.h"#include "mmsop_en.h"#include "userdefs.h"#include "fkeydefs.h"#include "gvaldefs.h"#include "scrndefs.h"#include "mem_chk.h"#ifdef AXS4MMSOBJ#include "mms_od.h"#endif#if MMS_VMD_ENST_INT count_vmd (ST_VOID);#endif/************************************************************************//* For debug version, use a static pointer to avoid duplication of *//* __FILE__ strings. *//************************************************************************/#ifdef DEBUG_SISCOstatic ST_CHAR *thisFileName = __FILE__;#endif/* Functions used internally for user interface *//************************************************************************//* do_stat *//* create and send a status request. *//************************************************************************/ST_VOID do_stat (ST_VOID) {#if MMS_STATUS_EN & REQ_ENSTATUS_REQ_INFO info1;ST_INT chan; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } if (ask ("\n Enter Extended Derivation (y:TRUE, n:FALSE) (default = TRUE) : ",1)) info1.extended = SD_TRUE; else info1.extended = SD_FALSE; if (!mp_status (chan,&info1)) { print_req_error (); (*menu_set_fun) (); return; } if (num_reps) /* if this an auto repeat - */ { if (start_cont ()) /* wait for 1st to complete */ return; num_outstanding = 1; /* we just put one in the pipe */ while (rep_count < num_reps) /* if enough done - */ { if (!mp_status (chan,&info1)) /* send the next one */ break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } else (*menu_set_fun) ();#endif }/************************************************************************//* do_ustat *//* create and send an unsolicited status request. *//************************************************************************/ST_VOID do_ustat (ST_VOID) {#if MMS_USTATUS_EN & REQ_ENUSTATUS_REQ_INFO info2;ST_INT chan;ST_INT temp;register ST_INT i; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } printf (" (0:State-Changes, 1:No-Changes, 2:Limited-Services, 3:All-Services)"); printf ("\n Enter Logical Status (default = State-Changes) : "); temp = 0; intget (&temp); info2.logical_stat = temp; printf (" (0:Operational, 1:Partially, 2:Inoperable, 3:Needs-Commissioning)"); printf ("\n Enter Physical Status (default = Operational) : "); temp = 0; intget (&temp); info2.physical_stat = temp; info2.local_detail_pres = SD_FALSE; printf (" Enter # of bits in Local Detail Parameter (0 - 128) "); printf ("\n (default = 0, which results in the parameter being omitted) : "); temp = 0; intget (&temp); if (temp > 0 && temp <= 128) { info2.local_detail_pres = SD_TRUE; info2.local_detail_len = temp; for (i = 0; i < 16; ++i) info2.local_detail[i] = 0; printf (" Enter Local Detail (hex bytes) :"); input_hex (info2.local_detail,16); } if (mms_op_err = mp_ustatus (chan,&info2)) print_req_error (); /* no response for this request */ (*menu_set_fun) ();#endif }/************************************************************************//* do_ident *//* create and send an indentify request. *//************************************************************************/ST_VOID do_ident (ST_VOID) {#if MMS_IDENT_EN & REQ_ENST_INT chan; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } if (!mp_ident (chan)) /* Send the identify request */ { print_req_error (); (*menu_set_fun) (); return; } if (num_reps) /* if this an auto repeat - */ { if (start_cont ()) /* wait for 1st to complete */ return; num_outstanding = 1; /* we just put one in the pipe */ while (rep_count < num_reps) /* if enough done - */ { if (!mp_ident (chan)) /* send the next one */ break; num_outstanding++; if (cont_serve ()) /* if user hit a key */ return; } cont_done (); /* display results */ } else (*menu_set_fun) ();#endif }/************************************************************************//* do_rename *//* create and send a rename request *//************************************************************************/ST_VOID do_rename (ST_VOID) {#if MMS_RENAME_EN & REQ_ENRENAME_REQ_INFO req_info;ST_INT chan;ST_BOOLEAN data_entered;ST_INT num, len;ST_CHAR temp [256];ST_UCHAR cs_class[20]; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } data_entered = SD_TRUE; if (ask (" Enter MMS Object Class (y:Standard, n:CS) (default = Standard) : ",1)) { req_info.cs_objclass_pres = SD_FALSE; printf (" Enter Object Class (0 - 11) (default = 0) : "); req_info.obj.mms_class = 0; if (intget (&num)) { if ((num >= 0) && (num <= 11)) req_info.obj.mms_class = num; } } else { req_info.cs_objclass_pres = SD_TRUE; printf (" Enter ASN.1 for CS Object Class : "); len = input_hex (cs_class,19); if (len) { req_info.obj.cs.len = len; req_info.obj.cs.cs_class = cs_class; } else data_entered = SD_FALSE; } if (data_entered) { /* get current name from operator */ printf (" For the Current Object Name :\n"); data_entered = get_objname (&req_info.cur_name); } if (data_entered) { /* get entry contents from operator */ printf (" Enter New Identifier for Object : (R) "); if (strget (temp)) { temp[MAX_IDENT_LEN] = '\x00'; strcpy (req_info.new_ident, temp); } else data_entered = SD_FALSE; } if (data_entered) { if (!mp_rename (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_rename (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_get_mms_objs *//* create and send a getname list request. *//************************************************************************/#ifdef AXS4MMSOBJST_VOID do_get_mms_objs (ST_VOID) {#if MMS_GETNAMES_EN & REQ_ENST_INT chan;ST_VOID gnl_done_fun (MMS_OBJ_SET *set); if (!get_chan (&chan)) { (*menu_set_fun) (); return; } if (mv_get_mms_obj (chan, gnl_done_fun) == NULL) wait_msg ("\n getNameList must be supported by both client and server"); (*menu_set_fun) ();#endif }#if MMS_GETNAMES_EN & REQ_ENST_VOID gnl_done_fun (MMS_OBJ_SET *obj_set) { printf ("\n filing MMS object set as file mmsobj.set"); if (obj_set != NULL) { ms_file_mms_obj_set (obj_set, "mmsobj.set"); ms_del_mms_obj_set (obj_set);/* dyn_mem_ptr_status (); */ /* did we leak any memory?? */ } }#endif#endif/************************************************************************//* do_namelist *//* create and send a getname list request. *//************************************************************************/ST_VOID do_namelist (ST_VOID) {#if MMS_GETNAMES_EN & REQ_ENNAMELIST_REQ_INFO info;ST_INT chan;ST_CHAR temp[256];ST_UCHAR cs_class[20]; if (!get_chan (&chan)) { (*menu_set_fun) (); return; } if (ask (" Enter Extended Object Class (y:Standard, n:CS) (default = Standard) : ",1)) { info.cs_objclass_pres = 0; printf (" Enter Object Class (0 - 11) (default = 0) : "); info.obj.mms_class = 0; intget ((ST_INT *) &info.obj.mms_class); } else { info.cs_objclass_pres = 1; printf (" Enter ASN.1 for CS Object Class : "); info.obj.cs.len = input_hex (cs_class,19); if (!info.obj.cs.len) { (*menu_set_fun) (); return; } info.obj.cs.cs_class = cs_class; } printf (" (0:VMD-Specific, 1:DOM-Specific, 2:AA-Specific)"); printf ("\n Enter Object Scope (default = VMD) : "); info.objscope = 0; intget ((ST_INT *) &info.objscope); if (info.objscope == 1) { printf (" DOM-Specific Name, Enter Domain Id : (R) "); if (strget (temp)) { temp[MAX_IDENT_LEN] = '\x00'; strcpy (info.dname, temp); } } printf (" Enter Continue After Name : (O) "); if (strget (temp)) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -