📄 mmsop_en.c
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//* (c) Copyright Systems Integration Specialists Company, Inc., *//* 1986 - 1998, All Rights Reserved. *//* *//* MODULE NAME : mmsop_en.c *//* PRODUCT(S) : MMSEASE, MMSEASE-LITE *//* *//* MODULE DESCRIPTION : *//* This module is used to initialize the tables used in defining *//* the supported operation set, and MUST be re-compiled if the *//* supported command set is reduced (or expanded) via the subset *//* creation mechanism. This module also defines and initializes *//* the supported services parameters. *//* *//* The following tables are initialized: *//* *//* *operation enable table (mmsop_en [MAX_MMSOP_DIS+1]) : *//* used to check if an MMS operation is to be supported *//* as requestor and/or responder, and if the data element *//* containing the opcode is of the proper form. *//* *//* *operation name table (mms_op_string [MAX_MMSOP_DIS+1]) : *//* used to print the name of the MMS operation. *//* *//* *request decode function table *//* (mms_req_decode_fun [MAX_MMSOP_DIS+1]) : *//* used to define which function will be executed to *//* decode a request. *//* *//* *response decode function table *//* (mms_rsp_decode_fun [MAX_MMSOP_DIS+1]) : *//* used to define which function will be executed to *//* decode a response. *//* *//* **indication service function table *//* (mms_ind_serve_fun [MAX_IND_SFUN+1]) : *//* used to define which function will be executed to *//* service an indication. *//* *//* **confirmation service function table *//* (mms_conf_serve_fun [MAX_CONF_SFUN+1]) : *//* used to define which function will be executed to *//* service a confirmation. *//* *//* * - these tables are not normally modified by the user. *//* ** - these tables may be modified by the user. *//* *//* *//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE : *//* *//* MODIFICATION LOG : *//* Date Who Rev Comments *//* -------- --- ------ ------------------------------------------- *//* 07/11/02 EJV 17 mms_conf_serve_fun: corrected few entries. *//* 07/09/02 MDE 16 Fixed up opcode defines *//* 12/18/01 JRB 15 Convert to use ASN1R. *//* 04/19/00 JRB 14 Fix SD_CONST for decode funct ptr arrays. *//* 09/13/99 MDE 13 Added SD_CONST modifiers *//* 10/05/98 EJV 12 Replace struct acse_assinfo with ACSE_ASSINFO*//* Chg u_mllp_l_assoc_ind_fun return to ST_RET. *//* 05/27/98 MDE 11 Added MLOG_DISABLE define use *//* 04/13/98 MDE 10 MMS-LITE MLOG logging, unconfirmed logging *//* 12/30/97 EJV 09 Added typecast to all functions in tables: *//* m_req_log_fun_tbl and m_resp_log_fun_tbl *//* 10/13/97 DSF 08 no more MAP21_CASE!!! *//* 09/05/97 DSF 07 Fixed m_cl_max_getvla_vars #ifdef problem *//* 09/02/97 DSF 06 Always define mms_op_string if not MMS-LITE *//* 08/18/97 MDE 05 Moved parameter support def's to mmsop_en.h *//* 08/14/97 DSF 04 define MLOG_ENABLE if not MMS-LITE *//* 08/05/97 MDE 03 MLOG integration *//* 07/03/97 MDE 02 Minor tweaks to decode size control vars *//* 06/09/97 MDE 01 Added decode size control variables *//* 04/15/97 DSF 7.00 MMSEASE 7.0 release. See MODL70.DOC for *//* history. *//************************************************************************/#include "glbtypes.h"#include "sysincs.h"#include "mmsop_en.h"#include "mms_dfun.h"#if !defined(MMS_LITE) && !defined(MLOG_DISABLE)#define MLOG_ENABLE #endif#if !defined(MMS_LITE)#include "mms_usr.h"#else#include "mms_def2.h"#endif#ifdef MLOG_ENABLE #include "mloguser.h"#endif/************************************************************************//************************************************************************//* The following defines are used in initializing the mmsop_en array. *//* Each entry of the array consists of 8 bits: 00ijklmn, where the *//* bottom 6 bits mean the following: *//* *//* i - if 1, then response is NULL *//* j - if 1, then request is NULL *//* k - if 1, then response is constructor; otherwise, primitive. *//* l - if 1, then request is constructor; otherwise, primitive. *//* m - if 1, then response is supported; otherwise not. *//* n - if 1, then request is supported; otherwise not. *//* *//* By "supported" is meant that the executable program contains code to *//* handle that op code. *//************************************************************************//* *//* resp req */#define PRIM_PRIM 0x00 /* primitive resp and req */#define PRIM_CSTR 0x04 /* prim resp, constructor req */#define CSTR_PRIM 0x08 /* constructor resp, prim req */#define CSTR_CSTR 0x0C /* cstr resp, cstr req */#define NULL_NULL 0x30 /* primitive resp and req */#define NULL_PRIM 0x20 /* prim resp, constructor req */#define PRIM_NULL 0x10 /* constructor resp, prim req */#define NULL_CSTR 0x24 /* prim resp, constructor req */#define CSTR_NULL 0x18 /* constructor resp, prim req *//************************************************************************//* initialize the operation enable table, opcode is index into table *//************************************************************************/SD_CONST ST_UCHAR mmsop_en [MAX_MMSOP_DIS+1] = { MMS_STATUS_EN | CSTR_PRIM, /* 00 STATUS */ MMS_GETNAMES_EN | CSTR_CSTR, /* 01 GET_NAMLIST */ MMS_IDENT_EN | CSTR_NULL, /* 02 IDENTIFY */ MMS_RENAME_EN | NULL_CSTR, /* 03 RENAME */ MMS_READ_EN | CSTR_CSTR, /* 04 READ */ MMS_WRITE_EN | CSTR_CSTR, /* 05 WRITE */ MMS_GETVAR_EN | CSTR_CSTR, /* 06 GET_VARDEF */ MMS_DEFVAR_EN | NULL_CSTR, /* 07 DEF_VARNAM */ MMS_DEFSCAT_EN | NULL_CSTR, /* 08 DEF_SCATTERED */ MMS_GETSCAT_EN | CSTR_CSTR, /* 09 GET_SCATTERED */ MMS_DELVAR_EN | CSTR_CSTR, /* 10 DEL_VARNAM */ MMS_DEFVLIST_EN | NULL_CSTR, /* 11 DEF_VARLIST */ MMS_GETVLIST_EN | CSTR_CSTR, /* 12 GET_VARLIST */ MMS_DELVLIST_EN | CSTR_CSTR, /* 13 DEL_VARLIST */ MMS_DEFTYPE_EN | NULL_CSTR, /* 14 DEF_TYPENAM */ MMS_GETTYPE_EN | CSTR_CSTR, /* 15 GET_TYPEDEF */ MMS_DELTYPE_EN | CSTR_CSTR, /* 16 DEL_TYPENAM */ MMS_INPUT_EN | PRIM_CSTR, /* 17 INPUT */ MMS_OUTPUT_EN | NULL_CSTR, /* 18 OUTPUT */ MMS_TAKECTRL_EN | CSTR_CSTR, /* 19 TAKE_CONTROL */ MMS_RELCTRL_EN | NULL_CSTR, /* 20 REL_CONTROL */ MMS_DEFINE_SEM_EN | NULL_CSTR, /* 21 DEF_SEMAPHORE */ MMS_DELETE_SEM_EN | NULL_CSTR, /* 22 DEL_SEMAPHORE */ MMS_REP_SEMSTAT_EN | CSTR_CSTR, /* 23 REP_SEM_STATUS */ MMS_REP_SEMPOOL_EN | CSTR_CSTR, /* 24 REP_SEM_POOL_STATUS */ MMS_REP_SEMENTRY_EN | CSTR_CSTR, /* 25 REP_SEM_ENTRY_STATUS */ MMS_INIT_DWN_EN | CSTR_CSTR, /* 26 INIT_DOWNLOAD */ MMS_DWN_LOAD_EN | CSTR_PRIM, /* 27 DOWN_LOAD */ MMS_TERM_DWN_EN | NULL_CSTR, /* 28 TERM_DOWNLOAD */ MMS_INIT_UPL_EN | CSTR_PRIM, /* 29 INIT_UPLOAD */ MMS_UP_LOAD_EN | CSTR_PRIM, /* 30 UP_LOAD */ MMS_TERM_UPL_EN | NULL_PRIM, /* 31 TERM_UPLOAD */ MMS_RDDWN_EN | NULL_CSTR, /* 32 REQ_DOWNLOAD */ MMS_RDUPL_EN | NULL_CSTR, /* 33 REQ_UPLOAD */ MMS_LOAD_DOM_EN | NULL_CSTR, /* 34 LOAD_DOMAIN */ MMS_STR_DOM_EN | NULL_CSTR, /* 35 STORE_DOMAIN */ MMS_DEL_DOM_EN | NULL_PRIM, /* 36 DELETE_DOMAIN */ MMS_GET_DOM_EN | CSTR_PRIM, /* 37 GET_DOMAIN */ MMS_CRE_PI_EN | NULL_CSTR, /* 38 CREATE_PROGRAM_INVOCATION*/ MMS_DEL_PI_EN | NULL_PRIM, /* 39 DEL_PROGRAM_INVOCATION */ MMS_START_EN | NULL_CSTR, /* 40 START */ MMS_STOP_EN | NULL_CSTR, /* 41 STOP */ MMS_RESUME_EN | NULL_CSTR, /* 42 RESUME */ MMS_RESET_EN | NULL_CSTR, /* 43 RESET */ MMS_KILL_EN | NULL_CSTR, /* 44 KILL */ MMS_GET_PI_EN | CSTR_PRIM, /* 45 GET_PROGRAM_INVOCATION */ MMS_OBTAINFILE_EN | NULL_CSTR, /* 46 OBTAIN_FILE */ MMS_DEFEC_EN | NULL_CSTR, /* 47 DEFINE_EVENT_CONDITION */ MMS_DELEC_EN | PRIM_CSTR, /* 48 DELETE_EVENT_CONDITION */ MMS_GETECA_EN | CSTR_CSTR, /* 49 GET EVENT CONDITION ATTR */ MMS_REPECS_EN | CSTR_CSTR, /* 50 REPORT EVENT COND STATUS */ MMS_ALTECM_EN | NULL_CSTR, /* 51 ALTER_EVENT_COND_MON */ MMS_TRIGE_EN | NULL_CSTR, /* 52 TRIGGER_EVENT */ MMS_DEFEA_EN | NULL_CSTR, /* 53 DEFINE_EVENT_ACTION */ MMS_DELEA_EN | PRIM_CSTR, /* 54 DELETE_EVENT_ACTION */ MMS_GETEAA_EN | CSTR_CSTR, /* 55 GET_EVENT_ACTION_ATTRIB */ MMS_REPEAS_EN | PRIM_CSTR, /* 56 REPORT_EVENT_ACTION_STAT */ MMS_DEFEE_EN | NULL_CSTR, /* 57 DEFINE_EVENT_ENROLLMENT */ MMS_DELEE_EN | PRIM_CSTR, /* 58 DELETE_EVENT_ENROLLMENT */ MMS_ALTEE_EN | CSTR_CSTR, /* 59 ALTER_EVENT_ENROLLMENT */ MMS_REPEES_EN | CSTR_CSTR, /* 60 REPORT_EVENT_ENROLL_STAT */ MMS_GETEEA_EN | CSTR_CSTR, /* 61 GET_EVENT_ENROLL_ATTRIB */ MMS_ACKEVNOT_EN | NULL_CSTR, /* 62 ACK_EVENT_NOTIFICATION */ MMS_GETAS_EN | CSTR_CSTR, /* 63 GET_ALARM_SUMMARY */ MMS_GETAES_EN | CSTR_CSTR, /* 64 GET_ALARM_ENROLL_SUMMARY */ MMS_JREAD_EN | CSTR_CSTR, /* 65 READ_JOURNAL */ MMS_JWRITE_EN | NULL_CSTR, /* 66 WRITE_JOURNAL */ MMS_JINIT_EN | PRIM_CSTR, /* 67 INITIALIZE_JOURNAL */ MMS_JSTAT_EN | CSTR_CSTR, /* 68 REPORT_JOURNAL_STATUS */ MMS_JCREATE_EN | NULL_CSTR, /* 69 CREATE JOURNAL */ MMS_JDELETE_EN | NULL_CSTR, /* 70 DELETE JOURNAL */ MMS_GETCL_EN | CSTR_CSTR, /* 71 GET CAPABILITY LIST */ MMS_FOPEN_EN | CSTR_CSTR, /* 72 FILE_OPEN */ MMS_FREAD_EN | CSTR_PRIM, /* 73 FILE_READ */ MMS_FCLOSE_EN | NULL_PRIM, /* 74 FILE_CLOSE */ MMS_FRENAME_EN | NULL_CSTR, /* 75 FILE_RENAME */ MMS_FDELETE_EN | NULL_CSTR, /* 76 FILE_DELETE */ MMS_FDIR_EN | CSTR_CSTR, /* 77 FILE_DIR */ MMS_USTATUS_EN | CSTR_CSTR, /* 78 UNSOLICITED_STATUS */ MMS_INFO_EN | CSTR_CSTR, /* 79 INFO_RPT */ MMS_EVNOT_EN | CSTR_CSTR, /* 80 EVENT NOTIFICATION */ 0, /* 81 ATTACH TO EVENT COND */ 0, /* 82 ATTACH TO SEMAPHORE */ MMS_CONCLUDE_EN | NULL_NULL, /* 83 CONCLUDE */ MMS_CANCEL_EN | PRIM_PRIM, /* 84 CANCEL */ MMS_INIT_EN | CSTR_CSTR /* 85 INITIATE */ }; #if !defined (MMS_LITE) || defined (DEBUG_SISCO)/************************************************************************//************************************************************************//* INITIALIZE THE OPCODE PRINT STRINGS *//************************************************************************/ST_CHAR *mms_op_string [] = /* opcode is index into table */ { "STATUS", /* 00 STATUS */ "GET_NAMLIST", /* 01 GET_NAMLIST */ "IDENTIFY", /* 02 IDENTIFY */ "RENAME", /* 03 RENAME */ "READ", /* 04 READ */ "WRITE", /* 05 WRITE */ "GET_VARDEF", /* 06 GET_VARDEF */ "DEF_VARNAM", /* 07 DEF_VARNAM */ "DEF_SCATTERED", /* 08 DEF_SCATTERED */ "GET_SCATTERED", /* 09 GET_SCATTERED */ "DEL_VARNAM", /* 10 DEL_VARNAM */ "DEF_VARLIST", /* 11 DEF_VARLIST */ "GET_VARLIST", /* 12 GET_VARLIST */ "DEL_VARLIST", /* 13 DEL_VARLIST */ "DEF_TYPENAM", /* 14 DEF_TYPENAM */ "GET_TYPEDEF", /* 15 GET_TYPEDEF */ "DEL_TYPENAM", /* 16 DEL_TYPENAM */ "INPUT", /* 17 INPUT */ "OUTPUT", /* 18 OUTPUT */ "TAKE_CONTROL", /* 19 TAKE_CONTROL */ "REL_CONTROL", /* 20 REL_CONTROL */ "DEF_SEMAPHORE", /* 21 DEF_SEMAPHORE */ "DEL_SEMAPHORE", /* 22 DEL_SEMAPHORE */ "REP_SEM_STATUS", /* 23 REP_SEM_STATUS */ "REP_SEM_POOL_STATUS", /* 24 REP_SEM_POOL_STATUS */ "REP_SEM_ENTRY_STATUS", /* 25 REP_SEM_ENTRY_STATUS */ "INIT_DOWNLOAD", /* 26 INIT_DOWNLOAD */ "DOWN_LOAD", /* 27 DOWN_LOAD */ "TERM_DOWNLOAD", /* 28 TERM_DOWNLOAD */ "INIT_UPLOAD", /* 29 INIT_UPLOAD */ "UP_LOAD", /* 30 UP_LOAD */ "TERM_UPLOAD", /* 31 TERM_UPLOAD */ "REQ_DOWNLOAD", /* 32 REQ_DOWNLOAD */ "REQ_UPLOAD", /* 33 REQ_UPLOAD */ "LOAD_DOMAIN", /* 34 LOAD_DOMAIN */ "STORE_DOMAIN", /* 35 STORE_DOMAIN */ "DELETE_DOMAIN", /* 36 DELETE_DOMAIN */ "GET_DOMAIN", /* 37 GET_DOMAIN */ "CREATE_PROGRAM_INVOCATION", /* 38 CREATE_PROG_INVOCATION */ "DEL_PROGRAM_INVOCATION", /* 39 DEL_PROGRAM_INVOCATION */ "START", /* 40 START */ "STOP", /* 41 STOP */ "RESUME", /* 42 RESUME */ "RESET", /* 43 RESET */ "KILL", /* 44 KILL */ "GET_PROGRAM_INVOCATION", /* 45 GET_PROGRAM_INVOCATION */ "OBTAIN_FILE", /* 46 OBTAIN_FILE */ "DEFINE_EVENT_COND", /* 47 DEFINE_EVENT_COND */ "DELETE_EVENT_COND", /* 48 DELETE_EVENT_COND */ "GET_EVENT_CONDITION_ATTR", /* 49 GET_EVENT_COND_ATTR */ "REPORT_EVENT_COND_STATUS", /* 50 REPORT_EVENT_COND_STAT */ "ALTER_EVENT_COND_MON", /* 51 ALTER_EVENT_COND_MON */ "TRIGGER_EVENT", /* 52 TRIGGER_EVENT */ "DEFINE_EVEVT_ACTION", /* 53 DEFINE_EVENT_ACTION */ "DELETE_EVENT_ACTION", /* 54 DELETE_EVENT_ACTION */ "GET_EVENT_ACTION_ATTR", /* 55 GET_EVENT_ACT_ATTR */ "REPORT_EVENT_ACTION_STAT", /* 56 REPORT_EVENT_ACT_STAT */ "DEFINE_EVENT_ENROLLMENT", /* 57 DEFINE_EVENT_ENROLL */ "DELETE_EVENT_ENROLLMENT", /* 58 DELETE_EVENT_ENROLL */ "ALTER_EVENT_ENROLLMENT", /* 59 ALTER_EVENT_ENROLL */ "REPORT_EVENT_ENROLL_STAT", /* 60 REPORT_EV_ENROLL_STAT */ "GET_EVENT_ENROLL_ATTR", /* 61 GET_EVENT_ENROLL_ATTR */ "ACK_EVENT_NOTIFICATION", /* 62 ACK_EVENT_NOTIFICATION */ "GET_ALARM_SUMMARY", /* 63 GET_ALARM_SUMMARY */ "GET_ALARM_ENROLL_SUMMARY", /* 64 GET_ALARM_ENROLL_SUM */ "READ_JOURNAL", /* 65 READ_JOURNAL */ "WRITE_JOURNAL", /* 66 WRITE_JOURNAL */ "INITIALIZE_JOURNAL", /* 67 INITIALIZE_JOURNAL */ "REPORT_JOURNAL_STATUS", /* 68 REPORT_JOURNAL_STATUS */ "CREATE JOURNAL", /* 69 CREATE JOURNAL */ "DELETE JOURNAL", /* 70 DELETE JOURNAL */ "GET CAPABILITY LIST", /* 71 GET CAPABILITY LIST */ "FILE_OPEN", /* 72 FILE_OPEN */ "FILE_READ", /* 73 FILE_READ */ "FILE_CLOSE", /* 74 FILE_CLOSE */ "FILE_RENAME", /* 75 FILE_RENAME */ "FILE_DELETE", /* 76 FILE_DELETE */ "FILE_DIR", /* 77 FILE_DIR */ "UNSOLICITED_STATUS", /* 78 UNSOLICITED_STATUS */ "INFO_RPT", /* 79 INFO_RPT */ "EVENT NOTIFICATION", /* 80 EVENT NOTIFICATION */ "ATTACH TO EVENT CONDITION", /* 81 ATTACH TO EVENT COND */ "ATTACH TO SEMAPHORE", /* 82 ATTACH TO SEMAPHORE */ "CONCLUDE", /* 83 CONCLUDE */ "CANCEL", /* 84 CANCEL */ "INITIATE", /* 85 INITIATE */ "", /* 86 NOT A MMS OPERATION */ "", /* 87 NOT A MMS OPERATION */ "", /* 88 NOT A MMS OPERATION */ "", /* 89 NOT A MMS OPERATION */ "MV READ", /* 90 NAMED READ */ "MV WRITE", /* 91 NAMED WRITE */ "", /* 92 NOT A MMS OPERATION */ "MV MVE_FOPEN", /* 93 REMOTE FILE OPEN */ "MV FREAD", /* 94 REMOTE FILE READ */ "MV FCLOSE", /* 95 REMOTE FILE CLOSE */ "MV INIT", /* 96 INITIATE */ "MV DEFTYPE", /* 97 TYPE DEFINITION */ "MV FCOPY", /* 98 REMOTE FILE COPY */ "MV DOWNLOAD", /* 99 VM DOMAIN DOWNLOAD */ "MV UPLOAD", /* 100 VM DOMAIN UPLOAD */ "MV READ VARS", /* 101 GENERAL READ */ "MV WRITE VARS", /* 102 GENERAL WRITE */ "", /* 103 NOT A MMS OPERATION */ "", /* 104 NOT A MMS OPERATION */ "" /* 105 NOT A MMS OPERATION */ };ST_INT m_num_mms_op_string = sizeof (mms_op_string)/sizeof (ST_CHAR *);#endif/************************************************************************//************************************************************************//* The following defines are used in initializing the request and *//* response decode functions, the indication and confirmation service *//* funtions, and the supported service indicators. *//************************************************************************//************************************************************************//************************************************************************//* VMD SUPPORT - CONFIRMED SERVICES *//************************************************************************/#if (MMS_STATUS_EN & REQ_EN)#define MMS_STATUS_RSP_DFUN mms_status_rsp#define MMS_STATUS_CONF_SFUN u_mp_status_conf#else#define MMS_STATUS_RSP_DFUN mms_rsp_not_supp#define MMS_STATUS_CONF_SFUN u_conf_not_supp#endif#if (MMS_STATUS_EN & RESP_EN)#define MMS_STATUS_REQ_DFUN mms_status_req#define MMS_STATUS_IND_SFUN u_status_ind#define STATUS_SSI 0x80#else#define MMS_STATUS_REQ_DFUN mms_req_not_supp#define MMS_STATUS_IND_SFUN u_ind_not_supp#define STATUS_SSI 0x00#endif#if (MMS_GETNAMES_EN & REQ_EN)#define MMS_GETNAMES_RSP_DFUN mms_namelist_rsp#define MMS_GETNAMES_CONF_SFUN u_mp_namelist_conf#else#define MMS_GETNAMES_RSP_DFUN mms_rsp_not_supp#define MMS_GETNAMES_CONF_SFUN u_conf_not_supp#endif#if (MMS_GETNAMES_EN & RESP_EN)#define MMS_GETNAMES_REQ_DFUN mms_namelist_req#define MMS_GETNAMES_IND_SFUN u_namelist_ind#define GETNAMES_SSI 0x40#else#define MMS_GETNAMES_REQ_DFUN mms_req_not_supp#define MMS_GETNAMES_IND_SFUN u_ind_not_supp#define GETNAMES_SSI 0x00#endif#if (MMS_IDENT_EN & REQ_EN)#define MMS_IDENT_RSP_DFUN mms_identify_rsp#define MMS_IDENT_CONF_SFUN u_mp_ident_conf
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -