libiec61850  1.5.3
Typedefs | Enumerations | Functions
Handle external access to data model and access control

Typedefs

typedef MmsDataAccessError(* WriteAccessHandler) (DataAttribute *dataAttribute, MmsValue *value, ClientConnection connection, void *parameter)
 callback handler to intercept/control client write access to data attributes More...
 
typedef MmsDataAccessError(* ReadAccessHandler) (LogicalDevice *ld, LogicalNode *ln, DataObject *dataObject, FunctionalConstraint fc, ClientConnection connection, void *parameter)
 callback handler to control client read access to data attributes More...
 

Enumerations

enum  AccessPolicy { ACCESS_POLICY_ALLOW , ACCESS_POLICY_DENY }
 

Functions

LIB61850_API void IedServer_handleWriteAccess (IedServer self, DataAttribute *dataAttribute, WriteAccessHandler handler, void *parameter)
 Install a WriteAccessHandler for a data attribute. More...
 
LIB61850_API void IedServer_handleWriteAccessForComplexAttribute (IedServer self, DataAttribute *dataAttribute, WriteAccessHandler handler, void *parameter)
 Install a WriteAccessHandler for a data attribute and for all sub data attributes. More...
 
LIB61850_API void IedServer_setWriteAccessPolicy (IedServer self, FunctionalConstraint fc, AccessPolicy policy)
 Change the default write access policy for functional constraint data with a specific FC. More...
 
LIB61850_API void IedServer_setReadAccessHandler (IedServer self, ReadAccessHandler handler, void *parameter)
 Install the global read access handler. More...
 

Detailed Description

Typedef Documentation

◆ ReadAccessHandler

typedef MmsDataAccessError(* ReadAccessHandler) (LogicalDevice *ld, LogicalNode *ln, DataObject *dataObject, FunctionalConstraint fc, ClientConnection connection, void *parameter)

callback handler to control client read access to data attributes

User provided callback function to control MMS client read access to IEC 61850 data objects. The application is to allow read access to data objects for specific clients only. It can be used to implement a role based access control (RBAC).

Parameters
ldthe logical device the client wants to access
lnthe logical node the client wants to access
dataObjectthe data object the client wants to access
fcthe functional constraint of the access
connectionthe client connection that causes the access
parameterthe user provided parameter
Returns
DATA_ACCESS_ERROR_SUCCESS if access is accepted, DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED if access is denied.

◆ WriteAccessHandler

typedef MmsDataAccessError(* WriteAccessHandler) (DataAttribute *dataAttribute, MmsValue *value, ClientConnection connection, void *parameter)

callback handler to intercept/control client write access to data attributes

User provided callback function to intercept/control MMS client access to IEC 61850 data attributes. The application can install the same handler multiple times and distinguish data attributes by the dataAttribute parameter. This handler can be used to perform write access control do data attributes. One application can be to allow write access only from a specific client. Another application could be to check if the value is in the allowed range before the write is accepted. When the callback returns DATA_ACCESS_ERROR_SUCCESS the write access is accepted and the stack will update the value automatically. When the callback returns DATA_ACCESS_ERROR_SUCCESS_NO_UPDATE the write access is accepted but the stack will not update the value automatically.

Parameters
thedata attribute that has been written by an MMS client.
thevalue the client want to write to the data attribute
connectionthe connection object of the client connection that invoked the write operation
parameterthe user provided parameter
Returns
DATA_ACCESS_ERROR_SUCCESS, or DATA_ACCESS_ERROR_SUCCESS_NO_UPDATE if access is accepted, DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED if access is denied.

Enumeration Type Documentation

◆ AccessPolicy

Enumerator
ACCESS_POLICY_ALLOW 
ACCESS_POLICY_DENY 

Function Documentation

◆ IedServer_handleWriteAccess()

LIB61850_API void IedServer_handleWriteAccess ( IedServer  self,
DataAttribute *  dataAttribute,
WriteAccessHandler  handler,
void *  parameter 
)

Install a WriteAccessHandler for a data attribute.

This instructs the server to monitor write attempts by MMS clients to specific data attributes. If a client tries to write to the monitored data attribute the handler is invoked. The handler can decide if the write access will be allowed or denied. If a WriteAccessHandler is set for a specific data attribute - the default write access policy will not be performed for that data attribute.

NOTE: If the data attribute has sub data attributes, the WriteAccessHandler is not set for the sub data attributes and will not be called when the sub data attribute is written directly!

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute to monitor
handlerthe callback function that is invoked if a client tries to write to the monitored data attribute.
parametera user provided parameter that is passed to the WriteAccessHandler when called.

◆ IedServer_handleWriteAccessForComplexAttribute()

LIB61850_API void IedServer_handleWriteAccessForComplexAttribute ( IedServer  self,
DataAttribute *  dataAttribute,
WriteAccessHandler  handler,
void *  parameter 
)

Install a WriteAccessHandler for a data attribute and for all sub data attributes.

This instructs the server to monitor write attempts by MMS clients to specific data attributes. If a client tries to write to the monitored data attribute the handler is invoked. The handler can decide if the write access will be allowed or denied. If a WriteAccessHandler is set for a specific data attribute - the default write access policy will not be performed for that data attribute.

When the data attribute is a complex attribute then the handler will also be installed for all sub data attributes. When the data attribute is a basic data attribute then this function behaves like IedServer_handleWriteAccess.

Parameters
selfthe instance of IedServer to operate on.
dataAttributethe data attribute to monitor
handlerthe callback function that is invoked if a client tries to write to the monitored data attribute.
parametera user provided parameter that is passed to the WriteAccessHandler when called.

◆ IedServer_setReadAccessHandler()

LIB61850_API void IedServer_setReadAccessHandler ( IedServer  self,
ReadAccessHandler  handler,
void *  parameter 
)

Install the global read access handler.

The read access handler will be called for every read access before the server grants access to the client.

Parameters
selfthe instance of IedServer to operate on.
handlerthe callback function that is invoked if a client tries to read a data object.
parametera user provided parameter that is passed to the callback function.

◆ IedServer_setWriteAccessPolicy()

LIB61850_API void IedServer_setWriteAccessPolicy ( IedServer  self,
FunctionalConstraint  fc,
AccessPolicy  policy 
)

Change the default write access policy for functional constraint data with a specific FC.

Parameters
selfthe instance of IedServer to operate on.
fcthe FC for which to change the default write access policy.
policythe new policy to apply.