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

📄 icta_cfg.c

📁 ICCP Toolkit 是在 Tru64下开发Tase.2通信协议的开发包
💻 C
📖 第 1 页 / 共 5 页
字号:
/************************************************************************//* SISCO SOFTWARE MODULE HEADER *****************************************//************************************************************************//*   (c) Copyright Systems Integration Specialists Company, Inc.,       *//*          1996-1998, All Rights Reserved                              *//*                                                                      */ /*                                                                      */ /* MODULE NAME : icta_cfg.c						*//* PRODUCT(S)  : ICCP toolkit		                             	*//*									*//* MODULE DESCRIPTION : 						*//*     Handle the configurable items for the ICCP test application	*//*									*//* GLOBAL FUNCTIONS DEFINED IN THIS MODULE :				*//*				ST_RET ictaConfigure(ST_VOID)		*//*									*//* MODIFICATION LOG :							*//*  Date     Who   Rev			Comments			*//* --------  ---  ------   -------------------------------------------	*//* 08/05/02  nav    16     Changes to test 8 remote ar names            *//* 06/13/01  nav    15     Add UseApTitles				*//* 11/28/00  nav    14     Add UseRecieveDsTs				*//* 08/28/00  nav    13     Add useNewB4B8 Support			*//* 06/30/00  nav    12     Get PDU Size as a long not a short		*//* 06/02/00  nav    11     Get rid of _strdate calls			*//* 05/09/00  nav    10     Add TranGroup startTime as time of day	*//* 04/07/00  nav     9     Add RetryDelay				*//* 06/03/99  nav     8     Add bIncrementVars support			*//* 01/23/98  EJV     7     removed include cfglog.h			*//* 01/16/98  EJV     6     Unix compiler don't like '//' for comment	*//*                         Added typecast in list functions.		*//* 12/11/97  nav     5     add LocalDomainName and RemoteDomainName	*//* 06/19/97  nav     4     Overhaul - One process can be client & server*//* 06/05/97  nav     3     Convert to MMS-EASE V7.00			*//* 03/05/97  rkr     2     set user types to be IC_TYPE_USER_DEFINED    *//* 02/12/97  nav     1     handle matrix accounts			*//* 12/18/96  NAV           Created                                      *//************************************************************************/#include "ictamain.h"#include "cfg_util.h"/************************************************************************//* Local defines							*//************************************************************************/#define ICTA_CFG_FILE		"iccptest.cfg"#define CFG_LOG_FILE		"iccp_cfg.log"#define CFG_LOG_TYPE    5500#define ICA_Log_Cfg0(a)    {\            if (cfg_log_mask & CFG_LOG_ERR)\	      slog (sLogCtrl,CFG_LOG_TYPE,\	      thisFileName,__LINE__,a);\	    }#define ICA_Log_Cfg1(a,b)  {\            if (cfg_log_mask & CFG_LOG_ERR)\	      slog (sLogCtrl,CFG_LOG_TYPE,\	      thisFileName,__LINE__,a,b);\	    }/************************************************************************//* Static and Local variables						*//************************************************************************/static ST_CHAR *thisFileName = __FILE__;static ICTA_TYPE *pstType;static ICTA_REMOTE_INFO *pstCurrentRemote;static ICTA_LINK_INFO   *pstCurrentLink;static ICTA_SERVER_INFO *pstCurrentServer;static ICTA_CLIENT_INFO *pstCurrentClient;static ICTA_VAR_INFO    *pstServerVar, *pstClientVar;static ICTA_MSG_INFO	*pstServerMsg, *pstClientMsg;static ICTA_DEVICE	*pstServerDevice, *pstClientDevice;static ICTA_SIMPLE_ACCT *pstServerAcct, *pstClientAcct;static ICTA_MATRIX_ACCT *pstServerMatrix, *pstClientMatrix;static ICTA_TA_CONDITION *pstClientCond;static ICTA_TRANSFER_INFO *pstClientTran;/************************************************************************//*  Functions prototypes 						*//************************************************************************/static ST_RET readCfgFile (ST_CHAR *configFile);static ST_VOID  cfgConfigBegin (ST_VOID);static ST_VOID  cfgConfigEnd (ST_VOID);static ST_VOID  cfgGeneralBegin (ST_VOID);static ST_VOID  	cfgGeneralMultiThread (ST_VOID);static ST_VOID		cfgGeneralAutoResponse (ST_VOID);static ST_VOID		cfgGeneralRunVerbose (ST_VOID);static ST_VOID		cfgGeneralIncrementVars (ST_VOID);static ST_VOID		cfgGeneralNewB4B8 (ST_VOID);static ST_VOID		cfgGeneralReceiveDsTs (ST_VOID);static ST_VOID		cfgGeneralUseApTitles (ST_VOID);static ST_VOID          cfgGeneralUseNewDefLink (ST_VOID);static ST_VOID          cfgGeneralUseNewStartRem (ST_VOID);static ST_VOID  cfgGeneralEnd (ST_VOID);static ST_VOID  cfgLocalBegin (ST_VOID);static ST_VOID  	cfgLocalName (ST_VOID);static ST_VOID  	cfgMaxTranSets (ST_VOID);static ST_VOID  	cfgMaxDataSets (ST_VOID);static ST_VOID  	cfgMaxMsgSize (ST_VOID);static ST_VOID  cfgLocalEnd (ST_VOID);static ST_VOID  cfgTypesBegin (ST_VOID);static ST_VOID  	cfgType (ST_VOID);static ST_VOID  	cfgTDL (ST_VOID);static ST_VOID  cfgTypesEnd (ST_VOID);static ST_VOID  cfgRemoteBegin (ST_VOID);static ST_VOID		cfgRemoteName (ST_VOID);static ST_VOID		cfgRemoteVersion (ST_VOID);static ST_VOID		cfgRemoteBilatID (ST_VOID);static ST_VOID		cfgRemoteLocalDom (ST_VOID);static ST_VOID		cfgRemoteRemoteDom (ST_VOID);static ST_VOID		cfgRemoteShortInt (ST_VOID);static ST_VOID		cfgRemoteReqTO (ST_VOID);static ST_VOID		cfgRemoteRetry (ST_VOID);static ST_VOID		cfgRemoteReplyTO (ST_VOID);static ST_VOID		cfgRemoteReqIdent (ST_VOID);static ST_VOID		cfgRemoteInitAssoc (ST_VOID);static ST_VOID          cfgRemoteLinkBegin (ST_VOID);static ST_VOID			cfgRemoteLinkName (ST_VOID);static ST_VOID			cfgRemoteLinkLocalAR (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR1 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR2 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR3 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR4 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR5 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR6 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR7 (ST_VOID);static ST_VOID			cfgRemoteLinkRemAR8 (ST_VOID);static ST_VOID			cfgRemoteLinkCritical (ST_VOID);static ST_VOID		cfgRemoteLinkEnd (ST_VOID);static ST_VOID		cfgRemoteServerBegin (ST_VOID);static ST_VOID			cfgServerFeaturesBegin (ST_VOID);static ST_VOID				cfgFeaturesBlock2 (ST_VOID);static ST_VOID				cfgFeaturesBlock3 (ST_VOID);static ST_VOID				cfgFeaturesBlock4 (ST_VOID);static ST_VOID				cfgFeaturesBlock5 (ST_VOID);static ST_VOID				cfgFeaturesBlock6 (ST_VOID);static ST_VOID				cfgFeaturesBlock7 (ST_VOID);static ST_VOID				cfgFeaturesBlock8 (ST_VOID);static ST_VOID				cfgFeaturesBlock9 (ST_VOID);static ST_VOID			cfgServerFeaturesEnd (ST_VOID);static ST_VOID  		cfgServerVarsBegin (ST_VOID);static ST_VOID  			cfgServerVarName (ST_VOID);static ST_VOID  			cfgServerVarScope (ST_VOID);static ST_VOID  			cfgServerVarType (ST_VOID);static ST_VOID  			cfgServerVarWriteable (ST_VOID);static ST_VOID  		cfgServerVarsEnd (ST_VOID);static ST_VOID			cfgServerMsgBegin (ST_VOID);static ST_VOID				cfgServerMsgRef (ST_VOID);static ST_VOID				cfgServerMsgScope (ST_VOID);static ST_VOID				cfgServerMsgSize (ST_VOID);static ST_VOID			cfgServerMsgEnd (ST_VOID);static ST_VOID			cfgServerDeviceBegin (ST_VOID);static ST_VOID				cfgServerDeviceName (ST_VOID);static ST_VOID				cfgServerDeviceScope (ST_VOID);static ST_VOID				cfgServerDeviceType (ST_VOID);static ST_VOID				cfgServerDeviceSBO (ST_VOID);static ST_VOID			cfgServerDeviceEnd (ST_VOID);static ST_VOID			cfgServerAcctBegin (ST_VOID);static ST_VOID				cfgServerAcctRef (ST_VOID);static ST_VOID				cfgServerAcctScope (ST_VOID);static ST_VOID				cfgServerAcctType (ST_VOID);static ST_VOID				cfgServerAcctValue (ST_VOID);static ST_VOID				cfgServerAcctRows (ST_VOID);static ST_VOID				cfgServerAcctMatrix (ST_VOID);static ST_VOID			cfgServerAcctEnd (ST_VOID);static ST_VOID			cfgServerMatrixBegin (ST_VOID);static ST_VOID				cfgServerMatrixRef (ST_VOID);static ST_VOID				cfgServerMatrixScope (ST_VOID);static ST_VOID			cfgServerMatrixEnd (ST_VOID);static ST_VOID		cfgRemoteServerEnd (ST_VOID);static ST_VOID  	cfgRemoteClientBegin (ST_VOID);static ST_VOID  		cfgClientVarsBegin (ST_VOID);static ST_VOID  			cfgClientVarName (ST_VOID);static ST_VOID				cfgClientVarScope (ST_VOID);static ST_VOID  			cfgClientVarType (ST_VOID);static ST_VOID  			cfgClientVarWriteable (ST_VOID);static ST_VOID  		cfgClientVarsEnd (ST_VOID);static ST_VOID			cfgClientMsgBegin (ST_VOID);static ST_VOID				cfgClientMsgRef (ST_VOID);static ST_VOID				cfgClientMsgScope (ST_VOID);static ST_VOID				cfgClientMsgSize (ST_VOID);static ST_VOID			cfgClientMsgEnd (ST_VOID);static ST_VOID			cfgClientDeviceBegin (ST_VOID);static ST_VOID				cfgClientDeviceName (ST_VOID);static ST_VOID				cfgClientDeviceScope (ST_VOID);static ST_VOID				cfgClientDeviceType (ST_VOID);static ST_VOID				cfgClientDeviceSBO (ST_VOID);static ST_VOID			cfgClientDeviceEnd (ST_VOID);static ST_VOID			cfgClientSAcctBegin (ST_VOID);static ST_VOID				cfgClientSAcctRef (ST_VOID);static ST_VOID				cfgClientSAcctScope (ST_VOID);static ST_VOID				cfgClientSAcctType (ST_VOID);static ST_VOID				cfgClientSAcctValue (ST_VOID);static ST_VOID				cfgClientSAcctRows (ST_VOID);static ST_VOID				cfgClientSAcctMatrix (ST_VOID);static ST_VOID			cfgClientSAcctEnd (ST_VOID);static ST_VOID			cfgClientMatrixBegin (ST_VOID);static ST_VOID				cfgClientMatrixRef (ST_VOID);static ST_VOID				cfgClientMatrixScope (ST_VOID);static ST_VOID			cfgClientMatrixEnd (ST_VOID);static ST_VOID			cfgClientCondBegin (ST_VOID);static ST_VOID				cfgClientCondName (ST_VOID);static ST_VOID				cfgClientCondCond (ST_VOID);static ST_VOID			cfgClientCondEnd (ST_VOID);static ST_VOID			cfgClientTranGroupBegin (ST_VOID);static ST_VOID				cfgClientTranLinkName (ST_VOID);static ST_VOID				cfgClientTranRef (ST_VOID);static ST_VOID				cfgClientTranPeriodic (ST_VOID);static ST_VOID				cfgClientTranInterval (ST_VOID);static ST_VOID				cfgClientTranOffset (ST_VOID);static ST_VOID				cfgClientTranRBE (ST_VOID);static ST_VOID				cfgClientTranBufInt (ST_VOID);static ST_VOID				cfgClientTranIntInt (ST_VOID);static ST_VOID				cfgClientTranTranCrit (ST_VOID);static ST_VOID				cfgClientTranStart (ST_VOID);static ST_VOID				cfgClientTranStartTime (ST_VOID);static ST_VOID				cfgClientTranVars (ST_VOID);static ST_VOID			cfgClientTranGroupEnd (ST_VOID);static ST_VOID		cfgRemoteClientEnd (ST_VOID);static ST_VOID  cfgRemoteEnd (ST_VOID);/************************************************************************//* utility function prototypes						*//************************************************************************/static ST_VOID setupType (ST_VOID);static ST_BOOLEAN findClientAcct(ST_INT16 sVal);static ICTA_VAR_INFO *findCfgClientVar(char *name);static ST_RET timeStringToTimeT (char *timeStr, time_t *timeOut);static int parseDateString (char *s);static int parseTimeString (char *s);static int strToMonth (char *s, int *monthOut);/************************************************************************//* Configuration keyword tables						*//************************************************************************/struct cfg_kw_el kwtblCfgBegin[] =  {    {"%ConfigurationBegin",	cfgConfigBegin,           NULL },    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblBegin [] =  {    {"%GeneralConfigBegin",	cfgGeneralBegin, NULL },    {"%ConfigLocalBegin", 	cfgLocalBegin, 	 NULL },    {"%ConfigTypesBegin", 	cfgTypesBegin,   NULL },    {"%ConfigRemoteBegin", 	cfgRemoteBegin,	 NULL },    {"%ConfigurationEnd",	cfgConfigEnd,	 NULL },    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblGeneralAttr [] =  {    {"MultipleThreads", 	cfgGeneralMultiThread,	   NULL },    {"AutoResponse",		cfgGeneralAutoResponse,    NULL },    {"RunVerbose",		cfgGeneralRunVerbose,	   NULL },    {"IncrementVars",		cfgGeneralIncrementVars,   NULL },    {"UseNewB4B8",		cfgGeneralNewB4B8,	   NULL },    {"UseReceiveDsTs",		cfgGeneralReceiveDsTs,	   NULL },    {"UseApTitles",		cfgGeneralUseApTitles,	   NULL },    {"UseNewDefLink",           cfgGeneralUseNewDefLink,   NULL },    {"UseNewStartRemote",       cfgGeneralUseNewStartRem,  NULL },    {"%GeneralConfigEnd", 	cfgGeneralEnd,		   NULL },     { NULL, NULL, NULL}  }; struct cfg_kw_el kwtblLocalAttr [] =  {    {"LocalName",		cfgLocalName,	NULL },    {"MaxTransferSets",		cfgMaxTranSets,	NULL },    {"MaxDataSets", 	     	cfgMaxDataSets,	NULL },    {"MaxMMSMsgSize", 	     	cfgMaxMsgSize, 	NULL },    {"%ConfigLocalEnd",      	cfgLocalEnd,	NULL },    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblTypesAttr [] =  {    {"TypeName",	     	cfgType,		NULL },    {"TDL",    	     		cfgTDL,		NULL },    {"%ConfigTypesEnd",      	cfgTypesEnd,	NULL },    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblRemote [] =  {    {"RemoteName",		cfgRemoteName,		NULL},    {"ICCPVersion",		cfgRemoteVersion,	NULL},     {"BilateralTableID",	cfgRemoteBilatID,	NULL},    {"LocalDomainName",		cfgRemoteLocalDom,	NULL},    {"RemoteDomainName",	cfgRemoteRemoteDom,	NULL},    {"ShortestInterval",	cfgRemoteShortInt,	NULL},    {"RequestTimeout",		cfgRemoteReqTO,		NULL},    {"RetryDelay",		cfgRemoteRetry,		NULL},    {"ReplyTimeout",		cfgRemoteReplyTO,	NULL},    {"InitiateAssoc",		cfgRemoteInitAssoc,	NULL},    {"ReqRemoteIdentity",	cfgRemoteReqIdent,	NULL},    {"%RemoteLinkBegin",	cfgRemoteLinkBegin,	NULL},    {"%RemoteServerBegin",	cfgRemoteServerBegin,	NULL},    {"%RemoteClientBegin",	cfgRemoteClientBegin,	NULL},    {"%ConfigRemoteEnd",	cfgRemoteEnd,	 	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblRemoteLink [] =  {    {"LinkName",		cfgRemoteLinkName,	NULL},    {"LocalArName",		cfgRemoteLinkLocalAR,	NULL},    {"RemoteARName1",		cfgRemoteLinkRemAR1,	NULL},    {"RemoteARName2",		cfgRemoteLinkRemAR2,	NULL},    {"RemoteARName3",		cfgRemoteLinkRemAR3,	NULL},    {"RemoteARName4",		cfgRemoteLinkRemAR4,	NULL},    {"RemoteARName5",		cfgRemoteLinkRemAR5,	NULL},    {"RemoteARName6",		cfgRemoteLinkRemAR6,	NULL},    {"RemoteARName7",		cfgRemoteLinkRemAR7,	NULL},    {"RemoteARName8",		cfgRemoteLinkRemAR8,	NULL},    {"CriticalTimeout",		cfgRemoteLinkCritical,	NULL},    {"%RemoteLinkEnd",		cfgRemoteLinkEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServer [] =  {    {"%ServerFeaturesBegin",	cfgServerFeaturesBegin,	NULL},    {"%ServerVarsBegin",	cfgServerVarsBegin,	NULL},    {"%ServerMessageBegin",	cfgServerMsgBegin,	NULL},    {"%ServerDeviceBegin",	cfgServerDeviceBegin,	NULL},    {"%ServerSimpleAcctBegin",	cfgServerAcctBegin,	NULL},    {"%ServerMatrixAcctBegin",  cfgServerMatrixBegin,	NULL},    {"%RemoteServerEnd",	cfgRemoteServerEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblConfigEnd [] =  {    {"%ConfigRemoteBegin",	cfgRemoteBegin,  NULL },    {"%ConfigurationEnd",	cfgConfigEnd,	 NULL },    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerFeatures [] =  {    {"Block2",			cfgFeaturesBlock2,	NULL},    {"Block3",			cfgFeaturesBlock3,	NULL},    {"Block4",			cfgFeaturesBlock4,	NULL},    {"Block5",			cfgFeaturesBlock5,	NULL},    {"Block6",			cfgFeaturesBlock6,	NULL},    {"Block7",			cfgFeaturesBlock7,	NULL},    {"Block8",			cfgFeaturesBlock8,	NULL},    {"Block9",			cfgFeaturesBlock9,	NULL},    {"%ServerFeaturesEnd",	cfgServerFeaturesEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerVars [] =  {    {"Name",		cfgServerVarName,	NULL},    {"Scope",		cfgServerVarScope,	NULL},    {"Type",		cfgServerVarType,	NULL},    {"Writeable",	cfgServerVarWriteable,	NULL},    {"%ServerVarsEnd",	cfgServerVarsEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerMsg [] =  {    {"MsgRef", 			cfgServerMsgRef,	NULL},    {"Scope",			cfgServerMsgScope,	NULL},    {"MaxSize",			cfgServerMsgSize,	NULL},    {"%ServerMessageEnd",	cfgServerMsgEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerDevice [] =  {    {"Name",			cfgServerDeviceName,	NULL},    {"Scope",		 	cfgServerDeviceScope,	NULL},    {"Type",		 	cfgServerDeviceType,	NULL},    {"SBO",		 	cfgServerDeviceSBO,	NULL},    {"%ServerDeviceEnd", 	cfgServerDeviceEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerAcct [] =  {    {"AcctRef",			cfgServerAcctRef,	NULL},    {"Scope",			cfgServerAcctScope,	NULL},    {"Type",			cfgServerAcctType,	NULL},    {"ValueType",		cfgServerAcctValue,	NULL},    {"Rows",			cfgServerAcctRows,	NULL},    {"MatrixRef",		cfgServerAcctMatrix,	NULL},    {"%ServerSimpleAcctEnd",	cfgServerAcctEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblServerMatrix [] =  {    {"MatrixRef",		cfgServerMatrixRef,	NULL},    {"MatrixScope",		cfgServerMatrixScope,	NULL},    {"%ServerMatrixAcctEnd",	cfgServerMatrixEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblClient [] =  {    {"%ClientVarsBegin",	cfgClientVarsBegin,	NULL},    {"%ClientMessageBegin",	cfgClientMsgBegin,	NULL},    {"%ClientDeviceBegin",	cfgClientDeviceBegin,	NULL},    {"%ClientSimpleAcctBegin",	cfgClientSAcctBegin,	NULL},    {"%ClientMatrixAcctBegin",  cfgClientMatrixBegin,	NULL},    {"%ClientTACondBegin",	cfgClientCondBegin,	NULL},    {"%ClientTranGroupBegin",	cfgClientTranGroupBegin,NULL},    {"%RemoteClientEnd",	cfgRemoteClientEnd,	NULL},    { NULL, NULL, NULL}  };struct cfg_kw_el kwtblClientVars [] =

⌨️ 快捷键说明

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