protected bool UpdateConfig(MultiXTpmDB DS) { DS.AcceptChanges(); MultiXTpm.ConfigData Config = new MultiXTpm.ConfigData(); if (DS.Group.Count > 0) { Config.Groups = new MultiXTpm.Group[DS.Group.Count]; int I = 0; foreach (MultiXTpmDB.GroupRow Row in DS.Group) { MultiXTpm.Group Group = new MultiXTpm.Group(); if (!Row.IsDescriptionNull()) Group.Description = Row.Description; Group.ID = Row.ID; if (Row.GetGroupProcessClassesRows().Length > 0) { int J = 0; Group.ProcessClassIDs = new int[Row.GetGroupProcessClassesRows().Length]; foreach (MultiXTpmDB.GroupProcessClassesRow GPCRow in Row.GetGroupProcessClassesRows()) { Group.ProcessClassIDs[J++] = GPCRow.ProcessClassID; } } Config.Groups[I++] = Group; } } if (DS.ProcessClass.Count > 0) { Config.ProcessClasses = new MultiXTpm.ProcessClass[DS.ProcessClass.Count]; int I = 0; foreach (MultiXTpmDB.ProcessClassRow Row in DS.ProcessClass) { MultiXTpm.ProcessClass ProcessClass = new MultiXTpm.ProcessClass(); ProcessClass.AutoStart = Row.AutoStart; ProcessClass.AdditionalConfigTextFile = Row.AdditionalConfigTextFile; ProcessClass.DebugLevel = Row.DebugLevel; ProcessClass.DefaultSendTimeout = Row.DefaultSendTimeout; if (!Row.IsDescriptionNull()) ProcessClass.Description = Row.Description; if (!Row.IsExecCmdNull()) ProcessClass.ExecCmd = Row.ExecCmd; if (!Row.IsExecParamsNull()) ProcessClass.ExecParams = Row.ExecParams; if (!Row.IsExpectedPasswordNull()) ProcessClass.ExpectedPassword = Row.ExpectedPassword; ProcessClass.ID = Row.ID; ProcessClass.InactivityTimer = Row.InactivityTimer; ProcessClass.MaxInstances = Row.MaxInstances; ProcessClass.MaxQueueSize = Row.MaxQueueSize; ProcessClass.MaxRecoveryQueueSize = Row.MaxRecoveryQueueSize; ProcessClass.MaxSessions = Row.MaxSessions; ProcessClass.MinInstances = Row.MinInstances; if (!Row.IsPasswordToSendNull()) ProcessClass.PasswordToSend = Row.PasswordToSend; if (!Row.IsClassNameNull()) ProcessClass.ClassName = Row.ClassName; ProcessClass.StartProcessDelay = Row.StartProcessDelay; if (Row.GetProcessClassLinksRows().Length > 0) { ProcessClass.LinkIDs = new int[Row.GetProcessClassLinksRows().Length]; int J = 0; foreach (MultiXTpmDB.ProcessClassLinksRow PCLRow in Row.GetProcessClassLinksRows()) { ProcessClass.LinkIDs[J++] = PCLRow.LinkID; } } if (Row.GetProcessClassParamsRows().Length > 0) { ProcessClass.Params = new MultiXTpm.Param[Row.GetProcessClassParamsRows().Length]; int J = 0; foreach (MultiXTpmDB.ProcessClassParamsRow PCPRow in Row.GetProcessClassParamsRows()) { MultiXTpm.Param Param = new MultiXTpm.Param(); if (!PCPRow.ParamRow.IsParamNameNull()) Param.ParamName = PCPRow.ParamRow.ParamName; if (!PCPRow.ParamRow.IsParamValueNull()) Param.ParamValue = PCPRow.ParamRow.ParamValue; ProcessClass.Params[J++] = Param; } } Config.ProcessClasses[I++] = ProcessClass; } } if (DS.Link.Count > 0) { Config.Links = new MultiXTpm.Link[DS.Link.Count]; int I = 0; foreach (MultiXTpmDB.LinkRow Row in DS.Link) { MultiXTpm.Link Link = new MultiXTpm.Link(); Config.Links[I++] = Link; if (!Row.IsDescriptionNull()) Link.Description = Row.Description; Link.ID = Row.ID; Link.LinkType = (MultiXTpm.MultiXLinkType)Row.LinkType; if (!Row.IsLocalAddressNull()) Link.LocalAddress = Row.LocalAddress; if (!Row.IsLocalPortNull()) Link.LocalPort = Row.LocalPort; Link.OpenMode = (MultiXTpm.MultiXOpenMode)Row.OpenMode; Link.Raw = Row.Raw; if (!Row.IsRemoteAddressNull()) Link.RemoteAddress = Row.RemoteAddress; if (!Row.IsRemotePortNull()) Link.RemotePort = Row.RemotePort; if (Row.GetLinkParamsRows().Length > 0) { Link.Params = new MultiXTpm.Param[Row.GetLinkParamsRows().Length]; int J = 0; foreach (MultiXTpmDB.LinkParamsRow LPRow in Row.GetLinkParamsRows()) { MultiXTpm.Param Param = new MultiXTpm.Param(); if (!LPRow.ParamRow.IsParamNameNull()) Param.ParamName = LPRow.ParamRow.ParamName; if (!LPRow.ParamRow.IsParamValueNull()) Param.ParamValue = LPRow.ParamRow.ParamValue; Link.Params[J++] = Param; } } Link.SSLParams = new MultiXTpm.SSLParams(); if (Row.SSLAPI == MultiXTpm.SSL_API.OpenSSL.ToString()) Link.SSLParams.API = MultiXTpm.SSL_API.OpenSSL; else Link.SSLParams.API = MultiXTpm.SSL_API.NoSSLAPI; Link.SSLParams.CertificateFile = Row.SSLCertificateFile; Link.SSLParams.ClientAuthenticationRequired = Row.SSLClientAuthenticationRequired; Link.SSLParams.DHFile = Row.SSLDHFile; Link.SSLParams.PrivateKeyFile = Row.SSLPrivateKeyFile; Link.SSLParams.PrivateKeyPassword = Row.SSLPrivateKeyPassword; Link.SSLParams.PrivateKeyPasswordFile = Row.SSLPrivateKeyPasswordFile; Link.SSLParams.RSAPrivateKeyFile = Row.SSLRSAPrivateKeyFile; Link.SSLParams.ServerAuthenticationRequired = Row.SSLServerAuthenticationRequired; Link.SSLParams.ServerNameVerificationRequired = Row.SSLServerNameVerificationRequired; Link.SSLParams.TrustStoreDirectory = Row.SSLTrustStoreDirectory; Link.SSLParams.TrustStoreFile = Row.SSLTrustStoreFile; } } if (DS.Message.Count > 0) { Config.Messages = new MultiXTpm.Message[DS.Message.Count]; int I = 0; foreach (MultiXTpmDB.MessageRow Row in DS.Message) { MultiXTpm.Message Msg = new MultiXTpm.Message(); Config.Messages[I++] = Msg; Msg.DbProtected = Row.DbProtected; Msg.Description = Row.Description; Msg.ID = Row.ID; Msg.Priority = Row.Priority; Msg.Stateful = Row.Stateful; Msg.Timeout = Row.Timeout; Msg.WSDllFile = Row.WSDllFile; Msg.WSDllFunction = Row.WSDllFunction; Msg.WSURL = Row.WSURL; Msg.WSSoapAction = Row.WSSoapAction; if (Row.GetGroupForwardFlagsRows().Length > 0) { int J = 0; Msg.ForwardFlags = new MultiXTpm.GroupForwardFlags[Row.GetGroupForwardFlagsRows().Length]; foreach (MultiXTpmDB.GroupForwardFlagsRow GFRow in Row.GetGroupForwardFlagsRows()) { MultiXTpm.GroupForwardFlags Flags = new MultiXTpm.GroupForwardFlags(); Msg.ForwardFlags[J++] = Flags; Flags.GroupID = GFRow.GroupID; Flags.IgnoreResponse = GFRow.IgnoreResponse; Flags.ForwardToAll = GFRow.ForwardToAll; Flags.ResponseRequired = GFRow.ResponseRequired; } } } } if (m_Tpm.UpdateConfig(ref Config, true)) { RebuildDS(DS, Config, null); return true; } return false; }
public SystemStatus GetSystemStatus(System.DateTime LastConfigTime, out ConfigData Config) { object[] results = this.Invoke("GetSystemStatus", new object[] { LastConfigTime}); Config = ((ConfigData)(results[1])); return ((SystemStatus)(results[0])); }
/// <remarks/> public SystemStatus EndGetSystemStatus(System.IAsyncResult asyncResult, out ConfigData Config) { object[] results = this.EndInvoke(asyncResult); Config = ((ConfigData)(results[1])); return ((SystemStatus)(results[0])); }
/// <remarks/> public void UpdateConfigAsync(ConfigData Config, bool SaveToDisk, object userState) { if ((this.UpdateConfigOperationCompleted == null)) { this.UpdateConfigOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateConfigOperationCompleted); } this.InvokeAsync("UpdateConfig", new object[] { Config, SaveToDisk}, this.UpdateConfigOperationCompleted, userState); }
/// <remarks/> public void UpdateConfigAsync(ConfigData Config, bool SaveToDisk) { this.UpdateConfigAsync(Config, SaveToDisk, null); }
/// <remarks/> public bool EndUpdateConfig(System.IAsyncResult asyncResult, out ConfigData Config) { object[] results = this.EndInvoke(asyncResult); Config = ((ConfigData)(results[1])); return ((bool)(results[0])); }
/// <remarks/> public System.IAsyncResult BeginUpdateConfig(ConfigData Config, bool SaveToDisk, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("UpdateConfig", new object[] { Config, SaveToDisk}, callback, asyncState); }
public bool UpdateConfig(ref ConfigData Config, bool SaveToDisk) { object[] results = this.Invoke("UpdateConfig", new object[] { Config, SaveToDisk}); Config = ((ConfigData)(results[1])); return ((bool)(results[0])); }