openiec61850 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openiec61850-0.1.0/.gitignore +15 -0
- openiec61850-0.1.0/CHANGELOG.md +129 -0
- openiec61850-0.1.0/CMakeLists.txt +72 -0
- openiec61850-0.1.0/CMakePresets.json +90 -0
- openiec61850-0.1.0/CONTRIBUTING.md +42 -0
- openiec61850-0.1.0/GLOSSARY.md +97 -0
- openiec61850-0.1.0/LICENSE +202 -0
- openiec61850-0.1.0/NOTICE +4 -0
- openiec61850-0.1.0/PKG-INFO +176 -0
- openiec61850-0.1.0/README.md +147 -0
- openiec61850-0.1.0/cmake/CompilerWarnings.cmake +19 -0
- openiec61850-0.1.0/cmake/Sanitizers.cmake +18 -0
- openiec61850-0.1.0/cmake/openiec61850Config.cmake.in +19 -0
- openiec61850-0.1.0/docs/adr/0001-clean-room-apache-2.md +8 -0
- openiec61850-0.1.0/docs/adr/0002-own-api-not-pyiec61850.md +3 -0
- openiec61850-0.1.0/docs/adr/0003-cpp20-nanobind.md +12 -0
- openiec61850-0.1.0/docs/adr/0004-asynchronous-core.md +3 -0
- openiec61850-0.1.0/docs/adr/0005-build-and-dependencies.md +3 -0
- openiec61850-0.1.0/docs/adr/0006-homelab-gitlab-github-releases.md +8 -0
- openiec61850-0.1.0/docs/adr/0007-interoperability-without-physical-ieds.md +7 -0
- openiec61850-0.1.0/docs/adr/0008-alpha-release-criteria.md +12 -0
- openiec61850-0.1.0/docs/guides/architecture.md +93 -0
- openiec61850-0.1.0/docs/guides/contributing.md +296 -0
- openiec61850-0.1.0/docs/guides/getting-started.md +282 -0
- openiec61850-0.1.0/docs/guides/releasing.md +186 -0
- openiec61850-0.1.0/docs/index.md +14 -0
- openiec61850-0.1.0/include/openiec61850/association/association.hpp +6 -0
- openiec61850-0.1.0/include/openiec61850/association/client_association.hpp +150 -0
- openiec61850-0.1.0/include/openiec61850/association/error.hpp +36 -0
- openiec61850-0.1.0/include/openiec61850/association/server_association.hpp +175 -0
- openiec61850-0.1.0/include/openiec61850/association/types.hpp +248 -0
- openiec61850-0.1.0/include/openiec61850/ber/ber.hpp +8 -0
- openiec61850-0.1.0/include/openiec61850/ber/decode.hpp +125 -0
- openiec61850-0.1.0/include/openiec61850/ber/oid.hpp +69 -0
- openiec61850-0.1.0/include/openiec61850/ber/reader.hpp +84 -0
- openiec61850-0.1.0/include/openiec61850/ber/tag.hpp +67 -0
- openiec61850-0.1.0/include/openiec61850/ber/writer.hpp +80 -0
- openiec61850-0.1.0/include/openiec61850/client/client.hpp +310 -0
- openiec61850-0.1.0/include/openiec61850/client/control.hpp +289 -0
- openiec61850-0.1.0/include/openiec61850/client/error.hpp +57 -0
- openiec61850-0.1.0/include/openiec61850/client/error_details.hpp +50 -0
- openiec61850-0.1.0/include/openiec61850/client/report.hpp +86 -0
- openiec61850-0.1.0/include/openiec61850/client/types.hpp +322 -0
- openiec61850-0.1.0/include/openiec61850/client/values.hpp +41 -0
- openiec61850-0.1.0/include/openiec61850/core/bytes.hpp +12 -0
- openiec61850-0.1.0/include/openiec61850/core/error.hpp +31 -0
- openiec61850-0.1.0/include/openiec61850/core/result.hpp +56 -0
- openiec61850-0.1.0/include/openiec61850/core/version.hpp +16 -0
- openiec61850-0.1.0/include/openiec61850/goose/frame.hpp +121 -0
- openiec61850-0.1.0/include/openiec61850/goose/goose.hpp +12 -0
- openiec61850-0.1.0/include/openiec61850/goose/link.hpp +151 -0
- openiec61850-0.1.0/include/openiec61850/goose/pdu.hpp +102 -0
- openiec61850-0.1.0/include/openiec61850/goose/publisher.hpp +118 -0
- openiec61850-0.1.0/include/openiec61850/goose/receiver.hpp +53 -0
- openiec61850-0.1.0/include/openiec61850/goose/scl_config.hpp +58 -0
- openiec61850-0.1.0/include/openiec61850/goose/subscriber.hpp +198 -0
- openiec61850-0.1.0/include/openiec61850/goose/sv.hpp +216 -0
- openiec61850-0.1.0/include/openiec61850/goose/sv_publisher.hpp +91 -0
- openiec61850-0.1.0/include/openiec61850/goose/sv_subscriber.hpp +123 -0
- openiec61850-0.1.0/include/openiec61850/iso/acse/apdu.hpp +279 -0
- openiec61850-0.1.0/include/openiec61850/iso/cotp/connection.hpp +135 -0
- openiec61850-0.1.0/include/openiec61850/iso/cotp/tpdu.hpp +157 -0
- openiec61850-0.1.0/include/openiec61850/iso/cotp/tpkt.hpp +58 -0
- openiec61850-0.1.0/include/openiec61850/iso/presentation/connection.hpp +172 -0
- openiec61850-0.1.0/include/openiec61850/iso/presentation/ppdu.hpp +254 -0
- openiec61850-0.1.0/include/openiec61850/iso/session/connection.hpp +140 -0
- openiec61850-0.1.0/include/openiec61850/iso/session/spdu.hpp +236 -0
- openiec61850-0.1.0/include/openiec61850/mms/data.hpp +323 -0
- openiec61850-0.1.0/include/openiec61850/mms/list_view.hpp +179 -0
- openiec61850-0.1.0/include/openiec61850/mms/mms.hpp +7 -0
- openiec61850-0.1.0/include/openiec61850/mms/pdu.hpp +977 -0
- openiec61850-0.1.0/include/openiec61850/mms/type_description.hpp +99 -0
- openiec61850-0.1.0/include/openiec61850/model/basic_type.hpp +87 -0
- openiec61850-0.1.0/include/openiec61850/model/entry_id.hpp +57 -0
- openiec61850-0.1.0/include/openiec61850/model/enums.hpp +111 -0
- openiec61850-0.1.0/include/openiec61850/model/functional_constraint.hpp +55 -0
- openiec61850-0.1.0/include/openiec61850/model/mms_mapping.hpp +110 -0
- openiec61850-0.1.0/include/openiec61850/model/model.hpp +11 -0
- openiec61850-0.1.0/include/openiec61850/model/object_reference.hpp +228 -0
- openiec61850-0.1.0/include/openiec61850/model/quality.hpp +136 -0
- openiec61850-0.1.0/include/openiec61850/model/rcb_options.hpp +198 -0
- openiec61850-0.1.0/include/openiec61850/model/timestamp.hpp +116 -0
- openiec61850-0.1.0/include/openiec61850/scl/address.hpp +59 -0
- openiec61850-0.1.0/include/openiec61850/scl/btype.hpp +47 -0
- openiec61850-0.1.0/include/openiec61850/scl/diagnostics.hpp +87 -0
- openiec61850-0.1.0/include/openiec61850/scl/document.hpp +455 -0
- openiec61850-0.1.0/include/openiec61850/scl/instance.hpp +157 -0
- openiec61850-0.1.0/include/openiec61850/scl/load.hpp +52 -0
- openiec61850-0.1.0/include/openiec61850/scl/scl.hpp +8 -0
- openiec61850-0.1.0/include/openiec61850/server/error.hpp +29 -0
- openiec61850-0.1.0/include/openiec61850/server/files.hpp +146 -0
- openiec61850-0.1.0/include/openiec61850/server/model.hpp +475 -0
- openiec61850-0.1.0/include/openiec61850/server/scl_model.hpp +89 -0
- openiec61850-0.1.0/include/openiec61850/server/server.hpp +399 -0
- openiec61850-0.1.0/include/openiec61850/transport/cotp_channel.hpp +192 -0
- openiec61850-0.1.0/include/openiec61850/transport/io_runtime.hpp +71 -0
- openiec61850-0.1.0/include/openiec61850/transport/spawn.hpp +53 -0
- openiec61850-0.1.0/include/openiec61850/transport/tls.hpp +86 -0
- openiec61850-0.1.0/mkdocs.yml +15 -0
- openiec61850-0.1.0/packaging/check_version.py +54 -0
- openiec61850-0.1.0/packaging/cibuildwheel/install-vcpkg.sh +30 -0
- openiec61850-0.1.0/packaging/vcpkg/openiec61850/portfile.cmake +35 -0
- openiec61850-0.1.0/packaging/vcpkg/openiec61850/usage +4 -0
- openiec61850-0.1.0/packaging/vcpkg/openiec61850/vcpkg.json +30 -0
- openiec61850-0.1.0/pyproject.toml +101 -0
- openiec61850-0.1.0/python/CMakeLists.txt +35 -0
- openiec61850-0.1.0/python/openiec61850/__init__.py +373 -0
- openiec61850-0.1.0/python/openiec61850/_client.py +1622 -0
- openiec61850-0.1.0/python/openiec61850/_control.py +237 -0
- openiec61850-0.1.0/python/openiec61850/_core.pyi +437 -0
- openiec61850-0.1.0/python/openiec61850/_errors.py +582 -0
- openiec61850-0.1.0/python/openiec61850/_server.py +1764 -0
- openiec61850-0.1.0/python/openiec61850/_types.py +1301 -0
- openiec61850-0.1.0/python/openiec61850/_values.py +339 -0
- openiec61850-0.1.0/python/openiec61850/goose/__init__.py +1316 -0
- openiec61850-0.1.0/python/openiec61850/py.typed +0 -0
- openiec61850-0.1.0/python/openiec61850/sync.py +537 -0
- openiec61850-0.1.0/python/src/bindings.hpp +12 -0
- openiec61850-0.1.0/python/src/client_binding.cpp +656 -0
- openiec61850-0.1.0/python/src/convert.cpp +702 -0
- openiec61850-0.1.0/python/src/convert.hpp +81 -0
- openiec61850-0.1.0/python/src/goose_binding.cpp +1070 -0
- openiec61850-0.1.0/python/src/model_binding.cpp +118 -0
- openiec61850-0.1.0/python/src/module.cpp +48 -0
- openiec61850-0.1.0/python/src/pump.hpp +182 -0
- openiec61850-0.1.0/python/src/runtime.cpp +170 -0
- openiec61850-0.1.0/python/src/runtime.hpp +188 -0
- openiec61850-0.1.0/python/src/server_binding.cpp +1382 -0
- openiec61850-0.1.0/python/src/testing_module.cpp +250 -0
- openiec61850-0.1.0/src/CMakeLists.txt +96 -0
- openiec61850-0.1.0/src/association/CMakeLists.txt +7 -0
- openiec61850-0.1.0/src/association/client_association.cpp +347 -0
- openiec61850-0.1.0/src/association/core.cpp +521 -0
- openiec61850-0.1.0/src/association/core.hpp +217 -0
- openiec61850-0.1.0/src/association/error.cpp +38 -0
- openiec61850-0.1.0/src/association/handshake.cpp +306 -0
- openiec61850-0.1.0/src/association/handshake.hpp +78 -0
- openiec61850-0.1.0/src/association/server_association.cpp +302 -0
- openiec61850-0.1.0/src/association/types.cpp +70 -0
- openiec61850-0.1.0/src/ber/CMakeLists.txt +5 -0
- openiec61850-0.1.0/src/ber/decode.cpp +283 -0
- openiec61850-0.1.0/src/ber/oid.cpp +37 -0
- openiec61850-0.1.0/src/ber/reader.cpp +106 -0
- openiec61850-0.1.0/src/ber/writer.cpp +177 -0
- openiec61850-0.1.0/src/client/CMakeLists.txt +9 -0
- openiec61850-0.1.0/src/client/acsi_services.cpp +701 -0
- openiec61850-0.1.0/src/client/client.cpp +762 -0
- openiec61850-0.1.0/src/client/control.cpp +881 -0
- openiec61850-0.1.0/src/client/detail.hpp +360 -0
- openiec61850-0.1.0/src/client/error.cpp +65 -0
- openiec61850-0.1.0/src/client/report.cpp +176 -0
- openiec61850-0.1.0/src/client/services.cpp +883 -0
- openiec61850-0.1.0/src/client/types.cpp +21 -0
- openiec61850-0.1.0/src/client/values.cpp +78 -0
- openiec61850-0.1.0/src/core/CMakeLists.txt +4 -0
- openiec61850-0.1.0/src/core/error.cpp +37 -0
- openiec61850-0.1.0/src/core/version.cpp.in +9 -0
- openiec61850-0.1.0/src/goose/CMakeLists.txt +12 -0
- openiec61850-0.1.0/src/goose/detail.hpp +118 -0
- openiec61850-0.1.0/src/goose/frame.cpp +123 -0
- openiec61850-0.1.0/src/goose/link_loopback.cpp +113 -0
- openiec61850-0.1.0/src/goose/link_raw.cpp +256 -0
- openiec61850-0.1.0/src/goose/pdu.cpp +183 -0
- openiec61850-0.1.0/src/goose/publisher.cpp +217 -0
- openiec61850-0.1.0/src/goose/receiver.cpp +149 -0
- openiec61850-0.1.0/src/goose/scl_config.cpp +218 -0
- openiec61850-0.1.0/src/goose/subscriber.cpp +231 -0
- openiec61850-0.1.0/src/goose/subscription_impl.hpp +70 -0
- openiec61850-0.1.0/src/goose/sv.cpp +269 -0
- openiec61850-0.1.0/src/goose/sv_publisher.cpp +168 -0
- openiec61850-0.1.0/src/goose/sv_subscriber.cpp +145 -0
- openiec61850-0.1.0/src/iso/CMakeLists.txt +4 -0
- openiec61850-0.1.0/src/iso/acse/CMakeLists.txt +2 -0
- openiec61850-0.1.0/src/iso/acse/apdu.cpp +670 -0
- openiec61850-0.1.0/src/iso/cotp/CMakeLists.txt +4 -0
- openiec61850-0.1.0/src/iso/cotp/connection.cpp +251 -0
- openiec61850-0.1.0/src/iso/cotp/tpdu.cpp +292 -0
- openiec61850-0.1.0/src/iso/cotp/tpkt.cpp +76 -0
- openiec61850-0.1.0/src/iso/presentation/CMakeLists.txt +3 -0
- openiec61850-0.1.0/src/iso/presentation/connection.cpp +316 -0
- openiec61850-0.1.0/src/iso/presentation/ppdu.cpp +604 -0
- openiec61850-0.1.0/src/iso/session/CMakeLists.txt +3 -0
- openiec61850-0.1.0/src/iso/session/connection.cpp +230 -0
- openiec61850-0.1.0/src/iso/session/spdu.cpp +549 -0
- openiec61850-0.1.0/src/mms/CMakeLists.txt +5 -0
- openiec61850-0.1.0/src/mms/data.cpp +586 -0
- openiec61850-0.1.0/src/mms/detail.hpp +24 -0
- openiec61850-0.1.0/src/mms/pdu_decode.cpp +1330 -0
- openiec61850-0.1.0/src/mms/pdu_encode.cpp +695 -0
- openiec61850-0.1.0/src/mms/type_description.cpp +305 -0
- openiec61850-0.1.0/src/model/CMakeLists.txt +10 -0
- openiec61850-0.1.0/src/model/basic_type.cpp +105 -0
- openiec61850-0.1.0/src/model/detail.hpp +52 -0
- openiec61850-0.1.0/src/model/entry_id.cpp +53 -0
- openiec61850-0.1.0/src/model/enums.cpp +110 -0
- openiec61850-0.1.0/src/model/functional_constraint.cpp +27 -0
- openiec61850-0.1.0/src/model/mms_mapping.cpp +350 -0
- openiec61850-0.1.0/src/model/object_reference.cpp +278 -0
- openiec61850-0.1.0/src/model/quality.cpp +33 -0
- openiec61850-0.1.0/src/model/rcb_options.cpp +33 -0
- openiec61850-0.1.0/src/model/timestamp.cpp +28 -0
- openiec61850-0.1.0/src/scl/CMakeLists.txt +8 -0
- openiec61850-0.1.0/src/scl/address.cpp +137 -0
- openiec61850-0.1.0/src/scl/btype.cpp +165 -0
- openiec61850-0.1.0/src/scl/diagnostics.cpp +77 -0
- openiec61850-0.1.0/src/scl/document.cpp +147 -0
- openiec61850-0.1.0/src/scl/instantiate.cpp +620 -0
- openiec61850-0.1.0/src/scl/load.cpp +730 -0
- openiec61850-0.1.0/src/scl/text.hpp +62 -0
- openiec61850-0.1.0/src/scl/validate.cpp +360 -0
- openiec61850-0.1.0/src/scl/validate.hpp +11 -0
- openiec61850-0.1.0/src/scl/xml.hpp +107 -0
- openiec61850-0.1.0/src/server/CMakeLists.txt +14 -0
- openiec61850-0.1.0/src/server/access.cpp +291 -0
- openiec61850-0.1.0/src/server/control.cpp +528 -0
- openiec61850-0.1.0/src/server/detail.hpp +558 -0
- openiec61850-0.1.0/src/server/file_services.cpp +369 -0
- openiec61850-0.1.0/src/server/files.cpp +302 -0
- openiec61850-0.1.0/src/server/goose_control.cpp +103 -0
- openiec61850-0.1.0/src/server/logging.cpp +346 -0
- openiec61850-0.1.0/src/server/model.cpp +926 -0
- openiec61850-0.1.0/src/server/reporting.cpp +624 -0
- openiec61850-0.1.0/src/server/scl_model.cpp +639 -0
- openiec61850-0.1.0/src/server/server.cpp +669 -0
- openiec61850-0.1.0/src/server/services.cpp +446 -0
- openiec61850-0.1.0/src/server/setting_groups.cpp +234 -0
- openiec61850-0.1.0/src/server/values.cpp +170 -0
- openiec61850-0.1.0/src/server/values.hpp +32 -0
- openiec61850-0.1.0/src/transport/CMakeLists.txt +4 -0
- openiec61850-0.1.0/src/transport/cotp_channel.cpp +754 -0
- openiec61850-0.1.0/src/transport/io_runtime.cpp +74 -0
- openiec61850-0.1.0/src/transport/tls.cpp +212 -0
- openiec61850-0.1.0/src/transport/tls_impl.hpp +26 -0
- openiec61850-0.1.0/tests/CMakeLists.txt +22 -0
- openiec61850-0.1.0/tests/association/CMakeLists.txt +3 -0
- openiec61850-0.1.0/tests/association/test_association.cpp +883 -0
- openiec61850-0.1.0/tests/association/test_handshake.cpp +319 -0
- openiec61850-0.1.0/tests/ber/CMakeLists.txt +5 -0
- openiec61850-0.1.0/tests/ber/ber_test_util.hpp +14 -0
- openiec61850-0.1.0/tests/ber/test_decode.cpp +332 -0
- openiec61850-0.1.0/tests/ber/test_oid.cpp +128 -0
- openiec61850-0.1.0/tests/ber/test_reader.cpp +214 -0
- openiec61850-0.1.0/tests/ber/test_writer.cpp +254 -0
- openiec61850-0.1.0/tests/client/CMakeLists.txt +7 -0
- openiec61850-0.1.0/tests/client/client_test_util.hpp +71 -0
- openiec61850-0.1.0/tests/client/fake_server.cpp +1221 -0
- openiec61850-0.1.0/tests/client/fake_server.hpp +160 -0
- openiec61850-0.1.0/tests/client/test_client.cpp +365 -0
- openiec61850-0.1.0/tests/client/test_control.cpp +538 -0
- openiec61850-0.1.0/tests/client/test_error_details.cpp +182 -0
- openiec61850-0.1.0/tests/client/test_report.cpp +160 -0
- openiec61850-0.1.0/tests/client/test_reporting.cpp +424 -0
- openiec61850-0.1.0/tests/core/CMakeLists.txt +4 -0
- openiec61850-0.1.0/tests/core/test_error.cpp +11 -0
- openiec61850-0.1.0/tests/core/test_result.cpp +30 -0
- openiec61850-0.1.0/tests/core/test_version.cpp +9 -0
- openiec61850-0.1.0/tests/goose/CMakeLists.txt +9 -0
- openiec61850-0.1.0/tests/goose/goose_test_util.hpp +87 -0
- openiec61850-0.1.0/tests/goose/test_frame.cpp +96 -0
- openiec61850-0.1.0/tests/goose/test_pdu.cpp +188 -0
- openiec61850-0.1.0/tests/goose/test_publisher.cpp +165 -0
- openiec61850-0.1.0/tests/goose/test_raw_socket.cpp +68 -0
- openiec61850-0.1.0/tests/goose/test_scl_config.cpp +157 -0
- openiec61850-0.1.0/tests/goose/test_subscriber.cpp +294 -0
- openiec61850-0.1.0/tests/goose/test_sv.cpp +185 -0
- openiec61850-0.1.0/tests/goose/test_sv_pubsub.cpp +194 -0
- openiec61850-0.1.0/tests/iso/CMakeLists.txt +4 -0
- openiec61850-0.1.0/tests/iso/acse/CMakeLists.txt +2 -0
- openiec61850-0.1.0/tests/iso/acse/test_apdu.cpp +449 -0
- openiec61850-0.1.0/tests/iso/cotp/CMakeLists.txt +4 -0
- openiec61850-0.1.0/tests/iso/cotp/test_connection.cpp +376 -0
- openiec61850-0.1.0/tests/iso/cotp/test_tpdu.cpp +210 -0
- openiec61850-0.1.0/tests/iso/cotp/test_tpkt.cpp +112 -0
- openiec61850-0.1.0/tests/iso/presentation/CMakeLists.txt +3 -0
- openiec61850-0.1.0/tests/iso/presentation/test_connection.cpp +417 -0
- openiec61850-0.1.0/tests/iso/presentation/test_ppdu.cpp +386 -0
- openiec61850-0.1.0/tests/iso/session/CMakeLists.txt +3 -0
- openiec61850-0.1.0/tests/iso/session/test_connection.cpp +360 -0
- openiec61850-0.1.0/tests/iso/session/test_spdu.cpp +364 -0
- openiec61850-0.1.0/tests/mms/CMakeLists.txt +5 -0
- openiec61850-0.1.0/tests/mms/mms_test_util.hpp +37 -0
- openiec61850-0.1.0/tests/mms/test_data.cpp +283 -0
- openiec61850-0.1.0/tests/mms/test_pdu.cpp +590 -0
- openiec61850-0.1.0/tests/mms/test_pdu_services.cpp +365 -0
- openiec61850-0.1.0/tests/mms/test_type_description.cpp +93 -0
- openiec61850-0.1.0/tests/model/CMakeLists.txt +5 -0
- openiec61850-0.1.0/tests/model/test_attributes.cpp +316 -0
- openiec61850-0.1.0/tests/model/test_basic_type.cpp +114 -0
- openiec61850-0.1.0/tests/model/test_mms_mapping.cpp +320 -0
- openiec61850-0.1.0/tests/model/test_object_reference.cpp +259 -0
- openiec61850-0.1.0/tests/package/CMakeLists.txt +9 -0
- openiec61850-0.1.0/tests/package/main.cpp +64 -0
- openiec61850-0.1.0/tests/package/run.cmake +43 -0
- openiec61850-0.1.0/tests/python/conftest.py +44 -0
- openiec61850-0.1.0/tests/python/test_backpressure.py +182 -0
- openiec61850-0.1.0/tests/python/test_client.py +292 -0
- openiec61850-0.1.0/tests/python/test_control.py +199 -0
- openiec61850-0.1.0/tests/python/test_error_details.py +89 -0
- openiec61850-0.1.0/tests/python/test_goose.py +332 -0
- openiec61850-0.1.0/tests/python/test_import.py +10 -0
- openiec61850-0.1.0/tests/python/test_parity.py +386 -0
- openiec61850-0.1.0/tests/python/test_readme.py +206 -0
- openiec61850-0.1.0/tests/python/test_reporting.py +164 -0
- openiec61850-0.1.0/tests/python/test_server.py +678 -0
- openiec61850-0.1.0/tests/python/test_services_ext.py +598 -0
- openiec61850-0.1.0/tests/python/test_sync.py +68 -0
- openiec61850-0.1.0/tests/python/test_tls.py +123 -0
- openiec61850-0.1.0/tests/python/test_types.py +166 -0
- openiec61850-0.1.0/tests/scl/CMakeLists.txt +8 -0
- openiec61850-0.1.0/tests/scl/data/ed1_relay.icd +296 -0
- openiec61850-0.1.0/tests/scl/data/ed2_bay.cid +234 -0
- openiec61850-0.1.0/tests/scl/data/object_arrays.icd +88 -0
- openiec61850-0.1.0/tests/scl/data/station.scd +95 -0
- openiec61850-0.1.0/tests/scl/scl_test_util.hpp +38 -0
- openiec61850-0.1.0/tests/scl/test_address.cpp +86 -0
- openiec61850-0.1.0/tests/scl/test_btype.cpp +91 -0
- openiec61850-0.1.0/tests/scl/test_diagnostics.cpp +299 -0
- openiec61850-0.1.0/tests/scl/test_instance.cpp +314 -0
- openiec61850-0.1.0/tests/scl/test_load.cpp +288 -0
- openiec61850-0.1.0/tests/server/CMakeLists.txt +13 -0
- openiec61850-0.1.0/tests/server/server_test_util.hpp +212 -0
- openiec61850-0.1.0/tests/server/stall_proxy.hpp +190 -0
- openiec61850-0.1.0/tests/server/test_backpressure.cpp +571 -0
- openiec61850-0.1.0/tests/server/test_control.cpp +168 -0
- openiec61850-0.1.0/tests/server/test_control_models.cpp +698 -0
- openiec61850-0.1.0/tests/server/test_model.cpp +220 -0
- openiec61850-0.1.0/tests/server/test_reporting.cpp +295 -0
- openiec61850-0.1.0/tests/server/test_scl_model.cpp +589 -0
- openiec61850-0.1.0/tests/server/test_server.cpp +358 -0
- openiec61850-0.1.0/tests/server/test_services_ext.cpp +666 -0
- openiec61850-0.1.0/tests/server/test_set_file.cpp +776 -0
- openiec61850-0.1.0/tests/server/test_tls.cpp +73 -0
- openiec61850-0.1.0/tests/soak/CMakeLists.txt +3 -0
- openiec61850-0.1.0/tests/soak/test_soak.cpp +847 -0
- openiec61850-0.1.0/tests/transport/CMakeLists.txt +5 -0
- openiec61850-0.1.0/tests/transport/test_cotp_channel.cpp +506 -0
- openiec61850-0.1.0/tests/transport/test_io_runtime.cpp +130 -0
- openiec61850-0.1.0/tests/transport/test_tls.cpp +444 -0
- openiec61850-0.1.0/tests/transport/tls_certs.cpp +170 -0
- openiec61850-0.1.0/tests/transport/tls_certs.hpp +51 -0
- openiec61850-0.1.0/tests/tsan.supp +9 -0
- openiec61850-0.1.0/tools/CMakeLists.txt +38 -0
- openiec61850-0.1.0/tools/client_main.cpp +437 -0
- openiec61850-0.1.0/tools/common.cpp +284 -0
- openiec61850-0.1.0/tools/common.hpp +62 -0
- openiec61850-0.1.0/tools/server_main.cpp +339 -0
- openiec61850-0.1.0/tools/smoke_test.sh +111 -0
- openiec61850-0.1.0/tools/tls_peer_test.sh +441 -0
- openiec61850-0.1.0/vcpkg.json +31 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
6
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). While the version is 0.x, a minor
|
|
7
|
+
release may break the API. The release process is in
|
|
8
|
+
[docs/guides/releasing.md](docs/guides/releasing.md).
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
## [0.1.0] - 2026-11-01
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- TLS: an abort with traffic in flight no longer keeps the socket open for the whole close
|
|
17
|
+
timeout (1 s); the pending read is cancelled before the TLS shutdown.
|
|
18
|
+
- A peer that stops reading no longer grows memory without limit, on either role: the server's
|
|
19
|
+
queue of answers and reports, the rejects of a request flood and the transport's output buffer
|
|
20
|
+
were all unbounded (measured: 19 MiB/s with reports enabled, 130 MiB/s with a request flood).
|
|
21
|
+
New `channel_options::max_output_bytes` (16 MiB) and `write_stall_timeout` (30 s without
|
|
22
|
+
progress), plain and TLS, in Python on `IsoParameters` and `ServerIsoParameters`: past them the
|
|
23
|
+
association ends, `errc::output_limit_exceeded` (`OutputLimitExceeded`) or `timed_out`, and the
|
|
24
|
+
others do not notice.
|
|
25
|
+
- `server::stop()` and `abort()` no longer hang on a peer that does not read: the ABRT gets 1 s.
|
|
26
|
+
- A client that keeps reading is no longer aborted at `max_output_bytes` during an `update()` storm:
|
|
27
|
+
the server sent one PDU per turn on its strand, and a turn came after all the updates waiting
|
|
28
|
+
there. The whole queue now goes out per turn, in bounded groups on the association's strand, and
|
|
29
|
+
updates are applied 64 calls per turn, so that the rest of the I/O thread gets to run.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- Reports of an association aborted that way: a URCB loses what was queued and is disabled; a BRCB
|
|
34
|
+
stops at half the limit, keeps its entries in its buffer and goes back to those not written, so
|
|
35
|
+
that the next association gets them. `server::slow_peer_aborts()` counts those aborts.
|
|
36
|
+
- `server::update()` fails with `errc::overloaded` (`ServerOverloaded`) with
|
|
37
|
+
`server_options::max_pending_updates` (8192) changes pending, instead of queueing on the strand
|
|
38
|
+
shared with the clients without limit. Never blocks, and drops nothing it accepted;
|
|
39
|
+
`server::pending_updates()` tells how far behind the strand is.
|
|
40
|
+
- `incoming_request::encoded_answer()`, `server_association::send_batch()`: PDUs encoded by the caller.
|
|
41
|
+
The server no longer encodes a response twice to check its size.
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- `benchmarks/reference/`: the reference benchmark against libiec61850 (provisional results, not
|
|
46
|
+
reviewed), and `--max-associations` in `openiec61850-server`.
|
|
47
|
+
- Native core (C++20, Asio standalone, one I/O thread, `result<T>` + `std::error_code` errors).
|
|
48
|
+
- Full ISO stack for MMS: BER codec (X.690), TPKT and COTP class 0 (RFC 1006, X.224), session
|
|
49
|
+
(X.225, kernel + duplex), presentation (X.226, kernel), ACSE (X.227), with sans-I/O state
|
|
50
|
+
machines and COTP over TCP.
|
|
51
|
+
- MMS codec (ISO 9506): Initiate/Conclude/Cancel/Reject, Identify, GetNameList, Read, Write,
|
|
52
|
+
GetVariableAccessAttributes, named variable lists, InformationReport, journal and file
|
|
53
|
+
services, with zero-copy `data_view` and owning values.
|
|
54
|
+
- MMS association layer for both roles: pipelined requests, timeouts, orderly release, abort,
|
|
55
|
+
password authentication. Confirmed services run in both directions: `server_association::request()`
|
|
56
|
+
and `client_association::set_request_handler()`.
|
|
57
|
+
- SetFile (MMS obtainFile): `client::set_file()` from memory or a stream, and in the server a pull
|
|
58
|
+
into the `file_store` (`write()`, `writable()`) with the `on_obtain_file` hook,
|
|
59
|
+
`max_obtain_file_size` and `obtain_file_timeout`. Off without the hook; advertised in
|
|
60
|
+
servicesSupportedCalled only when usable. In Python `Client.write_file`, `Client.upload_file`, the same on `sync.Client`,
|
|
61
|
+
`Server.start(on_obtain_file=...)` and `FileStore.write`.
|
|
62
|
+
- IEC 61850 naming and basic types: object references, functional constraints, the 8-1 MMS
|
|
63
|
+
mapping, Quality, TimeStamp, EntryID, TrgOps/OptFlds, control enums.
|
|
64
|
+
- ACSI client: directory discovery, data definitions, read/write, data sets, URCB/BRCB reporting
|
|
65
|
+
with GI and association recovery (BRCB resume from EntryID), control (direct and SBO, normal
|
|
66
|
+
and enhanced security), setting groups, logs, file services, GoCB attributes, MMS service
|
|
67
|
+
error details.
|
|
68
|
+
- ACSI server: model builder and SCL-driven models, read/write with access checks and hooks,
|
|
69
|
+
data sets, URCB/BRCB reporting engine (dchg/qchg/dupd, BufTm, IntgPd, GI, buffer overflow),
|
|
70
|
+
control with all four control models (CommandTermination, operTm, Test/Beh handling),
|
|
71
|
+
setting groups, logs, file store, GoCB attributes.
|
|
72
|
+
- TLS (IEC 62351-3) for MMS on client and server, enabled with `OPENIEC61850_ENABLE_TLS`:
|
|
73
|
+
mutual certificate authentication, peer name checks, CRLs, TLS 1.2 and 1.3, the peer certificate
|
|
74
|
+
exposed to the `authorize` hook and in `association_info`, TLS 1.3 key updates by time or
|
|
75
|
+
volume. Python: `TlsConfig`, `TlsSession`, `TLS_PORT`, `TlsError`, with wheels built with TLS.
|
|
76
|
+
Tools: `--tls` and the `--tls-*` options.
|
|
77
|
+
- SCL (IEC 61850-6) parser for ICD/CID/IID/SCD with validation diagnostics, IED instantiation and
|
|
78
|
+
GSE/SMV address extraction.
|
|
79
|
+
- Arrays of data objects in server models: DO and SDO with `count` (SCL, `ln_handle::data_object`,
|
|
80
|
+
`do_handle::sub_object` / `element`, Python `count=` and `DataObjectBuilder.element`), seen as MMS
|
|
81
|
+
arrays with element access through AlternateAccess, `DOI` / `SDI` `ix` initial values, `FCDA` `ix`
|
|
82
|
+
and the `LD/LN$FC$DO(1)$DA` form in report and log DataRefs (`to_mms_data_reference`,
|
|
83
|
+
`from_mms_data_reference`), also used for data set members indexed into an array attribute. `get_data_definition` accepts array indices and
|
|
84
|
+
`get_data_directory` lists the data of array elements.
|
|
85
|
+
- Control of elements of arrays of data objects: `get_control` / `operate` accept `LD/LN.DO(i)`
|
|
86
|
+
(Python `Client.control` / `operate`), with AlternateAccess on the wire and LastApplError and
|
|
87
|
+
CommandTermination routed to the element.
|
|
88
|
+
- Logs of other logical devices: SCL `LogControl` `ldInst` and `log_control_settings::log_ld`
|
|
89
|
+
(Python `LogControl.log_ld`).
|
|
90
|
+
- `Timestamp` and `EntryTime` initial values in SCL and `parse_value` (xs:dateTime).
|
|
91
|
+
- GOOSE and Sampled Values (9-2 LE) publishers and subscribers over Linux AF_PACKET, with
|
|
92
|
+
retransmission and TAL supervision.
|
|
93
|
+
- Python package `openiec61850`: `asyncio` client and server APIs, typed values, exception
|
|
94
|
+
hierarchy, `openiec61850.sync` blocking facades. Release wheels never ship the test-only
|
|
95
|
+
`openiec61850._testing` extension.
|
|
96
|
+
Python also covers the rest of the stack options (`IsoParameters`, `ServerIsoParameters`, the
|
|
97
|
+
responding AP title, `accept_connection`), the `authorize` diagnostic (`AcseDiagnostic`), the
|
|
98
|
+
CO structure of a `Control`, and GOOSE / SV frames and supervision without I/O
|
|
99
|
+
(`encode_goose`, `decode_goose`, `encode_sv`, `decode_sv`, `SequenceTracker`, `SmpCntTracker`).
|
|
100
|
+
- Command-line tools `openiec61850-server` and `openiec61850-client`.
|
|
101
|
+
- Google Benchmark suite and a libiec61850 interoperability harness run as Docker binaries
|
|
102
|
+
(both directions).
|
|
103
|
+
- IEC61850bean as the second interoperability peer of ADR 0007, in both directions
|
|
104
|
+
(`interop/iec61850bean`, `ONLY=bean interop/run.sh`). Run natively; its Docker path has not been
|
|
105
|
+
run yet, and TLS is not covered. Its defects are listed in `interop/iec61850bean/README.md`.
|
|
106
|
+
- CMake package: `find_package(openiec61850 CONFIG)` exporting `openiec61850::openiec61850`,
|
|
107
|
+
with installed headers and tools, a version file, and a vcpkg overlay port in
|
|
108
|
+
`packaging/vcpkg`.
|
|
109
|
+
- Release tooling: cibuildwheel configuration (manylinux_2_28), GitLab release job, GitHub
|
|
110
|
+
Actions for public PR checks and PyPI trusted publishing. The version comes only from
|
|
111
|
+
`project(... VERSION)` in `CMakeLists.txt`.
|
|
112
|
+
|
|
113
|
+
### Changed
|
|
114
|
+
|
|
115
|
+
- `client::get_data_set_values()` sets specificationWithResult, which IEC61850bean requires.
|
|
116
|
+
- `client::get_rcb_values()` reads an empty EntryID as unset instead of failing, which also made
|
|
117
|
+
enabling a BRCB fail on IEC61850bean.
|
|
118
|
+
|
|
119
|
+
### Known limitations
|
|
120
|
+
|
|
121
|
+
This is an alpha release (ADR 0008): the API may change and no conformance to IEC 61850 is
|
|
122
|
+
claimed. Not verified against the text of the standards: the ObtainFile encoding, the `(n)` form
|
|
123
|
+
of data references into arrays of data objects, the 8-1 clauses cited for it, and the mandatory
|
|
124
|
+
cipher suites of IEC 62351-3. TLS was tested against OpenSSL and between openiec61850 peers, not
|
|
125
|
+
against another IEC 61850 implementation. TLS 1.2 keys are not renewed during an association.
|
|
126
|
+
Not implemented: GOOSE and Sampled Values security (IEC 62351-6), certificate authentication in
|
|
127
|
+
ACSE (IEC 62351-4), third-party `sourceFileServer` in ObtainFile. The reference benchmark against
|
|
128
|
+
libiec61850 does not exist yet, so nothing is promised about performance. macOS and Windows
|
|
129
|
+
builds are not exercised in the homelab.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.25)
|
|
2
|
+
|
|
3
|
+
# Use vcpkg in manifest mode automatically when VCPKG_ROOT is set.
|
|
4
|
+
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{VCPKG_ROOT})
|
|
5
|
+
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
|
|
6
|
+
endif()
|
|
7
|
+
|
|
8
|
+
option(OPENIEC61850_BUILD_TESTS "Build the C++ tests" ON)
|
|
9
|
+
option(OPENIEC61850_BUILD_PYTHON "Build the Python module (nanobind)" OFF)
|
|
10
|
+
option(OPENIEC61850_BUILD_FUZZERS "Build the fuzzing targets (requires clang)" OFF)
|
|
11
|
+
option(OPENIEC61850_BUILD_TOOLS "Build the command-line tools (openiec61850-server, openiec61850-client)" ON)
|
|
12
|
+
option(OPENIEC61850_BUILD_BENCHMARKS "Build the Google Benchmark suite (benchmarks/)" OFF)
|
|
13
|
+
option(OPENIEC61850_ENABLE_TLS "Enable TLS (IEC 62351) via OpenSSL 3" OFF)
|
|
14
|
+
option(OPENIEC61850_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
|
|
15
|
+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
16
|
+
set(_openiec61850_top_level ON)
|
|
17
|
+
else()
|
|
18
|
+
set(_openiec61850_top_level OFF)
|
|
19
|
+
endif()
|
|
20
|
+
option(OPENIEC61850_INSTALL "Generate install rules (headers, library, CMake package)" ${_openiec61850_top_level})
|
|
21
|
+
set(OPENIEC61850_SANITIZERS "" CACHE STRING "Semicolon-separated list of sanitizers (e.g. address;undefined)")
|
|
22
|
+
|
|
23
|
+
if(OPENIEC61850_BUILD_TESTS)
|
|
24
|
+
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
|
|
25
|
+
endif()
|
|
26
|
+
if(OPENIEC61850_ENABLE_TLS)
|
|
27
|
+
list(APPEND VCPKG_MANIFEST_FEATURES "tls")
|
|
28
|
+
endif()
|
|
29
|
+
if(OPENIEC61850_BUILD_BENCHMARKS)
|
|
30
|
+
list(APPEND VCPKG_MANIFEST_FEATURES "benchmarks")
|
|
31
|
+
endif()
|
|
32
|
+
|
|
33
|
+
project(openiec61850 VERSION 0.1.0 LANGUAGES CXX)
|
|
34
|
+
|
|
35
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
36
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
37
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
38
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
39
|
+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
40
|
+
|
|
41
|
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
42
|
+
include(CompilerWarnings)
|
|
43
|
+
include(Sanitizers)
|
|
44
|
+
|
|
45
|
+
find_package(asio CONFIG REQUIRED)
|
|
46
|
+
find_package(pugixml CONFIG REQUIRED)
|
|
47
|
+
if(OPENIEC61850_ENABLE_TLS)
|
|
48
|
+
find_package(OpenSSL 3 REQUIRED)
|
|
49
|
+
endif()
|
|
50
|
+
|
|
51
|
+
add_subdirectory(src)
|
|
52
|
+
|
|
53
|
+
if(OPENIEC61850_BUILD_TESTS)
|
|
54
|
+
enable_testing()
|
|
55
|
+
add_subdirectory(tests)
|
|
56
|
+
endif()
|
|
57
|
+
|
|
58
|
+
if(OPENIEC61850_BUILD_TOOLS)
|
|
59
|
+
add_subdirectory(tools)
|
|
60
|
+
endif()
|
|
61
|
+
|
|
62
|
+
if(OPENIEC61850_BUILD_PYTHON)
|
|
63
|
+
add_subdirectory(python)
|
|
64
|
+
endif()
|
|
65
|
+
|
|
66
|
+
if(OPENIEC61850_BUILD_FUZZERS)
|
|
67
|
+
add_subdirectory(fuzz)
|
|
68
|
+
endif()
|
|
69
|
+
|
|
70
|
+
if(OPENIEC61850_BUILD_BENCHMARKS)
|
|
71
|
+
add_subdirectory(benchmarks)
|
|
72
|
+
endif()
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 6,
|
|
3
|
+
"cmakeMinimumRequired": {"major": 3, "minor": 25, "patch": 0},
|
|
4
|
+
"configurePresets": [
|
|
5
|
+
{
|
|
6
|
+
"name": "base",
|
|
7
|
+
"hidden": true,
|
|
8
|
+
"generator": "Ninja",
|
|
9
|
+
"binaryDir": "${sourceDir}/build/${presetName}",
|
|
10
|
+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
|
11
|
+
"cacheVariables": {"OPENIEC61850_BUILD_TESTS": "ON"}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "dev",
|
|
15
|
+
"inherits": "base",
|
|
16
|
+
"displayName": "Debug with tests",
|
|
17
|
+
"cacheVariables": {"CMAKE_BUILD_TYPE": "Debug", "OPENIEC61850_ENABLE_TLS": "ON"}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "release",
|
|
21
|
+
"inherits": "base",
|
|
22
|
+
"displayName": "Release with tests",
|
|
23
|
+
"cacheVariables": {"CMAKE_BUILD_TYPE": "RelWithDebInfo", "OPENIEC61850_ENABLE_TLS": "ON"}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "asan",
|
|
27
|
+
"inherits": "base",
|
|
28
|
+
"displayName": "Debug with ASan + UBSan",
|
|
29
|
+
"cacheVariables": {
|
|
30
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
31
|
+
"OPENIEC61850_SANITIZERS": "address;undefined",
|
|
32
|
+
"OPENIEC61850_WARNINGS_AS_ERRORS": "ON",
|
|
33
|
+
"OPENIEC61850_ENABLE_TLS": "ON"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "tsan",
|
|
38
|
+
"inherits": "base",
|
|
39
|
+
"displayName": "Debug with TSan (clang)",
|
|
40
|
+
"cacheVariables": {
|
|
41
|
+
"CMAKE_BUILD_TYPE": "Debug",
|
|
42
|
+
"CMAKE_CXX_COMPILER": "clang++",
|
|
43
|
+
"OPENIEC61850_SANITIZERS": "thread",
|
|
44
|
+
"OPENIEC61850_WARNINGS_AS_ERRORS": "ON",
|
|
45
|
+
"OPENIEC61850_ENABLE_TLS": "ON"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "fuzz",
|
|
50
|
+
"inherits": "base",
|
|
51
|
+
"displayName": "libFuzzer fuzzers (clang)",
|
|
52
|
+
"cacheVariables": {
|
|
53
|
+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
|
|
54
|
+
"CMAKE_CXX_COMPILER": "clang++",
|
|
55
|
+
"OPENIEC61850_SANITIZERS": "address;undefined",
|
|
56
|
+
"OPENIEC61850_BUILD_FUZZERS": "ON",
|
|
57
|
+
"OPENIEC61850_BUILD_TESTS": "OFF"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "bench",
|
|
62
|
+
"inherits": "base",
|
|
63
|
+
"displayName": "Release benchmarks (Google Benchmark)",
|
|
64
|
+
"cacheVariables": {
|
|
65
|
+
"CMAKE_BUILD_TYPE": "Release",
|
|
66
|
+
"OPENIEC61850_BUILD_BENCHMARKS": "ON",
|
|
67
|
+
"OPENIEC61850_BUILD_TESTS": "OFF"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"buildPresets": [
|
|
72
|
+
{"name": "dev", "configurePreset": "dev"},
|
|
73
|
+
{"name": "release", "configurePreset": "release"},
|
|
74
|
+
{"name": "asan", "configurePreset": "asan"},
|
|
75
|
+
{"name": "tsan", "configurePreset": "tsan"},
|
|
76
|
+
{"name": "fuzz", "configurePreset": "fuzz"},
|
|
77
|
+
{"name": "bench", "configurePreset": "bench"}
|
|
78
|
+
],
|
|
79
|
+
"testPresets": [
|
|
80
|
+
{"name": "dev", "configurePreset": "dev", "output": {"outputOnFailure": true}},
|
|
81
|
+
{"name": "release", "configurePreset": "release", "output": {"outputOnFailure": true}},
|
|
82
|
+
{"name": "asan", "configurePreset": "asan", "output": {"outputOnFailure": true}},
|
|
83
|
+
{
|
|
84
|
+
"name": "tsan",
|
|
85
|
+
"configurePreset": "tsan",
|
|
86
|
+
"output": {"outputOnFailure": true},
|
|
87
|
+
"environment": {"TSAN_OPTIONS": "suppressions=${sourceDir}/tests/tsan.supp:$penv{TSAN_OPTIONS}"}
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Clean-room rule (ADR 0001)
|
|
4
|
+
|
|
5
|
+
openiec61850 is implemented **only** from the text of the standards (IEC 61850, ISO 9506/MMS, ISO 8072/8073, ISO 8326/8327, ISO 8822/8823, ISO 8649/8650, ITU-T X.690 and RFC 1006).
|
|
6
|
+
|
|
7
|
+
- Do not read, copy, port or "translate" code from libiec61850 or pyiec61850.
|
|
8
|
+
- Running libiec61850 binaries as a test peer and in benchmarks is allowed.
|
|
9
|
+
- The same goes for IEC61850bean: run its released jars, never read its sources or fetch a sources jar.
|
|
10
|
+
- When referring to a standard in comments, cite the clause (e.g. `// ISO 8327-1 §8.3.1`).
|
|
11
|
+
|
|
12
|
+
## Environment
|
|
13
|
+
|
|
14
|
+
Requirements: a C++20 compiler (GCC 13+, Clang 17+ or MSVC 19.38+), CMake 3.25+, Ninja, and vcpkg with `VCPKG_ROOT` set.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cmake --preset dev && cmake --build --preset dev && ctest --preset dev
|
|
18
|
+
cmake --preset asan && cmake --build --preset asan && ctest --preset asan
|
|
19
|
+
cmake --preset tsan && cmake --build --preset tsan && ctest --preset tsan
|
|
20
|
+
pip install -e ".[test]" && pytest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The `[soak]` tests run for a few seconds by default; for a real soak set the seconds per case:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
OPENIEC61850_SOAK_SECONDS=300 build/tsan/tests/openiec61850_tests '[soak]'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
ThreadSanitizer suppressions live in `tests/tsan.supp` and are for verified third-party false
|
|
30
|
+
positives only. Outside `ctest --preset tsan`, pass them with
|
|
31
|
+
`TSAN_OPTIONS=suppressions=tests/tsan.supp`.
|
|
32
|
+
|
|
33
|
+
## Layout
|
|
34
|
+
|
|
35
|
+
Each component (`ber`, `iso`, `mms`...) has:
|
|
36
|
+
|
|
37
|
+
- `include/openiec61850/<component>/`: public headers;
|
|
38
|
+
- `src/<component>/CMakeLists.txt`: adds sources to the `openiec61850` target;
|
|
39
|
+
- `tests/<component>/CMakeLists.txt`: adds tests to the `openiec61850_tests` target;
|
|
40
|
+
- `fuzz/<component>/`: fuzzers for every decoder that handles network input (ADR 0003).
|
|
41
|
+
|
|
42
|
+
Decoders never trust lengths received from the network: every access is bounds-checked against the buffer, and errors are returned as `openiec61850::result<T>`, with no exceptions on the parsing path.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# openiec61850
|
|
2
|
+
|
|
3
|
+
Clean-room library of the IEC 61850 standard with a native core and a first-class Python API.
|
|
4
|
+
|
|
5
|
+
## Language
|
|
6
|
+
|
|
7
|
+
### Project
|
|
8
|
+
|
|
9
|
+
**Binding parity**:
|
|
10
|
+
The guarantee that every public feature of the native core also exists in the Python API, with nothing exclusive to the native side.
|
|
11
|
+
_Avoid_: "100% compatibility", pybind compatibility
|
|
12
|
+
|
|
13
|
+
**pyiec61850 compatibility layer**:
|
|
14
|
+
A separate, optional package that imitates the API of libiec61850's SWIG binding to migrate legacy code; it is not part of the core.
|
|
15
|
+
_Avoid_: compatible mode, drop-in
|
|
16
|
+
|
|
17
|
+
**Reference benchmark**:
|
|
18
|
+
A comparative measurement between openiec61850 and libiec61850 on the same machine, which serves as the official criterion for "high performance".
|
|
19
|
+
_Avoid_: performance test (generic)
|
|
20
|
+
|
|
21
|
+
**Alpha release**:
|
|
22
|
+
A public 0.x version published after meeting the release criteria, with an unstable API and no claim of conformance to the standard.
|
|
23
|
+
_Avoid_: ready, stable, certified
|
|
24
|
+
|
|
25
|
+
### Communication roles
|
|
26
|
+
|
|
27
|
+
**Client**:
|
|
28
|
+
ACSI role that establishes an association with a Server through MMS over the ISO/TCP stack and invokes services on it.
|
|
29
|
+
_Avoid_: master, subscriber
|
|
30
|
+
|
|
31
|
+
**Server**:
|
|
32
|
+
ACSI role performed by an IED that exposes its data model and serves the requests of Clients through MMS.
|
|
33
|
+
_Avoid_: slave, publisher
|
|
34
|
+
|
|
35
|
+
**Subscriber**:
|
|
36
|
+
Role that receives layer 2 multicast messages (GOOSE or SV) from a Publisher, without an association.
|
|
37
|
+
_Avoid_: GOOSE client, MMS subscriber
|
|
38
|
+
|
|
39
|
+
**Publisher**:
|
|
40
|
+
Role that sends GOOSE or SV multicast messages.
|
|
41
|
+
_Avoid_: GOOSE server
|
|
42
|
+
|
|
43
|
+
**Association**:
|
|
44
|
+
Logical session established between a Client and a Server, within which services are invoked.
|
|
45
|
+
_Avoid_: connection (when speaking at the ACSI level)
|
|
46
|
+
|
|
47
|
+
**ACSI layer**:
|
|
48
|
+
API level that speaks in IEC 61850 terms (Association, LD/LN/DO/DA, RCB, control, setting groups and so on).
|
|
49
|
+
_Avoid_: high-level API
|
|
50
|
+
|
|
51
|
+
**Generic MMS layer**:
|
|
52
|
+
API level that speaks in ISO 9506 terms (domains, named variables, GetNameList, Read/Write), without IEC 61850 semantics; it is public for diagnostics and for non-conforming Servers.
|
|
53
|
+
_Avoid_: low-level API, raw MMS
|
|
54
|
+
|
|
55
|
+
### Data model in the Client
|
|
56
|
+
|
|
57
|
+
**MMS value**:
|
|
58
|
+
Generic representation, without model type, of a data item carried over MMS (structure, array, integer, float, bit-string, UtcTime and so on).
|
|
59
|
+
_Avoid_: MmsValue (the libiec61850 name)
|
|
60
|
+
|
|
61
|
+
**Discovered model**:
|
|
62
|
+
Navigable tree of a Server's data model (LD/LN/DO/DA), built at run time through the directory and definition services.
|
|
63
|
+
_Avoid_: dynamic model, cache
|
|
64
|
+
|
|
65
|
+
**SCL model**:
|
|
66
|
+
A Server's data model obtained offline from an SCL file (ICD/CID/SCD), instead of online discovery.
|
|
67
|
+
_Avoid_: static model
|
|
68
|
+
|
|
69
|
+
**Quality**:
|
|
70
|
+
Quality attribute associated with a data item (validity, source, test, operator blocked and so on), per IEC 61850-7-3.
|
|
71
|
+
_Avoid_: status, flags
|
|
72
|
+
|
|
73
|
+
**Timestamp**:
|
|
74
|
+
IEC 61850 UtcTime instant with a fraction of a second and time quality (accuracy, leap second, synchronisation).
|
|
75
|
+
_Avoid_: datetime, time
|
|
76
|
+
|
|
77
|
+
### Reporting
|
|
78
|
+
|
|
79
|
+
**RCB**:
|
|
80
|
+
Report control block in the Server that defines what is reported to the Client and how; it can be buffered (BRCB) or unbuffered (URCB).
|
|
81
|
+
_Avoid_: subscription, report subscription
|
|
82
|
+
|
|
83
|
+
**Report**:
|
|
84
|
+
Unsolicited message that the Server sends to the Client when an enabled RCB is triggered.
|
|
85
|
+
_Avoid_: event, notification
|
|
86
|
+
|
|
87
|
+
**EntryID**:
|
|
88
|
+
Identifier of an entry in a BRCB's buffer, used to resume the flow of reports without loss after an interruption.
|
|
89
|
+
_Avoid_: sequence number (SqNum is something else)
|
|
90
|
+
|
|
91
|
+
**Association recovery**:
|
|
92
|
+
Automatic and optional recovery of a lost Association: reconnection and re-enabling of the RCBs, resuming BRCBs from the last EntryID received.
|
|
93
|
+
_Avoid_: auto-reconnect (which suggests only a TCP reconnection)
|
|
94
|
+
|
|
95
|
+
**Server edition**:
|
|
96
|
+
Edition of IEC 61850 (Ed.1, Ed.2 or Ed.2.1) that the Server implements, which changes the semantics of some services and control blocks.
|
|
97
|
+
_Avoid_: version
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|