libiec61850  1.5.3
iec61850_server.h
Go to the documentation of this file.
1 /*
2  * iec61850_server.h
3  *
4  * IEC 61850 server API for libiec61850.
5  *
6  * Copyright 2013-2023 Michael Zillgith
7  *
8  * This file is part of libIEC61850.
9  *
10  * libIEC61850 is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * libIEC61850 is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * See COPYING file for the complete license text.
24  *
25  */
26 
27 #ifndef IED_SERVER_API_H_
28 #define IED_SERVER_API_H_
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
38 #include "mms_server.h"
39 #include "iec61850_dynamic_model.h"
40 #include "iec61850_model.h"
41 #include "hal_filesystem.h"
44 
45 #define IEC61850_REPORTSETTINGS_RPT_ID 1
46 #define IEC61850_REPORTSETTINGS_BUF_TIME 2
47 #define IEC61850_REPORTSETTINGS_DATSET 4
48 #define IEC61850_REPORTSETTINGS_TRG_OPS 8
49 #define IEC61850_REPORTSETTINGS_OPT_FIELDS 16
50 #define IEC61850_REPORTSETTINGS_INTG_PD 32
51 
55 typedef struct sIedServerConfig* IedServerConfig;
56 
58 {
61 
64 
67 
70 
73 
76 
79 
82 
85 
88 
90  uint8_t edition;
91 
94 
97 
100 
103 
106 
109 
112 };
113 
119 LIB61850_API IedServerConfig
121 
125 LIB61850_API void
126 IedServerConfig_destroy(IedServerConfig self);
127 
133 LIB61850_API void
134 IedServerConfig_setEdition(IedServerConfig self, uint8_t edition);
135 
141 LIB61850_API uint8_t
142 IedServerConfig_getEdition(IedServerConfig self);
143 
149 LIB61850_API void
150 IedServerConfig_setReportBufferSize(IedServerConfig self, int reportBufferSize);
151 
157 LIB61850_API int
159 
165 LIB61850_API void
166 IedServerConfig_setReportBufferSizeForURCBs(IedServerConfig self, int reportBufferSize);
167 
173 LIB61850_API int
175 
184 LIB61850_API void
185 IedServerConfig_setMaxMmsConnections(IedServerConfig self, int maxConnections);
186 
192 LIB61850_API int
194 
204 LIB61850_API void
205 IedServerConfig_setSyncIntegrityReportTimes(IedServerConfig self, bool enable);
206 
216 LIB61850_API bool
218 
226 LIB61850_API void
227 IedServerConfig_setFileServiceBasePath(IedServerConfig self, const char* basepath);
228 
232 LIB61850_API const char*
234 
240 LIB61850_API void
241 IedServerConfig_enableFileService(IedServerConfig self, bool enable);
242 
248 LIB61850_API bool
250 
256 LIB61850_API void
257 IedServerConfig_enableDynamicDataSetService(IedServerConfig self, bool enable);
258 
264 LIB61850_API bool
266 
275 LIB61850_API void
276 IedServerConfig_setMaxAssociationSpecificDataSets(IedServerConfig self, int maxDataSets);
277 
283 LIB61850_API int
285 
291 LIB61850_API void
292 IedServerConfig_setMaxDomainSpecificDataSets(IedServerConfig self, int maxDataSets);
293 
299 LIB61850_API int
301 
311 LIB61850_API void
312 IedServerConfig_setMaxDataSetEntries(IedServerConfig self, int maxDataSetEntries);
313 
319 LIB61850_API int
321 
327 LIB61850_API void
328 IedServerConfig_enableLogService(IedServerConfig self, bool enable);
329 
338 LIB61850_API void
339 IedServerConfig_enableEditSG(IedServerConfig self, bool enable);
340 
348 LIB61850_API void
349 IedServerConfig_enableResvTmsForSGCB(IedServerConfig self, bool enable);
350 
356 LIB61850_API void
357 IedServerConfig_enableResvTmsForBRCB(IedServerConfig self, bool enable);
358 
364 LIB61850_API bool
366 
372 LIB61850_API void
373 IedServerConfig_enableOwnerForRCB(IedServerConfig self, bool enable);
374 
380 LIB61850_API bool
382 
390 LIB61850_API void
391 IedServerConfig_useIntegratedGoosePublisher(IedServerConfig self, bool enable);
392 
398 LIB61850_API bool
400 
409 LIB61850_API void
410 IedServerConfig_setReportSetting(IedServerConfig self, uint8_t setting, bool isDyn);
411 
419 LIB61850_API bool
420 IedServerConfig_getReportSetting(IedServerConfig self, uint8_t setting);
421 
425 typedef struct sIedServer* IedServer;
426 
430 typedef struct sClientConnection* ClientConnection;
431 
446 LIB61850_API IedServer
447 IedServer_create(IedModel* dataModel);
448 
457 LIB61850_API IedServer
458 IedServer_createWithTlsSupport(IedModel* dataModel, TLSConfiguration tlsConfiguration);
459 
467 LIB61850_API IedServer
468 IedServer_createWithConfig(IedModel* dataModel, TLSConfiguration tlsConfiguration, IedServerConfig serverConfiguration);
469 
475 LIB61850_API void
477 
488 LIB61850_API bool
489 IedServer_addAccessPoint(IedServer self, const char* ipAddr, int tcpPort, TLSConfiguration tlsConfiguration);
490 
497 LIB61850_API void
498 IedServer_setLocalIpAddress(IedServer self, const char* localIpAddress);
499 
510 LIB61850_API void
511 IedServer_setServerIdentity(IedServer self, const char* vendor, const char* model, const char* revision);
512 
523 LIB61850_API void
524 IedServer_setFilestoreBasepath(IedServer self, const char* basepath);
525 
532 LIB61850_API void
533 IedServer_start(IedServer self, int tcpPort);
534 
540 LIB61850_API void
542 
553 LIB61850_API void
555 
569 LIB61850_API int
570 IedServer_waitReady(IedServer self, unsigned int timeoutMs);
571 
581 LIB61850_API void
583 
592 LIB61850_API void
594 
600 LIB61850_API void
602 
610 LIB61850_API IedModel*
612 
620 LIB61850_API bool
622 
630 LIB61850_API int
632 
643 LIB61850_API MmsServer
645 
658 LIB61850_API void
660 
671 LIB61850_API void
673 
686 LIB61850_API void
687 IedServer_setGooseInterfaceId(IedServer self, const char* interfaceId);
688 
702 LIB61850_API void
703 IedServer_setGooseInterfaceIdEx(IedServer self, LogicalNode* ln, const char* gcbName, const char* interfaceId);
704 
718 LIB61850_API void
719 IedServer_useGooseVlanTag(IedServer self, LogicalNode* ln, const char* gcbName, bool useVlanTag);
720 
733 LIB61850_API void
734 IedServer_setTimeQuality(IedServer self, bool leapSecondKnown, bool clockFailure, bool clockNotSynchronized, int subsecondPrecision);
735 
756 LIB61850_API void
757 IedServer_setAuthenticator(IedServer self, AcseAuthenticator authenticator, void* authenticatorParameter);
758 
768 LIB61850_API const char*
770 
780 LIB61850_API const char*
782 
793 LIB61850_API void*
795 
805 typedef void (*IedConnectionIndicationHandler) (IedServer self, ClientConnection connection, bool connected, void* parameter);
806 
814 LIB61850_API void
816 
817 
840 LIB61850_API void
842 
851 LIB61850_API void
853 
866 LIB61850_API MmsValue*
867 IedServer_getAttributeValue(IedServer self, DataAttribute* dataAttribute);
868 
880 LIB61850_API bool
881 IedServer_getBooleanAttributeValue(IedServer self, const DataAttribute* dataAttribute);
882 
894 LIB61850_API int32_t
895 IedServer_getInt32AttributeValue(IedServer self, const DataAttribute* dataAttribute);
896 
908 LIB61850_API int64_t
909 IedServer_getInt64AttributeValue(IedServer self, const DataAttribute* dataAttribute);
910 
922 LIB61850_API uint32_t
923 IedServer_getUInt32AttributeValue(IedServer self, const DataAttribute* dataAttribute);
924 
936 LIB61850_API float
937 IedServer_getFloatAttributeValue(IedServer self, const DataAttribute* dataAttribute);
938 
950 LIB61850_API uint64_t
951 IedServer_getUTCTimeAttributeValue(IedServer self, const DataAttribute* dataAttribute);
952 
968 LIB61850_API uint32_t
969 IedServer_getBitStringAttributeValue(IedServer self, const DataAttribute* dataAttribute);
970 
982 LIB61850_API const char*
983 IedServer_getStringAttributeValue(IedServer self, const DataAttribute* dataAttribute);
984 
1000 LIB61850_API MmsValue*
1002 
1019 LIB61850_API void
1020 IedServer_updateAttributeValue(IedServer self, DataAttribute* dataAttribute, MmsValue* value);
1021 
1034 LIB61850_API void
1035 IedServer_updateFloatAttributeValue(IedServer self, DataAttribute* dataAttribute, float value);
1036 
1049 LIB61850_API void
1050 IedServer_updateInt32AttributeValue(IedServer self, DataAttribute* dataAttribute, int32_t value);
1051 
1064 LIB61850_API void
1065 IedServer_updateDbposValue(IedServer self, DataAttribute* dataAttribute, Dbpos value);
1066 
1079 LIB61850_API void
1080 IedServer_updateInt64AttributeValue(IedServer self, DataAttribute* dataAttribute, int64_t value);
1081 
1094 LIB61850_API void
1095 IedServer_updateUnsignedAttributeValue(IedServer self, DataAttribute* dataAttribute, uint32_t value);
1096 
1109 LIB61850_API void
1110 IedServer_updateBitStringAttributeValue(IedServer self, DataAttribute* dataAttribute, uint32_t value);
1111 
1124 LIB61850_API void
1125 IedServer_updateBooleanAttributeValue(IedServer self, DataAttribute* dataAttribute, bool value);
1126 
1139 LIB61850_API void
1140 IedServer_updateVisibleStringAttributeValue(IedServer self, DataAttribute* dataAttribute, char *value);
1141 
1154 LIB61850_API void
1155 IedServer_updateUTCTimeAttributeValue(IedServer self, DataAttribute* dataAttribute, uint64_t value);
1156 
1169 LIB61850_API void
1170 IedServer_updateTimestampAttributeValue(IedServer self, DataAttribute* dataAttribute, Timestamp* timestamp);
1171 
1186 LIB61850_API void
1187 IedServer_updateQuality(IedServer self, DataAttribute* dataAttribute, Quality quality);
1188 
1192 LIB61850_API void
1193 IedServer_setLogStorage(IedServer self, const char* logRef, LogStorage logStorage);
1194 
1211 LIB61850_API void
1212 IedServer_changeActiveSettingGroup(IedServer self, SettingGroupControlBlock* sgcb, uint8_t newActiveSg);
1213 
1222 LIB61850_API uint8_t
1223 IedServer_getActiveSettingGroup(IedServer self, SettingGroupControlBlock* sgcb);
1224 
1240 typedef bool (*ActiveSettingGroupChangedHandler) (void* parameter, SettingGroupControlBlock* sgcb,
1241  uint8_t newActSg, ClientConnection connection);
1242 
1251 LIB61850_API void
1252 IedServer_setActiveSettingGroupChangedHandler(IedServer self, SettingGroupControlBlock* sgcb,
1253  ActiveSettingGroupChangedHandler handler, void* parameter);
1254 
1272 typedef bool (*EditSettingGroupChangedHandler) (void* parameter, SettingGroupControlBlock* sgcb,
1273  uint8_t newEditSg, ClientConnection connection);
1274 
1283 LIB61850_API void
1284 IedServer_setEditSettingGroupChangedHandler(IedServer self, SettingGroupControlBlock* sgcb,
1285  EditSettingGroupChangedHandler handler, void* parameter);
1286 
1296 typedef void (*EditSettingGroupConfirmationHandler) (void* parameter, SettingGroupControlBlock* sgcb,
1297  uint8_t editSg);
1298 
1307 LIB61850_API void
1309  EditSettingGroupConfirmationHandler handler, void* parameter);
1310 
1322 typedef enum {
1329  CONTROL_VALUE_INVALID = 11
1331 
1335 typedef enum {
1340 
1341 typedef void* ControlAction;
1342 
1349 LIB61850_API void
1351 
1358 LIB61850_API void
1360 
1368 LIB61850_API int
1370 
1378 LIB61850_API uint8_t*
1379 ControlAction_getOrIdent(ControlAction self, int* orIdentSize);
1380 
1388 LIB61850_API int
1390 
1398 LIB61850_API bool
1400 
1408 LIB61850_API bool
1410 
1418 LIB61850_API bool
1420 
1428 LIB61850_API ClientConnection
1430 
1438 LIB61850_API DataObject*
1440 
1448 LIB61850_API uint64_t
1450 
1471 typedef CheckHandlerResult (*ControlPerformCheckHandler) (ControlAction action, void* parameter, MmsValue* ctlVal, bool test, bool interlockCheck);
1472 
1495 typedef ControlHandlerResult (*ControlWaitForExecutionHandler) (ControlAction action, void* parameter, MmsValue* ctlVal, bool test, bool synchroCheck);
1496 
1517 typedef ControlHandlerResult (*ControlHandler) (ControlAction action, void* parameter, MmsValue* ctlVal, bool test);
1518 
1522 typedef enum {
1530 
1541 typedef void (*ControlSelectStateChangedHandler) (ControlAction action, void* parameter, bool isSelected, SelectStateChangedReason reason);
1542 
1556 LIB61850_API void
1557 IedServer_setControlHandler(IedServer self, DataObject* node, ControlHandler handler, void* parameter);
1558 
1573 LIB61850_API void
1574 IedServer_setPerformCheckHandler(IedServer self, DataObject* node, ControlPerformCheckHandler handler, void* parameter);
1575 
1590 LIB61850_API void
1591 IedServer_setWaitForExecutionHandler(IedServer self, DataObject* node, ControlWaitForExecutionHandler handler, void* parameter);
1592 
1593 
1609 LIB61850_API void
1611 
1622 LIB61850_API void
1623 IedServer_updateCtlModel(IedServer self, DataObject* ctlObject, ControlModel value);
1624 
1633 typedef enum {
1634  RCB_EVENT_GET_PARAMETER, /* << parameter read by client (not implemented) */
1635  RCB_EVENT_SET_PARAMETER, /* << parameter set by client */
1636  RCB_EVENT_UNRESERVED, /* << RCB reservation canceled */
1637  RCB_EVENT_RESERVED, /* << RCB reserved */
1638  RCB_EVENT_ENABLE, /* << RCB enabled */
1639  RCB_EVENT_DISABLE, /* << RCB disabled */
1640  RCB_EVENT_GI, /* << GI report triggered */
1641  RCB_EVENT_PURGEBUF, /* << Purge buffer procedure executed */
1642  RCB_EVENT_OVERFLOW, /* << Report buffer overflow */
1643  RCB_EVENT_REPORT_CREATED /* << A new report was created and inserted into the buffer */
1645 
1656 typedef void (*IedServer_RCBEventHandler) (void* parameter, ReportControlBlock* rcb, ClientConnection connection, IedServer_RCBEventType event, const char* parameterName, MmsDataAccessError serviceError);
1657 
1665 LIB61850_API void
1667 
1677 #define IEC61850_SVCB_EVENT_ENABLE 1
1678 
1680 #define IEC61850_SVCB_EVENT_DISABLE 0
1681 
1689 typedef void (*SVCBEventHandler) (SVControlBlock* svcb, int event, void* parameter);
1690 
1699 LIB61850_API void
1700 IedServer_setSVCBHandler(IedServer self, SVControlBlock* svcb, SVCBEventHandler handler, void* parameter);
1701 
1710 typedef struct sMmsGooseControlBlock* MmsGooseControlBlock;
1711 
1713 #define IEC61850_GOCB_EVENT_ENABLE 1
1714 
1716 #define IEC61850_GOCB_EVENT_DISABLE 0
1717 
1718 typedef void (*GoCBEventHandler) (MmsGooseControlBlock goCb, int event, void* parameter);
1719 
1730 LIB61850_API void
1731 IedServer_setGoCBHandler(IedServer self, GoCBEventHandler handler, void* parameter);
1732 
1733 LIB61850_API char*
1735 
1736 LIB61850_API LogicalNode*
1738 
1739 LIB61850_API DataSet*
1741 
1742 LIB61850_API bool
1744 
1745 LIB61850_API int
1747 
1748 LIB61850_API int
1750 
1751 LIB61850_API bool
1753 
1754 LIB61850_API bool
1756 
1765 /***************************************************************************
1766  * Access control
1767  **************************************************************************/
1768 
1792 (*WriteAccessHandler) (DataAttribute* dataAttribute, MmsValue* value, ClientConnection connection, void* parameter);
1793 
1813 LIB61850_API void
1814 IedServer_handleWriteAccess(IedServer self, DataAttribute* dataAttribute,
1815  WriteAccessHandler handler, void* parameter);
1816 
1836 LIB61850_API void
1838  WriteAccessHandler handler, void* parameter);
1839 
1840 typedef enum {
1844 
1853 LIB61850_API void
1855 
1873 (*ReadAccessHandler) (LogicalDevice* ld, LogicalNode* ln, DataObject* dataObject, FunctionalConstraint fc, ClientConnection connection, void* parameter);
1874 
1884 LIB61850_API void
1886 
1891 #ifdef __cplusplus
1892 }
1893 #endif
1894 
1895 #endif /* IED_SERVER_API_H_ */
ControlAddCause
Definition: iec61850_common.h:190
ControlLastApplError
Definition: iec61850_common.h:229
Dbpos
Definition: iec61850_common.h:384
FunctionalConstraint
Definition: iec61850_common.h:264
LIB61850_API const char * ClientConnection_getPeerAddress(ClientConnection self)
get the peer address of this connection as string
LIB61850_API const char * ClientConnection_getLocalAddress(ClientConnection self)
get the local address of this connection as string
void(* IedConnectionIndicationHandler)(IedServer self, ClientConnection connection, bool connected, void *parameter)
User provided callback function that is invoked whenever a new client connects or an existing connect...
Definition: iec61850_server.h:805
LIB61850_API void IedServer_setConnectionIndicationHandler(IedServer self, IedConnectionIndicationHandler handler, void *parameter)
set a callback function that will be called on connection events (open or close).
LIB61850_API void IedServer_setAuthenticator(IedServer self, AcseAuthenticator authenticator, void *authenticatorParameter)
set the authenticator for this server
LIB61850_API void * ClientConnection_getSecurityToken(ClientConnection self)
Get the security token associated with this connection.
LIB61850_API void IedServer_setControlHandler(IedServer self, DataObject *node, ControlHandler handler, void *parameter)
Set control handler for controllable data object.
LIB61850_API void IedServer_setSelectStateChangedHandler(IedServer self, DataObject *node, ControlSelectStateChangedHandler handler, void *parameter)
Set a callback handler for a controllable data object to track select state changes.
ControlHandlerResult(* ControlHandler)(ControlAction action, void *parameter, MmsValue *ctlVal, bool test)
Control model callback to actually perform the control operation.
Definition: iec61850_server.h:1517
ControlHandlerResult
result codes for control handler (ControlWaitForExecutionHandler and ControlHandler)
Definition: iec61850_server.h:1335
LIB61850_API void IedServer_updateCtlModel(IedServer self, DataObject *ctlObject, ControlModel value)
Update the control model for the specified controllable data object with the given value and update "...
ControlHandlerResult(* ControlWaitForExecutionHandler)(ControlAction action, void *parameter, MmsValue *ctlVal, bool test, bool synchroCheck)
Control model callback to perform the dynamic tests (optional).
Definition: iec61850_server.h:1495
LIB61850_API void IedServer_setPerformCheckHandler(IedServer self, DataObject *node, ControlPerformCheckHandler handler, void *parameter)
Set a handler for a controllable data object to perform operative tests.
LIB61850_API DataObject * ControlAction_getControlObject(ControlAction self)
Gets the control object that is subject to this action.
LIB61850_API ClientConnection ControlAction_getClientConnection(ControlAction self)
Gets the client object associated with the client that caused the control action.
LIB61850_API bool ControlAction_getSynchroCheck(ControlAction self)
Gets the synchroCheck bit provided by the client.
void(* ControlSelectStateChangedHandler)(ControlAction action, void *parameter, bool isSelected, SelectStateChangedReason reason)
Control model callback that is called when the select state of a control changes.
Definition: iec61850_server.h:1541
LIB61850_API int ControlAction_getOrCat(ControlAction self)
Gets the originator category provided by the client.
CheckHandlerResult(* ControlPerformCheckHandler)(ControlAction action, void *parameter, MmsValue *ctlVal, bool test, bool interlockCheck)
Control model callback to perform the static tests (optional).
Definition: iec61850_server.h:1471
void * ControlAction
Definition: iec61850_server.h:1341
LIB61850_API bool ControlAction_isSelect(ControlAction self)
Check if the control callback is called by a select or operate command.
LIB61850_API uint8_t * ControlAction_getOrIdent(ControlAction self, int *orIdentSize)
Gets the originator identifier provided by the client.
LIB61850_API void ControlAction_setError(ControlAction self, ControlLastApplError error)
Sets the error code for the next command termination or application error message.
LIB61850_API int ControlAction_getCtlNum(ControlAction self)
Get the ctlNum attribute send by the client.
LIB61850_API uint64_t ControlAction_getControlTime(ControlAction self)
Gets the time of the control, if it's a timeActivatedControl, returns 0, if it's not.
LIB61850_API bool ControlAction_getInterlockCheck(ControlAction self)
Gets the interlockCheck bit provided by the client.
CheckHandlerResult
result code for ControlPerformCheckHandler
Definition: iec61850_server.h:1322
SelectStateChangedReason
Reason why a select state of a control object changed.
Definition: iec61850_server.h:1522
LIB61850_API void IedServer_setWaitForExecutionHandler(IedServer self, DataObject *node, ControlWaitForExecutionHandler handler, void *parameter)
Set a handler for a controllable data object to perform dynamic tests.
LIB61850_API void ControlAction_setAddCause(ControlAction self, ControlAddCause addCause)
Sets the add cause for the next command termination or application error message.
@ CONTROL_RESULT_FAILED
Definition: iec61850_server.h:1336
@ CONTROL_RESULT_OK
Definition: iec61850_server.h:1337
@ CONTROL_RESULT_WAITING
Definition: iec61850_server.h:1338
@ CONTROL_TEMPORARILY_UNAVAILABLE
Definition: iec61850_server.h:1326
@ CONTROL_HARDWARE_FAULT
Definition: iec61850_server.h:1325
@ CONTROL_OBJECT_UNDEFINED
Definition: iec61850_server.h:1328
@ CONTROL_ACCEPTED
Definition: iec61850_server.h:1323
@ CONTROL_VALUE_INVALID
Definition: iec61850_server.h:1329
@ CONTROL_OBJECT_ACCESS_DENIED
Definition: iec61850_server.h:1327
@ CONTROL_WAITING_FOR_SELECT
Definition: iec61850_server.h:1324
@ SELECT_STATE_REASON_DISCONNECTED
Definition: iec61850_server.h:1528
@ SELECT_STATE_REASON_TIMEOUT
Definition: iec61850_server.h:1525
@ SELECT_STATE_REASON_CANCELED
Definition: iec61850_server.h:1524
@ SELECT_STATE_REASON_SELECTED
Definition: iec61850_server.h:1523
@ SELECT_STATE_REASON_OPERATE_FAILED
Definition: iec61850_server.h:1527
@ SELECT_STATE_REASON_OPERATED
Definition: iec61850_server.h:1526
LIB61850_API void IedServer_lockDataModel(IedServer self)
Lock the data model for data update.
LIB61850_API MmsValue * IedServer_getAttributeValue(IedServer self, DataAttribute *dataAttribute)
Get data attribute value.
LIB61850_API void IedServer_updateInt64AttributeValue(IedServer self, DataAttribute *dataAttribute, int64_t value)
Update the value of an IEC 61850 integer64 data attribute (like BCR actVal)
LIB61850_API void IedServer_updateAttributeValue(IedServer self, DataAttribute *dataAttribute, MmsValue *value)
Update the MmsValue object of an IEC 61850 data attribute.
LIB61850_API MmsValue * IedServer_getFunctionalConstrainedData(IedServer self, DataObject *dataObject, FunctionalConstraint fc)
Get the MmsValue object related to a functional constrained data object (FCD)
LIB61850_API void IedServer_updateUnsignedAttributeValue(IedServer self, DataAttribute *dataAttribute, uint32_t value)
Update the value of an IEC 61850 unsigned integer data attribute.
LIB61850_API void IedServer_updateTimestampAttributeValue(IedServer self, DataAttribute *dataAttribute, Timestamp *timestamp)
Update the value of an IEC 61850 UTC time (timestamp) data attribute.
LIB61850_API uint32_t IedServer_getBitStringAttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of a bit string data attribute as integer value.
LIB61850_API void IedServer_updateFloatAttributeValue(IedServer self, DataAttribute *dataAttribute, float value)
Update the value of an IEC 61850 float data attribute.
LIB61850_API void IedServer_updateDbposValue(IedServer self, DataAttribute *dataAttribute, Dbpos value)
Update the value of an IEC 61850 Dbpos (double point/position) data attribute.
LIB61850_API void IedServer_updateBitStringAttributeValue(IedServer self, DataAttribute *dataAttribute, uint32_t value)
Update the value of an IEC 61850 bit string data attribute.
LIB61850_API int32_t IedServer_getInt32AttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of an integer data attribute.
LIB61850_API bool IedServer_getBooleanAttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of a boolean data attribute.
LIB61850_API uint32_t IedServer_getUInt32AttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of an unsigned integer data attribute.
LIB61850_API const char * IedServer_getStringAttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of a string type data attribute.
LIB61850_API int64_t IedServer_getInt64AttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of an integer data attribute.
LIB61850_API float IedServer_getFloatAttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of a floating point data attribute.
LIB61850_API void IedServer_updateBooleanAttributeValue(IedServer self, DataAttribute *dataAttribute, bool value)
Update the value of an IEC 61850 boolean data attribute.
LIB61850_API uint64_t IedServer_getUTCTimeAttributeValue(IedServer self, const DataAttribute *dataAttribute)
Get data attribute value of a UTC time data attribute.
LIB61850_API void IedServer_updateInt32AttributeValue(IedServer self, DataAttribute *dataAttribute, int32_t value)
Update the value of an IEC 61850 integer32 data attribute.
LIB61850_API void IedServer_updateQuality(IedServer self, DataAttribute *dataAttribute, Quality quality)
Update a quality ("q") IEC 61850 data attribute.
LIB61850_API void IedServer_updateUTCTimeAttributeValue(IedServer self, DataAttribute *dataAttribute, uint64_t value)
Update the value of an IEC 61850 UTC time (timestamp) data attribute.
LIB61850_API void IedServer_updateVisibleStringAttributeValue(IedServer self, DataAttribute *dataAttribute, char *value)
Update the value of an IEC 61850 visible string data attribute.
LIB61850_API void IedServer_unlockDataModel(IedServer self)
Unlock the data model and process pending client requests.
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.
MmsDataAccessError(* WriteAccessHandler)(DataAttribute *dataAttribute, MmsValue *value, ClientConnection connection, void *parameter)
callback handler to intercept/control client write access to data attributes
Definition: iec61850_server.h:1792
MmsDataAccessError(* ReadAccessHandler)(LogicalDevice *ld, LogicalNode *ln, DataObject *dataObject, FunctionalConstraint fc, ClientConnection connection, void *parameter)
callback handler to control client read access to data attributes
Definition: iec61850_server.h:1873
LIB61850_API void IedServer_handleWriteAccess(IedServer self, DataAttribute *dataAttribute, WriteAccessHandler handler, void *parameter)
Install a WriteAccessHandler for a data attribute.
AccessPolicy
Definition: iec61850_server.h:1840
LIB61850_API void IedServer_setReadAccessHandler(IedServer self, ReadAccessHandler handler, void *parameter)
Install the global read access handler.
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.
@ ACCESS_POLICY_ALLOW
Definition: iec61850_server.h:1841
@ ACCESS_POLICY_DENY
Definition: iec61850_server.h:1842
LIB61850_API void IedServer_stop(IedServer self)
Stop handling client connections.
LIB61850_API IedServer IedServer_createWithTlsSupport(IedModel *dataModel, TLSConfiguration tlsConfiguration)
Create a new IedServer with TLS support.
LIB61850_API IedModel * IedServer_getDataModel(IedServer self)
Return the data model of the server.
LIB61850_API void IedServer_start(IedServer self, int tcpPort)
Start handling client connections.
LIB61850_API int IedServer_getNumberOfOpenConnections(IedServer self)
Get number of open MMS connections.
LIB61850_API bool IedServer_addAccessPoint(IedServer self, const char *ipAddr, int tcpPort, TLSConfiguration tlsConfiguration)
Add a new local access point (server will listen to provided IP/port combination)
LIB61850_API void IedServer_setLocalIpAddress(IedServer self, const char *localIpAddress)
Set the local IP address to listen on.
LIB61850_API void IedServer_processIncomingData(IedServer self)
handle incoming TCP data in non-threaded mode
LIB61850_API void IedServer_destroy(IedServer self)
Destroy an IedServer instance and release all resources (memory, TCP sockets)
LIB61850_API void IedServer_setServerIdentity(IedServer self, const char *vendor, const char *model, const char *revision)
Set the identify for the MMS identify service.
LIB61850_API MmsServer IedServer_getMmsServer(IedServer self)
Get access to the underlying MmsServer instance.
LIB61850_API void IedServer_setTimeQuality(IedServer self, bool leapSecondKnown, bool clockFailure, bool clockNotSynchronized, int subsecondPrecision)
Set the time quality for all timestamps internally generated by this IedServer instance.
LIB61850_API void IedServer_stopThreadless(IedServer self)
Stop handling client connections for non-threaded mode.
LIB61850_API bool IedServer_isRunning(IedServer self)
Check if IedServer instance is listening for client connections.
LIB61850_API void IedServer_setGooseInterfaceIdEx(IedServer self, LogicalNode *ln, const char *gcbName, const char *interfaceId)
Set the Ethernet interface to be used by GOOSE publishing.
LIB61850_API IedServer IedServer_create(IedModel *dataModel)
Create a new IedServer instance.
LIB61850_API void IedServer_setGooseInterfaceId(IedServer self, const char *interfaceId)
Set the Ethernet interface to be used by GOOSE publishing.
LIB61850_API void IedServer_disableGoosePublishing(IedServer self)
Disable all GOOSE control blocks.
LIB61850_API void IedServer_enableGoosePublishing(IedServer self)
Enable all GOOSE control blocks.
LIB61850_API void IedServer_performPeriodicTasks(IedServer self)
perform periodic background tasks in non-threaded mode
LIB61850_API int IedServer_waitReady(IedServer self, unsigned int timeoutMs)
Wait until a server connection is ready (with timeout)
LIB61850_API void IedServer_useGooseVlanTag(IedServer self, LogicalNode *ln, const char *gcbName, bool useVlanTag)
Enable/disable the use of VLAN tags in GOOSE messages.
LIB61850_API IedServer IedServer_createWithConfig(IedModel *dataModel, TLSConfiguration tlsConfiguration, IedServerConfig serverConfiguration)
Create new new IedServer with extended configurations parameters.
LIB61850_API void IedServer_setFilestoreBasepath(IedServer self, const char *basepath)
Set the virtual filestore basepath for the MMS file services.
LIB61850_API void IedServer_startThreadless(IedServer self, int tcpPort)
Start handling client connection for non-threaded mode.
LIB61850_API int MmsGooseControlBlock_getMinTime(MmsGooseControlBlock self)
LIB61850_API char * MmsGooseControlBlock_getName(MmsGooseControlBlock self)
LIB61850_API bool MmsGooseControlBlock_getGoEna(MmsGooseControlBlock self)
struct sMmsGooseControlBlock * MmsGooseControlBlock
Definition: iec61850_server.h:1710
LIB61850_API LogicalNode * MmsGooseControlBlock_getLogicalNode(MmsGooseControlBlock self)
LIB61850_API int MmsGooseControlBlock_getMaxTime(MmsGooseControlBlock self)
LIB61850_API void IedServer_setGoCBHandler(IedServer self, GoCBEventHandler handler, void *parameter)
Set a callback handler for GoCB events (enabled/disabled)
LIB61850_API bool MmsGooseControlBlock_getNdsCom(MmsGooseControlBlock self)
void(* GoCBEventHandler)(MmsGooseControlBlock goCb, int event, void *parameter)
Definition: iec61850_server.h:1718
LIB61850_API DataSet * MmsGooseControlBlock_getDataSet(MmsGooseControlBlock self)
LIB61850_API bool MmsGooseControlBlock_getFixedOffs(MmsGooseControlBlock self)
LIB61850_API void IedServer_setRCBEventHandler(IedServer self, IedServer_RCBEventHandler handler, void *parameter)
Set a handler for report control block (RCB) events.
void(* IedServer_RCBEventHandler)(void *parameter, ReportControlBlock *rcb, ClientConnection connection, IedServer_RCBEventType event, const char *parameterName, MmsDataAccessError serviceError)
Callback that is called in case of RCB event.
Definition: iec61850_server.h:1656
IedServer_RCBEventType
Definition: iec61850_server.h:1633
@ RCB_EVENT_SET_PARAMETER
Definition: iec61850_server.h:1635
@ RCB_EVENT_PURGEBUF
Definition: iec61850_server.h:1641
@ RCB_EVENT_GET_PARAMETER
Definition: iec61850_server.h:1634
@ RCB_EVENT_GI
Definition: iec61850_server.h:1640
@ RCB_EVENT_DISABLE
Definition: iec61850_server.h:1639
@ RCB_EVENT_UNRESERVED
Definition: iec61850_server.h:1636
@ RCB_EVENT_RESERVED
Definition: iec61850_server.h:1637
@ RCB_EVENT_REPORT_CREATED
Definition: iec61850_server.h:1643
@ RCB_EVENT_OVERFLOW
Definition: iec61850_server.h:1642
@ RCB_EVENT_ENABLE
Definition: iec61850_server.h:1638
LIB61850_API void IedServer_setEditSettingGroupConfirmationHandler(IedServer self, SettingGroupControlBlock *sgcb, EditSettingGroupConfirmationHandler handler, void *parameter)
Set the callback handler for the COnfEditSG event.
LIB61850_API uint8_t IedServer_getActiveSettingGroup(IedServer self, SettingGroupControlBlock *sgcb)
Get the active setting group number.
LIB61850_API void IedServer_setActiveSettingGroupChangedHandler(IedServer self, SettingGroupControlBlock *sgcb, ActiveSettingGroupChangedHandler handler, void *parameter)
Set the callback handler for the SetActSG event.
LIB61850_API void IedServer_setEditSettingGroupChangedHandler(IedServer self, SettingGroupControlBlock *sgcb, EditSettingGroupChangedHandler handler, void *parameter)
Set the callback handler for the SetEditSG event.
bool(* ActiveSettingGroupChangedHandler)(void *parameter, SettingGroupControlBlock *sgcb, uint8_t newActSg, ClientConnection connection)
Callback handler that is invoked when the active setting group is about to be changed by an external ...
Definition: iec61850_server.h:1240
LIB61850_API void IedServer_changeActiveSettingGroup(IedServer self, SettingGroupControlBlock *sgcb, uint8_t newActiveSg)
Change active setting group.
bool(* EditSettingGroupChangedHandler)(void *parameter, SettingGroupControlBlock *sgcb, uint8_t newEditSg, ClientConnection connection)
Callback handler that is invoked when the edit setting group is about to be changed by an external cl...
Definition: iec61850_server.h:1272
void(* EditSettingGroupConfirmationHandler)(void *parameter, SettingGroupControlBlock *sgcb, uint8_t editSg)
Callback handler that is invoked when the edit setting group has been confirmed by an external client...
Definition: iec61850_server.h:1296
LIB61850_API void IedServer_setSVCBHandler(IedServer self, SVControlBlock *svcb, SVCBEventHandler handler, void *parameter)
Set a handler for SVCB control block events (enable/disable)
void(* SVCBEventHandler)(SVControlBlock *svcb, int event, void *parameter)
callback handler for SVCB events.
Definition: iec61850_server.h:1689
struct sMmsValue MmsValue
Definition: mms_value.h:68
MmsDataAccessError
Definition: mms_value.h:46
uint16_t Quality
Definition: iec61850_common.h:330
ControlModel
Control model (represented by "ctlModel" attribute)
Definition: iec61850_common.h:61
bool(* AcseAuthenticator)(void *parameter, AcseAuthenticationParameter authParameter, void **securityToken, IsoApplicationReference *appReference)
Callback function to authenticate a client.
Definition: iso_connection_parameters.h:105
LIB61850_API int IedServerConfig_getMaxMmsConnections(IedServerConfig self)
Get the maximum number of MMS (TCP) connections the server accepts.
struct sClientConnection * ClientConnection
Definition: iec61850_server.h:430
LIB61850_API void IedServerConfig_enableEditSG(IedServerConfig self, bool enable)
Enable/disable the EditSG service to allow clients to change setting groups (default is enabled)
LIB61850_API bool IedServerConfig_isOwnerForRCBEnabled(IedServerConfig self)
Owner for RCBs enabled (visible)
LIB61850_API void IedServerConfig_enableResvTmsForBRCB(IedServerConfig self, bool enable)
Enable/disable the presence of BRCB.ResvTms (default value is true)
LIB61850_API void IedServerConfig_setMaxDomainSpecificDataSets(IedServerConfig self, int maxDataSets)
Set the maximum allowed number of domain specific (permanent) data sets.
LIB61850_API void IedServerConfig_setReportBufferSize(IedServerConfig self, int reportBufferSize)
Set the report buffer size for buffered reporting.
LIB61850_API bool IedServerConfig_getReportSetting(IedServerConfig self, uint8_t setting)
Check if a configurable report setting is writable or read-only.
LIB61850_API void IedServerConfig_destroy(IedServerConfig self)
Destroy the configuration object.
LIB61850_API int IedServerConfig_getReportBufferSize(IedServerConfig self)
Gets the report buffer size for buffered reporting.
LIB61850_API void IedServer_setLogStorage(IedServer self, const char *logRef, LogStorage logStorage)
LIB61850_API int IedServerConfig_getMaxAssociationSpecificDataSets(IedServerConfig self)
Get the maximum allowed number of association specific (non-permanent) data sets.
LIB61850_API IedServerConfig IedServerConfig_create(void)
Create a new configuration object.
LIB61850_API const char * IedServerConfig_getFileServiceBasePath(IedServerConfig self)
Get the basepath of the file services.
LIB61850_API void IedServerConfig_useIntegratedGoosePublisher(IedServerConfig self, bool enable)
Enable/disable using the integrated GOOSE publisher for configured GoCBs.
LIB61850_API int IedServerConfig_getReportBufferSizeForURCBs(IedServerConfig self)
Gets the report buffer size for unbuffered reporting.
LIB61850_API bool IedServerConfig_getSyncIntegrityReportTimes(IedServerConfig self)
Check if synchronized integrity report times are enabled.
LIB61850_API int IedServerConfig_getMaxDomainSpecificDataSets(IedServerConfig self)
Get the maximum allowed number of domain specific (permanent) data sets.
LIB61850_API void IedServerConfig_setEdition(IedServerConfig self, uint8_t edition)
Set the IEC 61850 standard edition to use (default is edition 2)
LIB61850_API bool IedServerConfig_isResvTmsForBRCBEnabled(IedServerConfig self)
ResvTms for BRCB enabled (visible)
LIB61850_API void IedServerConfig_setMaxMmsConnections(IedServerConfig self, int maxConnections)
Set the maximum number of MMS (TCP) connections the server accepts.
LIB61850_API bool IedServerConfig_isDynamicDataSetServiceEnabled(IedServerConfig self)
Is the dynamic data set service for MMS enabled or disabled.
LIB61850_API void IedServerConfig_enableOwnerForRCB(IedServerConfig self, bool enable)
Enable/disable the presence of owner in report control blocks (default value is false);.
LIB61850_API void IedServerConfig_setReportBufferSizeForURCBs(IedServerConfig self, int reportBufferSize)
Set the report buffer size for unbuffered reporting.
LIB61850_API void IedServerConfig_setSyncIntegrityReportTimes(IedServerConfig self, bool enable)
Enable synchronized integrity report times.
LIB61850_API bool IedServerConfig_isFileServiceEnabled(IedServerConfig self)
Is the MMS file service enabled or disabled.
LIB61850_API uint8_t IedServerConfig_getEdition(IedServerConfig self)
Get the configued IEC 61850 standard edition.
LIB61850_API void IedServerConfig_enableLogService(IedServerConfig self, bool enable)
Enable/disable the log service for MMS.
LIB61850_API void IedServerConfig_enableFileService(IedServerConfig self, bool enable)
Enable/disable the MMS file service support.
LIB61850_API bool IedServerConfig_isLogServiceEnabled(IedServerConfig self)
Is the log service for MMS enabled or disabled.
LIB61850_API int IedServerConfig_getMaxDatasSetEntries(IedServerConfig self)
Get the maximum number of entries in dynamic data sets.
LIB61850_API void IedServerConfig_setFileServiceBasePath(IedServerConfig self, const char *basepath)
Set the basepath of the file services.
LIB61850_API void IedServerConfig_enableResvTmsForSGCB(IedServerConfig self, bool enable)
Enable/disable the SGCB.ResvTms when EditSG is enabled.
LIB61850_API void IedServerConfig_setMaxDataSetEntries(IedServerConfig self, int maxDataSetEntries)
Set the maximum number of entries in dynamic data sets.
LIB61850_API void IedServerConfig_setMaxAssociationSpecificDataSets(IedServerConfig self, int maxDataSets)
Set the maximum allowed number of association specific (non-permanent) data sets.
LIB61850_API void IedServerConfig_setReportSetting(IedServerConfig self, uint8_t setting, bool isDyn)
Make a configurable report setting writeable or read-only.
LIB61850_API void IedServerConfig_enableDynamicDataSetService(IedServerConfig self, bool enable)
Enable/disable the dynamic data set service for MMS.
struct sIedServer * IedServer
Definition: iec61850_server.h:425
Configuration object to configure IEC 61850 stack features.
Definition: iec61850_server.h:58
int maxMmsConnections
Definition: iec61850_server.h:93
bool useIntegratedGoosePublisher
Definition: iec61850_server.h:87
bool enableFileService
Definition: iec61850_server.h:69
uint8_t edition
Definition: iec61850_server.h:90
bool enableOwnerForRCB
Definition: iec61850_server.h:105
int maxDomainSpecificDataSets
Definition: iec61850_server.h:78
uint8_t reportSettingsWritable
Definition: iec61850_server.h:111
char * fileServiceBasepath
Definition: iec61850_server.h:66
int reportBufferSize
Definition: iec61850_server.h:60
int maxDataSetEntries
Definition: iec61850_server.h:81
int reportBufferSizeURCBs
Definition: iec61850_server.h:63
int maxAssociationSpecificDataSets
Definition: iec61850_server.h:75
bool enableDynamicDataSetService
Definition: iec61850_server.h:72
bool syncIntegrityReportTimes
Definition: iec61850_server.h:108
bool enableResvTmsForBRCB
Definition: iec61850_server.h:102
bool enableLogService
Definition: iec61850_server.h:84
bool enableResvTmsForSGCB
Definition: iec61850_server.h:99
bool enableEditSG
Definition: iec61850_server.h:96
Definition: iec61850_common.h:421