|
|
@ -1,7 +1,7 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* IEC61850ServerAPI.cs
|
|
|
|
* IEC61850ServerAPI.cs
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright 2016-2024 Michael Zillgith
|
|
|
|
* Copyright 2016-2025 Michael Zillgith
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -25,10 +25,7 @@ using IEC61850.Model;
|
|
|
|
using IEC61850.TLS;
|
|
|
|
using IEC61850.TLS;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
using System.Data.Common;
|
|
|
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Security.Principal;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// IEC 61850 API for the libiec61850 .NET wrapper library
|
|
|
|
// IEC 61850 API for the libiec61850 .NET wrapper library
|
|
|
|
namespace IEC61850
|
|
|
|
namespace IEC61850
|
|
|
@ -47,7 +44,8 @@ namespace IEC61850
|
|
|
|
public static IedModel CreateModelFromConfigFile(string filePath)
|
|
|
|
public static IedModel CreateModelFromConfigFile(string filePath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr retVal = ConfigFileParser_createModelFromConfigFileEx(filePath);
|
|
|
|
IntPtr retVal = ConfigFileParser_createModelFromConfigFileEx(filePath);
|
|
|
|
if (retVal == IntPtr.Zero) {
|
|
|
|
if (retVal == IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -334,7 +332,7 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
public LogicalDevice(IntPtr self, IedModel iedModel) : base(self)
|
|
|
|
public LogicalDevice(IntPtr self, IedModel iedModel) : base(self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.IedModel = iedModel;
|
|
|
|
IedModel = iedModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -344,7 +342,7 @@ namespace IEC61850
|
|
|
|
/// <param name="parent">Model containing this logical device</param>
|
|
|
|
/// <param name="parent">Model containing this logical device</param>
|
|
|
|
public LogicalDevice(string inst, IedModel parent)
|
|
|
|
public LogicalDevice(string inst, IedModel parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.IedModel = parent;
|
|
|
|
IedModel = parent;
|
|
|
|
|
|
|
|
|
|
|
|
self = LogicalDevice_create(inst, parent.self);
|
|
|
|
self = LogicalDevice_create(inst, parent.self);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -357,7 +355,7 @@ namespace IEC61850
|
|
|
|
/// <param name="ldName">LD name (for functional naming). When set, the exernally visible domain name for this LD</param>
|
|
|
|
/// <param name="ldName">LD name (for functional naming). When set, the exernally visible domain name for this LD</param>
|
|
|
|
public LogicalDevice(string inst, IedModel parent, string ldName)
|
|
|
|
public LogicalDevice(string inst, IedModel parent, string ldName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.IedModel = parent;
|
|
|
|
IedModel = parent;
|
|
|
|
|
|
|
|
|
|
|
|
self = LogicalDevice_createEx(inst, parent.self, ldName);
|
|
|
|
self = LogicalDevice_createEx(inst, parent.self, ldName);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -368,7 +366,7 @@ namespace IEC61850
|
|
|
|
/// <returns>the SGCB instance or NULL if no SGCB is available</returns>
|
|
|
|
/// <returns>the SGCB instance or NULL if no SGCB is available</returns>
|
|
|
|
public SettingGroupControlBlock GetSettingGroupControlBlock()
|
|
|
|
public SettingGroupControlBlock GetSettingGroupControlBlock()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr sgcb = LogicalDevice_getSettingGroupControlBlock(this.self);
|
|
|
|
IntPtr sgcb = LogicalDevice_getSettingGroupControlBlock(self);
|
|
|
|
|
|
|
|
|
|
|
|
if (sgcb == IntPtr.Zero)
|
|
|
|
if (sgcb == IntPtr.Zero)
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -410,12 +408,14 @@ namespace IEC61850
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum AccessPolicy {
|
|
|
|
public enum AccessPolicy
|
|
|
|
|
|
|
|
{
|
|
|
|
ACCESS_POLICY_ALLOW = 0,
|
|
|
|
ACCESS_POLICY_ALLOW = 0,
|
|
|
|
ACCESS_POLICY_DENY = 1
|
|
|
|
ACCESS_POLICY_DENY = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public enum DataAttributeType {
|
|
|
|
public enum DataAttributeType
|
|
|
|
|
|
|
|
{
|
|
|
|
BOOLEAN = 0,
|
|
|
|
BOOLEAN = 0,
|
|
|
|
INT8 = 1,
|
|
|
|
INT8 = 1,
|
|
|
|
INT16 = 2,
|
|
|
|
INT16 = 2,
|
|
|
@ -968,7 +968,7 @@ namespace IEC61850
|
|
|
|
public DataAttribute GetChildWithFc(string objRef, FunctionalConstraint fc)
|
|
|
|
public DataAttribute GetChildWithFc(string objRef, FunctionalConstraint fc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DataAttribute dataAttribute = null;
|
|
|
|
DataAttribute dataAttribute = null;
|
|
|
|
IntPtr da = ModelNode_getChildWithFc(this.self, objRef, (int)fc);
|
|
|
|
IntPtr da = ModelNode_getChildWithFc(self, objRef, (int)fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (da != IntPtr.Zero)
|
|
|
|
if (da != IntPtr.Zero)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1155,7 +1155,7 @@ namespace IEC61850
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (this.parent != null)
|
|
|
|
if (parent != null)
|
|
|
|
return parent.GetIedModel();
|
|
|
|
return parent.GetIedModel();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -1327,14 +1327,16 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr objRefPtr = ModelNode_getObjectReferenceEx(self, nativeMemory, withoutIedName);
|
|
|
|
IntPtr objRefPtr = ModelNode_getObjectReferenceEx(self, nativeMemory, withoutIedName);
|
|
|
|
|
|
|
|
|
|
|
|
if (objRefPtr != IntPtr.Zero) {
|
|
|
|
if (objRefPtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string objRef = Marshal.PtrToStringAnsi(objRefPtr);
|
|
|
|
string objRef = Marshal.PtrToStringAnsi(objRefPtr);
|
|
|
|
|
|
|
|
|
|
|
|
Marshal.FreeHGlobal(nativeMemory);
|
|
|
|
Marshal.FreeHGlobal(nativeMemory);
|
|
|
|
|
|
|
|
|
|
|
|
return objRef;
|
|
|
|
return objRef;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
Marshal.FreeHGlobal(nativeMemory);
|
|
|
|
Marshal.FreeHGlobal(nativeMemory);
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -1795,7 +1797,7 @@ namespace IEC61850
|
|
|
|
if (token != IntPtr.Zero)
|
|
|
|
if (token != IntPtr.Zero)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GCHandle handle = GCHandle.FromIntPtr(token);
|
|
|
|
GCHandle handle = GCHandle.FromIntPtr(token);
|
|
|
|
return handle as object;
|
|
|
|
return handle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1915,7 +1917,7 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
if (lnModelNode != null && lnModelNode is LogicalNode)
|
|
|
|
if (lnModelNode != null && lnModelNode is LogicalNode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.ln = lnModelNode as LogicalNode;
|
|
|
|
ln = lnModelNode as LogicalNode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2132,7 +2134,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr conPtr = ControlAction_getClientConnection(self);
|
|
|
|
IntPtr conPtr = ControlAction_getClientConnection(self);
|
|
|
|
|
|
|
|
|
|
|
|
if (conPtr != IntPtr.Zero) {
|
|
|
|
if (conPtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
iedServer.clientConnections.TryGetValue(conPtr, out con);
|
|
|
|
iedServer.clientConnections.TryGetValue(conPtr, out con);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2261,7 +2264,8 @@ namespace IEC61850
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Return type of ControlHandler and ControlWaitForExecutionHandler
|
|
|
|
/// Return type of ControlHandler and ControlWaitForExecutionHandler
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public enum ControlHandlerResult {
|
|
|
|
public enum ControlHandlerResult
|
|
|
|
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// check or operation failed
|
|
|
|
/// check or operation failed
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -2280,7 +2284,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
public delegate ControlHandlerResult ControlHandler(ControlAction action, object parameter, MmsValue ctlVal, bool test);
|
|
|
|
public delegate ControlHandlerResult ControlHandler(ControlAction action, object parameter, MmsValue ctlVal, bool test);
|
|
|
|
|
|
|
|
|
|
|
|
public enum CheckHandlerResult {
|
|
|
|
public enum CheckHandlerResult
|
|
|
|
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// check passed
|
|
|
|
/// check passed
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -2849,7 +2854,8 @@ namespace IEC61850
|
|
|
|
// hold references to managed LogStorage instances to avoid problems with GC
|
|
|
|
// hold references to managed LogStorage instances to avoid problems with GC
|
|
|
|
private Dictionary<string, LogStorage> logStorages = new Dictionary<string, LogStorage>();
|
|
|
|
private Dictionary<string, LogStorage> logStorages = new Dictionary<string, LogStorage>();
|
|
|
|
|
|
|
|
|
|
|
|
internal class ControlHandlerInfo {
|
|
|
|
internal class ControlHandlerInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
public DataObject controlObject = null;
|
|
|
|
public DataObject controlObject = null;
|
|
|
|
public GCHandle handle;
|
|
|
|
public GCHandle handle;
|
|
|
|
|
|
|
|
|
|
|
@ -2868,12 +2874,12 @@ namespace IEC61850
|
|
|
|
public ControlHandlerInfo(DataObject controlObject)
|
|
|
|
public ControlHandlerInfo(DataObject controlObject)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.controlObject = controlObject;
|
|
|
|
this.controlObject = controlObject;
|
|
|
|
this.handle = GCHandle.Alloc(this);
|
|
|
|
handle = GCHandle.Alloc(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~ControlHandlerInfo()
|
|
|
|
~ControlHandlerInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.handle.Free();
|
|
|
|
handle.Free();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2904,7 +2910,8 @@ namespace IEC61850
|
|
|
|
ControlAction controlAction = new ControlAction(action, info, this);
|
|
|
|
ControlAction controlAction = new ControlAction(action, info, this);
|
|
|
|
|
|
|
|
|
|
|
|
return (int)info.checkHandler(controlAction, info.checkHandlerParameter, new MmsValue(ctlVal), test, interlockCheck);
|
|
|
|
return (int)info.checkHandler(controlAction, info.checkHandlerParameter, new MmsValue(ctlVal), test, interlockCheck);
|
|
|
|
} else
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
return (int)CheckHandlerResult.OBJECT_UNDEFINED;
|
|
|
|
return (int)CheckHandlerResult.OBJECT_UNDEFINED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2938,7 +2945,8 @@ namespace IEC61850
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private struct WriteAccessHandlerInfo {
|
|
|
|
private struct WriteAccessHandlerInfo
|
|
|
|
|
|
|
|
{
|
|
|
|
public WriteAccessHandler handler;
|
|
|
|
public WriteAccessHandler handler;
|
|
|
|
public InternalWriteAccessHandler internalHandler;
|
|
|
|
public InternalWriteAccessHandler internalHandler;
|
|
|
|
public object parameter;
|
|
|
|
public object parameter;
|
|
|
@ -2992,7 +3000,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
ModelNode ldModelNode = iedModel.GetModelNodeFromNodeRef(ld);
|
|
|
|
ModelNode ldModelNode = iedModel.GetModelNodeFromNodeRef(ld);
|
|
|
|
ModelNode lnModelNode = iedModel.GetModelNodeFromNodeRef(ln);
|
|
|
|
ModelNode lnModelNode = iedModel.GetModelNodeFromNodeRef(ln);
|
|
|
@ -3054,7 +3062,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
return dataSetAccessHandler(dataSetAccessHandlerParameter, con, (DataSetOperation)operation, datasetRef);
|
|
|
|
return dataSetAccessHandler(dataSetAccessHandlerParameter, con, (DataSetOperation)operation, datasetRef);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3094,7 +3102,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
return activeSettingGroupChangedHandler(activeSettingGroupChangedHandlerParameter, new SettingGroupControlBlock(sgcb), newActSg, con);
|
|
|
|
return activeSettingGroupChangedHandler(activeSettingGroupChangedHandlerParameter, new SettingGroupControlBlock(sgcb), newActSg, con);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3129,7 +3137,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
return editSettingGroupChangedHandler(editSettingGroupChangedHandlerParameter, new SettingGroupControlBlock(sgcb), newEditSg, con);
|
|
|
|
return editSettingGroupChangedHandler(editSettingGroupChangedHandlerParameter, new SettingGroupControlBlock(sgcb), newEditSg, con);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3181,12 +3189,12 @@ namespace IEC61850
|
|
|
|
public SVCHandlerInfo(SVControlBlock sampledValuesControlBlock)
|
|
|
|
public SVCHandlerInfo(SVControlBlock sampledValuesControlBlock)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.sampledValuesControlBlock = sampledValuesControlBlock;
|
|
|
|
this.sampledValuesControlBlock = sampledValuesControlBlock;
|
|
|
|
this.handle = GCHandle.Alloc(this);
|
|
|
|
handle = GCHandle.Alloc(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
~SVCHandlerInfo()
|
|
|
|
~SVCHandlerInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.handle.Free();
|
|
|
|
handle.Free();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3256,7 +3264,7 @@ namespace IEC61850
|
|
|
|
AcseAuthenticationParameter acseAuthenticationParameter = new AcseAuthenticationParameter(authParameter);
|
|
|
|
AcseAuthenticationParameter acseAuthenticationParameter = new AcseAuthenticationParameter(authParameter);
|
|
|
|
IsoApplicationReference isoApplicationReference = new IsoApplicationReference(appReference);
|
|
|
|
IsoApplicationReference isoApplicationReference = new IsoApplicationReference(appReference);
|
|
|
|
GCHandle token = GCHandle.FromIntPtr(securityToken);
|
|
|
|
GCHandle token = GCHandle.FromIntPtr(securityToken);
|
|
|
|
return acseAuthenticatorHandler(acseAuthenticatorHandlerParameter, acseAuthenticationParameter, token as object, isoApplicationReference);
|
|
|
|
return acseAuthenticatorHandler(acseAuthenticatorHandlerParameter, acseAuthenticationParameter, token, isoApplicationReference);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -3289,7 +3297,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
ModelNode ldModelNode = iedModel.GetModelNodeFromNodeRef(ld);
|
|
|
|
ModelNode ldModelNode = iedModel.GetModelNodeFromNodeRef(ld);
|
|
|
|
ModelNode lnModelNode = iedModel.GetModelNodeFromNodeRef(ln);
|
|
|
|
ModelNode lnModelNode = iedModel.GetModelNodeFromNodeRef(ln);
|
|
|
@ -3339,7 +3347,7 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
ModelNode ldModelNode = null;
|
|
|
|
ModelNode ldModelNode = null;
|
|
|
|
|
|
|
|
|
|
|
@ -3357,19 +3365,23 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
private void ConnectionIndicationHandlerImpl(IntPtr iedServer, IntPtr clientConnection, bool connected, IntPtr parameter)
|
|
|
|
private void ConnectionIndicationHandlerImpl(IntPtr iedServer, IntPtr clientConnection, bool connected, IntPtr parameter)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connected == false) {
|
|
|
|
if (connected == false)
|
|
|
|
|
|
|
|
{
|
|
|
|
ClientConnection con = null;
|
|
|
|
ClientConnection con = null;
|
|
|
|
|
|
|
|
|
|
|
|
clientConnections.TryGetValue(clientConnection, out con);
|
|
|
|
clientConnections.TryGetValue(clientConnection, out con);
|
|
|
|
|
|
|
|
|
|
|
|
if (con != null) {
|
|
|
|
if (con != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (connectionHandler != null)
|
|
|
|
if (connectionHandler != null)
|
|
|
|
connectionHandler(this, con, false, connectionHandlerParameter);
|
|
|
|
connectionHandler(this, con, false, connectionHandlerParameter);
|
|
|
|
|
|
|
|
|
|
|
|
clientConnections.Remove(clientConnection);
|
|
|
|
clientConnections.Remove(clientConnection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
ClientConnection con = new ClientConnection(clientConnection);
|
|
|
|
ClientConnection con = new ClientConnection(clientConnection);
|
|
|
|
|
|
|
|
|
|
|
|
clientConnections.Add(clientConnection, con);
|
|
|
|
clientConnections.Add(clientConnection, con);
|
|
|
@ -3402,7 +3414,7 @@ namespace IEC61850
|
|
|
|
public IedServer(IedModel iedModel, TLSConfiguration tlsConfig, IedServerConfig config = null)
|
|
|
|
public IedServer(IedModel iedModel, TLSConfiguration tlsConfig, IedServerConfig config = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.iedModel = iedModel;
|
|
|
|
this.iedModel = iedModel;
|
|
|
|
this.tlsConfiguration = tlsConfig;
|
|
|
|
tlsConfiguration = tlsConfig;
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr nativeConfig = IntPtr.Zero;
|
|
|
|
IntPtr nativeConfig = IntPtr.Zero;
|
|
|
|
IntPtr nativeTLSConfig = IntPtr.Zero;
|
|
|
|
IntPtr nativeTLSConfig = IntPtr.Zero;
|
|
|
@ -3491,8 +3503,8 @@ namespace IEC61850
|
|
|
|
IedServer_destroy(self);
|
|
|
|
IedServer_destroy(self);
|
|
|
|
self = IntPtr.Zero;
|
|
|
|
self = IntPtr.Zero;
|
|
|
|
internalConnectionHandler = null;
|
|
|
|
internalConnectionHandler = null;
|
|
|
|
this.iedModel = null;
|
|
|
|
iedModel = null;
|
|
|
|
this.tlsConfiguration = null;
|
|
|
|
tlsConfiguration = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3537,7 +3549,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
controlHandlers.TryGetValue(controlObject, out info);
|
|
|
|
controlHandlers.TryGetValue(controlObject, out info);
|
|
|
|
|
|
|
|
|
|
|
|
if (info == null) {
|
|
|
|
if (info == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
info = new ControlHandlerInfo(controlObject);
|
|
|
|
info = new ControlHandlerInfo(controlObject);
|
|
|
|
controlHandlers.Add(controlObject, info);
|
|
|
|
controlHandlers.Add(controlObject, info);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3939,7 +3952,7 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.clientConnections.TryGetValue(connection, out con);
|
|
|
|
clientConnections.TryGetValue(connection, out con);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReportControlBlock reportControlBlock = null;
|
|
|
|
ReportControlBlock reportControlBlock = null;
|
|
|
|