diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0cc585584..d7d74e749 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,8 @@ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp +// +// SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +// SPDX-License-Identifier: Apache-2.0 { "name": "VILLASnode", "image": "registry.git.rwth-aachen.de/acs/public/villas/node/dev-vscode", diff --git a/.dockerignore b/.dockerignore index c8faab8d7..d1f1a4930 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + build/ build_*/ packaging/docker/Dockerfile.* diff --git a/.editorconfig b/.editorconfig index a75847bc8..35447f7c9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,6 @@ # EditorConfig is awesome: http://EditorConfig.org +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # top-most EditorConfig file root = true diff --git a/.envrc b/.envrc index 7239e2fce..604dd135d 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 export_or_unset() { diff --git a/.gitignore b/.gitignore index 38f0645ae..6d33a0f0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + /build*/ *~ *.swp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df48decba..7bdfc7bbc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + variables: GIT_SUBMODULE_STRATEGY: recursive GIT_DEPTH: 0 @@ -19,7 +22,6 @@ stages: - latest # Stage: prepare -############################################################################## # Build docker image which is used to build & test VILLASnode prepare:docker: @@ -47,7 +49,6 @@ prepare:docker: - docker # Stage: build -############################################################################## build:source: stage: build @@ -86,7 +87,6 @@ build:source: - docker # Stage: test -############################################################################## test:flake8: stage: test @@ -164,8 +164,15 @@ test:integration: - job: "build:source: [fedora]" artifacts: true +test:reuse: + stage: test + image: + name: fsfe/reuse:latest + entrypoint: [""] + script: + - reuse lint + # Stage: packaging -############################################################################## pkg:docker: stage: packaging @@ -214,7 +221,6 @@ pkg:docker: needs: [] # Stage: deploy -############################################################################## deploy:docker: stage: deploy @@ -265,7 +271,7 @@ deploy:docker-dev-vscode: - job: "prepare:docker: [fedora, dev-vscode, ${DOCKER_IMAGE}/dev-vscode]" # Stage: latest -############################################################################## + .latest:docker:latest: &deploy_latest_docker stage: latest diff --git a/.gitmodules b/.gitmodules index 0878dbb87..ffec47725 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + [submodule "common"] path = common url = https://github.com/VILLASframework/common.git diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 000000000..29a674205 --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,12 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: VILLASnode +Upstream-Contact: Steffen Vogel +Source: https://fein-aachen.org/en/projects/villas-node/ + +Files: *.vi *.opal *.dft *.sib *.json *.ipynb doc/pictures/* clients/opal/models/send_receive/eonerc_logo.png doc/favicon.png +Copyright: 2018-2023, Institute for Automation of Complex Power Systems, RWTH Aachen University +License: Apache-2.0 + +Files: clients/rtds/**/*.txt clients/hypersim/*.ecf etc/labs/lab3.pcap packaging/live-iso/files/etc/* packaging/nix/flake.lock tests/valgrind.supp packaging/archlinux/villas-node.install +Copyright: 2018-2023, Institute for Automation of Complex Power Systems, RWTH Aachen University +License: Apache-2.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d2b3ca1d..c2ea4135f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog + + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fffdec13..c4fae12ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ # Main CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 cmake_minimum_required(VERSION 3.14) diff --git a/CODEOWNERS b/CODEOWNERS index 0ea4b22e1..afeda374d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, # @stv0g will be requested for diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 77c712e58..e6b34b3c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -173,4 +173,9 @@ Please rebase your work against the `develop` before submitting a merge reqeuest ## Make the CI happy :-) -Only branches which pass the CI can be merged. \ No newline at end of file +Only branches which pass the CI can be merged. + +## License + +- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +- SPDX-License-Identifier: Apache-2.0 diff --git a/COPYING.md b/COPYING.md deleted file mode 100644 index d0af96c39..000000000 --- a/COPYING.md +++ /dev/null @@ -1,194 +0,0 @@ -Apache License -============== - -_Version 2.0, January 2004_ -_<>_ - -### Terms and Conditions for use, reproduction, and distribution - -#### 1. Definitions - -“License” shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -“Licensor” shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -“Legal Entity” shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, “control” means **(i)** the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the -outstanding shares, or **(iii)** beneficial ownership of such entity. - -“You” (or “Your”) shall mean an individual or Legal Entity exercising -permissions granted by this License. - -“Source” form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -“Object” form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -“Work” shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -“Derivative Works” shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -“Contribution” shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -“submitted” means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as “Not a Contribution.” - -“Contributor” shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -#### 2. Grant of Copyright License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -#### 3. Grant of Patent License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -#### 4. Redistribution - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -* **(a)** You must give any other recipients of the Work or Derivative Works a copy of -this License; and -* **(b)** You must cause any modified files to carry prominent notices stating that You -changed the files; and -* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. - -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -#### 5. Submission of Contributions - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -#### 6. Trademarks - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -#### 7. Disclaimer of Warranty - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -#### 8. Limitation of Liability - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -#### 9. Accepting Warranty or Additional Liability - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -_END OF TERMS AND CONDITIONS_ - -### APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets `[]` replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same “printed page” as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..38ab65d4f --- /dev/null +++ b/LICENSE @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 000000000..38ab65d4f --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/BSD-1-Clause.txt b/LICENSES/BSD-1-Clause.txt new file mode 100644 index 000000000..0d02ecb8b --- /dev/null +++ b/LICENSES/BSD-1-Clause.txt @@ -0,0 +1,7 @@ +Copyright (c) . All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/BSD-2-Clause.txt b/LICENSES/BSD-2-Clause.txt new file mode 100644 index 000000000..f1c72cce8 --- /dev/null +++ b/LICENSES/BSD-2-Clause.txt @@ -0,0 +1,9 @@ +Copyright (c) + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/LGPL-2.1-only.txt b/LICENSES/LGPL-2.1-only.txt new file mode 100644 index 000000000..a7b06bf78 --- /dev/null +++ b/LICENSES/LGPL-2.1-only.txt @@ -0,0 +1,175 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + Copyright (C) year name of author + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the library `Frob' (a library for tweaking knobs) written +by James Random Hacker. + +signature of Ty Coon, 1 April 1990 +Ty Coon, President of Vice +That's all there is to it! diff --git a/README.md b/README.md index 8db8c42cc..6f43f0275 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,9 @@ VILLASnode is used in distributed- and co-simulation scenarios and developed for User documentation is available here: -## Copyright - -2014-2023, Institute for Automation of Complex Power Systems, EONERC - ## License -This project is released under the terms of the [Apache 2.0 license](COPYING.md). +This project is released under the terms of the [Apache 2.0 license](LICENSE). We kindly ask all academic publications employing components of VILLASframework to cite one of the following papers: @@ -46,6 +42,9 @@ We kindly ask all academic publications employing components of VILLASframework For other licensing options please consult [Prof. Antonello Monti](mailto:amonti@eonerc.rwth-aachen.de). +- SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +- SPDX-License-Identifier: Apache-2.0 + ## Contact [![EONERC ACS Logo](doc/pictures/eonerc_logo.png)](http://www.acs.eonerc.rwth-aachen.de) diff --git a/clients/CMakeLists.txt b/clients/CMakeLists.txt index 53b6c278e..18483662a 100644 --- a/clients/CMakeLists.txt +++ b/clients/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 add_subdirectory(opal) add_subdirectory(shmem) diff --git a/clients/hypersim/README.md b/clients/hypersim/README.md index 8ece256bd..858ce8283 100644 --- a/clients/hypersim/README.md +++ b/clients/hypersim/README.md @@ -9,3 +9,8 @@ Detailed information for installation and usage of the UCM is provided in the [u ## Author - Anju Meghwani + +## License + +- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +- SPDX-License-Identifier: Apache-2.0 diff --git a/clients/hypersim/model/ucm_node.def b/clients/hypersim/model/ucm_node.def index 1cab21fc1..fa959c3d7 100644 --- a/clients/hypersim/model/ucm_node.def +++ b/clients/hypersim/model/ucm_node.def @@ -2,6 +2,9 @@ %% Generated from : ucm_def_file_templ_en.sh Version 1.5 %% Hypersim (Ucm) : (c) Hydro-Quebec -- 2005 %% +%% SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +%% SPDX-License-Identifier: Apache-2.0 +%% %% ----------------------------------------------------------------------------- %% Model : villas -- Fri Jun 15 12:07:11 PDT 2018 %% ----------------------------------------------------------------------------- diff --git a/clients/matlab/README.md b/clients/matlab/README.md index ede5c361b..c6d42585f 100644 --- a/clients/matlab/README.md +++ b/clients/matlab/README.md @@ -2,3 +2,8 @@ Additional documentation about this example is available here: https://villas.fein-aachen.org/doc/node-client-matlab.html + +## License + +- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +- SPDX-License-Identifier: Apache-2.0 diff --git a/clients/matlab/receiver.m b/clients/matlab/receiver.m index 3cb234458..642a4cbb1 100644 --- a/clients/matlab/receiver.m +++ b/clients/matlab/receiver.m @@ -1,9 +1,9 @@ % Simple MATLAB code to receive VILLAS UDP samples % -% @author Megha Gupta -% @author Steffen Vogel -% @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -% @license Apache 2.0 +% Author: Megha Gupta +% Author: Steffen Vogel +% SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +% SPDX-License-Identifier: Apache-2.0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% close all; diff --git a/clients/matlab/villas.conf b/clients/matlab/villas.conf index c785b46bf..1c18fe34f 100644 --- a/clients/matlab/villas.conf +++ b/clients/matlab/villas.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { signal = { type = "signal", diff --git a/clients/opal/.gitignore b/clients/opal/.gitignore index bf0824e59..5e2310b64 100644 --- a/clients/opal/.gitignore +++ b/clients/opal/.gitignore @@ -1 +1,4 @@ -*.log \ No newline at end of file +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +*.log diff --git a/clients/opal/.project b/clients/opal/.project index b6ea0fd2b..41a1564e5 100644 --- a/clients/opal/.project +++ b/clients/opal/.project @@ -10,3 +10,7 @@ com.opalrt.rtlab.ui.rtlabnature + diff --git a/clients/opal/CMakeLists.txt b/clients/opal/CMakeLists.txt index 774b83339..9496d9b54 100644 --- a/clients/opal/CMakeLists.txt +++ b/clients/opal/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 if(OPAL_FOUND) # Just call the original Makefile diff --git a/clients/opal/models/send_receive/.gitignore b/clients/opal/models/send_receive/.gitignore index f7b9f592e..291b31561 100644 --- a/clients/opal/models/send_receive/.gitignore +++ b/clients/opal/models/send_receive/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + *.o *.d AsyncIP diff --git a/clients/opal/models/send_receive/Makefile.mk b/clients/opal/models/send_receive/Makefile.mk index 8632312f8..56da211e9 100644 --- a/clients/opal/models/send_receive/Makefile.mk +++ b/clients/opal/models/send_receive/Makefile.mk @@ -1,9 +1,8 @@ # Makefile. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 TARGET = AsyncIP diff --git a/clients/opal/models/send_receive/include/config.h b/clients/opal/models/send_receive/include/config.h index bd2e88a24..1b28c4cfc 100644 --- a/clients/opal/models/send_receive/include/config.h +++ b/clients/opal/models/send_receive/include/config.h @@ -1,10 +1,9 @@ -/** Compile-time configuration. +/* Compile-time configuration. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _CONFIG_H_ #define _CONFIG_H_ @@ -14,13 +13,13 @@ #define MAX_VALUES 64 -/* List of protocols */ +// List of protocols #define VILLAS 1 #define GTNET_SKT 2 -/* Default protocol */ +// Default protocol #ifndef PROTOCOL #define PROTOCOL VILLAS -#endif /* PROTOCOL */ +#endif // PROTOCOL -#endif /* _CONFIG_H_ */ +#endif // _CONFIG_H_ diff --git a/clients/opal/models/send_receive/include/msg.h b/clients/opal/models/send_receive/include/msg.h index a2726756e..05d23e231 100644 --- a/clients/opal/models/send_receive/include/msg.h +++ b/clients/opal/models/send_receive/include/msg.h @@ -1,17 +1,16 @@ -/** Message related functions +/* Message related functions * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once -/* Forward declarations. */ +// Forward declarations struct msg; -/** Swaps the byte-order of the message. +/* Swaps the byte-order of the message. * * Message are always transmitted in network (big endian) byte order. * @@ -25,7 +24,7 @@ void msg_ntoh(struct msg *m); void msg_hton(struct msg *m); -/** Check the consistency of a message. +/* Check the consistency of a message. * * The functions checks the header fields of a message. * diff --git a/clients/opal/models/send_receive/include/msg_format.h b/clients/opal/models/send_receive/include/msg_format.h index bcbb45824..e0263456a 100644 --- a/clients/opal/models/send_receive/include/msg_format.h +++ b/clients/opal/models/send_receive/include/msg_format.h @@ -1,33 +1,32 @@ -/** Message format +/* Message format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include -/** The current version number for the message format */ +// The current version number for the message format #define MSG_VERSION 2 -/** @todo Implement more message types */ -#define MSG_TYPE_DATA 0 /**< Message contains float values */ -#define MSG_TYPE_START 1 /**< Message marks the beginning of a new simulation case */ -#define MSG_TYPE_STOP 2 /**< Message marks the end of a simulation case */ +// @todo Implement more message types +#define MSG_TYPE_DATA 0 // Message contains float values +#define MSG_TYPE_START 1 // Message marks the beginning of a new simulation case +#define MSG_TYPE_STOP 2 // Message marks the end of a simulation case -/** The total size in bytes of a message */ +// The total size in bytes of a message #define MSG_LEN(values) (sizeof(struct msg) + MSG_DATA_LEN(values)) -/** The length of \p values values in bytes. */ +// The length of \p values values in bytes #define MSG_DATA_LEN(values) (sizeof(float) * (values)) -/** The offset to the first data value in a message. */ +// The offset to the first data value in a message #define MSG_DATA_OFFSET(msg) ((char *) (msg) + offsetof(struct msg, data)) -/** Initialize a message with default values */ +// Initialize a message with default values #define MSG_INIT(len, seq) (struct msg) {\ .version = MSG_VERSION, \ .type = MSG_TYPE_DATA, \ @@ -36,43 +35,43 @@ .id = 0 \ } -/** The timestamp of a message in struct timespec format */ +// The timestamp of a message in struct timespec format #define MSG_TS(msg) (struct timespec) { \ .tv_sec = (msg)->ts.sec, \ .tv_nsec = (msg)->ts.nsec \ } -/** This message format is used by all clients +/* This message format is used by all clients * * @diafile msg_format.dia - **/ + */ struct msg { #if BYTE_ORDER == BIG_ENDIAN - unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */ - unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */ - unsigned reserved1 : 2; /**< Reserved bits */ + unsigned version: 4; // Specifies the format of the remaining message (see MGS_VERSION) + unsigned type : 2; // Data or control message (see MSG_TYPE_*) + unsigned reserved1 : 2; // Reserved bits #elif BYTE_ORDER == LITTLE_ENDIAN - unsigned reserved1 : 2; /**< Reserved bits */ - unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */ - unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */ + unsigned reserved1 : 2; // Reserved bits + unsigned type : 2; // Data or control message (see MSG_TYPE_*) + unsigned version: 4; // Specifies the format of the remaining message (see MGS_VERSION) #else #error Invalid byte-order -#endif /* BYTEORDER */ +#endif // BYTEORDER - uint8_t id; /**< An id which identifies the source of this sample */ - uint16_t length; /**< The number of values in msg::data[]. */ - uint32_t sequence; /**< The sequence number is incremented by one for consecutive messages. */ + uint8_t id; // An id which identifies the source of this sample + uint16_t length; // The number of values in msg::data[] + uint32_t sequence; // The sequence number is incremented by one for consecutive messages - /** A timestamp per message. */ + // A timestamp per message struct { - uint32_t sec; /**< Seconds since 1970-01-01 00:00:00 */ - uint32_t nsec; /**< Nanoseconds of the current second. */ + uint32_t sec; // Seconds since 1970-01-01 00:00:00 + uint32_t nsec; // Nanoseconds of the current second } ts; - /** The message payload. */ + // The message payload union { - float f; /**< Floating point values. */ - uint32_t i; /**< Integer values. */ + float f; // Floating point values + uint32_t i; // Integer values } data[]; } __attribute__((packed)); diff --git a/clients/opal/models/send_receive/include/socket.h b/clients/opal/models/send_receive/include/socket.h index f8f6d41dc..372ad6ce2 100644 --- a/clients/opal/models/send_receive/include/socket.h +++ b/clients/opal/models/send_receive/include/socket.h @@ -1,10 +1,9 @@ -/** Helper functions for sockets. +/* Helper functions for sockets. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _SOCKET_H_ #define _SOCKET_H_ @@ -18,9 +17,9 @@ #define TCP_PROTOCOL 2 struct socket { - struct sockaddr_in send_ad; /* Send address */ - struct sockaddr_in recv_ad; /* Receive address */ - int sd; /* socket descriptor */ + struct sockaddr_in send_ad; // Send address + struct sockaddr_in recv_ad; // Receive address + int sd; // socket descriptor }; int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct); @@ -31,4 +30,4 @@ int socket_recv(struct socket *s, char *data, int len, double timeout); int socket_close(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct); -#endif /* _SOCKET_H_ */ +#endif // _SOCKET_H_ diff --git a/clients/opal/models/send_receive/include/utils.h b/clients/opal/models/send_receive/include/utils.h index 0ea275c5c..1d9f3b740 100644 --- a/clients/opal/models/send_receive/include/utils.h +++ b/clients/opal/models/send_receive/include/utils.h @@ -1,16 +1,15 @@ -/** Configure scheduler. +/* Configure scheduler. * - * @file - * @author Steffen Vogel - * @author Mathieu Dubé-Dallaire - * @copyright 2003, OPAL-RT Technologies inc - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Mathieu Dubé-Dallaire + * SPDX-FileCopyrightText: 2003 OPAL-RT Technologies inc + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _UTILS_H_ #define _UTILS_H_ int AssignProcToCpu0(void); -#endif /* _UTILS_H_ */ +#endif // _UTILS_H_ diff --git a/clients/opal/models/send_receive/send_receive.llm b/clients/opal/models/send_receive/send_receive.llm index 8e9920b5b..51ab8a042 100644 --- a/clients/opal/models/send_receive/send_receive.llm +++ b/clients/opal/models/send_receive/send_receive.llm @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 [EnvVars] ABORT_COMPILE_WHEN_NO_BITSTREAM=0 ACTION_AFTER_N_OVERRUNS=10 diff --git a/clients/opal/models/send_receive/send_receive.mdl b/clients/opal/models/send_receive/send_receive.mdl index e2db790ec..8e2786703 100644 --- a/clients/opal/models/send_receive/send_receive.mdl +++ b/clients/opal/models/send_receive/send_receive.mdl @@ -1,4 +1,6 @@ # $Revision: 1.1 $ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 Model { Name "send_receive" Version 8.4 diff --git a/clients/opal/models/send_receive/send_receive.probe b/clients/opal/models/send_receive/send_receive.probe index 543ee070d..7f8547967 100644 --- a/clients/opal/models/send_receive/send_receive.probe +++ b/clients/opal/models/send_receive/send_receive.probe @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 [General] ATT_VERSION=6 FileVersion=6 diff --git a/clients/opal/models/send_receive/src/compat.c b/clients/opal/models/send_receive/src/compat.c index f5958b3ba..d0d8f5132 100644 --- a/clients/opal/models/send_receive/src/compat.c +++ b/clients/opal/models/send_receive/src/compat.c @@ -1,12 +1,11 @@ -/** Compatibility code for GCC +/* Compatibility code for GCC * * OPAL-RT's libSystem.a links against some Intel * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/clients/opal/models/send_receive/src/main.asv b/clients/opal/models/send_receive/src/main.asv index 0046dc9f1..bdc8c1ad4 100644 --- a/clients/opal/models/send_receive/src/main.asv +++ b/clients/opal/models/send_receive/src/main.asv @@ -1,9 +1,8 @@ /** Main routine of AsyncIP. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ /* Standard ANSI C headers needed for this program */ diff --git a/clients/opal/models/send_receive/src/main.c b/clients/opal/models/send_receive/src/main.c index 12975126d..5714a4f86 100644 --- a/clients/opal/models/send_receive/src/main.c +++ b/clients/opal/models/send_receive/src/main.c @@ -1,12 +1,11 @@ -/** Main routine of AsyncIP. +/* Main routine of AsyncIP. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ -/* Standard ANSI C headers needed for this program */ +// Standard ANSI C headers needed for this program #include #include #include @@ -24,7 +23,7 @@ #include "OpalPrint.h" #include "AsyncApi.h" -/* This is the message format */ +// This is the message format #include "config.h" #include "socket.h" #include "utils.h" @@ -40,15 +39,16 @@ #define ASYNC_SHMEM_SIZE atoi(argv[2]) #define PRINT_SHMEM_NAME argv[3] -/* Global Variables */ +// Global Variables struct socket skt; -static void * SendToIPPort(void *arg) +static +void * SendToIPPort(void *arg) { unsigned int ModelState, SendID, Sequence = 0; int nbSend = 0, ret, cnt, len; - /* Data from OPAL-RT model */ + // Data from OPAL-RT model double mdldata[MAX_VALUES]; int mdldata_size; @@ -69,7 +69,7 @@ static void * SendToIPPort(void *arg) } do { - /* This call unblocks when the 'Data Ready' line of a send icon is asserted. */ + // This call unblocks when the 'Data Ready' line of a send icon is asserted. ret = OpalWaitForAsyncSendRequest(&SendID); if (ret != EOK) { ModelState = OpalGetAsyncModelState(); @@ -81,10 +81,10 @@ static void * SendToIPPort(void *arg) continue; } - /* No errors encountered yet */ + // No errors encountered yet OpalSetAsyncSendIconError(0, SendID); - /* Get the size of the data being sent by the unblocking SendID */ + // Get the size of the data being sent by the unblocking SendID OpalGetAsyncSendIconDataLength(&mdldata_size, SendID); cnt = mdldata_size / sizeof(double); if (cnt > MAX_VALUES) { @@ -93,11 +93,11 @@ static void * SendToIPPort(void *arg) cnt = MAX_VALUES; } - /* Read data from the model */ + // Read data from the model OpalGetAsyncSendIconData(mdldata, mdldata_size, SendID); #if PROTOCOL == VILLAS - /* Get current time */ + // Get current time struct timespec now; clock_gettime(CLOCK_REALTIME, &now); @@ -128,7 +128,7 @@ static void * SendToIPPort(void *arg) #error Unknown protocol #endif - /* Perform the actual write to the ip port */ + // Perform the actual write to the ip port ret = socket_send(&skt, (char *) msg, len); if (ret < 0) OpalSetAsyncSendIconError(errno, SendID); @@ -153,12 +153,13 @@ static void * SendToIPPort(void *arg) return NULL; } -static void * RecvFromIPPort(void *arg) +static +void * RecvFromIPPort(void *arg) { unsigned int ModelState, RecvID; int nbRecv = 0, ret, cnt; - /* Data from OPAL-RT model */ + // Data from OPAL-RT model double mdldata[MAX_VALUES]; int mdldata_size; @@ -180,7 +181,7 @@ static void * RecvFromIPPort(void *arg) return NULL; } - /* Get list of RecvIds */ + // Get list of RecvIds unsigned int RecvIDs[nbRecv]; ret = OpalGetAsyncRecvIDList(RecvIDs, sizeof(RecvIDs)); if (ret != EOK) { @@ -189,14 +190,14 @@ static void * RecvFromIPPort(void *arg) } do { - /* Receive message */ + // Receive message ret = socket_recv(&skt, (char *) msg, sizeof(buf), 1.0); if (ret < 1) { ModelState = OpalGetAsyncModelState(); if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) { - if (ret == 0) /* timeout, so we continue silently */ + if (ret == 0) // timeout, so we continue silently OpalPrint("%s: Timeout while waiting for data\n", PROGNAME, errno); - if (ret == -1) /* a more serious error, so we print it */ + if (ret == -1) // a more serious error, so we print it OpalPrint("%s: Error %d while waiting for data\n", PROGNAME, errno); continue; @@ -211,7 +212,7 @@ static void * RecvFromIPPort(void *arg) #else #error Unknown protocol #endif - /* Check if this RecvID exists */ + // Check if this RecvID exists for (int i = 0; i < nbRecv; i++) { if (RecvIDs[i] == RecvID) goto found; @@ -220,7 +221,7 @@ static void * RecvFromIPPort(void *arg) OpalPrint("%s: Received message with non-existent RecvID=%d. Changing to RecvID=%d...\n", PROGNAME, RecvID, RecvIDs[0]); RecvID = RecvIDs[0]; -found: /* Get the number of signals to send back to the model */ +found: // Get the number of signals to send back to the model OpalGetAsyncRecvIconDataLength(&mdldata_size, RecvID); cnt = mdldata_size / sizeof(double); if (cnt > MAX_VALUES) { @@ -246,8 +247,8 @@ found: /* Get the number of signals to send back to the model */ for (int i = 0; i < msg->length; i++) mdldata[i] = (double) msg->data[i].f; - /* Update OPAL model */ - OpalSetAsyncRecvIconStatus(msg->sequence, RecvID); /* Set the Status to the message ID */ + // Update OPAL model + OpalSetAsyncRecvIconStatus(msg->sequence, RecvID); // Set the Status to the message ID #elif PROTOCOL == GTNET_SKT uint32_t *imsg = (uint32_t *) msg; for (int i = 0; i < cnt; i++) { @@ -258,7 +259,7 @@ found: /* Get the number of signals to send back to the model */ #error Unknown protocol #endif - OpalSetAsyncRecvIconError(0, RecvID); /* Set the Error to 0 */ + OpalSetAsyncRecvIconError(0, RecvID); // Set the Error to 0 OpalSetAsyncRecvIconData(mdldata, mdldata_size, RecvID); @@ -282,20 +283,20 @@ int main(int argc, char *argv[]) OpalPrint("%s: This is %s client version %s\n", PROGNAME, PROGNAME, VERSION); - /* Check for the proper arguments to the program */ + // Check for the proper arguments to the program if (argc < 4) { printf("Invalid Arguments: 1-AsyncShmemName 2-AsyncShmemSize 3-PrintShmemName\n"); exit(0); } - /* Enable the OpalPrint function. This prints to the OpalDisplay. */ + // Enable the OpalPrint function. This prints to the OpalDisplay. ret = OpalSystemCtrl_Register(PRINT_SHMEM_NAME); if (ret != EOK) { printf("%s: ERROR: OpalPrint() access not available\n", PROGNAME); exit(EXIT_FAILURE); } - /* Open Share Memory created by the model. */ + // Open Share Memory created by the model. ret = OpalOpenAsyncMem(ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME); if (ret != EOK) { OpalPrint("%s: ERROR: Model shared memory not available\n", PROGNAME); @@ -314,14 +315,14 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Initialize socket */ + // Initialize socket ret = socket_init(&skt, IconCtrlStruct); if (ret != EOK) { OpalPrint("%s: ERROR: Failed to create socket.\n", PROGNAME); exit(EXIT_FAILURE); } - /* Start send/receive threads */ + // Start send/receive threads ret = pthread_create(&tid_send, NULL, SendToIPPort, NULL); if (ret < 0) OpalPrint("%s: ERROR: Could not create thread (SendToIPPort), errno %d\n", PROGNAME, errno); @@ -330,7 +331,7 @@ int main(int argc, char *argv[]) if (ret < 0) OpalPrint("%s: ERROR: Could not create thread (RecvFromIPPort), errno %d\n", PROGNAME, errno); - /* Wait for both threads to finish */ + // Wait for both threads to finish ret = pthread_join(tid_send, NULL); if (ret) OpalPrint("%s: ERROR: pthread_join (SendToIPPort), errno %d\n", PROGNAME, ret); @@ -339,7 +340,7 @@ int main(int argc, char *argv[]) if (ret) OpalPrint("%s: ERROR: pthread_join (RecvFromIPPort), errno %d\n", PROGNAME, ret); - /* Close the ip port and shared memories */ + // Close the ip port and shared memories socket_close(&skt, IconCtrlStruct); OpalCloseAsyncMem (ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME); diff --git a/clients/opal/models/send_receive/src/msg.c b/clients/opal/models/send_receive/src/msg.c index 5cc9c7fd9..d07252191 100644 --- a/clients/opal/models/send_receive/src/msg.c +++ b/clients/opal/models/send_receive/src/msg.c @@ -1,9 +1,9 @@ -/** Message related functions. +/* Message related functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/clients/opal/models/send_receive/src/socket.c b/clients/opal/models/send_receive/src/socket.c index c6cbd94fd..a4d314b3e 100644 --- a/clients/opal/models/send_receive/src/socket.c +++ b/clients/opal/models/send_receive/src/socket.c @@ -1,9 +1,9 @@ -/** Helper functions for sockets. +/* Helper functions for sockets. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -25,7 +25,7 @@ int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) { - struct ip_mreq mreq; /* Multicast group structure */ + struct ip_mreq mreq; // Multicast group structure unsigned char TTL = 1, LOOP = 0; int rc, proto, ret; @@ -39,26 +39,26 @@ int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) OpalPrint("%s: Remote Address : %s\n", PROGNAME, IconCtrlStruct.StringParam[0]); OpalPrint("%s: Remote Port : %d\n", PROGNAME, (int) IconCtrlStruct.FloatParam[1]); - /* Initialize the socket */ + // Initialize the socket s->sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (s->sd < 0) { OpalPrint("%s: ERROR: Could not open socket\n", PROGNAME); return EIO; } - /* Set the structure for the remote port and address */ + // Set the structure for the remote port and address memset(&s->send_ad, 0, sizeof(s->send_ad)); s->send_ad.sin_family = AF_INET; s->send_ad.sin_addr.s_addr = inet_addr(IconCtrlStruct.StringParam[0]); s->send_ad.sin_port = htons((u_short) IconCtrlStruct.FloatParam[1]); - /* Set the structure for the local port and address */ + // Set the structure for the local port and address memset(&s->recv_ad, 0, sizeof(s->recv_ad)); s->recv_ad.sin_family = AF_INET; s->recv_ad.sin_addr.s_addr = INADDR_ANY; s->recv_ad.sin_port = htons((u_short) IconCtrlStruct.FloatParam[2]); - /* Bind local port and address to socket. */ + // Bind local port and address to socket. ret = bind(s->sd, (struct sockaddr *) &s->recv_ad, sizeof(struct sockaddr_in)); if (ret < 0) { OpalPrint("%s: ERROR: Could not bind local port to socket\n", PROGNAME); @@ -67,7 +67,7 @@ int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) else OpalPrint("%s: Local Port : %d\n", PROGNAME, (int) IconCtrlStruct.FloatParam[2]); - /* If sending to a multicast address */ + // If sending to a multicast address if ((inet_addr(IconCtrlStruct.StringParam[0]) & inet_addr("240.0.0.0")) == inet_addr("224.0.0.0")) { ret = setsockopt(s->sd, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &TTL, sizeof(TTL)); if (ret == -1) { @@ -84,13 +84,13 @@ int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) OpalPrint("%s: Configured socket for sending to multicast address\n", PROGNAME); } - /* If receiving from a multicast group, register for it. */ + // If receiving from a multicast group, register for it. if (inet_addr(IconCtrlStruct.StringParam[1]) > 0) { if ((inet_addr(IconCtrlStruct.StringParam[1]) & inet_addr("240.0.0.0")) == inet_addr("224.0.0.0")) { mreq.imr_multiaddr.s_addr = inet_addr(IconCtrlStruct.StringParam[1]); mreq.imr_interface.s_addr = INADDR_ANY; - /* Have the multicast socket join the multicast group */ + // Have the multicast socket join the multicast group ret = setsockopt(s->sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof(mreq)); if (ret == -1) { OpalPrint("%s: ERROR: Could not join multicast group (%d)\n", PROGNAME, errno); @@ -134,11 +134,11 @@ int socket_recv(struct socket *s, char *data, int len, double timeout) socklen_t client_ad_size = sizeof(client_ad); fd_set sd_set; - /* Set the descriptor set for the select() call */ + // Set the descriptor set for the select() call FD_ZERO(&sd_set); FD_SET(s->sd, &sd_set); - /* Set the tv structure to the correct timeout value */ + // Set the tv structure to the correct timeout value tv.tv_sec = (int) timeout; tv.tv_usec = (int) ((timeout - tv.tv_sec) * 1000000); @@ -148,9 +148,9 @@ int socket_recv(struct socket *s, char *data, int len, double timeout) * a future instance (model load). */ ret = select(s->sd + 1, &sd_set, (fd_set *) 0, (fd_set *) 0, &tv); switch (ret) { - case -1: /* Error */ + case -1: // Error return -1; - case 0: /* We hit the timeout */ + case 0: // We hit the timeout return 0; default: if (!(FD_ISSET(s->sd, &sd_set))) { @@ -161,9 +161,9 @@ int socket_recv(struct socket *s, char *data, int len, double timeout) } } - /* Clear the data array (in case we receive an incomplete packet) */ + // Clear the data array (in case we receive an incomplete packet) memset(data, 0, len); - /* Perform the reception */ + // Perform the reception return recvfrom(s->sd, data, len, 0, (struct sockaddr *) &client_ad, &client_ad_size); } diff --git a/clients/opal/models/send_receive/src/utils.c b/clients/opal/models/send_receive/src/utils.c index 3a8118ed2..3015fc344 100644 --- a/clients/opal/models/send_receive/src/utils.c +++ b/clients/opal/models/send_receive/src/utils.c @@ -1,11 +1,11 @@ -/** Configure scheduler. +/* Configure scheduler. * - * @author Steffen Vogel - * @author Mathieu Dubé-Dallaire - * @copyright 2003, OPAL-RT Technologies inc - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Mathieu Dubé-Dallaire + * SPDX-FileCopyrightText: 2003 OPAL-RT Technologies inc + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -26,7 +26,7 @@ int AssignProcToCpu0(void) CPU_ZERO(&bindSet); CPU_SET(0, &bindSet); - /* Changing process cpu affinity */ + // Changing process cpu affinity ret = sched_setaffinity(0, sizeof(cpu_set_t), &bindSet); if (ret) { OpalPrint("Unable to bind the process to CPU 0: %d\n", errno); diff --git a/clients/opal/villas_udp.llp b/clients/opal/villas_udp.llp index 472a97c08..230f74e7b 100644 --- a/clients/opal/villas_udp.llp +++ b/clients/opal/villas_udp.llp @@ -1,4 +1,8 @@ + villas_udp diff --git a/clients/python/client.py b/clients/python/client.py index d70b4e0fb..daff5bb0d 100644 --- a/clients/python/client.py +++ b/clients/python/client.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + import villas_pb2 import time, socket, errno, sys, os, signal diff --git a/clients/shmem/CMakeLists.txt b/clients/shmem/CMakeLists.txt index 0cffc905f..a2f5a2bb8 100644 --- a/clients/shmem/CMakeLists.txt +++ b/clients/shmem/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 add_executable(villas-shmem villas-shmem.cpp) diff --git a/clients/shmem/villas-shmem.cpp b/clients/shmem/villas-shmem.cpp index 345b5ca4f..289970905 100644 --- a/clients/shmem/villas-shmem.cpp +++ b/clients/shmem/villas-shmem.cpp @@ -1,12 +1,12 @@ -/** Test "client" for the shared memory interface. +/* Test "client" for the shared memory interface. * * Waits on the incoming queue, prints received samples and writes them * back to the other queue. * - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/clients/typhoon/villas_typhoon_ethernet_variable_exchange.tse b/clients/typhoon/villas_typhoon_ethernet_variable_exchange.tse index d9773ab1d..93be472e2 100644 --- a/clients/typhoon/villas_typhoon_ethernet_variable_exchange.tse +++ b/clients/typhoon/villas_typhoon_ethernet_variable_exchange.tse @@ -1,5 +1,8 @@ version = 4.2 +// SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +// SPDX-License-Identifier: Apache-2.0 + // // Saved by sw version: 2022.1 SP1 // Save timestamp: 24-Mar-2022 @ 04:26:31 PM diff --git a/cmake/FindEtherlab.cmake b/cmake/FindEtherlab.cmake index bd343ac5e..95a22afab 100644 --- a/cmake/FindEtherlab.cmake +++ b/cmake/FindEtherlab.cmake @@ -1,10 +1,9 @@ # CMakeLists.txt. # -# @author Niklas Eiling -# @author Steffen Vogel -# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Niklas Eiling +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2018 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 find_path(ETHERLAB_INCLUDE_DIR NAMES ecrt.h diff --git a/cmake/FindIBVerbs.cmake b/cmake/FindIBVerbs.cmake index 57315d6c8..38806105f 100644 --- a/cmake/FindIBVerbs.cmake +++ b/cmake/FindIBVerbs.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 find_path(IBVERBS_INCLUDE_DIR NAMES infiniband/verbs.h diff --git a/cmake/FindOpal.cmake b/cmake/FindOpal.cmake index 1d659e883..4cfb5656d 100644 --- a/cmake/FindOpal.cmake +++ b/cmake/FindOpal.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(OPAL_PREFIX /usr/opalrt/common) diff --git a/cmake/FindRDMACM.cmake b/cmake/FindRDMACM.cmake index b5cbd466d..6e6f92ef7 100644 --- a/cmake/FindRDMACM.cmake +++ b/cmake/FindRDMACM.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 find_path(RDMACM_INCLUDE_DIR NAMES rdma/rdma_cma.h diff --git a/cmake/FindSymbol.cmake b/cmake/FindSymbol.cmake index c6654ede8..0b566ef95 100644 --- a/cmake/FindSymbol.cmake +++ b/cmake/FindSymbol.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 function(FindSymbol LIBRARY SYMBOL FOUND) find_program(OBJDUMP_EXECUTABLE NAMES objdump) diff --git a/cmake/VILLASnodePackaging.cmake b/cmake/VILLASnodePackaging.cmake index 2fcf94ade..57fbe67e8 100644 --- a/cmake/VILLASnodePackaging.cmake +++ b/cmake/VILLASnodePackaging.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 include(CPackComponent) get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS) @@ -61,7 +60,7 @@ set(CPACK_RPM_PACKAGE_LICENSE "Apache-2.0") set(CPACK_RPM_PACKAGE_URL ${PROJECT_HOMEPAGE_URL}) set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") -set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.md") +set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md") set(CPACK_SOURCE_IGNORE_FILES "build/;\\\\.gitmodules;\\\\.git/;\\\\.vscode;\\\\.editorconfig;\\\\.gitlab-ci.yml;\\\\.(docker|git)ignore;\\\\.DS_Store") diff --git a/cmake/config/Coverage.cmake b/cmake/config/Coverage.cmake index ec4852bdf..84868c279 100644 --- a/cmake/config/Coverage.cmake +++ b/cmake/config/Coverage.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" diff --git a/cmake/config/Debug.cmake b/cmake/config/Debug.cmake index 37961761c..4188605c0 100644 --- a/cmake/config/Debug.cmake +++ b/cmake/config/Debug.cmake @@ -1,6 +1,5 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 diff --git a/cmake/config/Profiling.cmake b/cmake/config/Profiling.cmake index 7296d4fdf..d9c2aa422 100644 --- a/cmake/config/Profiling.cmake +++ b/cmake/config/Profiling.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(CMAKE_CXX_FLAGS_PROFILING "${CMAKE_CXX_FLAGS} -pg" diff --git a/cmake/config/Release.cmake b/cmake/config/Release.cmake index 1cc8307c5..7c02eae4c 100644 --- a/cmake/config/Release.cmake +++ b/cmake/config/Release.cmake @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # don't treat warnings as errors on normal release builds if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT DEFINED VILLAS_COMPILE_WARNING_AS_ERROR) diff --git a/cmake/toolchains/debian-arm64.cmake b/cmake/toolchains/debian-arm64.cmake index a55b0829a..7cfc37f3b 100644 --- a/cmake/toolchains/debian-arm64.cmake +++ b/cmake/toolchains/debian-arm64.cmake @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR aarch64) diff --git a/cmake/toolchains/debian-armhf.cmake b/cmake/toolchains/debian-armhf.cmake index e153e8216..65b57b262 100644 --- a/cmake/toolchains/debian-armhf.cmake +++ b/cmake/toolchains/debian-armhf.cmake @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR armv7l) diff --git a/common b/common index 120312e93..413a0ba31 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 120312e938dc298b4dc13792e1acf7510190bbf4 +Subproject commit 413a0ba31971730f60664ef69709b70d64c9de80 diff --git a/doc/.gitignore b/doc/.gitignore index b3fbf1bb9..6109c45b3 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + html/ doxygen_sqlite3.db warnings.log diff --git a/doc/.redocly.yaml b/doc/.redocly.yaml index 47dc94ec0..acbf12858 100644 --- a/doc/.redocly.yaml +++ b/doc/.redocly.yaml @@ -1,4 +1,8 @@ # See https://redoc.ly/docs/cli/configuration/ for more information. +# +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- apiDefinitions: main: openapi/openapi.yaml lint: diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 4cf0e4023..ec7d18766 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 find_package(Doxygen) @@ -37,7 +36,7 @@ if(DOXYGEN_FOUND) set(DOXYGEN_DIAFILE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/figures/) doxygen_add_docs(doc - README.md CONTRIBUTING.md COPYING.md src/ lib/ tests/ include/ doc/ + README.md CONTRIBUTING.md LICENSE src/ lib/ tests/ include/ doc/ WORKING_DIRECTORY ${PROJECT_DIR} ) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 4db7e3af4..a4fcdfe26 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1,4 +1,6 @@ # Doxyfile 1.8.10 +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -765,7 +767,7 @@ WARN_LOGFILE = doc/warnings.log # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = README.md CONTRIBUTING.md COPYING.md src/ lib/ tests/ include/ doc/ +INPUT = README.md CONTRIBUTING.md LICENSE src/ lib/ tests/ include/ doc/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/doc/index.html b/doc/index.html index e4b850287..abf11b59a 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,3 +1,7 @@ + diff --git a/doc/openapi-relay.yaml b/doc/openapi-relay.yaml index 9fd870414..4f2ca883f 100644 --- a/doc/openapi-relay.yaml +++ b/doc/openapi-relay.yaml @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- openapi: '3.0.0' info: diff --git a/doc/openapi/README.md b/doc/openapi/README.md deleted file mode 100644 index ae48cf097..000000000 --- a/doc/openapi/README.md +++ /dev/null @@ -1,13 +0,0 @@ -## The `openapi` folder - -This folder contains your entrypoint `openapi.yaml`. - -That file contains references to the entire API definition. - -Here are some sections to pay attention to: - -* Top-level **description**: this accepts markdown, and Redoc and Redocly API Reference will render it at the top of the docs. Consider maintaining your markdown in a separate file and [embedding it](https://redoc.ly/docs/api-reference-docs/embedded-markdown/). Note to Redoc community edition users, the special tags are only available to the Redocly API Reference users, but you can still embed markdown. -* Security schemes: you will define the scheme(s) your API uses for security (eg OAuth2, API Key, etc...). The security schemes are used by the Redocly API Reference "Try It" API console feature. -* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. -* Tags: it's a good idea to organize each operation. Each tag can have a description. The description is used as a section description within the reference docs. -* Servers: a list of your servers, each with a URL. diff --git a/doc/openapi/components/README.md b/doc/openapi/components/README.md deleted file mode 100644 index 26eaeb5d5..000000000 --- a/doc/openapi/components/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Reusable components -=========== - -* You can create the following folders here: - - `schemas` - reusable [Schema Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject) - - `responses` - reusable [Response Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject) - - `parameters` - reusable [Parameter Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject) - - `examples` - reusable [Example Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject) - - `headers` - reusable [Header Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject) - - `requestBodies` - reusable [Request Body Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject) - - `links` - reusable [Link Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#linkObject) - - `callbacks` - reusable [Callback Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject) - - `securitySchemes` - reusable [Security Scheme Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject) -* Filename of files inside the folders represent component name, e.g. `Customer.yaml` diff --git a/doc/openapi/components/parameters/node-uuid-name.yaml b/doc/openapi/components/parameters/node-uuid-name.yaml index 5494e3152..dba4ec868 100644 --- a/doc/openapi/components/parameters/node-uuid-name.yaml +++ b/doc/openapi/components/parameters/node-uuid-name.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- name: uuid-or-name description: Either a UUID or node-name in: path diff --git a/doc/openapi/components/parameters/node-uuid.yaml b/doc/openapi/components/parameters/node-uuid.yaml index e0499f60c..63b4a75a8 100644 --- a/doc/openapi/components/parameters/node-uuid.yaml +++ b/doc/openapi/components/parameters/node-uuid.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- name: uuid description: A globally unique identifier for each node. in: path diff --git a/doc/openapi/components/parameters/path-uuid.yaml b/doc/openapi/components/parameters/path-uuid.yaml index 3423a9eb4..5d7bd9a31 100644 --- a/doc/openapi/components/parameters/path-uuid.yaml +++ b/doc/openapi/components/parameters/path-uuid.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- name: uuid description: A globally unique identifier for each path. in: path diff --git a/doc/openapi/components/schemas/config.yaml b/doc/openapi/components/schemas/config.yaml index 830d6930b..f79ccb389 100644 --- a/doc/openapi/components/schemas/config.yaml +++ b/doc/openapi/components/schemas/config.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: VILLASnode configuration file description: Schema of the VILLASnode configuration file. diff --git a/doc/openapi/components/schemas/config/format.yaml b/doc/openapi/components/schemas/config/format.yaml index d8b2948f6..85ba3fc4c 100644 --- a/doc/openapi/components/schemas/config/format.yaml +++ b/doc/openapi/components/schemas/config/format.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: diff --git a/doc/openapi/components/schemas/config/format_obj.yaml b/doc/openapi/components/schemas/config/format_obj.yaml index 4d30832f2..29a847af6 100644 --- a/doc/openapi/components/schemas/config/format_obj.yaml +++ b/doc/openapi/components/schemas/config/format_obj.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: Format Object required: diff --git a/doc/openapi/components/schemas/config/format_spec.yaml b/doc/openapi/components/schemas/config/format_spec.yaml index e51bac1c6..981161fef 100644 --- a/doc/openapi/components/schemas/config/format_spec.yaml +++ b/doc/openapi/components/schemas/config/format_spec.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - description: | The payload format which is used to encode and decode exchanged messages. example: villas.human diff --git a/doc/openapi/components/schemas/config/formats/_csv.yaml b/doc/openapi/components/schemas/config/formats/_csv.yaml index f44b43a42..217dbe72e 100644 --- a/doc/openapi/components/schemas/config/formats/_csv.yaml +++ b/doc/openapi/components/schemas/config/formats/_csv.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: csv.yaml diff --git a/doc/openapi/components/schemas/config/formats/_gtnet.yaml b/doc/openapi/components/schemas/config/formats/_gtnet.yaml index 0b90d185e..cadb2e015 100644 --- a/doc/openapi/components/schemas/config/formats/_gtnet.yaml +++ b/doc/openapi/components/schemas/config/formats/_gtnet.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: gtnet.yaml diff --git a/doc/openapi/components/schemas/config/formats/_iotagent_ul.yaml b/doc/openapi/components/schemas/config/formats/_iotagent_ul.yaml index 9ec5939bf..ee1c4e1fb 100644 --- a/doc/openapi/components/schemas/config/formats/_iotagent_ul.yaml +++ b/doc/openapi/components/schemas/config/formats/_iotagent_ul.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: iotagent_ul.yaml diff --git a/doc/openapi/components/schemas/config/formats/_json.yaml b/doc/openapi/components/schemas/config/formats/_json.yaml index 402bdbaa2..ded744931 100644 --- a/doc/openapi/components/schemas/config/formats/_json.yaml +++ b/doc/openapi/components/schemas/config/formats/_json.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: json.yaml diff --git a/doc/openapi/components/schemas/config/formats/_json_edgeflex.yaml b/doc/openapi/components/schemas/config/formats/_json_edgeflex.yaml index 5f0f4f2c0..f39b60ca6 100644 --- a/doc/openapi/components/schemas/config/formats/_json_edgeflex.yaml +++ b/doc/openapi/components/schemas/config/formats/_json_edgeflex.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: json_edgeflex.yaml diff --git a/doc/openapi/components/schemas/config/formats/_json_kafka.yaml b/doc/openapi/components/schemas/config/formats/_json_kafka.yaml index 538128471..0d7f2986c 100644 --- a/doc/openapi/components/schemas/config/formats/_json_kafka.yaml +++ b/doc/openapi/components/schemas/config/formats/_json_kafka.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: json_kafka.yaml diff --git a/doc/openapi/components/schemas/config/formats/_json_reserve.yaml b/doc/openapi/components/schemas/config/formats/_json_reserve.yaml index 82d883689..afcd37e24 100644 --- a/doc/openapi/components/schemas/config/formats/_json_reserve.yaml +++ b/doc/openapi/components/schemas/config/formats/_json_reserve.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: json_reserve.yaml diff --git a/doc/openapi/components/schemas/config/formats/_opal_asyncip.yaml b/doc/openapi/components/schemas/config/formats/_opal_asyncip.yaml index 988eb6c98..5c6402be4 100644 --- a/doc/openapi/components/schemas/config/formats/_opal_asyncip.yaml +++ b/doc/openapi/components/schemas/config/formats/_opal_asyncip.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: opal_asyncip.yaml diff --git a/doc/openapi/components/schemas/config/formats/_protobuf.yaml b/doc/openapi/components/schemas/config/formats/_protobuf.yaml index ac4852a41..b4d2f9f8a 100644 --- a/doc/openapi/components/schemas/config/formats/_protobuf.yaml +++ b/doc/openapi/components/schemas/config/formats/_protobuf.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: protobuf.yaml diff --git a/doc/openapi/components/schemas/config/formats/_raw.yaml b/doc/openapi/components/schemas/config/formats/_raw.yaml index 1f867b024..51b0fb3fa 100644 --- a/doc/openapi/components/schemas/config/formats/_raw.yaml +++ b/doc/openapi/components/schemas/config/formats/_raw.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: raw.yaml diff --git a/doc/openapi/components/schemas/config/formats/_tsv.yaml b/doc/openapi/components/schemas/config/formats/_tsv.yaml index 769ebeca4..a7c5c42b8 100644 --- a/doc/openapi/components/schemas/config/formats/_tsv.yaml +++ b/doc/openapi/components/schemas/config/formats/_tsv.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: tsv.yaml diff --git a/doc/openapi/components/schemas/config/formats/_value.yaml b/doc/openapi/components/schemas/config/formats/_value.yaml index e64e79d37..ffe058b93 100644 --- a/doc/openapi/components/schemas/config/formats/_value.yaml +++ b/doc/openapi/components/schemas/config/formats/_value.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: value.yaml diff --git a/doc/openapi/components/schemas/config/formats/_villas_binary.yaml b/doc/openapi/components/schemas/config/formats/_villas_binary.yaml index d08f0e3e1..688161550 100644 --- a/doc/openapi/components/schemas/config/formats/_villas_binary.yaml +++ b/doc/openapi/components/schemas/config/formats/_villas_binary.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: villas_binary.yaml diff --git a/doc/openapi/components/schemas/config/formats/_villas_human.yaml b/doc/openapi/components/schemas/config/formats/_villas_human.yaml index 5dcaabb08..36a060b5a 100644 --- a/doc/openapi/components/schemas/config/formats/_villas_human.yaml +++ b/doc/openapi/components/schemas/config/formats/_villas_human.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: villas_human.yaml diff --git a/doc/openapi/components/schemas/config/formats/_villas_web.yaml b/doc/openapi/components/schemas/config/formats/_villas_web.yaml index 9f9d4cb79..64eb89eb6 100644 --- a/doc/openapi/components/schemas/config/formats/_villas_web.yaml +++ b/doc/openapi/components/schemas/config/formats/_villas_web.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../format_obj.yaml - $ref: villas_web.yaml diff --git a/doc/openapi/components/schemas/config/formats/column.yaml b/doc/openapi/components/schemas/config/formats/column.yaml index 28a16b910..17e26dc14 100644 --- a/doc/openapi/components/schemas/config/formats/column.yaml +++ b/doc/openapi/components/schemas/config/formats/column.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/csv.yaml b/doc/openapi/components/schemas/config/formats/csv.yaml index 7ac680bf8..47ce32c21 100644 --- a/doc/openapi/components/schemas/config/formats/csv.yaml +++ b/doc/openapi/components/schemas/config/formats/csv.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/gtnet.yaml b/doc/openapi/components/schemas/config/formats/gtnet.yaml index 32369c22c..82a8940b7 100644 --- a/doc/openapi/components/schemas/config/formats/gtnet.yaml +++ b/doc/openapi/components/schemas/config/formats/gtnet.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: raw.yaml diff --git a/doc/openapi/components/schemas/config/formats/iotagent_ul.yaml b/doc/openapi/components/schemas/config/formats/iotagent_ul.yaml index 155db87eb..e884bc98e 100644 --- a/doc/openapi/components/schemas/config/formats/iotagent_ul.yaml +++ b/doc/openapi/components/schemas/config/formats/iotagent_ul.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/json.yaml b/doc/openapi/components/schemas/config/formats/json.yaml index cae3501bb..0603c0f03 100644 --- a/doc/openapi/components/schemas/config/formats/json.yaml +++ b/doc/openapi/components/schemas/config/formats/json.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/json_edgeflex.yaml b/doc/openapi/components/schemas/config/formats/json_edgeflex.yaml index 4d163d8e5..842c450fe 100644 --- a/doc/openapi/components/schemas/config/formats/json_edgeflex.yaml +++ b/doc/openapi/components/schemas/config/formats/json_edgeflex.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/json_kafka.yaml b/doc/openapi/components/schemas/config/formats/json_kafka.yaml index 4d163d8e5..842c450fe 100644 --- a/doc/openapi/components/schemas/config/formats/json_kafka.yaml +++ b/doc/openapi/components/schemas/config/formats/json_kafka.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/json_reserve.yaml b/doc/openapi/components/schemas/config/formats/json_reserve.yaml index 4d163d8e5..842c450fe 100644 --- a/doc/openapi/components/schemas/config/formats/json_reserve.yaml +++ b/doc/openapi/components/schemas/config/formats/json_reserve.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/line.yaml b/doc/openapi/components/schemas/config/formats/line.yaml index 479554427..427491f73 100644 --- a/doc/openapi/components/schemas/config/formats/line.yaml +++ b/doc/openapi/components/schemas/config/formats/line.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/opal_asyncip.yaml b/doc/openapi/components/schemas/config/formats/opal_asyncip.yaml index 5d7af8db9..7eb36fae2 100644 --- a/doc/openapi/components/schemas/config/formats/opal_asyncip.yaml +++ b/doc/openapi/components/schemas/config/formats/opal_asyncip.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/protobuf.yaml b/doc/openapi/components/schemas/config/formats/protobuf.yaml index 155db87eb..e884bc98e 100644 --- a/doc/openapi/components/schemas/config/formats/protobuf.yaml +++ b/doc/openapi/components/schemas/config/formats/protobuf.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/raw.yaml b/doc/openapi/components/schemas/config/formats/raw.yaml index f08acd0e3..28692de9e 100644 --- a/doc/openapi/components/schemas/config/formats/raw.yaml +++ b/doc/openapi/components/schemas/config/formats/raw.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/tsv.yaml b/doc/openapi/components/schemas/config/formats/tsv.yaml index 7ac680bf8..47ce32c21 100644 --- a/doc/openapi/components/schemas/config/formats/tsv.yaml +++ b/doc/openapi/components/schemas/config/formats/tsv.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/value.yaml b/doc/openapi/components/schemas/config/formats/value.yaml index 155db87eb..e884bc98e 100644 --- a/doc/openapi/components/schemas/config/formats/value.yaml +++ b/doc/openapi/components/schemas/config/formats/value.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/villas_binary.yaml b/doc/openapi/components/schemas/config/formats/villas_binary.yaml index 155db87eb..e884bc98e 100644 --- a/doc/openapi/components/schemas/config/formats/villas_binary.yaml +++ b/doc/openapi/components/schemas/config/formats/villas_binary.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/villas_human.yaml b/doc/openapi/components/schemas/config/formats/villas_human.yaml index 28a16b910..17e26dc14 100644 --- a/doc/openapi/components/schemas/config/formats/villas_human.yaml +++ b/doc/openapi/components/schemas/config/formats/villas_human.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/formats/villas_web.yaml b/doc/openapi/components/schemas/config/formats/villas_web.yaml index 49044ec21..69c91ead8 100644 --- a/doc/openapi/components/schemas/config/formats/villas_web.yaml +++ b/doc/openapi/components/schemas/config/formats/villas_web.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/global.yaml b/doc/openapi/components/schemas/config/global.yaml index ab9075cf8..efd7d0784 100644 --- a/doc/openapi/components/schemas/config/global.yaml +++ b/doc/openapi/components/schemas/config/global.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: diff --git a/doc/openapi/components/schemas/config/hook.yaml b/doc/openapi/components/schemas/config/hook.yaml index 8049ab7a9..f6014aefa 100644 --- a/doc/openapi/components/schemas/config/hook.yaml +++ b/doc/openapi/components/schemas/config/hook.yaml @@ -1,5 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: enabled: diff --git a/doc/openapi/components/schemas/config/hook_list.yaml b/doc/openapi/components/schemas/config/hook_list.yaml index 778aba80f..48fa6fe10 100644 --- a/doc/openapi/components/schemas/config/hook_list.yaml +++ b/doc/openapi/components/schemas/config/hook_list.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: array title: Hook List example: diff --git a/doc/openapi/components/schemas/config/hook_multi.yaml b/doc/openapi/components/schemas/config/hook_multi.yaml index b7b83cb64..983db59fe 100644 --- a/doc/openapi/components/schemas/config/hook_multi.yaml +++ b/doc/openapi/components/schemas/config/hook_multi.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hook_obj.yaml b/doc/openapi/components/schemas/config/hook_obj.yaml index 81d1cd117..37d4021b5 100644 --- a/doc/openapi/components/schemas/config/hook_obj.yaml +++ b/doc/openapi/components/schemas/config/hook_obj.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: Hook Object required: diff --git a/doc/openapi/components/schemas/config/hook_single.yaml b/doc/openapi/components/schemas/config/hook_single.yaml index 1090813ff..3e6b4cb67 100644 --- a/doc/openapi/components/schemas/config/hook_single.yaml +++ b/doc/openapi/components/schemas/config/hook_single.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hook_spec.yaml b/doc/openapi/components/schemas/config/hook_spec.yaml index fc566d688..f0776559c 100644 --- a/doc/openapi/components/schemas/config/hook_spec.yaml +++ b/doc/openapi/components/schemas/config/hook_spec.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - description: | Hooks form a pipeline of steps which process, filter or alter sample data. example: print diff --git a/doc/openapi/components/schemas/config/hooks/_average.yaml b/doc/openapi/components/schemas/config/hooks/_average.yaml index d0e2011a8..460c5864c 100644 --- a/doc/openapi/components/schemas/config/hooks/_average.yaml +++ b/doc/openapi/components/schemas/config/hooks/_average.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: average.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_cast.yaml b/doc/openapi/components/schemas/config/hooks/_cast.yaml index 25d4ff2ab..56c9cf67f 100644 --- a/doc/openapi/components/schemas/config/hooks/_cast.yaml +++ b/doc/openapi/components/schemas/config/hooks/_cast.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: cast.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_decimate.yaml b/doc/openapi/components/schemas/config/hooks/_decimate.yaml index a0919b2ee..12890d4a7 100644 --- a/doc/openapi/components/schemas/config/hooks/_decimate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_decimate.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: decimate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_dp.yaml b/doc/openapi/components/schemas/config/hooks/_dp.yaml index 573ad0d7b..db8baf17d 100644 --- a/doc/openapi/components/schemas/config/hooks/_dp.yaml +++ b/doc/openapi/components/schemas/config/hooks/_dp.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: dp.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_drop.yaml b/doc/openapi/components/schemas/config/hooks/_drop.yaml index d251e88e3..fb708c3e2 100644 --- a/doc/openapi/components/schemas/config/hooks/_drop.yaml +++ b/doc/openapi/components/schemas/config/hooks/_drop.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: drop.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_dump.yaml b/doc/openapi/components/schemas/config/hooks/_dump.yaml index f5fcdbc8d..1bd301bb7 100644 --- a/doc/openapi/components/schemas/config/hooks/_dump.yaml +++ b/doc/openapi/components/schemas/config/hooks/_dump.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: dump.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ebm.yaml b/doc/openapi/components/schemas/config/hooks/_ebm.yaml index db125d977..8d7e9b0b5 100644 --- a/doc/openapi/components/schemas/config/hooks/_ebm.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ebm.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: ebm.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_fix.yaml b/doc/openapi/components/schemas/config/hooks/_fix.yaml index 4ef520298..6221c3e7b 100644 --- a/doc/openapi/components/schemas/config/hooks/_fix.yaml +++ b/doc/openapi/components/schemas/config/hooks/_fix.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: fix.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_gate.yaml b/doc/openapi/components/schemas/config/hooks/_gate.yaml index 4c14ce308..5702f7fb8 100644 --- a/doc/openapi/components/schemas/config/hooks/_gate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_gate.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: gate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml b/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml index 2a4e5ce8a..4f251752e 100644 --- a/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml +++ b/doc/openapi/components/schemas/config/hooks/_jitter_calc.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: jitter_calc.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml b/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml index 298b6a6cb..36f465543 100644 --- a/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml +++ b/doc/openapi/components/schemas/config/hooks/_limit_rate.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: limit_rate.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_limit_value.yaml b/doc/openapi/components/schemas/config/hooks/_limit_value.yaml index 2212ad325..aa4ada76b 100644 --- a/doc/openapi/components/schemas/config/hooks/_limit_value.yaml +++ b/doc/openapi/components/schemas/config/hooks/_limit_value.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: limit_value.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_lua.yaml b/doc/openapi/components/schemas/config/hooks/_lua.yaml index ac3ba59ce..36a51c205 100644 --- a/doc/openapi/components/schemas/config/hooks/_lua.yaml +++ b/doc/openapi/components/schemas/config/hooks/_lua.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: lua.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ma.yaml b/doc/openapi/components/schemas/config/hooks/_ma.yaml index 56e8fc95b..0754a5b2b 100644 --- a/doc/openapi/components/schemas/config/hooks/_ma.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ma.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: ma.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml b/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml index 73d4a4c78..30d0d69ae 100644 --- a/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml +++ b/doc/openapi/components/schemas/config/hooks/_pmu_dft.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: pmu_dft.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml b/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml index 7aedb280f..fd6526fc0 100644 --- a/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_pps_ts.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: pps_ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_print.yaml b/doc/openapi/components/schemas/config/hooks/_print.yaml index 4d74fbc20..f5f908140 100644 --- a/doc/openapi/components/schemas/config/hooks/_print.yaml +++ b/doc/openapi/components/schemas/config/hooks/_print.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: print.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_restart.yaml b/doc/openapi/components/schemas/config/hooks/_restart.yaml index a7f74c120..f01584c12 100644 --- a/doc/openapi/components/schemas/config/hooks/_restart.yaml +++ b/doc/openapi/components/schemas/config/hooks/_restart.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: restart.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_rms.yaml b/doc/openapi/components/schemas/config/hooks/_rms.yaml index d16d9295c..5da6ec15b 100644 --- a/doc/openapi/components/schemas/config/hooks/_rms.yaml +++ b/doc/openapi/components/schemas/config/hooks/_rms.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: rms.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_round.yaml b/doc/openapi/components/schemas/config/hooks/_round.yaml index 04f1796fc..7334d85c9 100644 --- a/doc/openapi/components/schemas/config/hooks/_round.yaml +++ b/doc/openapi/components/schemas/config/hooks/_round.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: round.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_scale.yaml b/doc/openapi/components/schemas/config/hooks/_scale.yaml index 190c37418..f8ee9f8c9 100644 --- a/doc/openapi/components/schemas/config/hooks/_scale.yaml +++ b/doc/openapi/components/schemas/config/hooks/_scale.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: scale.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml b/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml index 13065120c..ee86e61b9 100644 --- a/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml +++ b/doc/openapi/components/schemas/config/hooks/_shift_seq.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: shift_seq.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml b/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml index d260b165f..2d2dceee0 100644 --- a/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_shift_ts.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: shift_ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_skip_first.yaml b/doc/openapi/components/schemas/config/hooks/_skip_first.yaml index dd51e8018..00170ba1a 100644 --- a/doc/openapi/components/schemas/config/hooks/_skip_first.yaml +++ b/doc/openapi/components/schemas/config/hooks/_skip_first.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: skip_first.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_stats.yaml b/doc/openapi/components/schemas/config/hooks/_stats.yaml index 061528214..a12bef088 100644 --- a/doc/openapi/components/schemas/config/hooks/_stats.yaml +++ b/doc/openapi/components/schemas/config/hooks/_stats.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: stats.yaml diff --git a/doc/openapi/components/schemas/config/hooks/_ts.yaml b/doc/openapi/components/schemas/config/hooks/_ts.yaml index f9e438fc5..803400f5c 100644 --- a/doc/openapi/components/schemas/config/hooks/_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/_ts.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../hook_obj.yaml - $ref: ts.yaml diff --git a/doc/openapi/components/schemas/config/hooks/average.yaml b/doc/openapi/components/schemas/config/hooks/average.yaml index b772292ec..046d2a599 100644 --- a/doc/openapi/components/schemas/config/hooks/average.yaml +++ b/doc/openapi/components/schemas/config/hooks/average.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/cast.yaml b/doc/openapi/components/schemas/config/hooks/cast.yaml index 0c01489e0..38af5fad2 100644 --- a/doc/openapi/components/schemas/config/hooks/cast.yaml +++ b/doc/openapi/components/schemas/config/hooks/cast.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/decimate.yaml b/doc/openapi/components/schemas/config/hooks/decimate.yaml index c7cb8dc37..5fe375a39 100644 --- a/doc/openapi/components/schemas/config/hooks/decimate.yaml +++ b/doc/openapi/components/schemas/config/hooks/decimate.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/dp.yaml b/doc/openapi/components/schemas/config/hooks/dp.yaml index 2be619f38..49d7ccf5c 100644 --- a/doc/openapi/components/schemas/config/hooks/dp.yaml +++ b/doc/openapi/components/schemas/config/hooks/dp.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/drop.yaml b/doc/openapi/components/schemas/config/hooks/drop.yaml index 4783a3b94..38b20dcd1 100644 --- a/doc/openapi/components/schemas/config/hooks/drop.yaml +++ b/doc/openapi/components/schemas/config/hooks/drop.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/dump.yaml b/doc/openapi/components/schemas/config/hooks/dump.yaml index 4783a3b94..38b20dcd1 100644 --- a/doc/openapi/components/schemas/config/hooks/dump.yaml +++ b/doc/openapi/components/schemas/config/hooks/dump.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/ebm.yaml b/doc/openapi/components/schemas/config/hooks/ebm.yaml index ea9cb22d6..9dedcbca0 100644 --- a/doc/openapi/components/schemas/config/hooks/ebm.yaml +++ b/doc/openapi/components/schemas/config/hooks/ebm.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/fix.yaml b/doc/openapi/components/schemas/config/hooks/fix.yaml index 4783a3b94..38b20dcd1 100644 --- a/doc/openapi/components/schemas/config/hooks/fix.yaml +++ b/doc/openapi/components/schemas/config/hooks/fix.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/gate.yaml b/doc/openapi/components/schemas/config/hooks/gate.yaml index 24b30a12c..49b6af027 100644 --- a/doc/openapi/components/schemas/config/hooks/gate.yaml +++ b/doc/openapi/components/schemas/config/hooks/gate.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml b/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml index 4783a3b94..38b20dcd1 100644 --- a/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml +++ b/doc/openapi/components/schemas/config/hooks/jitter_calc.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/limit_rate.yaml b/doc/openapi/components/schemas/config/hooks/limit_rate.yaml index a3bb32f0e..87c3fcf84 100644 --- a/doc/openapi/components/schemas/config/hooks/limit_rate.yaml +++ b/doc/openapi/components/schemas/config/hooks/limit_rate.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/limit_value.yaml b/doc/openapi/components/schemas/config/hooks/limit_value.yaml index 37ccd0f97..de89d1448 100644 --- a/doc/openapi/components/schemas/config/hooks/limit_value.yaml +++ b/doc/openapi/components/schemas/config/hooks/limit_value.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/lua.yaml b/doc/openapi/components/schemas/config/hooks/lua.yaml index 64e219fa8..a6abb38c2 100644 --- a/doc/openapi/components/schemas/config/hooks/lua.yaml +++ b/doc/openapi/components/schemas/config/hooks/lua.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object additionalProperties: diff --git a/doc/openapi/components/schemas/config/hooks/ma.yaml b/doc/openapi/components/schemas/config/hooks/ma.yaml index 4325c880b..8f388e7b7 100644 --- a/doc/openapi/components/schemas/config/hooks/ma.yaml +++ b/doc/openapi/components/schemas/config/hooks/ma.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml b/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml index d6ce71fa4..c86e7d1c3 100644 --- a/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml +++ b/doc/openapi/components/schemas/config/hooks/pmu_dft.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/pps_ts.yaml b/doc/openapi/components/schemas/config/hooks/pps_ts.yaml index 7660280ef..17899eb56 100644 --- a/doc/openapi/components/schemas/config/hooks/pps_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/pps_ts.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/print.yaml b/doc/openapi/components/schemas/config/hooks/print.yaml index df1cff11c..de90bc800 100644 --- a/doc/openapi/components/schemas/config/hooks/print.yaml +++ b/doc/openapi/components/schemas/config/hooks/print.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/restart.yaml b/doc/openapi/components/schemas/config/hooks/restart.yaml index 0c99bd84b..20247f665 100644 --- a/doc/openapi/components/schemas/config/hooks/restart.yaml +++ b/doc/openapi/components/schemas/config/hooks/restart.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/hooks/rms.yaml b/doc/openapi/components/schemas/config/hooks/rms.yaml index 4325c880b..8f388e7b7 100644 --- a/doc/openapi/components/schemas/config/hooks/rms.yaml +++ b/doc/openapi/components/schemas/config/hooks/rms.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/round.yaml b/doc/openapi/components/schemas/config/hooks/round.yaml index 287d214aa..9822f8b19 100644 --- a/doc/openapi/components/schemas/config/hooks/round.yaml +++ b/doc/openapi/components/schemas/config/hooks/round.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/scale.yaml b/doc/openapi/components/schemas/config/hooks/scale.yaml index fe6743028..1349048f2 100644 --- a/doc/openapi/components/schemas/config/hooks/scale.yaml +++ b/doc/openapi/components/schemas/config/hooks/scale.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/shift_seq.yaml b/doc/openapi/components/schemas/config/hooks/shift_seq.yaml index 387ac0500..8ec50b6d8 100644 --- a/doc/openapi/components/schemas/config/hooks/shift_seq.yaml +++ b/doc/openapi/components/schemas/config/hooks/shift_seq.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/shift_ts.yaml b/doc/openapi/components/schemas/config/hooks/shift_ts.yaml index 2881cbe10..d2c3661aa 100644 --- a/doc/openapi/components/schemas/config/hooks/shift_ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/shift_ts.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/hooks/skip_first.yaml b/doc/openapi/components/schemas/config/hooks/skip_first.yaml index 84a1f05f2..58046aa64 100644 --- a/doc/openapi/components/schemas/config/hooks/skip_first.yaml +++ b/doc/openapi/components/schemas/config/hooks/skip_first.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/stats.yaml b/doc/openapi/components/schemas/config/hooks/stats.yaml index 8da13d0d4..43911fe98 100644 --- a/doc/openapi/components/schemas/config/hooks/stats.yaml +++ b/doc/openapi/components/schemas/config/hooks/stats.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/hooks/ts.yaml b/doc/openapi/components/schemas/config/hooks/ts.yaml index 4783a3b94..38b20dcd1 100644 --- a/doc/openapi/components/schemas/config/hooks/ts.yaml +++ b/doc/openapi/components/schemas/config/hooks/ts.yaml @@ -1,5 +1,6 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../hook.yaml diff --git a/doc/openapi/components/schemas/config/http.yaml b/doc/openapi/components/schemas/config/http.yaml index 1e9d4f4fe..f8ecfd215 100644 --- a/doc/openapi/components/schemas/config/http.yaml +++ b/doc/openapi/components/schemas/config/http.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: port: diff --git a/doc/openapi/components/schemas/config/logging.yaml b/doc/openapi/components/schemas/config/logging.yaml index a85737a41..d82471689 100644 --- a/doc/openapi/components/schemas/config/logging.yaml +++ b/doc/openapi/components/schemas/config/logging.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: Logging configuration properties: diff --git a/doc/openapi/components/schemas/config/netem.yaml b/doc/openapi/components/schemas/config/netem.yaml index bf99cd314..1ce51addb 100644 --- a/doc/openapi/components/schemas/config/netem.yaml +++ b/doc/openapi/components/schemas/config/netem.yaml @@ -1,5 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - description: | The netem configuration allows the user to apply network impairments to packets send out by the nodes. diff --git a/doc/openapi/components/schemas/config/node.yaml b/doc/openapi/components/schemas/config/node.yaml index d6ee16c2d..fc6c6bf64 100644 --- a/doc/openapi/components/schemas/config/node.yaml +++ b/doc/openapi/components/schemas/config/node.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: Node properties: diff --git a/doc/openapi/components/schemas/config/node_obj.yaml b/doc/openapi/components/schemas/config/node_obj.yaml index dfe8cd92e..258dfdbe2 100644 --- a/doc/openapi/components/schemas/config/node_obj.yaml +++ b/doc/openapi/components/schemas/config/node_obj.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: Format Object required: diff --git a/doc/openapi/components/schemas/config/node_signals.yaml b/doc/openapi/components/schemas/config/node_signals.yaml index db4ac7dbd..a594cec8a 100644 --- a/doc/openapi/components/schemas/config/node_signals.yaml +++ b/doc/openapi/components/schemas/config/node_signals.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: in: diff --git a/doc/openapi/components/schemas/config/nodes/_amqp.yaml b/doc/openapi/components/schemas/config/nodes/_amqp.yaml index 331d62dfb..b6cf3b342 100644 --- a/doc/openapi/components/schemas/config/nodes/_amqp.yaml +++ b/doc/openapi/components/schemas/config/nodes/_amqp.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: amqp.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_api.yaml b/doc/openapi/components/schemas/config/nodes/_api.yaml index c5b6347b8..8c7cb8603 100644 --- a/doc/openapi/components/schemas/config/nodes/_api.yaml +++ b/doc/openapi/components/schemas/config/nodes/_api.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: api.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_can.yaml b/doc/openapi/components/schemas/config/nodes/_can.yaml index 79a0caa67..35379af9e 100644 --- a/doc/openapi/components/schemas/config/nodes/_can.yaml +++ b/doc/openapi/components/schemas/config/nodes/_can.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: can.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_comedi.yaml b/doc/openapi/components/schemas/config/nodes/_comedi.yaml index 8fc9ebde2..f604da3a6 100644 --- a/doc/openapi/components/schemas/config/nodes/_comedi.yaml +++ b/doc/openapi/components/schemas/config/nodes/_comedi.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: comedi.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_ethercat.yaml b/doc/openapi/components/schemas/config/nodes/_ethercat.yaml index 414fa0f1f..5bf4c87ef 100644 --- a/doc/openapi/components/schemas/config/nodes/_ethercat.yaml +++ b/doc/openapi/components/schemas/config/nodes/_ethercat.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: ethercat.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_example.yaml b/doc/openapi/components/schemas/config/nodes/_example.yaml index 74f345f12..9b768110b 100644 --- a/doc/openapi/components/schemas/config/nodes/_example.yaml +++ b/doc/openapi/components/schemas/config/nodes/_example.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: example.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_exec.yaml b/doc/openapi/components/schemas/config/nodes/_exec.yaml index 93cb4bb82..99bb87eb1 100644 --- a/doc/openapi/components/schemas/config/nodes/_exec.yaml +++ b/doc/openapi/components/schemas/config/nodes/_exec.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: exec.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_file.yaml b/doc/openapi/components/schemas/config/nodes/_file.yaml index 690eca03b..3366cdf65 100644 --- a/doc/openapi/components/schemas/config/nodes/_file.yaml +++ b/doc/openapi/components/schemas/config/nodes/_file.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: file.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_fpga.yaml b/doc/openapi/components/schemas/config/nodes/_fpga.yaml index 168fc2572..537105d09 100644 --- a/doc/openapi/components/schemas/config/nodes/_fpga.yaml +++ b/doc/openapi/components/schemas/config/nodes/_fpga.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: fpga.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_iec60870-5-104.yaml b/doc/openapi/components/schemas/config/nodes/_iec60870-5-104.yaml index 47c5f4796..c3fc3fe20 100644 --- a/doc/openapi/components/schemas/config/nodes/_iec60870-5-104.yaml +++ b/doc/openapi/components/schemas/config/nodes/_iec60870-5-104.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: iec60870-5-104.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_iec61850-8-1.yaml b/doc/openapi/components/schemas/config/nodes/_iec61850-8-1.yaml index b37ffc302..9d1354a31 100644 --- a/doc/openapi/components/schemas/config/nodes/_iec61850-8-1.yaml +++ b/doc/openapi/components/schemas/config/nodes/_iec61850-8-1.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: iec61850-8-1.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_iec61850-9-2.yaml b/doc/openapi/components/schemas/config/nodes/_iec61850-9-2.yaml index 82e884739..cdcc44075 100644 --- a/doc/openapi/components/schemas/config/nodes/_iec61850-9-2.yaml +++ b/doc/openapi/components/schemas/config/nodes/_iec61850-9-2.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: iec61850-9-2.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_infiniband.yaml b/doc/openapi/components/schemas/config/nodes/_infiniband.yaml index a6cdca7bd..5a4eb4975 100644 --- a/doc/openapi/components/schemas/config/nodes/_infiniband.yaml +++ b/doc/openapi/components/schemas/config/nodes/_infiniband.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: infiniband.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_influxdb.yaml b/doc/openapi/components/schemas/config/nodes/_influxdb.yaml index 774751530..8da5a3d8b 100644 --- a/doc/openapi/components/schemas/config/nodes/_influxdb.yaml +++ b/doc/openapi/components/schemas/config/nodes/_influxdb.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: influxdb.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_kafka.yaml b/doc/openapi/components/schemas/config/nodes/_kafka.yaml index b6316f789..e976bbc48 100644 --- a/doc/openapi/components/schemas/config/nodes/_kafka.yaml +++ b/doc/openapi/components/schemas/config/nodes/_kafka.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: kafka.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_loopback.yaml b/doc/openapi/components/schemas/config/nodes/_loopback.yaml index 0407a01d6..f9ed90504 100644 --- a/doc/openapi/components/schemas/config/nodes/_loopback.yaml +++ b/doc/openapi/components/schemas/config/nodes/_loopback.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: loopback.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_modbus.yaml b/doc/openapi/components/schemas/config/nodes/_modbus.yaml index 2ecbc813d..2212b8bf5 100644 --- a/doc/openapi/components/schemas/config/nodes/_modbus.yaml +++ b/doc/openapi/components/schemas/config/nodes/_modbus.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: modbus.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_mqtt.yaml b/doc/openapi/components/schemas/config/nodes/_mqtt.yaml index 65bca5f28..4c1acf563 100644 --- a/doc/openapi/components/schemas/config/nodes/_mqtt.yaml +++ b/doc/openapi/components/schemas/config/nodes/_mqtt.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: mqtt.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_nanomsg.yaml b/doc/openapi/components/schemas/config/nodes/_nanomsg.yaml index b882440e8..6e6dab14a 100644 --- a/doc/openapi/components/schemas/config/nodes/_nanomsg.yaml +++ b/doc/openapi/components/schemas/config/nodes/_nanomsg.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: nanomsg.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_ngsi.yaml b/doc/openapi/components/schemas/config/nodes/_ngsi.yaml index 9df504f3c..ff89d23d3 100644 --- a/doc/openapi/components/schemas/config/nodes/_ngsi.yaml +++ b/doc/openapi/components/schemas/config/nodes/_ngsi.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: ngsi.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_opal.yaml b/doc/openapi/components/schemas/config/nodes/_opal.yaml index 1fbe97c8e..0f26cf2fe 100644 --- a/doc/openapi/components/schemas/config/nodes/_opal.yaml +++ b/doc/openapi/components/schemas/config/nodes/_opal.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: opal.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_redis.yaml b/doc/openapi/components/schemas/config/nodes/_redis.yaml index fd0c386ea..780474bc1 100644 --- a/doc/openapi/components/schemas/config/nodes/_redis.yaml +++ b/doc/openapi/components/schemas/config/nodes/_redis.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: redis.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_rtp.yaml b/doc/openapi/components/schemas/config/nodes/_rtp.yaml index 7eae9569b..8fdc442f1 100644 --- a/doc/openapi/components/schemas/config/nodes/_rtp.yaml +++ b/doc/openapi/components/schemas/config/nodes/_rtp.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: rtp.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_shmem.yaml b/doc/openapi/components/schemas/config/nodes/_shmem.yaml index 074a1eaff..5abb56d35 100644 --- a/doc/openapi/components/schemas/config/nodes/_shmem.yaml +++ b/doc/openapi/components/schemas/config/nodes/_shmem.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: shmem.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_signal_node.yaml b/doc/openapi/components/schemas/config/nodes/_signal_node.yaml index 1f2be236b..71c7b902a 100644 --- a/doc/openapi/components/schemas/config/nodes/_signal_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/_signal_node.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: signal_node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml b/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml index 414c2a3e9..1ec4a962e 100644 --- a/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/_signal_v2_node.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: signal_v2_node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_socket.yaml b/doc/openapi/components/schemas/config/nodes/_socket.yaml index cc5330e16..94da3b0f6 100644 --- a/doc/openapi/components/schemas/config/nodes/_socket.yaml +++ b/doc/openapi/components/schemas/config/nodes/_socket.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: socket.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_stats_node.yaml b/doc/openapi/components/schemas/config/nodes/_stats_node.yaml index b716510f8..18fd2c320 100644 --- a/doc/openapi/components/schemas/config/nodes/_stats_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/_stats_node.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: stats_node.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_temper.yaml b/doc/openapi/components/schemas/config/nodes/_temper.yaml index dacb2b000..770d10a53 100644 --- a/doc/openapi/components/schemas/config/nodes/_temper.yaml +++ b/doc/openapi/components/schemas/config/nodes/_temper.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: temper.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_test_rtt.yaml b/doc/openapi/components/schemas/config/nodes/_test_rtt.yaml index 827e45090..ca76d63ff 100644 --- a/doc/openapi/components/schemas/config/nodes/_test_rtt.yaml +++ b/doc/openapi/components/schemas/config/nodes/_test_rtt.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: test_rtt.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_uldaq.yaml b/doc/openapi/components/schemas/config/nodes/_uldaq.yaml index ec446ffce..3b082c334 100644 --- a/doc/openapi/components/schemas/config/nodes/_uldaq.yaml +++ b/doc/openapi/components/schemas/config/nodes/_uldaq.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: uldaq.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_webrtc.yaml b/doc/openapi/components/schemas/config/nodes/_webrtc.yaml index ce9514c00..54838ac00 100644 --- a/doc/openapi/components/schemas/config/nodes/_webrtc.yaml +++ b/doc/openapi/components/schemas/config/nodes/_webrtc.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: webrtc.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_websocket.yaml b/doc/openapi/components/schemas/config/nodes/_websocket.yaml index 2937af718..7d0812792 100644 --- a/doc/openapi/components/schemas/config/nodes/_websocket.yaml +++ b/doc/openapi/components/schemas/config/nodes/_websocket.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: websocket.yaml diff --git a/doc/openapi/components/schemas/config/nodes/_zeromq.yaml b/doc/openapi/components/schemas/config/nodes/_zeromq.yaml index 36e940bd6..4604ee28b 100644 --- a/doc/openapi/components/schemas/config/nodes/_zeromq.yaml +++ b/doc/openapi/components/schemas/config/nodes/_zeromq.yaml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- allOf: - $ref: ../node_obj.yaml - $ref: zeromq.yaml diff --git a/doc/openapi/components/schemas/config/nodes/amqp.yaml b/doc/openapi/components/schemas/config/nodes/amqp.yaml index 3c0175398..396a2ec8c 100644 --- a/doc/openapi/components/schemas/config/nodes/amqp.yaml +++ b/doc/openapi/components/schemas/config/nodes/amqp.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: Advanced Messaging & Queuing Protocol (AMQP) allOf: - type: object diff --git a/doc/openapi/components/schemas/config/nodes/api.yaml b/doc/openapi/components/schemas/config/nodes/api.yaml index 260acf78a..d259227db 100644 --- a/doc/openapi/components/schemas/config/nodes/api.yaml +++ b/doc/openapi/components/schemas/config/nodes/api.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../node.yaml - type: object diff --git a/doc/openapi/components/schemas/config/nodes/can.yaml b/doc/openapi/components/schemas/config/nodes/can.yaml index 1ac7b73e8..3c078ef94 100644 --- a/doc/openapi/components/schemas/config/nodes/can.yaml +++ b/doc/openapi/components/schemas/config/nodes/can.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/comedi.yaml b/doc/openapi/components/schemas/config/nodes/comedi.yaml index e144771cd..13ea62adf 100644 --- a/doc/openapi/components/schemas/config/nodes/comedi.yaml +++ b/doc/openapi/components/schemas/config/nodes/comedi.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/ethercat.yaml b/doc/openapi/components/schemas/config/nodes/ethercat.yaml index eb7b79203..5e379cab8 100644 --- a/doc/openapi/components/schemas/config/nodes/ethercat.yaml +++ b/doc/openapi/components/schemas/config/nodes/ethercat.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/example.yaml b/doc/openapi/components/schemas/config/nodes/example.yaml index 33e14d720..f1a1ac697 100644 --- a/doc/openapi/components/schemas/config/nodes/example.yaml +++ b/doc/openapi/components/schemas/config/nodes/example.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/exec.yaml b/doc/openapi/components/schemas/config/nodes/exec.yaml index 44491bdd7..ac3bcf143 100644 --- a/doc/openapi/components/schemas/config/nodes/exec.yaml +++ b/doc/openapi/components/schemas/config/nodes/exec.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/file.yaml b/doc/openapi/components/schemas/config/nodes/file.yaml index 36cd5536d..187efcbf1 100644 --- a/doc/openapi/components/schemas/config/nodes/file.yaml +++ b/doc/openapi/components/schemas/config/nodes/file.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/fpga.yaml b/doc/openapi/components/schemas/config/nodes/fpga.yaml index a571d19c9..86c508cc1 100644 --- a/doc/openapi/components/schemas/config/nodes/fpga.yaml +++ b/doc/openapi/components/schemas/config/nodes/fpga.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/iec60870-5-104.yaml b/doc/openapi/components/schemas/config/nodes/iec60870-5-104.yaml index 0a34b7657..cf26d0063 100644 --- a/doc/openapi/components/schemas/config/nodes/iec60870-5-104.yaml +++ b/doc/openapi/components/schemas/config/nodes/iec60870-5-104.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml b/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml index 1953d8eaa..e60f96851 100644 --- a/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml +++ b/doc/openapi/components/schemas/config/nodes/iec61850-8-1.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - $ref: ../node.yaml - type: object diff --git a/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml b/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml index 0c0e24ba6..fa6a64d5c 100644 --- a/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml +++ b/doc/openapi/components/schemas/config/nodes/iec61850-9-2.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/infiniband.yaml b/doc/openapi/components/schemas/config/nodes/infiniband.yaml index 8bad27f1f..220780275 100644 --- a/doc/openapi/components/schemas/config/nodes/infiniband.yaml +++ b/doc/openapi/components/schemas/config/nodes/infiniband.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/influxdb.yaml b/doc/openapi/components/schemas/config/nodes/influxdb.yaml index 65f94469f..c6718946f 100644 --- a/doc/openapi/components/schemas/config/nodes/influxdb.yaml +++ b/doc/openapi/components/schemas/config/nodes/influxdb.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/kafka.yaml b/doc/openapi/components/schemas/config/nodes/kafka.yaml index 1b132a8e5..e98fb4f32 100644 --- a/doc/openapi/components/schemas/config/nodes/kafka.yaml +++ b/doc/openapi/components/schemas/config/nodes/kafka.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/loopback.yaml b/doc/openapi/components/schemas/config/nodes/loopback.yaml index c4d7a1aea..70e76fb55 100644 --- a/doc/openapi/components/schemas/config/nodes/loopback.yaml +++ b/doc/openapi/components/schemas/config/nodes/loopback.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/modbus.yaml b/doc/openapi/components/schemas/config/nodes/modbus.yaml index 4c1a8efc9..3d9715063 100644 --- a/doc/openapi/components/schemas/config/nodes/modbus.yaml +++ b/doc/openapi/components/schemas/config/nodes/modbus.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object anyOf: diff --git a/doc/openapi/components/schemas/config/nodes/mqtt.yaml b/doc/openapi/components/schemas/config/nodes/mqtt.yaml index a57f4c0cc..d2cc3a6b8 100644 --- a/doc/openapi/components/schemas/config/nodes/mqtt.yaml +++ b/doc/openapi/components/schemas/config/nodes/mqtt.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/nanomsg.yaml b/doc/openapi/components/schemas/config/nodes/nanomsg.yaml index 2f569f17e..f83a50a32 100644 --- a/doc/openapi/components/schemas/config/nodes/nanomsg.yaml +++ b/doc/openapi/components/schemas/config/nodes/nanomsg.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/ngsi.yaml b/doc/openapi/components/schemas/config/nodes/ngsi.yaml index 6c59a7e7f..d6db7fc49 100644 --- a/doc/openapi/components/schemas/config/nodes/ngsi.yaml +++ b/doc/openapi/components/schemas/config/nodes/ngsi.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/opal.yaml b/doc/openapi/components/schemas/config/nodes/opal.yaml index 1ef2044fd..6266dc69e 100644 --- a/doc/openapi/components/schemas/config/nodes/opal.yaml +++ b/doc/openapi/components/schemas/config/nodes/opal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/redis.yaml b/doc/openapi/components/schemas/config/nodes/redis.yaml index 2022b161f..47432bef1 100644 --- a/doc/openapi/components/schemas/config/nodes/redis.yaml +++ b/doc/openapi/components/schemas/config/nodes/redis.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/rtp.yaml b/doc/openapi/components/schemas/config/nodes/rtp.yaml index 5d2f68fc9..e3970527d 100644 --- a/doc/openapi/components/schemas/config/nodes/rtp.yaml +++ b/doc/openapi/components/schemas/config/nodes/rtp.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/shmem.yaml b/doc/openapi/components/schemas/config/nodes/shmem.yaml index 0613dc5c3..c67b9ca7a 100644 --- a/doc/openapi/components/schemas/config/nodes/shmem.yaml +++ b/doc/openapi/components/schemas/config/nodes/shmem.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signal_node.yaml b/doc/openapi/components/schemas/config/nodes/signal_node.yaml index 58979e404..988b57acf 100644 --- a/doc/openapi/components/schemas/config/nodes/signal_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/signal_node.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml b/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml index 1ad78137f..13e7804e0 100644 --- a/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/signal_v2_node.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signals/api_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/api_signal.yaml index df2b9b6ed..3e99d969f 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/api_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/api_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml index 7ea2d1531..f2c564981 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/can_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml index 744dbfe1c..2ec1f8775 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/comedi_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec60870_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec60870_signal.yaml index e3fa38443..5d4b69c95 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/iec60870_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/iec60870_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_data.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_data.yaml index ee4a5b8b2..816382ff3 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_data.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_data.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_publisher_data.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_publisher_data.yaml index a4fdf1ace..57098098a 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_publisher_data.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_publisher_data.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - oneOf: - type: object diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_subscriber_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_subscriber_signal.yaml index 7a83e130b..69c0f8042 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_subscriber_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/iec61850_goose_subscriber_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml index f33d55385..8e65658de 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/iec61850_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/signals/modbus_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/modbus_signal.yaml index ae1861603..439d21da8 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/modbus_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/modbus_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: [type, address] diff --git a/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml index 7065251a7..e9ab4a1a1 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/signal_v2_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml index fdbdaf506..200434896 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/stats_signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml b/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml index f8c3344d9..5200ae976 100644 --- a/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml +++ b/doc/openapi/components/schemas/config/nodes/signals/uldaq_signal.yaml @@ -1,5 +1,7 @@ +# yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/socket.yaml b/doc/openapi/components/schemas/config/nodes/socket.yaml index 4a0db8ff3..49c9b1ec7 100644 --- a/doc/openapi/components/schemas/config/nodes/socket.yaml +++ b/doc/openapi/components/schemas/config/nodes/socket.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/stats_node.yaml b/doc/openapi/components/schemas/config/nodes/stats_node.yaml index 5ed9aa27b..e69b5e8f1 100644 --- a/doc/openapi/components/schemas/config/nodes/stats_node.yaml +++ b/doc/openapi/components/schemas/config/nodes/stats_node.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/temper.yaml b/doc/openapi/components/schemas/config/nodes/temper.yaml index 4b2321289..221483be1 100644 --- a/doc/openapi/components/schemas/config/nodes/temper.yaml +++ b/doc/openapi/components/schemas/config/nodes/temper.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/test_rtt.yaml b/doc/openapi/components/schemas/config/nodes/test_rtt.yaml index ca6540f84..03a03355d 100644 --- a/doc/openapi/components/schemas/config/nodes/test_rtt.yaml +++ b/doc/openapi/components/schemas/config/nodes/test_rtt.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/uldaq.yaml b/doc/openapi/components/schemas/config/nodes/uldaq.yaml index d8e05a323..e6189b659 100644 --- a/doc/openapi/components/schemas/config/nodes/uldaq.yaml +++ b/doc/openapi/components/schemas/config/nodes/uldaq.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object required: diff --git a/doc/openapi/components/schemas/config/nodes/webrtc.yaml b/doc/openapi/components/schemas/config/nodes/webrtc.yaml index 1b2d94229..64c10373b 100644 --- a/doc/openapi/components/schemas/config/nodes/webrtc.yaml +++ b/doc/openapi/components/schemas/config/nodes/webrtc.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/websocket.yaml b/doc/openapi/components/schemas/config/nodes/websocket.yaml index 580684456..236b1559e 100644 --- a/doc/openapi/components/schemas/config/nodes/websocket.yaml +++ b/doc/openapi/components/schemas/config/nodes/websocket.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/nodes/zeromq.yaml b/doc/openapi/components/schemas/config/nodes/zeromq.yaml index 50701d8be..aafa81243 100644 --- a/doc/openapi/components/schemas/config/nodes/zeromq.yaml +++ b/doc/openapi/components/schemas/config/nodes/zeromq.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - allOf: - type: object properties: diff --git a/doc/openapi/components/schemas/config/path.yaml b/doc/openapi/components/schemas/config/path.yaml index 7b8c41ac3..5483c6c2e 100644 --- a/doc/openapi/components/schemas/config/path.yaml +++ b/doc/openapi/components/schemas/config/path.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object title: The first anyOf schema description: An explanation about the purpose of this instance. diff --git a/doc/openapi/components/schemas/config/signal.yaml b/doc/openapi/components/schemas/config/signal.yaml index ef026ee3f..72a67c8cd 100644 --- a/doc/openapi/components/schemas/config/signal.yaml +++ b/doc/openapi/components/schemas/config/signal.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - type: object properties: name: diff --git a/doc/openapi/components/schemas/config/signal_list.yaml b/doc/openapi/components/schemas/config/signal_list.yaml index 6e6c02b59..60c646239 100644 --- a/doc/openapi/components/schemas/config/signal_list.yaml +++ b/doc/openapi/components/schemas/config/signal_list.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: Signal list description: | Each node should define a list of signals which it receives. diff --git a/doc/openapi/components/schemas/formats/edgeflex.yaml b/doc/openapi/components/schemas/formats/edgeflex.yaml index 771ccd99a..58c283c01 100644 --- a/doc/openapi/components/schemas/formats/edgeflex.yaml +++ b/doc/openapi/components/schemas/formats/edgeflex.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: PMU measurements as used in the EdgeFlex project by Manuel description: | VILLASnode does not support deseralization (yet). diff --git a/doc/openapi/components/schemas/formats/igor.yaml b/doc/openapi/components/schemas/formats/igor.yaml index a4df356e8..12bd23a9d 100644 --- a/doc/openapi/components/schemas/formats/igor.yaml +++ b/doc/openapi/components/schemas/formats/igor.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: PMU format used by Igor example: diff --git a/doc/openapi/components/schemas/formats/sogno-old.yaml b/doc/openapi/components/schemas/formats/sogno-old.yaml index 249eb51d4..77ad74657 100644 --- a/doc/openapi/components/schemas/formats/sogno-old.yaml +++ b/doc/openapi/components/schemas/formats/sogno-old.yaml @@ -1,7 +1,8 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: Original PMU sensor data format as used in the SOGNO EU project type: object diff --git a/doc/openapi/components/schemas/formats/sogno.yaml b/doc/openapi/components/schemas/formats/sogno.yaml index 2543d41fc..e12862ba8 100644 --- a/doc/openapi/components/schemas/formats/sogno.yaml +++ b/doc/openapi/components/schemas/formats/sogno.yaml @@ -1,6 +1,7 @@ # yaml-language-server: $schema=http://json-schema.org/draft-07/schema +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- - title: PMU format used in SOGNO LF project example: diff --git a/doc/openapi/openapi.yaml b/doc/openapi/openapi.yaml index 5b277260b..f28d7edc3 100644 --- a/doc/openapi/openapi.yaml +++ b/doc/openapi/openapi.yaml @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 --- openapi: 3.0.3 diff --git a/doc/openapi/paths/README.md b/doc/openapi/paths/README.md deleted file mode 100644 index 04496597e..000000000 --- a/doc/openapi/paths/README.md +++ /dev/null @@ -1,105 +0,0 @@ -Paths -===== - -Organize your path definitions within this folder. You will reference your paths from your main `openapi.yaml` entrypoint file. - -It may help you to adopt some conventions: - -* path separator token (e.g. `@`) or subfolders -* path parameter (e.g. `{example}`) -* file-per-path or file-per-operation - -There are different benefits and drawbacks to each decision. - -You can adopt any organization you wish. We have some tips for organizing paths based on common practices. - -## Each path in a separate file - -Use a predefined "path separator" and keep all of your path files in the top level of the `paths` folder. - -``` -# todo: insert tree view of paths folder -``` - -Redocly recommends using the `@` character for this case. - -In addition, Redocly recommends placing path parameters within `{}` curly braces if you adopt this style. - -#### Motivations - -* Quickly see a list of all paths. Many people think in terms of the "number" of "endpoints" (paths), and not the "number" of "operations" (paths * http methods). - -* Only the "file-per-path" option is semantically correct with the OpenAPI Specification 3.0.2. However, Redocly's openapi-cli will build valid bundles for any of the other options too. - - -#### Drawbacks - -* This may require multiple definitions per http method within a single file. -* It requires settling on a path separator (that is allowed to be used in filenames) and sticking to that convention. - -## Each operation in a separate file - -You may also place each operation in a separate file. - -In this case, if you want all paths at the top-level, you can concatenate the http method to the path name. Similar to the above option, you can - -### Files at top-level of `paths` - -You may name your files with some concatenation for the http method. For example, following a convention such as: `-.yaml`. - -#### Motivations - -* Quickly see all operations without needing to navigate subfolders. - -#### Drawbacks - -* Adopting an unusual path separator convention, instead of using subfolders. - -### Use subfolders to mirror API path structure - -Example: -``` -GET /customers - -/paths/customers/get.yaml -``` - -In this case, the path id defined within subfolders which mirror the API URL structure. - -Example with path parameter: -``` -GET /customers/{id} - -/paths/customers/{id}/get.yaml -``` - -#### Motivations - -It matches the URL structure. - -It is pretty easy to reference: - -```yaml -paths: - '/customers/{id}': - get: - $ref: ./paths/customers/{id}/get.yaml - put: - $ref: ./paths/customers/{id}/put.yaml -``` - -#### Drawbacks - -If you have a lot of nested folders, it may be confusing to reference your schemas. - -Example -``` -file: /paths/customers/{id}/timeline/{messageId}/get.yaml - -# excerpt of file - headers: - Rate-Limit-Remaining: - $ref: ../../../../../components/headers/Rate-Limit-Remaining.yaml - -``` -Notice the `../../../../../` in the ref which requires some attention to formulate correctly. While openapi-cli has a linter which suggests possible refs when there is a mistake, this is still a net drawback for APIs with deep paths. diff --git a/doc/openapi/paths/capabilities.yaml b/doc/openapi/paths/capabilities.yaml index c2881bf21..d8b873e3c 100644 --- a/doc/openapi/paths/capabilities.yaml +++ b/doc/openapi/paths/capabilities.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-capabilities diff --git a/doc/openapi/paths/config.yaml b/doc/openapi/paths/config.yaml index 1b8e2f656..bc4a65b13 100644 --- a/doc/openapi/paths/config.yaml +++ b/doc/openapi/paths/config.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-config diff --git a/doc/openapi/paths/graph.{format}.yaml b/doc/openapi/paths/graph.{format}.yaml index e1ea2cf30..23e2b2b57 100644 --- a/doc/openapi/paths/graph.{format}.yaml +++ b/doc/openapi/paths/graph.{format}.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-graph diff --git a/doc/openapi/paths/node/node@{uuid-or-name}.yaml b/doc/openapi/paths/node/node@{uuid-or-name}.yaml index ccdea0f0e..ee8b5484d 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-node diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@file@rewind.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@file@rewind.yaml index 76cbaac7f..373c0cc83 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@file@rewind.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@file@rewind.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: rewind-file-node diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@file@seek.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@file@seek.yaml index 0fcd76250..77b329e13 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@file@seek.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@file@seek.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: seek-file-node diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@pause.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@pause.yaml index 0487b1702..6915f87a1 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@pause.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@pause.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: pause-graph diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@restart.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@restart.yaml index 175999261..320d8b4b5 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@restart.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@restart.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: restart-node diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@resume.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@resume.yaml index b0f2f0037..a53b819aa 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@resume.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@resume.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: resume-node diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@start.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@start.yaml index 38060a4d7..bf0a0182e 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@start.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@start.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: start-node summary: Start a node. diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@stats.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@stats.yaml index 97e805d82..daef64382 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@stats.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@stats.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-node-stats summary: Get the statistics of a node. diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@stats@reset.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@stats@reset.yaml index 50f38ccd9..8e279210f 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@stats@reset.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@stats@reset.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: reset-node-stats summary: Reset the statistics counters for a specific node. diff --git a/doc/openapi/paths/node/node@{uuid-or-name}@stop.yaml b/doc/openapi/paths/node/node@{uuid-or-name}@stop.yaml index 370e88534..e4182c664 100644 --- a/doc/openapi/paths/node/node@{uuid-or-name}@stop.yaml +++ b/doc/openapi/paths/node/node@{uuid-or-name}@stop.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: stop-node summary: Stop a node. diff --git a/doc/openapi/paths/nodes.yaml b/doc/openapi/paths/nodes.yaml index 521a0b4f5..e49dcf175 100644 --- a/doc/openapi/paths/nodes.yaml +++ b/doc/openapi/paths/nodes.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-nodes summary: Get a list of all configure node instances. diff --git a/doc/openapi/paths/path/path@{uuid}.yaml b/doc/openapi/paths/path/path@{uuid}.yaml index 6b13f6b3a..5c1792cac 100644 --- a/doc/openapi/paths/path/path@{uuid}.yaml +++ b/doc/openapi/paths/path/path@{uuid}.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: get-path summary: Get details of a single path. diff --git a/doc/openapi/paths/path/path@{uuid}@start.yaml b/doc/openapi/paths/path/path@{uuid}@start.yaml index 0807cc36c..0898e1104 100644 --- a/doc/openapi/paths/path/path@{uuid}@start.yaml +++ b/doc/openapi/paths/path/path@{uuid}@start.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: start-path summary: Start a path. diff --git a/doc/openapi/paths/path/path@{uuid}@stop.yaml b/doc/openapi/paths/path/path@{uuid}@stop.yaml index f63f5e059..8a4a7cb54 100644 --- a/doc/openapi/paths/path/path@{uuid}@stop.yaml +++ b/doc/openapi/paths/path/path@{uuid}@stop.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: stop-path summary: Start a path. diff --git a/doc/openapi/paths/paths.yaml b/doc/openapi/paths/paths.yaml index d73b612be..8bb80fe1d 100644 --- a/doc/openapi/paths/paths.yaml +++ b/doc/openapi/paths/paths.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-paths summary: Get a list of all paths. diff --git a/doc/openapi/paths/restart.yaml b/doc/openapi/paths/restart.yaml index 4da89adb3..fa4d892fd 100644 --- a/doc/openapi/paths/restart.yaml +++ b/doc/openapi/paths/restart.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: restart summary: Restart the VILLASnode instance. diff --git a/doc/openapi/paths/shutdown.yaml b/doc/openapi/paths/shutdown.yaml index da170e100..179721ffb 100644 --- a/doc/openapi/paths/shutdown.yaml +++ b/doc/openapi/paths/shutdown.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- post: operationId: shutdown summary: Shutdown the VILLASnode instance. diff --git a/doc/openapi/paths/status.yaml b/doc/openapi/paths/status.yaml index 6e431efce..65441c6a7 100644 --- a/doc/openapi/paths/status.yaml +++ b/doc/openapi/paths/status.yaml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- get: operationId: get-status summary: Get the current status of the VILLASnode instance. diff --git a/doc/theme/header.html b/doc/theme/header.html index 9ae595d6a..93e1cd4ab 100644 --- a/doc/theme/header.html +++ b/doc/theme/header.html @@ -1,4 +1,8 @@ - + diff --git a/doc/theme/layout.xml b/doc/theme/layout.xml index aead553c7..bc43e0556 100644 --- a/doc/theme/layout.xml +++ b/doc/theme/layout.xml @@ -1,3 +1,7 @@ + diff --git a/doc/theme/style.css b/doc/theme/style.css index 069249785..2f0e4d845 100644 --- a/doc/theme/style.css +++ b/doc/theme/style.css @@ -1,3 +1,8 @@ +/* +SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +SPDX-License-Identifier: Apache-2.0 +*/ + #projectname { font-size: 200%; } diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt index 38d9b6685..b4b9ca7f9 100644 --- a/etc/CMakeLists.txt +++ b/etc/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/etc/WSCC_9bus_MV.conf b/etc/WSCC_9bus_MV.conf index e88c1db7e..0eabebb42 100644 --- a/etc/WSCC_9bus_MV.conf +++ b/etc/WSCC_9bus_MV.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + logging = { level = "info" } diff --git a/etc/eric-lab.conf b/etc/eric-lab.conf index 64a812413..62eaa57b6 100644 --- a/etc/eric-lab.conf +++ b/etc/eric-lab.conf @@ -8,9 +8,9 @@ # A detailed description of the format can be found here: # http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files # -# Author: Steffen Vogel -# Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC -## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 name = "villas-acs" # The name of this VILLASnode. Might by used by node-types # to identify themselves (default is the hostname). @@ -24,7 +24,7 @@ http = { port = 80 # Port for HTTP connections } -############ Dictionary of nodes ############ +## Dictionary of nodes nodes = { ws = { @@ -63,7 +63,7 @@ nodes = { } } -############ List of paths ############ +## List of paths paths = ( { diff --git a/etc/examples/api.conf b/etc/examples/api.conf index 0596af7ef..144d660e4 100644 --- a/etc/examples/api.conf +++ b/etc/examples/api.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + http = { port = 8080 } diff --git a/etc/examples/example.conf b/etc/examples/example.conf index bb56b247d..945242b99 100644 --- a/etc/examples/example.conf +++ b/etc/examples/example.conf @@ -1,17 +1,16 @@ -/** Example configuration file for VILLASnode. - * - * This example includes all valid configuration options for the server. - * Please note, that using all options at the same time does not really - * makes sense. The purpose of this example is to serve as a reference. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# Example configuration file for VILLASnode. +# +# This example includes all valid configuration options for the server. +# Please note, that using all options at the same time does not really +# makes sense. The purpose of this example is to serve as a reference. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Some global settings are used by multiple configuration files # and therefore defined in separate files diff --git a/etc/examples/formats/csv.conf b/etc/examples/formats/csv.conf index 14b49e433..35f727b62 100644 --- a/etc/examples/formats/csv.conf +++ b/etc/examples/formats/csv.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/gtnet.conf b/etc/examples/formats/gtnet.conf index c2e9199cc..d7b661d65 100644 --- a/etc/examples/formats/gtnet.conf +++ b/etc/examples/formats/gtnet.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/iotagent_ul.conf b/etc/examples/formats/iotagent_ul.conf index 29a6769e2..e9af8373e 100644 --- a/etc/examples/formats/iotagent_ul.conf +++ b/etc/examples/formats/iotagent_ul.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/json-edgeflex.conf b/etc/examples/formats/json-edgeflex.conf index ebf71ba84..5c894286c 100644 --- a/etc/examples/formats/json-edgeflex.conf +++ b/etc/examples/formats/json-edgeflex.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/json-kafka.conf b/etc/examples/formats/json-kafka.conf index 207c95488..5a7b46341 100644 --- a/etc/examples/formats/json-kafka.conf +++ b/etc/examples/formats/json-kafka.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/json-reserve.conf b/etc/examples/formats/json-reserve.conf index d20441ba6..604d21caa 100644 --- a/etc/examples/formats/json-reserve.conf +++ b/etc/examples/formats/json-reserve.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/json.conf b/etc/examples/formats/json.conf index 00d5d47bc..0a57d9d6d 100644 --- a/etc/examples/formats/json.conf +++ b/etc/examples/formats/json.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/opal-asyncip.conf b/etc/examples/formats/opal-asyncip.conf index 98612e54c..9860ef48d 100644 --- a/etc/examples/formats/opal-asyncip.conf +++ b/etc/examples/formats/opal-asyncip.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "socket" diff --git a/etc/examples/formats/protobuf.conf b/etc/examples/formats/protobuf.conf index 46f688165..bb3ff56d3 100644 --- a/etc/examples/formats/protobuf.conf +++ b/etc/examples/formats/protobuf.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/raw.conf b/etc/examples/formats/raw.conf index 1da00032e..a86d13ceb 100644 --- a/etc/examples/formats/raw.conf +++ b/etc/examples/formats/raw.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/tsv.conf b/etc/examples/formats/tsv.conf index ed1bb1b88..0e6a64bea 100644 --- a/etc/examples/formats/tsv.conf +++ b/etc/examples/formats/tsv.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/value.conf b/etc/examples/formats/value.conf index f14bcfa41..a054c36e4 100644 --- a/etc/examples/formats/value.conf +++ b/etc/examples/formats/value.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/villas-binary.conf b/etc/examples/formats/villas-binary.conf index 055357e24..1346d3f32 100644 --- a/etc/examples/formats/villas-binary.conf +++ b/etc/examples/formats/villas-binary.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/villas-human.conf b/etc/examples/formats/villas-human.conf index 4c4bdce8e..b5f6fcfa9 100644 --- a/etc/examples/formats/villas-human.conf +++ b/etc/examples/formats/villas-human.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/formats/villas-web.conf b/etc/examples/formats/villas-web.conf index ee3ef865d..c2439e966 100644 --- a/etc/examples/formats/villas-web.conf +++ b/etc/examples/formats/villas-web.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { node = { type = "file" diff --git a/etc/examples/global.conf b/etc/examples/global.conf index c1bf60e63..e3b78ee27 100644 --- a/etc/examples/global.conf +++ b/etc/examples/global.conf @@ -1,15 +1,14 @@ -/** Global configuration file for VILLASnode. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# Global configuration file for VILLASnode. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 -############ Global Options ############ +## Global Options affinity = 0x01 # Mask of cores the server should run on # This also maps the NIC interrupts to those cores! diff --git a/etc/examples/hooks/average.conf b/etc/examples/hooks/average.conf index 5b8c94bef..9f03a7eb9 100644 --- a/etc/examples/hooks/average.conf +++ b/etc/examples/hooks/average.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/cast.conf b/etc/examples/hooks/cast.conf index e9602d3f3..2b45e9bcd 100644 --- a/etc/examples/hooks/cast.conf +++ b/etc/examples/hooks/cast.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/decimate.conf b/etc/examples/hooks/decimate.conf index 0ea5031d0..7555fa432 100644 --- a/etc/examples/hooks/decimate.conf +++ b/etc/examples/hooks/decimate.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/dp.conf b/etc/examples/hooks/dp.conf index a98b0acad..6f897fa4b 100644 --- a/etc/examples/hooks/dp.conf +++ b/etc/examples/hooks/dp.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/dump.conf b/etc/examples/hooks/dump.conf index a88f93c85..142eaf28c 100644 --- a/etc/examples/hooks/dump.conf +++ b/etc/examples/hooks/dump.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/ebm.conf b/etc/examples/hooks/ebm.conf index 61de4d024..58c47f3e0 100644 --- a/etc/examples/hooks/ebm.conf +++ b/etc/examples/hooks/ebm.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/gate.conf b/etc/examples/hooks/gate.conf index ac5467e8f..4cb8e848a 100644 --- a/etc/examples/hooks/gate.conf +++ b/etc/examples/hooks/gate.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/hook-nodes.conf b/etc/examples/hooks/hook-nodes.conf index 54b2bba70..2240af636 100644 --- a/etc/examples/hooks/hook-nodes.conf +++ b/etc/examples/hooks/hook-nodes.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + # This files just contains some simple nodes # which are used to demonstrate the functionalities # of different hooks diff --git a/etc/examples/hooks/ip-dft-pmu.conf b/etc/examples/hooks/ip-dft-pmu.conf index e7c4bb0d5..31de833c9 100644 --- a/etc/examples/hooks/ip-dft-pmu.conf +++ b/etc/examples/hooks/ip-dft-pmu.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/jitter_calc.conf b/etc/examples/hooks/jitter_calc.conf index 242451fc6..012633a18 100644 --- a/etc/examples/hooks/jitter_calc.conf +++ b/etc/examples/hooks/jitter_calc.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/limit_rate.conf b/etc/examples/hooks/limit_rate.conf index 97381ead2..162e24783 100644 --- a/etc/examples/hooks/limit_rate.conf +++ b/etc/examples/hooks/limit_rate.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/limit_value.conf b/etc/examples/hooks/limit_value.conf index 7120894bb..00848b04f 100644 --- a/etc/examples/hooks/limit_value.conf +++ b/etc/examples/hooks/limit_value.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/lua.conf b/etc/examples/hooks/lua.conf index 9e4f3a77e..49c48000b 100644 --- a/etc/examples/hooks/lua.conf +++ b/etc/examples/hooks/lua.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" stats = 1 diff --git a/etc/examples/hooks/ma.conf b/etc/examples/hooks/ma.conf index 962c85e81..8e8d2eeac 100644 --- a/etc/examples/hooks/ma.conf +++ b/etc/examples/hooks/ma.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/pmu.conf b/etc/examples/hooks/pmu.conf index ab36e9d2e..e49349ece 100644 --- a/etc/examples/hooks/pmu.conf +++ b/etc/examples/hooks/pmu.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/pmu_dft.conf b/etc/examples/hooks/pmu_dft.conf index dcc6d993f..878733238 100644 --- a/etc/examples/hooks/pmu_dft.conf +++ b/etc/examples/hooks/pmu_dft.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/power.conf b/etc/examples/hooks/power.conf index 34d7320d6..bb277b558 100644 --- a/etc/examples/hooks/power.conf +++ b/etc/examples/hooks/power.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/pps_ts.conf b/etc/examples/hooks/pps_ts.conf index f001a8931..ea9132d02 100644 --- a/etc/examples/hooks/pps_ts.conf +++ b/etc/examples/hooks/pps_ts.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/print.conf b/etc/examples/hooks/print.conf index c16b5a4a4..5ed4aba09 100644 --- a/etc/examples/hooks/print.conf +++ b/etc/examples/hooks/print.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/rms.conf b/etc/examples/hooks/rms.conf index 776372ef8..a57398004 100644 --- a/etc/examples/hooks/rms.conf +++ b/etc/examples/hooks/rms.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/round.conf b/etc/examples/hooks/round.conf index 269586c62..5f69b5b55 100644 --- a/etc/examples/hooks/round.conf +++ b/etc/examples/hooks/round.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/scale.conf b/etc/examples/hooks/scale.conf index 988a99b28..94d59c874 100644 --- a/etc/examples/hooks/scale.conf +++ b/etc/examples/hooks/scale.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/shift_seq.conf b/etc/examples/hooks/shift_seq.conf index cd9aeed26..c32e32ee4 100644 --- a/etc/examples/hooks/shift_seq.conf +++ b/etc/examples/hooks/shift_seq.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/shift_ts.conf b/etc/examples/hooks/shift_ts.conf index 90d47dad2..4c4448c91 100644 --- a/etc/examples/hooks/shift_ts.conf +++ b/etc/examples/hooks/shift_ts.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/skip_first.conf b/etc/examples/hooks/skip_first.conf index 01527656b..348b8328c 100644 --- a/etc/examples/hooks/skip_first.conf +++ b/etc/examples/hooks/skip_first.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/hooks/stats.conf b/etc/examples/hooks/stats.conf index fab47328a..1523343ef 100644 --- a/etc/examples/hooks/stats.conf +++ b/etc/examples/hooks/stats.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node = { type = "socket" diff --git a/etc/examples/hooks/ts.conf b/etc/examples/hooks/ts.conf index 204a39cfc..c25f9ca7e 100644 --- a/etc/examples/hooks/ts.conf +++ b/etc/examples/hooks/ts.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "hook-nodes.conf" paths = ( diff --git a/etc/examples/nodes/amqp.conf b/etc/examples/nodes/amqp.conf index d6f216c2d..1fa1133e5 100644 --- a/etc/examples/nodes/amqp.conf +++ b/etc/examples/nodes/amqp.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { amqp_node = { type = "amqp", diff --git a/etc/examples/nodes/api.conf b/etc/examples/nodes/api.conf index 02a0f783f..a72ab1a19 100644 --- a/etc/examples/nodes/api.conf +++ b/etc/examples/nodes/api.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { api_node = { type = "api" diff --git a/etc/examples/nodes/can.conf b/etc/examples/nodes/can.conf index 8dbcec6f1..582eecb21 100644 --- a/etc/examples/nodes/can.conf +++ b/etc/examples/nodes/can.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { can_node1 = { type = "can" diff --git a/etc/examples/nodes/comedi.conf b/etc/examples/nodes/comedi.conf index 962d17eec..9b4e563e0 100644 --- a/etc/examples/nodes/comedi.conf +++ b/etc/examples/nodes/comedi.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { pcie6259 = { type = "comedi", diff --git a/etc/examples/nodes/ethercat.conf b/etc/examples/nodes/ethercat.conf index a51ca0130..c60b4433a 100644 --- a/etc/examples/nodes/ethercat.conf +++ b/etc/examples/nodes/ethercat.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + ethercat = { coupler = { position = 0 diff --git a/etc/examples/nodes/example.conf b/etc/examples/nodes/example.conf index 763a3de1a..272e9e86f 100644 --- a/etc/examples/nodes/example.conf +++ b/etc/examples/nodes/example.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { example_node = { type = "example" diff --git a/etc/examples/nodes/exec.conf b/etc/examples/nodes/exec.conf index ff336f5bf..0c39377ad 100644 --- a/etc/examples/nodes/exec.conf +++ b/etc/examples/nodes/exec.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { exec_node = { type = "exec" diff --git a/etc/examples/nodes/file.conf b/etc/examples/nodes/file.conf index c2ce9219b..16ca5366b 100644 --- a/etc/examples/nodes/file.conf +++ b/etc/examples/nodes/file.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { file_node = { type = "file" diff --git a/etc/examples/nodes/fpga.conf b/etc/examples/nodes/fpga.conf index 5066d4d49..56a1e1ac3 100644 --- a/etc/examples/nodes/fpga.conf +++ b/etc/examples/nodes/fpga.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + logging = { level = "debug" } diff --git a/etc/examples/nodes/iec60870-5-104-sequence.conf b/etc/examples/nodes/iec60870-5-104-sequence.conf index 5037b3933..d10e1d057 100644 --- a/etc/examples/nodes/iec60870-5-104-sequence.conf +++ b/etc/examples/nodes/iec60870-5-104-sequence.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { iec104_node_seq = { type = "iec60870-5-104" diff --git a/etc/examples/nodes/iec60870-5-104.conf b/etc/examples/nodes/iec60870-5-104.conf index d47b2405a..f0711c899 100644 --- a/etc/examples/nodes/iec60870-5-104.conf +++ b/etc/examples/nodes/iec60870-5-104.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { iec104_node = { diff --git a/etc/examples/nodes/iec61850-8-1.conf b/etc/examples/nodes/iec61850-8-1.conf index 819e128ef..9b77ca4b8 100644 --- a/etc/examples/nodes/iec61850-8-1.conf +++ b/etc/examples/nodes/iec61850-8-1.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { goose = { diff --git a/etc/examples/nodes/iec61850-9-2.conf b/etc/examples/nodes/iec61850-9-2.conf index bac280062..9f316762f 100644 --- a/etc/examples/nodes/iec61850-9-2.conf +++ b/etc/examples/nodes/iec61850-9-2.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { sampled_values_node = { type = "iec61850-9-2", diff --git a/etc/examples/nodes/infiniband.conf b/etc/examples/nodes/infiniband.conf index 409b73e79..61a444083 100644 --- a/etc/examples/nodes/infiniband.conf +++ b/etc/examples/nodes/infiniband.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { results = { type = "file", diff --git a/etc/examples/nodes/influxdb.conf b/etc/examples/nodes/influxdb.conf index 78ab415ba..b4f0ed806 100644 --- a/etc/examples/nodes/influxdb.conf +++ b/etc/examples/nodes/influxdb.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { influxdb_node = { type = "influxdb", diff --git a/etc/examples/nodes/kafka.conf b/etc/examples/nodes/kafka.conf index c303e2692..7ca158fff 100644 --- a/etc/examples/nodes/kafka.conf +++ b/etc/examples/nodes/kafka.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { kafka_node = { type = "kafka", diff --git a/etc/examples/nodes/loopback.conf b/etc/examples/nodes/loopback.conf index 1ab457568..25870a3a9 100644 --- a/etc/examples/nodes/loopback.conf +++ b/etc/examples/nodes/loopback.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { loopback_node = { type = "loopback", # A loopback node will receive exactly the same data which has been sent to it. diff --git a/etc/examples/nodes/modbus.conf b/etc/examples/nodes/modbus.conf index c1b3952df..4f8bf3a96 100644 --- a/etc/examples/nodes/modbus.conf +++ b/etc/examples/nodes/modbus.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { modbus_node = { type = "modbus" diff --git a/etc/examples/nodes/mqtt.conf b/etc/examples/nodes/mqtt.conf index 0ead39152..14e9f6729 100644 --- a/etc/examples/nodes/mqtt.conf +++ b/etc/examples/nodes/mqtt.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { mqtt_node = { type = "mqtt", diff --git a/etc/examples/nodes/nanomsg.conf b/etc/examples/nodes/nanomsg.conf index f856e34d1..d270ed2b1 100644 --- a/etc/examples/nodes/nanomsg.conf +++ b/etc/examples/nodes/nanomsg.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { nanomsg_node = { type = "nanomsg", diff --git a/etc/examples/nodes/netem.conf b/etc/examples/nodes/netem.conf index 35290b314..7d8067020 100644 --- a/etc/examples/nodes/netem.conf +++ b/etc/examples/nodes/netem.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node = { # The dictionary is indexed by the name of the node. type = "socket", # For a list of available node-types run: 'villas-node -h' diff --git a/etc/examples/nodes/ngsi.conf b/etc/examples/nodes/ngsi.conf index 3d40a5efd..8b99fd29b 100644 --- a/etc/examples/nodes/ngsi.conf +++ b/etc/examples/nodes/ngsi.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { ngsi_node = { type = "ngsi", diff --git a/etc/examples/nodes/opal.conf b/etc/examples/nodes/opal.conf index 51e76187c..96d96c199 100644 --- a/etc/examples/nodes/opal.conf +++ b/etc/examples/nodes/opal.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { opal_node = { # The server can be started as an Asynchronous process type = "opal", # from within an OPAL-RT model. diff --git a/etc/examples/nodes/redis.conf b/etc/examples/nodes/redis.conf index dc0288ba3..3d2ad5317 100644 --- a/etc/examples/nodes/redis.conf +++ b/etc/examples/nodes/redis.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { redis_node = { type = "redis", diff --git a/etc/examples/nodes/rtp.conf b/etc/examples/nodes/rtp.conf index 99fcd27bf..e88889b8e 100644 --- a/etc/examples/nodes/rtp.conf +++ b/etc/examples/nodes/rtp.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { rtp_node = { type = "rtp" diff --git a/etc/examples/nodes/shmem.conf b/etc/examples/nodes/shmem.conf index 5484b7864..ad1e98ae3 100644 --- a/etc/examples/nodes/shmem.conf +++ b/etc/examples/nodes/shmem.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { shmem_node = { type = "shmem", diff --git a/etc/examples/nodes/signal-v2.conf b/etc/examples/nodes/signal-v2.conf index 77789dad2..03c89b50b 100644 --- a/etc/examples/nodes/signal-v2.conf +++ b/etc/examples/nodes/signal-v2.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { signal_node = { type = "signal.v2", diff --git a/etc/examples/nodes/signal.conf b/etc/examples/nodes/signal.conf index 318d7def4..b25fe9d59 100644 --- a/etc/examples/nodes/signal.conf +++ b/etc/examples/nodes/signal.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { signal_node = { type = "signal", diff --git a/etc/examples/nodes/socket.conf b/etc/examples/nodes/socket.conf index a165eabfa..68173f1ce 100644 --- a/etc/examples/nodes/socket.conf +++ b/etc/examples/nodes/socket.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node = { # The dictionary is indexed by the name of the node. type = "socket", # For a list of available node-types run: 'villas-node -h' diff --git a/etc/examples/nodes/stats.conf b/etc/examples/nodes/stats.conf index f9aeb6539..4ce7c5c59 100644 --- a/etc/examples/nodes/stats.conf +++ b/etc/examples/nodes/stats.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node = { type = "socket" diff --git a/etc/examples/nodes/temper.conf b/etc/examples/nodes/temper.conf index 0de395ac3..10c9b4447 100644 --- a/etc/examples/nodes/temper.conf +++ b/etc/examples/nodes/temper.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { temper_node = { type = "temper" diff --git a/etc/examples/nodes/test_rtt.conf b/etc/examples/nodes/test_rtt.conf index b4814d692..7c5006a98 100644 --- a/etc/examples/nodes/test_rtt.conf +++ b/etc/examples/nodes/test_rtt.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { rtt_node = { # The "test_rtt" node-type runs a set of test cases for varying type = "test_rtt", # sending rates, number of values and generates statistics. diff --git a/etc/examples/nodes/uldaq.conf b/etc/examples/nodes/uldaq.conf index 3990c7d09..bd9bc9c14 100644 --- a/etc/examples/nodes/uldaq.conf +++ b/etc/examples/nodes/uldaq.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + http = { enabled = false } diff --git a/etc/examples/nodes/unix_domain.conf b/etc/examples/nodes/unix_domain.conf index 2da239f5d..ee18dd86a 100644 --- a/etc/examples/nodes/unix_domain.conf +++ b/etc/examples/nodes/unix_domain.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { unix_domain_node = { type = "socket", diff --git a/etc/examples/nodes/webrtc.conf b/etc/examples/nodes/webrtc.conf index 441ed41a0..077067077 100644 --- a/etc/examples/nodes/webrtc.conf +++ b/etc/examples/nodes/webrtc.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { webrtc_node = { type = "webrtc", diff --git a/etc/examples/nodes/websocket.conf b/etc/examples/nodes/websocket.conf index 579588941..9cc84e964 100644 --- a/etc/examples/nodes/websocket.conf +++ b/etc/examples/nodes/websocket.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { ws = { type = "websocket" diff --git a/etc/examples/nodes/zeromq.conf b/etc/examples/nodes/zeromq.conf index 3351e33be..63674c035 100644 --- a/etc/examples/nodes/zeromq.conf +++ b/etc/examples/nodes/zeromq.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { zeromq_node = { type = "zeromq" diff --git a/etc/examples/paths.conf b/etc/examples/paths.conf index 98a9f7359..e4ea04b3a 100644 --- a/etc/examples/paths.conf +++ b/etc/examples/paths.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + paths = ( { enabled = true, # Enable this path (default: true) diff --git a/etc/examples/typhoon.conf b/etc/examples/typhoon.conf index 1b9da8b17..4b1484aa6 100644 --- a/etc/examples/typhoon.conf +++ b/etc/examples/typhoon.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + stats = 1.0 nodes = { diff --git a/etc/examples/villas-web.conf b/etc/examples/villas-web.conf index 7178ca24d..c5065f2f0 100644 --- a/etc/examples/villas-web.conf +++ b/etc/examples/villas-web.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { sine = { type = "signal" diff --git a/etc/gtnet-skt/emulate_gtnet.conf b/etc/gtnet-skt/emulate_gtnet.conf index c3b517c93..9e8b4921f 100644 --- a/etc/gtnet-skt/emulate_gtnet.conf +++ b/etc/gtnet-skt/emulate_gtnet.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +#* GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test1.conf b/etc/gtnet-skt/test1.conf index 9b670d54f..1b7a02a32 100644 --- a/etc/gtnet-skt/test1.conf +++ b/etc/gtnet-skt/test1.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test2.conf b/etc/gtnet-skt/test2.conf index 04a492ab1..a2495dc8a 100644 --- a/etc/gtnet-skt/test2.conf +++ b/etc/gtnet-skt/test2.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test3.conf b/etc/gtnet-skt/test3.conf index a99410a76..df37cbbdc 100644 --- a/etc/gtnet-skt/test3.conf +++ b/etc/gtnet-skt/test3.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test4.conf b/etc/gtnet-skt/test4.conf index 2261c9111..df2b9c711 100644 --- a/etc/gtnet-skt/test4.conf +++ b/etc/gtnet-skt/test4.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test5.conf b/etc/gtnet-skt/test5.conf index 3ec13249a..e2aae0ee1 100644 --- a/etc/gtnet-skt/test5.conf +++ b/etc/gtnet-skt/test5.conf @@ -1,13 +1,12 @@ -/** GTNET-SKT test configuration. - * - * The syntax of this file is similar to JSON. - * A detailed description of the format can be found here: - * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files - * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ +# GTNET-SKT test configuration. +# +# The syntax of this file is similar to JSON. +# A detailed description of the format can be found here: +# http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files +# +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/gtnet-skt/test6_gtsync_compare.conf b/etc/gtnet-skt/test6_gtsync_compare.conf index a9c72e708..7ef93e8d0 100644 --- a/etc/gtnet-skt/test6_gtsync_compare.conf +++ b/etc/gtnet-skt/test6_gtsync_compare.conf @@ -21,9 +21,9 @@ # # $ ./pipe etc/loopback.conf node2 # -# Author: Steffen Vogel -# Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC -## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 logging = { level = "debug" diff --git a/etc/js/config.js b/etc/js/config.js index 8efbf78e0..637cfad22 100644 --- a/etc/js/config.js +++ b/etc/js/config.js @@ -7,9 +7,9 @@ * * villas node <(node /etc/villas/node/js/config.js) * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ var glob = require('glob'); diff --git a/etc/js/global.js b/etc/js/global.js index ddfceb43d..3ea55f673 100644 --- a/etc/js/global.js +++ b/etc/js/global.js @@ -4,9 +4,9 @@ * A detailed description of the format can be found here: * http://www.hyperrealm.com/libconfig/libconfig_manual.html//Configuration-Files * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ os = require('os'); diff --git a/etc/labs/lab10_nodes.conf b/etc/labs/lab10_nodes.conf index 8e6446c65..b3a747eee 100644 --- a/etc/labs/lab10_nodes.conf +++ b/etc/labs/lab10_nodes.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + hugepages = 200 nodes = { diff --git a/etc/labs/lab10_path_bidir.conf b/etc/labs/lab10_path_bidir.conf index 9cc469bd5..6c629d02b 100644 --- a/etc/labs/lab10_path_bidir.conf +++ b/etc/labs/lab10_path_bidir.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "lab10_nodes.conf" paths = ( diff --git a/etc/labs/lab10_path_hook.conf b/etc/labs/lab10_path_hook.conf index ac3aac655..d67a69f14 100644 --- a/etc/labs/lab10_path_hook.conf +++ b/etc/labs/lab10_path_hook.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "lab10_nodes.conf" paths = ( diff --git a/etc/labs/lab10_path_multiple_destinations.conf b/etc/labs/lab10_path_multiple_destinations.conf index 9a0c585e3..56cf5267d 100644 --- a/etc/labs/lab10_path_multiple_destinations.conf +++ b/etc/labs/lab10_path_multiple_destinations.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "lab10_nodes.conf" paths = ( diff --git a/etc/labs/lab10_path_uni.conf b/etc/labs/lab10_path_uni.conf index db2b28756..e40b4c139 100644 --- a/etc/labs/lab10_path_uni.conf +++ b/etc/labs/lab10_path_uni.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + @include "lab10_nodes.conf" paths = ( diff --git a/etc/labs/lab11.conf b/etc/labs/lab11.conf index 11a02442a..3bf31a450 100644 --- a/etc/labs/lab11.conf +++ b/etc/labs/lab11.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { rtds_gtnet1 = { type = "socket" diff --git a/etc/labs/lab12.conf b/etc/labs/lab12.conf index de274541c..c4cee9a55 100644 --- a/etc/labs/lab12.conf +++ b/etc/labs/lab12.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node1 = { type = "socket", diff --git a/etc/labs/lab13.conf b/etc/labs/lab13.conf index d66045ce6..a1cd8876d 100644 --- a/etc/labs/lab13.conf +++ b/etc/labs/lab13.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + affinity = 0x8, nodes = { diff --git a/etc/labs/lab17.conf b/etc/labs/lab17.conf index 6a72fb2ac..d6d5d7045 100644 --- a/etc/labs/lab17.conf +++ b/etc/labs/lab17.conf @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 nodes = { rtds_ss1 = { diff --git a/etc/labs/lab18.conf b/etc/labs/lab18.conf new file mode 100644 index 000000000..e3e84cf90 --- /dev/null +++ b/etc/labs/lab18.conf @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +# docker run -v C:\Git\villas\node:/node -ti registry.git.rwth-aachen.de/acs/public/villas/node:master node /node/etc/labs/lab18.conf + +nodes = { + webrtc = { + type = "webrtc" + session = "KUCHEN" + server = "https://villas.k8s.eonerc.rwth-aachen.de/ws/signaling" + wait_seconds = 120 + in = { + hooks = ("stats") + } + } + + signal = { + type = "signal.v2" + rate = 0.2 + in = { + signals = { + signal = "mixed" + count = 5 + } + } + } +} + +paths = ( + { + in = "webrtc" + }, + { + in = "signal" + out = "webrtc" + } +) diff --git a/etc/labs/lab3.conf b/etc/labs/lab3.conf index a6fd04e3b..490ad8564 100644 --- a/etc/labs/lab3.conf +++ b/etc/labs/lab3.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node1 = { type = "socket", diff --git a/etc/labs/lab4.conf b/etc/labs/lab4.conf index b92cdb600..0dd83a32d 100644 --- a/etc/labs/lab4.conf +++ b/etc/labs/lab4.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node1 = { type = "socket", diff --git a/etc/labs/lab5.conf b/etc/labs/lab5.conf index 0c0d392db..3085dbe74 100644 --- a/etc/labs/lab5.conf +++ b/etc/labs/lab5.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { rtds_gtnet1 = { type = "socket", diff --git a/etc/labs/lab7.conf b/etc/labs/lab7.conf index 8cee37886..5217a31bb 100644 --- a/etc/labs/lab7.conf +++ b/etc/labs/lab7.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { file_node1 = { type = "file", diff --git a/etc/labs/lab8.conf b/etc/labs/lab8.conf index 7ed74da87..a4f12ab4e 100644 --- a/etc/labs/lab8.conf +++ b/etc/labs/lab8.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node1 = { type = "socket" diff --git a/etc/labs/lab9_netem.conf b/etc/labs/lab9_netem.conf index 54f69dd28..849a467bb 100644 --- a/etc/labs/lab9_netem.conf +++ b/etc/labs/lab9_netem.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { udp_node1 = { type = "socket", diff --git a/etc/loopback.conf b/etc/loopback.conf index 87f3b2704..11b1b5eb6 100644 --- a/etc/loopback.conf +++ b/etc/loopback.conf @@ -25,9 +25,9 @@ * A detailed description of the format can be found here: * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ nodes = { diff --git a/etc/python/example.py b/etc/python/example.py index bb725cbe4..0132ad884 100644 --- a/etc/python/example.py +++ b/etc/python/example.py @@ -8,9 +8,9 @@ villas node <(python3 etc/python/example.py) - @author Steffen Vogel - @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - @license Apache 2.0 + Author: Steffen Vogel + SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + SPDX-License-Identifier: Apache-2.0 ''' import json diff --git a/etc/shmem_mqtt.conf b/etc/shmem_mqtt.conf index 02060fc83..f73c928cb 100644 --- a/etc/shmem_mqtt.conf +++ b/etc/shmem_mqtt.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { sig = { type = "signal" diff --git a/etc/syslab-zmq.conf b/etc/syslab-zmq.conf index dc158bcad..fa22731c6 100644 --- a/etc/syslab-zmq.conf +++ b/etc/syslab-zmq.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { b2b = { type = "zeromq" diff --git a/etc/test.conf b/etc/test.conf index 1e174dc6e..3adca8344 100644 --- a/etc/test.conf +++ b/etc/test.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + nodes = { signal = { type = "signal" diff --git a/etc/tricks/nodes/node_sig1.conf b/etc/tricks/nodes/node_sig1.conf index f70d46872..a252fdf13 100644 --- a/etc/tricks/nodes/node_sig1.conf +++ b/etc/tricks/nodes/node_sig1.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + sig1 = { type = "signal" signal = "sine" diff --git a/etc/tricks/nodes/node_sig2.conf b/etc/tricks/nodes/node_sig2.conf index 03d155036..51880a1c1 100644 --- a/etc/tricks/nodes/node_sig2.conf +++ b/etc/tricks/nodes/node_sig2.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + sig2 = { type = "signal" signal = "sine" diff --git a/etc/tricks/tricks.conf b/etc/tricks/tricks.conf index 39a3ca4d5..b56dfe492 100644 --- a/etc/tricks/tricks.conf +++ b/etc/tricks/tricks.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + logging = { level = "${LEVEL}" } diff --git a/etc/websocket-client.conf b/etc/websocket-client.conf index 27dc4386f..4bb7cce9b 100644 --- a/etc/websocket-client.conf +++ b/etc/websocket-client.conf @@ -4,9 +4,9 @@ * A detailed description of the format can be found here: * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ nodes = { diff --git a/etc/websocket-demo.conf b/etc/websocket-demo.conf index ecc8372b0..114f954cd 100644 --- a/etc/websocket-demo.conf +++ b/etc/websocket-demo.conf @@ -4,9 +4,9 @@ * A detailed description of the format can be found here: * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ nodes = { @@ -64,7 +64,7 @@ nodes = { } } -############ List of paths ############ +## List of paths paths = ( { diff --git a/fpga b/fpga index 1cac3fafd..14b425fc9 160000 --- a/fpga +++ b/fpga @@ -1 +1 @@ -Subproject commit 1cac3fafde6ef3098a145f9d5d936a2dc6b7d7c0 +Subproject commit 14b425fc9893ef63527d6230c1ec87ab10366850 diff --git a/include/villas/api.hpp b/include/villas/api.hpp index fc8da99de..59622799f 100644 --- a/include/villas/api.hpp +++ b/include/villas/api.hpp @@ -1,10 +1,9 @@ -/** REST-API-releated functions. +/* REST-API-releated functions. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -28,7 +27,7 @@ namespace api { const int version = 2; -/* Forward declarations */ +// Forward declarations class Session; class Response; class Request; @@ -75,7 +74,7 @@ public: } // namespace api -/* Forward declarations */ +// Forward declarations class SuperNode; class Api { @@ -86,7 +85,7 @@ protected: enum State state; std::thread thread; - std::atomic running; /**< Atomic flag for signalizing thread termination. */ + std::atomic running; // Atomic flag for signalizing thread termination. SuperNode *super_node; @@ -94,7 +93,7 @@ protected: void worker(); public: - /** Initialize the API. + /* Initialize the API. * * Save references to list of paths / nodes for command execution. */ @@ -109,8 +108,8 @@ public: return super_node; } - std::list sessions; /**< List of currently active connections */ - villas::QueueSignalled pending; /**< A queue of api_sessions which have pending requests. */ + std::list sessions; // List of currently active connections + villas::QueueSignalled pending; // A queue of api_sessions which have pending requests. }; } // namespace node diff --git a/include/villas/api/request.hpp b/include/villas/api/request.hpp index 5f3b3b29a..45fcb0d5e 100644 --- a/include/villas/api/request.hpp +++ b/include/villas/api/request.hpp @@ -1,10 +1,9 @@ -/** API Request. +/* API Request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -24,7 +23,7 @@ namespace villas { namespace node { namespace api { -/* Forward declarations */ +// Forward declarations class Session; class Response; class RequestFactory; @@ -148,8 +147,8 @@ public: regex(re) { } - virtual Request * - make(Session *s) + virtual + Request * make(Session *s) { auto *r = new T(s); @@ -159,21 +158,21 @@ public: } // Get plugin name - virtual std::string - getName() const + virtual + std::string getName() const { return name; } // Get plugin description - virtual std::string - getDescription() const + virtual + std::string getDescription() const { return desc; } - virtual bool - match(const std::string &uri, std::smatch &match) const + virtual + bool match(const std::string &uri, std::smatch &match) const { return std::regex_match(uri, match, regex); } diff --git a/include/villas/api/requests/node.hpp b/include/villas/api/requests/node.hpp index e8672f770..dda48a628 100644 --- a/include/villas/api/requests/node.hpp +++ b/include/villas/api/requests/node.hpp @@ -1,10 +1,9 @@ -/** API Request for nodes. +/* API Request for nodes. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -13,7 +12,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; namespace api { @@ -26,8 +25,8 @@ protected: public: using Request::Request; - virtual void - prepare(); + virtual + void prepare(); }; } // namespace api diff --git a/include/villas/api/requests/path.hpp b/include/villas/api/requests/path.hpp index 9868cd0ce..260aaf385 100644 --- a/include/villas/api/requests/path.hpp +++ b/include/villas/api/requests/path.hpp @@ -1,17 +1,16 @@ -/** API Request for paths. +/* API Request for paths. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Path; namespace api { @@ -24,8 +23,8 @@ protected: public: using Request::Request; - virtual void - prepare(); + virtual + void prepare(); }; } // namespace api diff --git a/include/villas/api/requests/universal.hpp b/include/villas/api/requests/universal.hpp index cc12d2ba6..c5772c6a6 100644 --- a/include/villas/api/requests/universal.hpp +++ b/include/villas/api/requests/universal.hpp @@ -1,10 +1,9 @@ -/** Universal Data-exchange API request. +/* Universal Data-exchange API request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,7 +13,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; namespace api { @@ -27,8 +26,8 @@ protected: public: using NodeRequest::NodeRequest; - virtual void - prepare(); + virtual + void prepare(); }; } // namespace api diff --git a/include/villas/api/response.hpp b/include/villas/api/response.hpp index 79afd3be9..ebf1286ef 100644 --- a/include/villas/api/response.hpp +++ b/include/villas/api/response.hpp @@ -1,10 +1,9 @@ -/** API response. +/* API response. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,7 +21,7 @@ namespace villas { namespace node { namespace api { -/* Forward declarations */ +// Forward declarations class Session; class Request; @@ -37,8 +36,8 @@ public: ~Response() { } - virtual void - encodeBody() + virtual + void encodeBody() { } int @@ -74,10 +73,11 @@ public: response(r) { } - virtual ~JsonResponse(); + virtual + ~JsonResponse(); - virtual void - encodeBody(); + virtual + void encodeBody(); }; class ErrorResponse : public JsonResponse { diff --git a/include/villas/api/session.hpp b/include/villas/api/session.hpp index b62ec896c..901d727a1 100644 --- a/include/villas/api/session.hpp +++ b/include/villas/api/session.hpp @@ -1,10 +1,9 @@ -/** API session. +/* API session. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,25 +16,25 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class SuperNode; class Api; class Web; namespace api { -/* Forward declarations */ +// Forward declarations class Request; class Response; class StatusRequest; class RequestFactory; -/** A connection via HTTP REST or WebSockets to issue API requests. */ +// A connection via HTTP REST or WebSockets to issue API requests. class Session { public: - friend Request; /**< Requires access to wsi for getting URL args and headers */ - friend StatusRequest; /**< Requires access to wsi for context status */ + friend Request; // Requires access to wsi for getting URL args and headers + friend StatusRequest; // Requires access to wsi for context status friend RequestFactory; enum State { @@ -93,13 +92,13 @@ public: void execute(); void shutdown(); - static int - protocolCallback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); + static + int protocolCallback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); Method getRequestMethod() const; - static std::string - methodToString(Method meth); + static + std::string methodToString(Method meth); }; } // namespace api diff --git a/include/villas/api/universal.hpp b/include/villas/api/universal.hpp index fb13678ed..d27e5509d 100644 --- a/include/villas/api/universal.hpp +++ b/include/villas/api/universal.hpp @@ -1,11 +1,10 @@ -/** Universal Data-exchange API request. +/* Universal Data-exchange API request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/capabilities.hpp b/include/villas/capabilities.hpp index 195f3c5f3..f4ec72099 100644 --- a/include/villas/capabilities.hpp +++ b/include/villas/capabilities.hpp @@ -1,9 +1,9 @@ -/** Capabilities +/* Capabilities * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,4 +15,4 @@ namespace node { json_t * getCapabilities(); } // namespace node -} /* namepace vilals */ +} // namepace vilals diff --git a/include/villas/config_class.hpp b/include/villas/config_class.hpp index f49563655..68dbf6445 100644 --- a/include/villas/config_class.hpp +++ b/include/villas/config_class.hpp @@ -1,10 +1,9 @@ -/** Configuration file parsing. +/* Configuration file parsing. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -34,44 +33,46 @@ protected: std::list includeDirectories; - /** Check if file exists on local system. */ - static bool isLocalFile(const std::string &uri) + // Check if file exists on local system. + static + bool isLocalFile(const std::string &uri) { return access(uri.c_str(), F_OK) != -1; } - /** Decode configuration file. */ + // Decode configuration file. json_t * decode(FILE *f); #ifdef WITH_CONFIG - /** Convert libconfig .conf file to libjansson .json file. */ + // Convert libconfig .conf file to libjansson .json file. json_t * libconfigDecode(FILE *f); - static const char ** includeFuncStub(config_t *cfg, const char *include_dir, const char *path, const char **error); + static + const char ** includeFuncStub(config_t *cfg, const char *include_dir, const char *path, const char **error); const char ** includeFunc(config_t *cfg, const char *include_dir, const char *path, const char **error); -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG - /** Load configuration from standard input (stdim). */ + // Load configuration from standard input (stdim). FILE * loadFromStdio(); - /** Load configuration from local file. */ + // Load configuration from local file. FILE * loadFromLocalFile(const std::string &u); std::list resolveIncludes(const std::string &name); void resolveEnvVars(std::string &text); - /** Resolve custom include directives. */ + // Resolve custom include directives. json_t * expandIncludes(json_t *in); - /** To shell-like subsitution of environment variables in strings. */ + // To shell-like subsitution of environment variables in strings. json_t * expandEnvVars(json_t *in); - /** Run a callback function for each string in the config */ + // Run a callback function for each string in the config json_t * walkStrings(json_t *in, str_walk_fcn_t cb); - /** Get the include dirs */ + // Get the include dirs std::list getIncludeDirectories(FILE *f) const; public: diff --git a/include/villas/config_helper.hpp b/include/villas/config_helper.hpp index ae66b2811..6a1ea189c 100644 --- a/include/villas/config_helper.hpp +++ b/include/villas/config_helper.hpp @@ -1,9 +1,9 @@ -/** Helpers for configuration parsers. +/* Helpers for configuration parsers. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,13 +21,13 @@ namespace node { #ifdef WITH_CONFIG -/** Convert a libconfig object to a jansson object */ +// Convert a libconfig object to a jansson object json_t * config_to_json(struct config_setting_t *cfg); -/** Convert a jansson object into a libconfig object. */ +// Convert a jansson object into a libconfig object. int json_to_config(json_t *json, struct config_setting_t *parent); -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG int json_object_extend_str(json_t *orig, const char *str); @@ -35,7 +35,7 @@ void json_object_extend_key_value(json_t *obj, const char *key, const char *valu void json_object_extend_key_value_token(json_t *obj, const char *key, const char *value); -/** Merge two JSON objects recursively. */ +// Merge two JSON objects recursively. int json_object_extend(json_t *orig, json_t *merge); json_t * json_load_cli(int argc, const char *argv[]); diff --git a/include/villas/dumper.hpp b/include/villas/dumper.hpp index 762814230..9eb34fea0 100644 --- a/include/villas/dumper.hpp +++ b/include/villas/dumper.hpp @@ -1,10 +1,9 @@ -/** Dump fields and values in a socket to plot them with villasDump.py. +/* Dump fields and values in a socket to plot them with villasDump.py. * - * @file - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/format.hpp b/include/villas/format.hpp index 8cafd277b..4d570a8e7 100644 --- a/include/villas/format.hpp +++ b/include/villas/format.hpp @@ -1,10 +1,9 @@ -/** Read / write sample data in different formats. +/* Read / write sample data in different formats. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,21 +17,20 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class FormatFactory; class Format { friend FormatFactory; - public: using Ptr = std::unique_ptr; protected: - int flags; /**< A set of flags which is automatically used. */ - int real_precision; /**< Number of digits used for floatint point numbers */ + int flags; // A set of flags which is automatically used. + int real_precision; // Number of digits used for floatint point numbers Logger logger; @@ -41,7 +39,7 @@ protected: size_t buflen; } in, out; - SignalList::Ptr signals; /**< Signal meta data for parsed samples by Format::scan() */ + SignalList::Ptr signals; // Signal meta data for parsed samples by Format::scan() public: Format(int fl); @@ -75,7 +73,7 @@ public: virtual int scan(FILE *f, struct Sample * const smps[], unsigned cnt); - /** Print \p cnt samples from \p smps into buffer \p buf of length \p len. + /* Print \p cnt samples from \p smps into buffer \p buf of length \p len. * * @param buf[out] The buffer which should be filled with serialized data. * @param len[in] The length of the buffer \p buf. @@ -89,7 +87,7 @@ public: virtual int sprint(char *buf, size_t len, size_t *wbytes, const struct Sample * const smps[], unsigned cnt) = 0; - /** Parse samples from the buffer \p buf with a length of \p len bytes. + /* Parse samples from the buffer \p buf with a length of \p len bytes. * * @param buf[in] The buffer of data which should be parsed / de-serialized. * @param len[in] The length of the buffer \p buf. @@ -103,7 +101,7 @@ public: virtual int sscan(const char *buf, size_t len, size_t *rbytes, struct Sample * const smps[], unsigned cnt) = 0; - /* Wrappers for sending a (un)parsing single samples */ + // Wrappers for sending a (un)parsing single samples int print(FILE *f, const struct Sample *smp) { @@ -171,7 +169,8 @@ class FormatPlugin : public FormatFactory { public: using FormatFactory::FormatFactory; - virtual Format * make() + virtual + Format * make() { auto *f = new T(flags); diff --git a/include/villas/formats/column.hpp b/include/villas/formats/column.hpp index 5449a5d16..528b68091 100644 --- a/include/villas/formats/column.hpp +++ b/include/villas/formats/column.hpp @@ -1,10 +1,9 @@ -/** Comma-separated values. +/* Comma-separated values. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,16 +14,18 @@ namespace villas { namespace node { -/* Forward declarations. */ +// Forward declarations struct Sample; class ColumnLineFormat : public LineFormat { protected: - virtual size_t sprintLine(char *buf, size_t len, const struct Sample *smp); - virtual size_t sscanLine(const char *buf, size_t len, struct Sample *smp); + virtual + size_t sprintLine(char *buf, size_t len, const struct Sample *smp); + virtual + size_t sscanLine(const char *buf, size_t len, struct Sample *smp); - char separator; /**< Column separator */ + char separator; // Column separator public: ColumnLineFormat(int fl, char delim, char sep) : diff --git a/include/villas/formats/iotagent_ul.hpp b/include/villas/formats/iotagent_ul.hpp index 547ff40f3..d7ec53fc1 100644 --- a/include/villas/formats/iotagent_ul.hpp +++ b/include/villas/formats/iotagent_ul.hpp @@ -1,9 +1,9 @@ -/** UltraLight format for FISMEP project. +/* UltraLight format for FISMEP project. * - * @author Iris Koester - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Iris Koester + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -12,7 +12,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class IotAgentUltraLightFormat : public Format { diff --git a/include/villas/formats/json.hpp b/include/villas/formats/json.hpp index 40cbb9e56..234ffb47e 100644 --- a/include/villas/formats/json.hpp +++ b/include/villas/formats/json.hpp @@ -1,9 +1,9 @@ -/** JSON serializtion sample data. +/* JSON serializtion sample data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,13 +14,14 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class JsonFormat : public Format { protected: - static enum SignalType detect(const json_t *val); + static + enum SignalType detect(const json_t *val); json_t * packTimestamps(const struct Sample *smp); int unpackTimestamps(json_t *json_ts, struct Sample *smp); diff --git a/include/villas/formats/json_edgeflex.hpp b/include/villas/formats/json_edgeflex.hpp index 8a22c714d..05c897ecb 100644 --- a/include/villas/formats/json_edgeflex.hpp +++ b/include/villas/formats/json_edgeflex.hpp @@ -1,9 +1,9 @@ -/** JSON serializtion for edgeFlex project. +/* JSON serializtion for edgeFlex project. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/formats/json_kafka.hpp b/include/villas/formats/json_kafka.hpp index 236388465..492b4da6b 100644 --- a/include/villas/formats/json_kafka.hpp +++ b/include/villas/formats/json_kafka.hpp @@ -1,9 +1,9 @@ -/** JSON serializtion for Kafka schema/payloads. +/* JSON serializtion for Kafka schema/payloads. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/formats/json_reserve.hpp b/include/villas/formats/json_reserve.hpp index 7800a0419..f90ee2feb 100644 --- a/include/villas/formats/json_reserve.hpp +++ b/include/villas/formats/json_reserve.hpp @@ -1,9 +1,9 @@ -/** JSON serializtion for RESERVE project. +/* JSON serializtion for RESERVE project. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/formats/line.hpp b/include/villas/formats/line.hpp index 54a4df2f1..9f8004752 100644 --- a/include/villas/formats/line.hpp +++ b/include/villas/formats/line.hpp @@ -1,10 +1,9 @@ -/** Line-based formats +/* Line-based formats * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -16,14 +15,16 @@ namespace node { class LineFormat : public Format { protected: - virtual size_t sprintLine(char *buf, size_t len, const struct Sample *smp) = 0; - virtual size_t sscanLine(const char *buf, size_t len, struct Sample *smp) = 0; + virtual + size_t sprintLine(char *buf, size_t len, const struct Sample *smp) = 0; + virtual + size_t sscanLine(const char *buf, size_t len, struct Sample *smp) = 0; - char delimiter; /**< Newline delimiter. */ - char comment; /**< Prefix for comment lines. */ + char delimiter; // Newline delimiter. + char comment; // Prefix for comment lines. - bool skip_first_line; /**< While reading, the first line is skipped (header) */ - bool print_header; /**< Before any data, a header line is printed */ + bool skip_first_line; // While reading, the first line is skipped (header) + bool print_header; // Before any data, a header line is printed bool first_line_skipped; bool header_printed; @@ -39,7 +40,7 @@ public: header_printed(false) { } - /** Print a header. */ + // Print a header virtual void header(FILE *f, const SignalList::Ptr sigs) { diff --git a/include/villas/formats/msg.hpp b/include/villas/formats/msg.hpp index dc9c6e795..0dac505aa 100644 --- a/include/villas/formats/msg.hpp +++ b/include/villas/formats/msg.hpp @@ -1,9 +1,9 @@ -/** Message related functions. +/* Message related functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -11,28 +11,28 @@ namespace villas { -/* Forward declarataions */ +// Forward declarataions struct List; namespace node { -/* Forward declaration */ +// Forward declarations struct Message; struct Sample; -/** Convert msg from network to host byteorder */ +// Convert msg from network to host byteorder void msg_ntoh(struct Message *m); -/** Convert msg from host to network byteorder */ +// Convert msg from host to network byteorder void msg_hton(struct Message *m); -/** Convert msg header from network to host byteorder */ +// Convert msg header from network to host byteorder void msg_hdr_hton(struct Message *m); -/** Convert msg header from host to network byteorder */ +// Convert msg header from host to network byteorder void msg_hdr_ntoh(struct Message *m); -/** Check the consistency of a message. +/* Check the consistency of a message. * * The functions checks the header fields of a message. * @@ -42,10 +42,10 @@ void msg_hdr_ntoh(struct Message *m); */ int msg_verify(const struct Message *m); -/** Copy fields from \p msg into \p smp. */ +// Copy fields from \p msg into \p smp. int msg_to_sample(const struct Message *msg, struct Sample *smp, const SignalList::Ptr sigs, uint8_t *source_index); -/** Copy fields form \p smp into \p msg. */ +// Copy fields form \p smp into \p msg. int msg_from_sample(struct Message *msg, const struct Sample *smp, const SignalList::Ptr sigs, uint8_t source_index); } // namespace node diff --git a/include/villas/formats/msg_format.hpp b/include/villas/formats/msg_format.hpp index 64ed1e4b1..7f1982495 100644 --- a/include/villas/formats/msg_format.hpp +++ b/include/villas/formats/msg_format.hpp @@ -1,33 +1,32 @@ -/** Message format +/* Message format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include -/** The current version number for the message format */ +// The current version number for the message format #define MSG_VERSION 2 -/** @todo Implement more message types */ -#define MSG_TYPE_DATA 0 /**< Message contains float / integer values */ -#define MSG_TYPE_START 1 /**< Message marks the beginning of a new simulation case */ -#define MSG_TYPE_STOP 2 /**< Message marks the end of a simulation case */ +// @todo Implement more message types +#define MSG_TYPE_DATA 0 // Message contains float / integer values +#define MSG_TYPE_START 1 // Message marks the beginning of a new simulation case +#define MSG_TYPE_STOP 2 // Message marks the end of a simulation case -/** The total size in bytes of a message */ +// The total size in bytes of a message #define MSG_LEN(values) (sizeof(struct Message) + MSG_DATA_LEN(values)) -/** The length of \p values values in bytes. */ +// The length of \p values values in bytes. #define MSG_DATA_LEN(values) (sizeof(float) * (values)) -/** The offset to the first data value in a message. */ +// The offset to the first data value in a message. #define MSG_DATA_OFFSET(msg) ((char *) (msg) + offsetof(struct Message, data)) -/** The timestamp of a message in struct timespec format */ +// The timestamp of a message in struct timespec format #define MSG_TS(msg, i) \ i.tv_sec = (msg)->ts.sec; \ i.tv_nsec = (msg)->ts.nsec; @@ -35,38 +34,38 @@ namespace villas { namespace node { -/** This message format is used by all clients +/* This message format is used by all clients * * @diafile msg_format.dia - **/ + */ struct Message { #if BYTE_ORDER == BIG_ENDIAN - unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */ - unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */ - unsigned reserved1 : 2; /**< Reserved bits */ + unsigned version: 4; // Specifies the format of the remaining message (see MGS_VERSION) + unsigned type : 2; // Data or control message (see MSG_TYPE_*) + unsigned reserved1 : 2; // Reserved bits #elif BYTE_ORDER == LITTLE_ENDIAN - unsigned reserved1 : 2; /**< Reserved bits */ - unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */ - unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */ + unsigned reserved1 : 2; // Reserved bits + unsigned type : 2; // Data or control message (see MSG_TYPE_*) + unsigned version: 4; // Specifies the format of the remaining message (see MGS_VERSION) #else #error Invalid byte-order #endif - uint8_t source_index; /**< An id which identifies the source of this sample. */ - uint16_t length; /**< The number of values in msg::data[]. */ - uint32_t sequence; /**< The sequence number is incremented by one for consecutive messages. */ + uint8_t source_index; // An id which identifies the source of this sample. + uint16_t length; // The number of values in msg::data[]. + uint32_t sequence; // The sequence number is incremented by one for consecutive messages. - /** A timestamp per message. */ + // A timestamp per message. struct { - uint32_t sec; /**< Seconds since 1970-01-01 00:00:00 */ - uint32_t nsec; /**< Nanoseconds of the current second. */ + uint32_t sec; // Seconds since 1970-01-01 00:00:00 + uint32_t nsec; // Nanoseconds of the current second } ts; - /** The message payload. */ + // The message payload. union { - float f; /**< Floating point values. */ - uint32_t i; /**< Integer values. */ + float f; // Floating point values + uint32_t i; // Integer values } data[]; } __attribute__((packed)); diff --git a/include/villas/formats/opal_asyncip.hpp b/include/villas/formats/opal_asyncip.hpp index d74593923..20cc5aa83 100644 --- a/include/villas/formats/opal_asyncip.hpp +++ b/include/villas/formats/opal_asyncip.hpp @@ -1,10 +1,9 @@ -/** A custom format for OPAL-RTs AsyncIP example +/* A custom format for OPAL-RTs AsyncIP example * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations. */ +// Forward declarations struct Sample; class OpalAsyncIPFormat : public BinaryFormat { @@ -47,7 +46,6 @@ public: void parse(json_t *json); }; - class OpalAsyncIPFormatPlugin : public FormatFactory { public: diff --git a/include/villas/formats/protobuf.hpp b/include/villas/formats/protobuf.hpp index cac4f68c9..be5fa5c06 100644 --- a/include/villas/formats/protobuf.hpp +++ b/include/villas/formats/protobuf.hpp @@ -1,10 +1,9 @@ -/** Protobuf IO format +/* Protobuf IO format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -12,13 +11,13 @@ #include -/* Generated message descriptors by protoc */ +// Generated message descriptors by protoc #include namespace villas { namespace node { -/* Forward declarations. */ +// Forward declarations struct Sample; class ProtobufFormat : public BinaryFormat { diff --git a/include/villas/formats/raw.hpp b/include/villas/formats/raw.hpp index c4e0201c0..49ae10b36 100644 --- a/include/villas/formats/raw.hpp +++ b/include/villas/formats/raw.hpp @@ -1,10 +1,9 @@ -/** RAW IO format +/* RAW IO format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -13,7 +12,7 @@ #include -/* float128 is currently not yet supported as htole128() functions a missing */ +// float128 is currently not yet supported as htole128() functions a missing #if 0 && defined(__GNUC__) && defined(__linux__) #define HAS_128BIT #endif @@ -21,7 +20,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class RawFormat : public BinaryFormat { diff --git a/include/villas/formats/value.hpp b/include/villas/formats/value.hpp index 4cc1e902a..66db86098 100644 --- a/include/villas/formats/value.hpp +++ b/include/villas/formats/value.hpp @@ -1,10 +1,9 @@ -/** The VILLASframework sample format +/* The VILLASframework sample format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/formats/villas_binary.hpp b/include/villas/formats/villas_binary.hpp index 520e1a84b..916bba8d8 100644 --- a/include/villas/formats/villas_binary.hpp +++ b/include/villas/formats/villas_binary.hpp @@ -1,10 +1,9 @@ -/** Message related functions +/* Message related functions * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations. */ +// Forward declarations struct Sample; class VillasBinaryFormat : public BinaryFormat { @@ -42,7 +41,6 @@ public: void parse(json_t *json); }; - template class VillasBinaryFormatPlugin : public FormatFactory { diff --git a/include/villas/formats/villas_human.hpp b/include/villas/formats/villas_human.hpp index bf99a6475..257b14a8f 100644 --- a/include/villas/formats/villas_human.hpp +++ b/include/villas/formats/villas_human.hpp @@ -1,10 +1,9 @@ -/** The VILLASframework sample format +/* The VILLASframework sample format * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/hook.hpp b/include/villas/hook.hpp index 3624b3d20..94143f9eb 100644 --- a/include/villas/hook.hpp +++ b/include/villas/hook.hpp @@ -1,14 +1,13 @@ -/** Hook functions +/* Hook functions * * Every node or path can register hook functions which is called for every * processed sample. This can be used to debug the data flow, get statistics * or alter the sample contents. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,7 +21,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class Path; struct Sample; @@ -36,10 +35,10 @@ public: using Ptr = std::shared_ptr; enum class Flags { - BUILTIN = (1 << 0), /**< Should we add this hook by default to every path?. */ - PATH = (1 << 1), /**< This hook type is used by paths. */ - NODE_READ = (1 << 2), /**< This hook type is used by nodes. */ - NODE_WRITE = (1 << 3) /**< This hook type is used by nodes. */ + BUILTIN = (1 << 0), // Should we add this hook by default to every path?. + PATH = (1 << 1), // This hook type is used by paths. + NODE_READ = (1 << 2), // This hook type is used by nodes. + NODE_WRITE = (1 << 3) // This hook type is used by nodes. }; enum class Reason { @@ -57,15 +56,15 @@ protected: enum State state; int flags; - unsigned priority; /**< A priority to change the order of execution within one type of hook. */ - bool enabled; /**< Is this hook active? */ + unsigned priority; // A priority to change the order of execution within one type of hook. + bool enabled; // Is this hook active? Path *path; Node *node; SignalList::Ptr signals; - json_t *config; /**< A JSON object containing the configuration of the hook. */ + json_t *config; // A JSON object containing the configuration of the hook. public: Hook(Path *p, Node *n, int fl, int prio, bool en = true); @@ -84,7 +83,7 @@ public: return logger; } - /** Called whenever a hook is started; before threads are created. */ + // Called whenever a hook is started; before threads are created. virtual void start() { @@ -93,7 +92,7 @@ public: state = State::STARTED; } - /** Called whenever a hook is stopped; after threads are destoyed. */ + // Called whenever a hook is stopped; after threads are destoyed. virtual void stop() { @@ -118,21 +117,21 @@ public: state = State::PREPARED; } - /** Called periodically. Period is set by global 'stats' option in the configuration file. */ + // Called periodically. Period is set by global 'stats' option in the configuration file. virtual void periodic() { assert(state == State::STARTED); } - /** Called whenever a new simulation case is started. This is detected by a sequence no equal to zero. */ + // Called whenever a new simulation case is started. This is detected by a sequence no equal to zero. virtual void restart() { assert(state == State::STARTED); } - /** Called whenever a sample is processed. */ + // Called whenever a sample is processed. virtual Reason process(struct Sample *smp) { @@ -215,9 +214,11 @@ public: using Ptr = std::shared_ptr; using Hook::Hook; - virtual void setRate(double rate, double maxRate = -1) = 0; + virtual + void setRate(double rate, double maxRate = -1) = 0; - virtual void parse() + virtual + void parse() { assert(state == State::INITIALIZED); @@ -246,7 +247,8 @@ protected: public: using plugin::Plugin::Plugin; - virtual Hook::Ptr make(Path *p, Node *n) = 0; + virtual + Hook::Ptr make(Path *p, Node *n) = 0; virtual int getFlags() const = 0; @@ -273,7 +275,8 @@ class HookPlugin : public HookFactory { public: using HookFactory::HookFactory; - virtual Hook::Ptr make(Path *p, Node *n) + virtual + Hook::Ptr make(Path *p, Node *n) { auto h = std::make_shared(p, n, getFlags(), getPriority()); diff --git a/include/villas/hook_list.hpp b/include/villas/hook_list.hpp index 70d23eba7..f9964158b 100644 --- a/include/villas/hook_list.hpp +++ b/include/villas/hook_list.hpp @@ -1,13 +1,11 @@ -/** Hook list functions +/* Hook list functions * * This file includes some examples. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,7 +16,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class Path; struct Sample; @@ -29,7 +27,7 @@ public: HookList() { } - /** Parses an object of hooks + /* Parses an object of hooks * * Example: * @@ -58,7 +56,7 @@ public: SignalList::Ptr getSignals() const; - /** Get the maximum number of signals which is used by any of the hooks in the list. */ + // Get the maximum number of signals which is used by any of the hooks in the list. unsigned getSignalsMaxCount() const; json_t * toJson() const; diff --git a/include/villas/hooks/decimate.hpp b/include/villas/hooks/decimate.hpp index d5f1c8a17..01a5388f2 100644 --- a/include/villas/hooks/decimate.hpp +++ b/include/villas/hooks/decimate.hpp @@ -1,9 +1,9 @@ -/** Decimate hook. +/* Decimate hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -51,4 +51,3 @@ public: } // namespace node } // namespace villas - diff --git a/include/villas/hooks/limit_rate.hpp b/include/villas/hooks/limit_rate.hpp index 92b08ad99..2ee99b3a3 100644 --- a/include/villas/hooks/limit_rate.hpp +++ b/include/villas/hooks/limit_rate.hpp @@ -1,9 +1,9 @@ -/** Rate-limiting hook. +/* Rate-limiting hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,11 +15,12 @@ namespace node { class LimitRateHook : public LimitHook { protected: + // The timestamp which should be used for limiting. enum { LIMIT_RATE_LOCAL, LIMIT_RATE_RECEIVED, LIMIT_RATE_ORIGIN - } mode; /**< The timestamp which should be used for limiting. */ + } mode; double deadtime; timespec last; @@ -32,14 +33,17 @@ public: last({0, 0}) { } - virtual void setRate(double rate, double maxRate = -1) + virtual + void setRate(double rate, double maxRate = -1) { deadtime = 1.0 / rate; } - virtual void parse(json_t *json); + virtual + void parse(json_t *json); - virtual Hook::Reason process(struct Sample *smp); + virtual + Hook::Reason process(struct Sample *smp); }; } // namespace node diff --git a/include/villas/hooks/lua.hpp b/include/villas/hooks/lua.hpp index 49de8b140..85b3365ee 100644 --- a/include/villas/hooks/lua.hpp +++ b/include/villas/hooks/lua.hpp @@ -1,9 +1,9 @@ -/** Lua expressions hook. +/* Lua expressions hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,7 +19,7 @@ extern "C" { namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class LuaHook; enum SignalType; @@ -48,14 +48,15 @@ class LuaHook : public Hook { friend LuaSignalExpression; private: - static const int SELF_REFERENCE = 55; + static + const int SELF_REFERENCE = 55; protected: std::string script; std::vector expressions; - SignalList::Ptr signalsProcessed; /**> Signals as emited by Lua process() function */ - SignalList::Ptr signalsExpressions; /**> Signals as emited by Lua expressions */ + SignalList::Ptr signalsProcessed; // Signals as emited by Lua process() function + SignalList::Ptr signalsExpressions; // Signals as emited by Lua expressions lua_State *L; std::mutex mutex; @@ -64,7 +65,7 @@ protected: bool hasExpressions; bool needsLocking; - /* Function indizes */ + // Function indices struct { int start; int stop; @@ -80,7 +81,7 @@ protected: void lookupFunctions(); void setupEnvironment(); - /* Lua functions */ + // Lua functions int luaInfo(lua_State *L); int luaWarn(lua_State *L); @@ -93,8 +94,8 @@ protected: // This template wraps a member function into a C-style "free" function compatible with lua. template - static int - dispatch(lua_State * L) { + static + int dispatch(lua_State * L) { lua_rawgeti(L, LUA_REGISTRYINDEX, SELF_REFERENCE); void *vptr = lua_touserdata(L, -1); lua_pop(L, 1); @@ -106,28 +107,35 @@ protected: public: LuaHook(Path *p, Node *n, int fl, int prio, bool en = true); - virtual ~LuaHook(); + virtual + ~LuaHook(); - virtual void parse(json_t *json); + virtual + void parse(json_t *json); - virtual void prepare(); + virtual + void prepare(); - /** Periodically called by the main thread. */ - virtual void periodic(); + // Periodically called by the main thread. + virtual + void periodic(); - /** Called whenever a hook is started; before threads are created. */ - virtual void start(); + // Called whenever a hook is started; before threads are created. + virtual + void start(); - /** Called whenever a hook is stopped; after threads are destoyed. */ - virtual void stop(); + // Called whenever a hook is stopped; after threads are destoyed. + virtual + void stop(); - /** Called whenever a new simulation case is started. This is detected by a sequence no equal to zero. */ - virtual void restart(); + // Called whenever a new simulation case is started. This is detected by a sequence no equal to zero. + virtual + void restart(); - /** Called whenever a sample is processed. */ - virtual Reason process(struct Sample *smp); + // Called whenever a sample is processed. + virtual + Reason process(struct Sample *smp); }; - } // namespace node } // namespace villas diff --git a/include/villas/hooks/pmu.hpp b/include/villas/hooks/pmu.hpp index 088f52381..e530c2632 100644 --- a/include/villas/hooks/pmu.hpp +++ b/include/villas/hooks/pmu.hpp @@ -1,9 +1,9 @@ -/** PMU hook. +/* PMU hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -14,7 +14,6 @@ namespace node { class PmuHook : public MultiSignalHook { - protected: enum class Status { INVALID, @@ -25,7 +24,7 @@ protected: double frequency; double amplitude; double phase; - double rocof; /* Rate of change of frequency. */ + double rocof; // Rate of change of frequency. Status valid; }; @@ -62,7 +61,7 @@ protected: timespec nextRun; bool init; unsigned initSampleCount; - /* Correction factors. */ + // Correction factors. double phaseOffset; double amplitudeOffset; double frequencyOffset; diff --git a/include/villas/kernel/if.hpp b/include/villas/kernel/if.hpp index 0fdcb1bf4..3543d6b2d 100644 --- a/include/villas/kernel/if.hpp +++ b/include/villas/kernel/if.hpp @@ -1,13 +1,12 @@ -/** Interface related functions +/* Interface related functions * * These functions are used to manage a network interface. * Most of them make use of Linux-specific APIs. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,10 +18,10 @@ #include #ifndef SO_MARK - #define SO_MARK 36 /**< Workaround: add missing constant for OPAL-RT Redhawk target */ + #define SO_MARK 36 // Workaround: add missing constant for OPAL-RT Redhawk target #endif -/* Forward declarations */ +// Forward declarations struct nl_addr; struct rtnl_link; struct rtnl_qdisc; @@ -30,7 +29,7 @@ struct rtnl_qdisc; namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class SuperNode; @@ -38,27 +37,27 @@ class SuperNode; namespace kernel { -/** Interface data structure */ +// Interface data structure class Interface { public: - struct rtnl_link *nl_link; /**< libnl3: Handle of interface. */ - struct rtnl_qdisc *tc_qdisc; /**< libnl3: Root priority queuing discipline (qdisc). */ + struct rtnl_link *nl_link; // libnl3: Handle of interface. + struct rtnl_qdisc *tc_qdisc; // libnl3: Root priority queuing discipline (qdisc). protected: - int affinity; /**< IRQ / Core Affinity of this interface. */ + int affinity; // IRQ / Core Affinity of this interface. - std::list irqs; /**< List of IRQs of the NIC. */ - std::list nodes; /**< List of nodes which use this interface. */ + std::list irqs; // List of IRQs of the NIC. + std::list nodes; // List of nodes which use this interface. Logger logger; public: - /** Add a new interface to the global list and lookup name, irqs... */ + // Add a new interface to the global list and lookup name, irqs... Interface(struct rtnl_link *link, int affinity = 0); ~Interface(); - /** Start interface. + /* Start interface. * * This setups traffic controls queue discs, network emulation and * maps interface IRQs according to affinity. @@ -69,7 +68,7 @@ public: */ int start(); - /** Stop interface + /* Stop interface * * This resets traffic qdiscs ant network emulation * and maps interface IRQs to all CPUs. @@ -80,14 +79,14 @@ public: */ int stop(); - /** Find existing or create new interface instance on which packets for a certain destination + /* Find existing or create new interface instance on which packets for a certain destination * will leave the system. */ static Interface * getEgress(struct sockaddr *sa, node::SuperNode *sn); - /** Get all IRQs for this interface. + /* Get all IRQs for this interface. * * Only MSI IRQs are determined by looking at: * /sys/class/net/{ifname}/device/msi_irqs/ @@ -98,7 +97,7 @@ public: */ int getIRQs(); - /** Change the SMP affinity of NIC interrupts. + /* Change the SMP affinity of NIC interrupts. * * @param i A pointer to the interface structure * @param affinity A mask specifying which cores should handle this interrupt. diff --git a/include/villas/kernel/nl-private.h b/include/villas/kernel/nl-private.h index ded3b0a97..c708c4ba9 100644 --- a/include/villas/kernel/nl-private.h +++ b/include/villas/kernel/nl-private.h @@ -1,3 +1,13 @@ +/* Netlink Types (Private) + * + * Copied from: https://github.com/tgraf/libnl/blob/master/include/netlink-private/types.h + * + * SPDX-License-Identifier: LGPL-2.1-only + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-FileCopyrightText: 2003-2013 Thomas Graf + * SPDX-FileCopyrightText: 2013 Sassano Systems LLC + */ + #pragma once #ifdef __cplusplus diff --git a/include/villas/kernel/nl.hpp b/include/villas/kernel/nl.hpp index ca4fcbda6..2317a347b 100644 --- a/include/villas/kernel/nl.hpp +++ b/include/villas/kernel/nl.hpp @@ -1,10 +1,9 @@ -/** Netlink related functions. +/* Netlink related functions. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,14 +17,14 @@ namespace villas { namespace kernel { namespace nl { -/** Get index of outgoing interface for given destination address. +/* Get index of outgoing interface for given destination address. * * @retval >=0 Interface index of outgoing interface. * @retval <0 Error. Something went wrong. */ int get_egress(struct nl_addr *addr); -/** Lookup routing tables to get the interface on which packets for a certain destination +/* Lookup routing tables to get the interface on which packets for a certain destination * will leave the system. * * @param[in] sa The destination address for outgoing packets. @@ -35,10 +34,10 @@ int get_egress(struct nl_addr *addr); */ struct rtnl_link * get_egress_link(struct sockaddr *sa); -/** Get or create global netlink socket. */ +// Get or create global netlink socket. struct nl_sock * init(); -/** Close and free global netlink socket. */ +// Close and free global netlink socket. void shutdown(); } // namespace nl diff --git a/include/villas/kernel/tc.hpp b/include/villas/kernel/tc.hpp index 55adcab83..a7f820356 100644 --- a/include/villas/kernel/tc.hpp +++ b/include/villas/kernel/tc.hpp @@ -1,15 +1,14 @@ -/** Setup interface queuing desciplines for network emulation +/* Setup interface queuing desciplines for network emulation * * We use the firewall mark to apply individual netem qdiscs * per node. Every node uses an own BSD socket. * By using so SO_MARK socket option (see socket(7)) * we can classify traffic originating from a node seperately. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,14 +22,14 @@ namespace villas { namespace kernel { -/* Forward declarations */ +// Forward declarations class Interface; namespace tc { typedef uint32_t tc_hdl_t; -/** Remove all queuing disciplines and filters. +/* Remove all queuing disciplines and filters. * * @param i The interface * @retval 0 Success. Everything went well. @@ -38,7 +37,7 @@ typedef uint32_t tc_hdl_t; */ int reset(Interface *i); -/** Create a priority (prio) queueing discipline. +/* Create a priority (prio) queueing discipline. * * @param i[in] The interface * @param qd[in,out] The libnl3 object of the new prio qdisc. @@ -50,7 +49,7 @@ int reset(Interface *i); */ int prio(Interface *i, struct rtnl_qdisc **qd, tc_hdl_t handle, tc_hdl_t, int bands); -/** Add a new filter based on the netfilter mark. +/* Add a new filter based on the netfilter mark. * * @param i The interface to which this classifier is applied to. * @param cls[in,out] The libnl3 object of the new prio qdisc. @@ -58,7 +57,7 @@ int prio(Interface *i, struct rtnl_qdisc **qd, tc_hdl_t handle, tc_hdl_t, int ba * @param mark The netfilter firewall mark (sometime called 'fwmark') * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. -*/ + */ int mark(Interface *i, struct rtnl_cls **cls, tc_hdl_t flowid, uint32_t mark); } // namespace tc diff --git a/include/villas/kernel/tc_netem.hpp b/include/villas/kernel/tc_netem.hpp index dea2d776c..5fe4b9085 100644 --- a/include/villas/kernel/tc_netem.hpp +++ b/include/villas/kernel/tc_netem.hpp @@ -1,15 +1,14 @@ -/** Setup network emulation +/* Setup network emulation * * We use the firewall mark to apply individual netem qdiscs * per node. Every node uses an own BSD socket. * By using so SO_MARK socket option (see socket(7)) * we can classify traffic originating from a node seperately. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,14 +22,14 @@ namespace villas { namespace kernel { -/* Forward declarations */ +// Forward declarations class Interface; namespace tc { typedef uint32_t tc_hdl_t; -/** Parse network emulator (netem) settings. +/* Parse network emulator (netem) settings. * * @param json A jansson object containing the settings. * @param[out] ne A pointer to a libnl3 qdisc object where setting will be written to. @@ -39,14 +38,14 @@ typedef uint32_t tc_hdl_t; */ int netem_parse(struct rtnl_qdisc **ne, json_t *json); -/** Print network emulator (netem) setting into buffer. +/* Print network emulator (netem) setting into buffer. * * @param tc A pointer to the libnl3 qdisc object where settings will be read from. * @return A pointer to a string which must be freed() by the caller. */ char * netem_print(struct rtnl_qdisc *ne); -/** Add a new network emulator (netem) discipline. +/* Add a new network emulator (netem) discipline. * * @param i[in] The interface to which this qdisc will be added. * @param qd[in,out] The libnl3 object of the new prio qdisc. diff --git a/include/villas/log_opal_sink.hpp b/include/villas/log_opal_sink.hpp index 9cd390c79..e0e85eb79 100644 --- a/include/villas/log_opal_sink.hpp +++ b/include/villas/log_opal_sink.hpp @@ -1,10 +1,9 @@ -/** Log sink for OPAL-RTs OpalPrint(). +/* Log sink for OPAL-RTs OpalPrint(). * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -46,13 +45,12 @@ protected: void flush_() override { - /* nothing to do */ + // nothing to do } }; using OpalSink_mt = OpalSink; using OpalSink_st = OpalSink; - } // namespace node } // namespace villas diff --git a/include/villas/mapping.hpp b/include/villas/mapping.hpp index c760325e9..d347cb959 100644 --- a/include/villas/mapping.hpp +++ b/include/villas/mapping.hpp @@ -1,10 +1,9 @@ -/** Sample value remapping for path source muxing. +/* Sample value remapping for path source muxing. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -28,7 +27,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; struct Sample; class Signal; @@ -56,15 +55,15 @@ public: RECEIVED }; - Node *node; /**< The node to which this mapping refers. */ - enum Type type; /**< The mapping type. Selects one of the union fields below. */ + Node *node; // The node to which this mapping refers. + enum Type type; // The mapping type. Selects one of the union fields below. - /** The number of values which is covered by this mapping entry. + /* The number of values which is covered by this mapping entry. * * A value of 0 indicates that all remaining values starting from the offset of a sample should be mapped. */ int length; - unsigned offset; /**< Offset of this mapping entry within sample::data */ + unsigned offset; // Offset of this mapping entry within sample::data union { struct { @@ -89,7 +88,7 @@ public: } timestamp; }; - std::string nodeName; /**< Used for between parse and prepare only. */ + std::string nodeName; // Used for between parse and prepare only. MappingEntry(); diff --git a/include/villas/mapping_list.hpp b/include/villas/mapping_list.hpp index e6e480ddb..47218ef6e 100644 --- a/include/villas/mapping_list.hpp +++ b/include/villas/mapping_list.hpp @@ -1,12 +1,11 @@ #pragma once -/** Sample value remapping for path source muxing. +/* Sample value remapping for path source muxing. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/include/villas/memory/ib.h b/include/villas/memory/ib.h index 164b6640d..56e2a559c 100644 --- a/include/villas/memory/ib.h +++ b/include/villas/memory/ib.h @@ -1,10 +1,9 @@ -/** Memory allocators. +/* Memory allocators. * - * @file - * @author Dennis Potter - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Dennis Potter + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/node.h b/include/villas/node.h index 25936ca62..85572f3d4 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -1,10 +1,9 @@ -/** Node C-API +/* Node C-API * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/node.hpp b/include/villas/node.hpp index a69ab1eab..e601fa462 100644 --- a/include/villas/node.hpp +++ b/include/villas/node.hpp @@ -1,10 +1,9 @@ -/** Nodes +/* Nodes * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -28,24 +27,24 @@ #if defined(LIBNL3_ROUTE_FOUND) && defined(__linux__) #define WITH_NETEM -#endif /* LIBNL3_ROUTE_FOUND */ +#endif // LIBNL3_ROUTE_FOUND -/* Forward declarations */ +// Forward declarations #ifdef WITH_NETEM struct rtnl_qdisc; struct rtnl_cls; -#endif /* WITH_NETEM */ +#endif // WITH_NETEM #define RE_NODE_NAME "[a-z0-9_-]{2,32}" namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeFactory; class SuperNode; -/** The class for a node. +/* The class for a node. * * Every entity which exchanges messages is represented by a node. * Nodes can be remote machines and simulators or locally running processes. @@ -58,21 +57,21 @@ public: Logger logger; uint64_t sequence_init; - uint64_t sequence; /**< This is a counter of received samples, in case the node-type does not generate sequence numbers itself. */ + uint64_t sequence; // This is a counter of received samples, in case the node-type does not generate sequence numbers itself. NodeDirection in, out; - PathSourceList sources; /**< A list of path sources which reference this node. */ - PathDestinationList destinations; /**< A list of path destinations which reference this node. */ + PathSourceList sources; // A list of path sources which reference this node. + PathDestinationList destinations; // A list of path destinations which reference this node. #ifdef __linux__ - int fwmark; /**< Socket mark for netem, routing and filtering */ + int fwmark; // Socket mark for netem, routing and filtering #ifdef WITH_NETEM - struct rtnl_qdisc *tc_qdisc; /**< libnl3: Network emulator queuing discipline */ - struct rtnl_cls *tc_classifier; /**< libnl3: Firewall mark classifier */ -#endif /* WITH_NETEM */ -#endif /* __linux__ */ + struct rtnl_qdisc *tc_qdisc; // libnl3: Network emulator queuing discipline + struct rtnl_cls *tc_classifier; // libnl3: Firewall mark classifier +#endif // WITH_NETEM +#endif // __linux__ protected: enum State state; @@ -81,18 +80,18 @@ protected: bool enabled; - Stats::Ptr stats; /**< Statistic counters. This is a pointer to the statistic hooks private data. */ + Stats::Ptr stats; // Statistic counters. This is a pointer to the statistic hooks private data. - json_t *config; /**< A JSON object containing the configuration of the node. */ + json_t *config; // A JSON object containing the configuration of the node. - std::string name_short; /**< A short identifier of the node, only used for configuration and logging */ - std::string name_long; /**< Singleton: A string used to print to screen. */ - std::string name_full; /**< Singleton: A string used to print to screen. */ + std::string name_short; // A short identifier of the node, only used for configuration and logging + std::string name_long; // Singleton: A string used to print to screen. + std::string name_full; // Singleton: A string used to print to screen. std::string details; - int affinity; /**< CPU Affinity of this node */ + int affinity; // CPU Affinity of this node - NodeFactory *factory; /**< The factory which created this instance */ + NodeFactory *factory; // The factory which created this instance virtual int _read(struct Sample * smps[], unsigned cnt) @@ -113,18 +112,18 @@ protected: } public: - /** Initialize node with default values */ + // Initialize node with default values Node(const uuid_t &id = {}, const std::string &name = ""); - /** Destroy node by freeing dynamically allocated memory. */ + // Destroy node by freeing dynamically allocated memory. virtual ~Node(); - /** Do initialization after parsing the configuration */ + // Do initialization after parsing the configuration virtual int prepare(); - /** Parse settings of a node. + /* Parse settings of a node. * * @param json A JSON object containing the configuration of the node. * @retval 0 Success. Everything went well. @@ -133,19 +132,19 @@ public: virtual int parse(json_t *json); - /** Validate node configuration. */ + // Validate node configuration. virtual int check(); - /** Start operation of a node. */ + // Start operation of a node. virtual int start(); - /** Stops operation of a node. */ + // Stops operation of a node. virtual int stop(); - /** Pauses operation of a node. */ + // Pauses operation of a node. virtual int pause() { @@ -157,18 +156,18 @@ public: return 0; } - /** Resumes operation of a node. */ + // Resumes operation of a node. virtual int resume() { return 0; } - /** Restarts operation of a node. */ + // Restarts operation of a node. virtual int restart(); - /** Receive multiple messages at once. + /* Receive multiple messages at once. * * This callback is optional. It will only be called if non-null. * @@ -184,7 +183,7 @@ public: */ int read(struct Sample * smps[], unsigned cnt); - /** Send multiple messages in a single datagram / packet. + /* Send multiple messages in a single datagram / packet. * * This callback is optional. It will only be called if non-null. * @@ -199,14 +198,14 @@ public: */ int write(struct Sample * smps[], unsigned cnt); - /** Reverse local and remote socket address. */ + // Reverse local and remote socket address. virtual int reverse() { return -1; } - /** Get a list of file descriptors on which the path should poll + /* Get a list of file descriptors on which the path should poll * to detect the availability of new samples which can be read. */ virtual @@ -215,7 +214,7 @@ public: return {}; } - /** Get a list of socket file descriptors which are used by the node + /* Get a list of socket file descriptors which are used by the node * To perform network IO. We use those to selectively apply network emulation */ virtual @@ -224,7 +223,7 @@ public: return {}; } - /** Get the memory type which this node-type expects. + /* Get the memory type which this node-type expects. * * This is useful for special node-types like Infiniband, GPUs & FPGAs * which require DMA-backed memory. @@ -235,13 +234,13 @@ public: return villas::node::memory::default_type; } - /** Get the factory which was used to construct this node. */ + // Get the factory which was used to construct this node. villas::node::NodeFactory * getFactory() const { return factory; } - /** Return a pointer to a string which should be used to print this node. + /* Return a pointer to a string which should be used to print this node. * * @param n A pointer to the node structure. */ @@ -250,63 +249,65 @@ public: return name_short; } - /** Return a pointer to a string which should be used to print this node. */ + // Return a pointer to a string which should be used to print this node. const std::string & getName() const { return name_long; } - /** Get the full name including type and details of the node. */ + // Get the full name including type and details of the node. const std::string & getNameFull(); - /** Just get the config details of this node as a string */ + // Just get the config details of this node as a string virtual const std::string & getDetails() { - static std::string empty; + static + std::string empty; + return empty; } - /** Return a pointer to a string which should be used to print this node. + /* Return a pointer to a string which should be used to print this node. * * @param n A pointer to the node structure. */ const std::string & getNameLong(); - /** Return a list of signals which are sent to this node. + /* Return a list of signals which are sent to this node. * * This list is derived from the path which uses the node as destination. */ SignalList::Ptr getOutputSignals(bool after_hooks = true) const; SignalList::Ptr getInputSignals(bool after_hooks = true) const; - /** Get the number of input signals (received by this node) */ + // Get the number of input signals (received by this node) unsigned getInputSignalsMaxCount() const; - /** Get the number of output signals (send out via this node) */ + // Get the number of output signals (send out via this node) unsigned getOutputSignalsMaxCount() const; void swapSignals(); - /** Get the node configuration as JSON. */ + // Get the node configuration as JSON. json_t * getConfig() { return config; } - /** Get the state of this node. */ + // Get the state of this node. enum State getState() const { return state; } - /** Set the state of this node. */ + // Set the state of this node. void setState(enum State s) { state = s; } - /** Get the UUID of this node. */ + // Get the UUID of this node. const uuid_t & getUuid() const { return uuid; @@ -327,7 +328,7 @@ public: enabled = en; } - /** Custom formatter for spdlog */ + // Custom formatter for spdlog template friend OStream &operator<<(OStream &os, const Node &n) { @@ -399,7 +400,7 @@ public: return "node"; } - /** Custom formatter for spdlog */ + // Custom formatter for spdlog template friend OStream &operator<<(OStream &os, const NodeFactory &f) { diff --git a/include/villas/node/config.hpp.in b/include/villas/node/config.hpp.in index 7bad18763..9176fa292 100644 --- a/include/villas/node/config.hpp.in +++ b/include/villas/node/config.hpp.in @@ -3,10 +3,9 @@ * This file contains some compiled-in settings. * This settings are not part of the configuration file. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 *********************************************************************************/ #pragma once diff --git a/include/villas/node/exceptions.hpp b/include/villas/node/exceptions.hpp index 4f72e828d..0093585f8 100644 --- a/include/villas/node/exceptions.hpp +++ b/include/villas/node/exceptions.hpp @@ -1,10 +1,9 @@ -/** VILLASnode exceptions. +/* VILLASnode exceptions. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -52,7 +51,7 @@ public: config(c) { } }; -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG class JanssonParseError : public ParseError { diff --git a/include/villas/node/memory.hpp b/include/villas/node/memory.hpp index 930cda757..fe9230584 100644 --- a/include/villas/node/memory.hpp +++ b/include/villas/node/memory.hpp @@ -1,16 +1,15 @@ -/** Memory allocators. +/* Memory allocators. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef IBVERBS_FOUND #include -#endif /* IBVERBS_FOUND */ +#endif // IBVERBS_FOUND #include #include @@ -22,16 +21,16 @@ namespace villas { namespace node { namespace memory { -/** Descriptor of a memory block. Associated block always starts at +/* Descriptor of a memory block. Associated block always starts at * &m + sizeof(struct Block). */ struct Block { struct Block *prev; struct Block *next; - size_t length; /**< Length of the block; doesn't include the descriptor itself */ + size_t length; // Length of the block; doesn't include the descriptor itself bool used; }; -/** @todo Unused for now */ +// @todo Unused for now struct Allocation { struct Type *type; @@ -53,12 +52,12 @@ struct Allocation { }; }; -/** Initilialize memory subsystem */ +// Initilialize memory subsystem int init(int hugepages) __attribute__ ((warn_unused_result)); int lock(size_t lock); -/** Allocate \p len bytes memory of type \p m. +/* Allocate \p len bytes memory of type \p m. * * @retval nullptr If allocation failed. * @retval <>0 If allocation was successful. diff --git a/include/villas/node/memory_type.hpp b/include/villas/node/memory_type.hpp index 0756b885e..553a94483 100644 --- a/include/villas/node/memory_type.hpp +++ b/include/villas/node/memory_type.hpp @@ -1,10 +1,9 @@ -/** Memory allocators. +/* Memory allocators. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,7 +13,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; namespace memory { @@ -40,13 +39,17 @@ struct Type { allocator_t alloc; deallocator_t free; - void *_vd; /**< Virtual data for internal state */ + void *_vd; // Virtual data for internal state }; -extern struct Type heap; -extern struct Type mmap; -extern struct Type mmap_hugetlb; -extern struct Type *default_type; +extern +struct Type heap; +extern +struct Type mmap; +extern +struct Type mmap_hugetlb; +extern +struct Type *default_type; struct Type * ib(NodeCompat *n, struct Type *parent); struct Type * managed(void *ptr, size_t len); diff --git a/include/villas/node_compat.hpp b/include/villas/node_compat.hpp index 4c8b13333..3b9c5dd8b 100644 --- a/include/villas/node_compat.hpp +++ b/include/villas/node_compat.hpp @@ -1,12 +1,11 @@ -/** Node compatability layer for C++ +/* Node compatability layer for C++ * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ -/** +/* * @addtogroup node Node * @{ */ @@ -22,14 +21,14 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompatFactory; class NodeCompat : public Node { protected: - struct NodeCompatType *_vt; /**< Virtual functions (C++ OOP style) */ - void *_vd; /**< Virtual data (used by struct vnode::_vt functions) */ + struct NodeCompatType *_vt; // Virtual functions (C++ OOP style) + void *_vd; // Virtual data (used by struct vnode::_vt functions) std::string _details; @@ -63,7 +62,7 @@ public: return _vt; } - /** Parse node connection details. + /* Parse node connection details. * * @param json A JSON object containing the configuration of the node. @@ -73,11 +72,11 @@ public: virtual int parse(json_t *json); - /** Returns a string with a textual represenation of this node. */ + // Returns a string with a textual represenation of this node. virtual const std::string & getDetails(); - /** Check the current node configuration for plausability and errors. + /* Check the current node configuration for plausability and errors. * * @retval 0 Success. Node configuration is good. @@ -89,7 +88,7 @@ public: virtual int prepare(); - /** Start this node. + /* Start this node. * * @retval 0 Success. Everything went well. @@ -98,7 +97,7 @@ public: virtual int start(); - /** Stop this node. + /* Stop this node. * * @retval 0 Success. Everything went well. @@ -107,7 +106,7 @@ public: virtual int stop(); - /** Restart this node. + /* Restart this node. * * @param n A pointer to the node object. @@ -117,7 +116,7 @@ public: virtual int restart(); - /** Pause this node. + /* Pause this node. * * @param n A pointer to the node object. @@ -127,7 +126,7 @@ public: virtual int pause(); - /** Resume this node. + /* Resume this node. * * @retval 0 Success. Everything went well. @@ -136,7 +135,7 @@ public: virtual int resume(); - /** Reverse source and destination of a node. + /* Reverse source and destination of a node. */ virtual @@ -145,7 +144,7 @@ public: virtual std::vector getPollFDs(); - /** Get list of socket file descriptors for configuring network emulation. + /* Get list of socket file descriptors for configuring network emulation. * * @return The number of file descriptors which have been put into \p sds. @@ -153,7 +152,7 @@ public: virtual std::vector getNetemFDs(); - /** Return a memory allocator which should be used for sample pools passed to this node. */ + // Return a memory allocator which should be used for sample pools passed to this node. virtual struct memory::Type * getMemoryType(); }; diff --git a/include/villas/node_compat_type.hpp b/include/villas/node_compat_type.hpp index 4535b28f7..328626b57 100644 --- a/include/villas/node_compat_type.hpp +++ b/include/villas/node_compat_type.hpp @@ -1,10 +1,9 @@ -/** Nodes +/* Nodes * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,7 +17,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class Node; class SuperNode; @@ -29,15 +28,15 @@ public: const char *name; const char *description; - unsigned vectorize; /**< Maximal vector length supported by this node type. Zero is unlimited. */ + unsigned vectorize; // Maximal vector length supported by this node type. Zero is unlimited. int flags; - enum State state; /**< State of this node-type. */ + enum State state; // State of this node-type. - size_t size; /**< Size of private data bock. @see node::_vd */ + size_t size; // Size of private data bock. @see node::_vd struct { - /** Global initialization per node type. + /* Global initialization per node type. * * This callback is invoked once per node-type. * This callback is optional. It will only be called if non-null. @@ -47,7 +46,7 @@ public: */ int (*start)(SuperNode *sn); - /** Global de-initialization per node type. + /* Global de-initialization per node type. * * This callback is invoked once per node-type. * This callback is optional. It will only be called if non-null. @@ -58,7 +57,7 @@ public: int (*stop)(); } type; - /** Initialize a new node instance. + /* Initialize a new node instance. * * This callback is optional. It will only be called if non-null. * @@ -67,7 +66,7 @@ public: */ int (*init)(NodeCompat *n); - /** Free memory of an instance of this type. + /* Free memory of an instance of this type. * * This callback is optional. It will only be called if non-null. * @@ -75,7 +74,7 @@ public: */ int (*destroy)(NodeCompat *n); - /** Parse node connection details. + /* Parse node connection details. * * This callback is optional. It will only be called if non-null. * @@ -86,7 +85,7 @@ public: */ int (*parse)(NodeCompat *n, json_t *json); - /** Check the current node configuration for plausability and errors. + /* Check the current node configuration for plausability and errors. * * This callback is optional. It will only be called if non-null. * @@ -98,7 +97,7 @@ public: int (*prepare)(NodeCompat *n); - /** Returns a string with a textual represenation of this node. + /* Returns a string with a textual represenation of this node. * * This callback is optional. It will only be called if non-null. * @@ -107,7 +106,7 @@ public: */ char * (*print)(NodeCompat *n); - /** Start this node. + /* Start this node. * * This callback is optional. It will only be called if non-null. * @@ -117,7 +116,7 @@ public: */ int (*start)(NodeCompat *n); - /** Restart this node. + /* Restart this node. * * This callback is optional. It will only be called if non-null. * @@ -127,7 +126,7 @@ public: */ int (*restart)(NodeCompat *n); - /** Stop this node. + /* Stop this node. * * This callback is optional. It will only be called if non-null. * @@ -137,7 +136,7 @@ public: */ int (*stop)(NodeCompat *n); - /** Pause this node. + /* Pause this node. * * This callback is optional. It will only be called if non-null. * @@ -147,7 +146,7 @@ public: */ int (*pause)(NodeCompat *n); - /** Resume this node. + /* Resume this node. * * This callback is optional. It will only be called if non-null. * @@ -157,7 +156,7 @@ public: */ int (*resume)(NodeCompat *n); - /** Receive multiple messages at once. + /* Receive multiple messages at once. * * This callback is optional. It will only be called if non-null. * @@ -175,7 +174,7 @@ public: */ int (*read)(NodeCompat *n, struct Sample * const smps[], unsigned cnt); - /** Send multiple messages in a single datagram / packet. + /* Send multiple messages in a single datagram / packet. * * This callback is optional. It will only be called if non-null. * @@ -192,7 +191,7 @@ public: */ int (*write)(NodeCompat *n, struct Sample * const smps[], unsigned cnt); - /** Reverse source and destination of a node. + /* Reverse source and destination of a node. * * This callback is optional. It will only be called if non-null. * @@ -200,7 +199,7 @@ public: */ int (*reverse)(NodeCompat *n); - /** Get list of file descriptors which can be used by poll/select to detect the availability of new data. + /* Get list of file descriptors which can be used by poll/select to detect the availability of new data. * * This callback is optional. It will only be called if non-null. * @@ -208,7 +207,7 @@ public: */ int (*poll_fds)(NodeCompat *n, int fds[]); - /** Get list of socket file descriptors for configuring network emulation. + /* Get list of socket file descriptors for configuring network emulation. * * This callback is optional. It will only be called if non-null. * @@ -216,7 +215,7 @@ public: */ int (*netem_fds)(NodeCompat *n, int sds[]); - /** Return a memory allocator which should be used for sample pools passed to this node. */ + // Return a memory allocator which should be used for sample pools passed to this node. struct memory::Type * (*memory_type)(NodeCompat *n, struct memory::Type *parent); }; diff --git a/include/villas/node_direction.hpp b/include/villas/node_direction.hpp index 54b87d518..c02506887 100644 --- a/include/villas/node_direction.hpp +++ b/include/villas/node_direction.hpp @@ -1,10 +1,9 @@ -/** Node direction +/* Node direction * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,7 +17,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class Path; @@ -27,11 +26,11 @@ class NodeDirection { public: enum class Direction { - IN, /**< VILLASnode is receiving/reading */ - OUT /**< VILLASnode is sending/writing */ + IN, // VILLASnode is receiving/reading + OUT // VILLASnode is sending/writing } direction; - /** The path which uses this node as a source/destination. + /* The path which uses this node as a source/destination. * * Usually every node should be used only by a single path as destination. * Otherwise samples from different paths would be interleaved. @@ -40,13 +39,13 @@ public: Node *node; int enabled; - int builtin; /**< This node should use built-in hooks by default. */ - unsigned vectorize; /**< Number of messages to send / recv at once (scatter / gather) */ + int builtin; // This node should use built-in hooks by default. + unsigned vectorize; // Number of messages to send / recv at once (scatter / gather) - HookList hooks; /**< List of read / write hooks (struct hook). */ - SignalList::Ptr signals; /**< Signal description. */ + HookList hooks; // List of read / write hooks (struct hook). + SignalList::Ptr signals; // Signal description. - json_t *config; /**< A JSON object containing the configuration of the node. */ + json_t *config; // A JSON object containing the configuration of the node. NodeDirection(enum NodeDirection::Direction dir, Node *n); diff --git a/include/villas/node_list.hpp b/include/villas/node_list.hpp index 51d95f954..e954ff339 100644 --- a/include/villas/node_list.hpp +++ b/include/villas/node_list.hpp @@ -1,11 +1,9 @@ -/** Node list +/* Node list * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,19 +16,19 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class NodeList : public std::list { public: - /** Lookup a node from the list based on its name */ + // Lookup a node from the list based on its name Node * lookup(const std::string &name); - /** Lookup a node from the list based on its UUID */ + // Lookup a node from the list based on its UUID Node * lookup(const uuid_t &uuid); - /** Parse an array or single node and checks if they exist in the "nodes" section. + /* Parse an array or single node and checks if they exist in the "nodes" section. * * Examples: * out = [ "sintef", "scedu" ] diff --git a/include/villas/nodes/amqp.hpp b/include/villas/nodes/amqp.hpp index e928cc5ef..f710bfbcd 100644 --- a/include/villas/nodes/amqp.hpp +++ b/include/villas/nodes/amqp.hpp @@ -1,10 +1,9 @@ -/** Node type: amqp +/* Node type: amqp * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,7 +21,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct amqp_ssl_info { @@ -42,7 +41,7 @@ struct amqp { amqp_bytes_t routing_key; amqp_bytes_t exchange; - /* We need to create two connection because rabbitmq-c is not thread-safe! */ + // We need to create two connection because rabbitmq-c is not thread-safe! amqp_connection_state_t producer; amqp_connection_state_t consumer; diff --git a/include/villas/nodes/api.hpp b/include/villas/nodes/api.hpp index 79ce3f4e2..4185d955c 100644 --- a/include/villas/nodes/api.hpp +++ b/include/villas/nodes/api.hpp @@ -1,11 +1,10 @@ -/** Node type: Universal Data-exchange API (v2) +/* Node type: Universal Data-exchange API (v2) * * @see https://github.com/ERIGrid2/JRA-3.1-api - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -16,7 +15,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class APINode : public Node { diff --git a/include/villas/nodes/can.hpp b/include/villas/nodes/can.hpp index 0c382da04..a8667d17e 100644 --- a/include/villas/nodes/can.hpp +++ b/include/villas/nodes/can.hpp @@ -1,10 +1,9 @@ -/** Node-type: CAN bus +/* Node-type: CAN bus * - * @file - * @author Niklas Eiling - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Niklas Eiling + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; union SignalData; @@ -26,12 +25,12 @@ struct can_signal { }; struct can { - /* Settings */ + // Settings char *interface_name; struct can_signal *in; struct can_signal *out; - /* States */ + // States int socket; union SignalData *sample_buf; size_t sample_buf_num; diff --git a/include/villas/nodes/comedi.hpp b/include/villas/nodes/comedi.hpp index c09a8970a..cd291e53c 100644 --- a/include/villas/nodes/comedi.hpp +++ b/include/villas/nodes/comedi.hpp @@ -1,10 +1,9 @@ -/** Node type: comedi +/* Node type: comedi * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -16,7 +15,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; // whether to use read() or mmap() kernel interface diff --git a/include/villas/nodes/ethercat.hpp b/include/villas/nodes/ethercat.hpp index 3de4a57d0..7d47e9650 100644 --- a/include/villas/nodes/ethercat.hpp +++ b/include/villas/nodes/ethercat.hpp @@ -1,12 +1,11 @@ -/** Node type: ethercat +/* Node type: ethercat * - * @file - * @author Niklas Eiling - * @author Steffen Vogel - * @author Divya Laxetti - * @copyright 2018-2020, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Niklas Eiling + * Author: Steffen Vogel + * Author: Divya Laxetti + * SPDX-FileCopyrightText: 2018-2020 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,11 +21,11 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; class SuperNode; -/* Include hard-coded Ethercat Bus configuration */ +// Include hard-coded Ethercat Bus configuration #include extern "C" { @@ -35,35 +34,35 @@ extern "C" { #define DEFAULT_ETHERCAT_QUEUE_LENGTH (DEFAULT_QUEUE_LENGTH * 64) -/** Internal data per ethercat node */ +// Internal data per ethercat node struct ethercat { - /* Settings */ + // Settings double rate; struct { unsigned num_channels; double range; unsigned position; - unsigned product_code; /**< Product ID of EtherCAT slave */ - unsigned vendor_id; /**< Vendor ID of EtherCAT slave */ + unsigned product_code; // Product ID of EtherCAT slave + unsigned vendor_id; // Vendor ID of EtherCAT slave ec_slave_config_t *sc; - unsigned *offsets; /**< Offsets for PDO entries */ + unsigned *offsets; // Offsets for PDO entries } in, out; ec_domain_t *domain; ec_pdo_entry_reg_t *domain_regs; - uint8_t *domain_pd; /**< Process data */ + uint8_t *domain_pd; // Process data - std::thread thread; /**< Cyclic task thread */ - struct Task task; /**< Periodic timer */ + std::thread thread; // Cyclic task thread + struct Task task; // Periodic timer struct Pool pool; - struct CQueueSignalled queue; /**< For samples which are received from WebSockets */ + struct CQueueSignalled queue; // For samples which are received from WebSockets - std::atomic send; /**< Last sample to be sent via EtherCAT */ + std::atomic send; // Last sample to be sent via EtherCAT }; -/* Internal datastructures */ +// Internal datastructures int ethercat_type_start(SuperNode *sn); diff --git a/include/villas/nodes/ethercat_config.hpp b/include/villas/nodes/ethercat_config.hpp index 19a996b68..c72687cdc 100644 --- a/include/villas/nodes/ethercat_config.hpp +++ b/include/villas/nodes/ethercat_config.hpp @@ -1,12 +1,11 @@ -/** Configuration for Ethercat Node-type +/* Configuration for Ethercat Node-type * - * @file - * @author Niklas Eiling - * @author Steffen Vogel - * @author Divya Laxetti - * @copyright 2018-2020, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Niklas Eiling + * Author: Steffen Vogel + * Author: Divya Laxetti + * SPDX-FileCopyrightText: 2018-2020 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -26,8 +25,7 @@ #define ETHERCAT_PID_EL3008 0x0bc03052 #define ETHERCAT_PID_FC1100 0x044c0c62 - -/** @todo Make PDO entry tables configurable */ +// @todo Make PDO entry tables configurable /* Master 0, Slave 3, "EL4038" * Vendor ID: 0x00000002 @@ -35,29 +33,32 @@ * Revision number: 0x00140000 */ -static ec_pdo_entry_info_t slave_3_pdo_entries[] = { - {0x7000, 0x01, 16}, /* Analog output */ - {0x7010, 0x01, 16}, /* Analog output */ - {0x7020, 0x01, 16}, /* Analog output */ - {0x7030, 0x01, 16}, /* Analog output */ - {0x7040, 0x01, 16}, /* Analog output */ - {0x7050, 0x01, 16}, /* Analog output */ - {0x7060, 0x01, 16}, /* Analog output */ - {0x7070, 0x01, 16}, /* Analog output */ +static +ec_pdo_entry_info_t slave_3_pdo_entries[] = { + {0x7000, 0x01, 16}, // Analog output + {0x7010, 0x01, 16}, // Analog output + {0x7020, 0x01, 16}, // Analog output + {0x7030, 0x01, 16}, // Analog output + {0x7040, 0x01, 16}, // Analog output + {0x7050, 0x01, 16}, // Analog output + {0x7060, 0x01, 16}, // Analog output + {0x7070, 0x01, 16}, // Analog output }; -static ec_pdo_info_t slave_3_pdos[] = { - {0x1600, 1, slave_3_pdo_entries + 0}, /* AO RxPDO-Map Outputs Ch.1 */ - {0x1601, 1, slave_3_pdo_entries + 1}, /* AO RxPDO-Map Outputs Ch.2 */ - {0x1602, 1, slave_3_pdo_entries + 2}, /* AO RxPDO-Map Outputs Ch.3 */ - {0x1603, 1, slave_3_pdo_entries + 3}, /* AO RxPDO-Map Outputs Ch.4 */ - {0x1604, 1, slave_3_pdo_entries + 4}, /* AO RxPDO-Map Outputs Ch.5 */ - {0x1605, 1, slave_3_pdo_entries + 5}, /* AO RxPDO-Map Outputs Ch.6 */ - {0x1606, 1, slave_3_pdo_entries + 6}, /* AO RxPDO-Map Outputs Ch.7 */ - {0x1607, 1, slave_3_pdo_entries + 7}, /* AO RxPDO-Map Outputs Ch.8 */ +static +ec_pdo_info_t slave_3_pdos[] = { + {0x1600, 1, slave_3_pdo_entries + 0}, // AO RxPDO-Map Outputs Ch.1 + {0x1601, 1, slave_3_pdo_entries + 1}, // AO RxPDO-Map Outputs Ch.2 + {0x1602, 1, slave_3_pdo_entries + 2}, // AO RxPDO-Map Outputs Ch.3 + {0x1603, 1, slave_3_pdo_entries + 3}, // AO RxPDO-Map Outputs Ch.4 + {0x1604, 1, slave_3_pdo_entries + 4}, // AO RxPDO-Map Outputs Ch.5 + {0x1605, 1, slave_3_pdo_entries + 5}, // AO RxPDO-Map Outputs Ch.6 + {0x1606, 1, slave_3_pdo_entries + 6}, // AO RxPDO-Map Outputs Ch.7 + {0x1607, 1, slave_3_pdo_entries + 7}, // AO RxPDO-Map Outputs Ch.8 }; -static ec_sync_info_t slave_3_syncs[] = { +static +ec_sync_info_t slave_3_syncs[] = { {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE}, {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE}, {2, EC_DIR_OUTPUT, 8, slave_3_pdos + 0, EC_WD_DISABLE}, @@ -71,101 +72,104 @@ static ec_sync_info_t slave_3_syncs[] = { * Revision number: 0x00150000 */ -static ec_pdo_entry_info_t slave_4_pdo_entries[] = { - {0x6000, 0x01, 1}, /* Underrange */ - {0x6000, 0x02, 1}, /* Overrange */ - {0x6000, 0x03, 2}, /* Limit 1 */ - {0x6000, 0x05, 2}, /* Limit 2 */ - {0x6000, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6000, 0x0f, 1}, /* TxPDO State */ - {0x6000, 0x10, 1}, /* TxPDO Toggle */ - {0x6000, 0x11, 16}, /* Value */ - {0x6010, 0x01, 1}, /* Underrange */ - {0x6010, 0x02, 1}, /* Overrange */ - {0x6010, 0x03, 2}, /* Limit 1 */ - {0x6010, 0x05, 2}, /* Limit 2 */ - {0x6010, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6010, 0x0f, 1}, /* TxPDO State */ - {0x6010, 0x10, 1}, /* TxPDO Toggle */ - {0x6010, 0x11, 16}, /* Value */ - {0x6020, 0x01, 1}, /* Underrange */ - {0x6020, 0x02, 1}, /* Overrange */ - {0x6020, 0x03, 2}, /* Limit 1 */ - {0x6020, 0x05, 2}, /* Limit 2 */ - {0x6020, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6020, 0x0f, 1}, /* TxPDO State */ - {0x6020, 0x10, 1}, /* TxPDO Toggle */ - {0x6020, 0x11, 16}, /* Value */ - {0x6030, 0x01, 1}, /* Underrange */ - {0x6030, 0x02, 1}, /* Overrange */ - {0x6030, 0x03, 2}, /* Limit 1 */ - {0x6030, 0x05, 2}, /* Limit 2 */ - {0x6030, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6030, 0x0f, 1}, /* TxPDO State */ - {0x6030, 0x10, 1}, /* TxPDO Toggle */ - {0x6030, 0x11, 16}, /* Value */ - {0x6040, 0x01, 1}, /* Underrange */ - {0x6040, 0x02, 1}, /* Overrange */ - {0x6040, 0x03, 2}, /* Limit 1 */ - {0x6040, 0x05, 2}, /* Limit 2 */ - {0x6040, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6040, 0x0f, 1}, /* TxPDO State */ - {0x6040, 0x10, 1}, /* TxPDO Toggle */ - {0x6040, 0x11, 16}, /* Value */ - {0x6050, 0x01, 1}, /* Underrange */ - {0x6050, 0x02, 1}, /* Overrange */ - {0x6050, 0x03, 2}, /* Limit 1 */ - {0x6050, 0x05, 2}, /* Limit 2 */ - {0x6050, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6050, 0x0f, 1}, /* TxPDO State */ - {0x6050, 0x10, 1}, /* TxPDO Toggle */ - {0x6050, 0x11, 16}, /* Value */ - {0x6060, 0x01, 1}, /* Underrange */ - {0x6060, 0x02, 1}, /* Overrange */ - {0x6060, 0x03, 2}, /* Limit 1 */ - {0x6060, 0x05, 2}, /* Limit 2 */ - {0x6060, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6060, 0x0f, 1}, /* TxPDO State */ - {0x6060, 0x10, 1}, /* TxPDO Toggle */ - {0x6060, 0x11, 16}, /* Value */ - {0x6070, 0x01, 1}, /* Underrange */ - {0x6070, 0x02, 1}, /* Overrange */ - {0x6070, 0x03, 2}, /* Limit 1 */ - {0x6070, 0x05, 2}, /* Limit 2 */ - {0x6070, 0x07, 1}, /* Error */ - {0x0000, 0x00, 1}, /* Gap */ - {0x0000, 0x00, 6}, /* Gap */ - {0x6070, 0x0f, 1}, /* TxPDO State */ - {0x6070, 0x10, 1}, /* TxPDO Toggle */ - {0x6070, 0x11, 16}, /* Value */ +static +ec_pdo_entry_info_t slave_4_pdo_entries[] = { + {0x6000, 0x01, 1}, // Underrange + {0x6000, 0x02, 1}, // Overrange + {0x6000, 0x03, 2}, // Limit 1 + {0x6000, 0x05, 2}, // Limit 2 + {0x6000, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6000, 0x0f, 1}, // TxPDO State + {0x6000, 0x10, 1}, // TxPDO Toggle + {0x6000, 0x11, 16}, // Value + {0x6010, 0x01, 1}, // Underrange + {0x6010, 0x02, 1}, // Overrange + {0x6010, 0x03, 2}, // Limit 1 + {0x6010, 0x05, 2}, // Limit 2 + {0x6010, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6010, 0x0f, 1}, // TxPDO State + {0x6010, 0x10, 1}, // TxPDO Toggle + {0x6010, 0x11, 16}, // Value + {0x6020, 0x01, 1}, // Underrange + {0x6020, 0x02, 1}, // Overrange + {0x6020, 0x03, 2}, // Limit 1 + {0x6020, 0x05, 2}, // Limit 2 + {0x6020, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6020, 0x0f, 1}, // TxPDO State + {0x6020, 0x10, 1}, // TxPDO Toggle + {0x6020, 0x11, 16}, // Value + {0x6030, 0x01, 1}, // Underrange + {0x6030, 0x02, 1}, // Overrange + {0x6030, 0x03, 2}, // Limit 1 + {0x6030, 0x05, 2}, // Limit 2 + {0x6030, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6030, 0x0f, 1}, // TxPDO State + {0x6030, 0x10, 1}, // TxPDO Toggle + {0x6030, 0x11, 16}, // Value + {0x6040, 0x01, 1}, // Underrange + {0x6040, 0x02, 1}, // Overrange + {0x6040, 0x03, 2}, // Limit 1 + {0x6040, 0x05, 2}, // Limit 2 + {0x6040, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6040, 0x0f, 1}, // TxPDO State + {0x6040, 0x10, 1}, // TxPDO Toggle + {0x6040, 0x11, 16}, // Value + {0x6050, 0x01, 1}, // Underrange + {0x6050, 0x02, 1}, // Overrange + {0x6050, 0x03, 2}, // Limit 1 + {0x6050, 0x05, 2}, // Limit 2 + {0x6050, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6050, 0x0f, 1}, // TxPDO State + {0x6050, 0x10, 1}, // TxPDO Toggle + {0x6050, 0x11, 16}, // Value + {0x6060, 0x01, 1}, // Underrange + {0x6060, 0x02, 1}, // Overrange + {0x6060, 0x03, 2}, // Limit 1 + {0x6060, 0x05, 2}, // Limit 2 + {0x6060, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6060, 0x0f, 1}, // TxPDO State + {0x6060, 0x10, 1}, // TxPDO Toggle + {0x6060, 0x11, 16}, // Value + {0x6070, 0x01, 1}, // Underrange + {0x6070, 0x02, 1}, // Overrange + {0x6070, 0x03, 2}, // Limit 1 + {0x6070, 0x05, 2}, // Limit 2 + {0x6070, 0x07, 1}, // Error + {0x0000, 0x00, 1}, // Gap + {0x0000, 0x00, 6}, // Gap + {0x6070, 0x0f, 1}, // TxPDO State + {0x6070, 0x10, 1}, // TxPDO Toggle + {0x6070, 0x11, 16}, // Value }; -static ec_pdo_info_t slave_4_pdos[] = { - {0x1a00, 10, slave_4_pdo_entries + 0}, /* AI TxPDO-Map Standard Ch.1 */ - {0x1a02, 10, slave_4_pdo_entries + 10}, /* AI TxPDO-Map Standard Ch.2 */ - {0x1a04, 10, slave_4_pdo_entries + 20}, /* AI TxPDO-Map Standard Ch.3 */ - {0x1a06, 10, slave_4_pdo_entries + 30}, /* AI TxPDO-Map Standard Ch.4 */ - {0x1a08, 10, slave_4_pdo_entries + 40}, /* AI TxPDO-Map Standard Ch.5 */ - {0x1a0a, 10, slave_4_pdo_entries + 50}, /* AI TxPDO-Map Standard Ch.6 */ - {0x1a0c, 10, slave_4_pdo_entries + 60}, /* AI TxPDO-Map Standard Ch.7 */ - {0x1a0e, 10, slave_4_pdo_entries + 70}, /* AI TxPDO-Map Standard Ch.8 */ +static +ec_pdo_info_t slave_4_pdos[] = { + {0x1a00, 10, slave_4_pdo_entries + 0}, // AI TxPDO-Map Standard Ch.1 + {0x1a02, 10, slave_4_pdo_entries + 10}, // AI TxPDO-Map Standard Ch.2 + {0x1a04, 10, slave_4_pdo_entries + 20}, // AI TxPDO-Map Standard Ch.3 + {0x1a06, 10, slave_4_pdo_entries + 30}, // AI TxPDO-Map Standard Ch.4 + {0x1a08, 10, slave_4_pdo_entries + 40}, // AI TxPDO-Map Standard Ch.5 + {0x1a0a, 10, slave_4_pdo_entries + 50}, // AI TxPDO-Map Standard Ch.6 + {0x1a0c, 10, slave_4_pdo_entries + 60}, // AI TxPDO-Map Standard Ch.7 + {0x1a0e, 10, slave_4_pdo_entries + 70}, // AI TxPDO-Map Standard Ch.8 }; -static ec_sync_info_t slave_4_syncs[] = { +static +ec_sync_info_t slave_4_syncs[] = { {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE}, {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE}, {2, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE}, diff --git a/include/villas/nodes/example.hpp b/include/villas/nodes/example.hpp index 5afbe6e9f..1e4daf4a6 100644 --- a/include/villas/nodes/example.hpp +++ b/include/villas/nodes/example.hpp @@ -1,13 +1,12 @@ -/** An example get started with new implementations of new node-types +/* An example get started with new implementations of new node-types * * This example does not do any particulary useful. * It is just a skeleton to get you started with new node-types. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,20 +17,20 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class ExampleNode : public Node { protected: - /* Place any configuration and per-node state here */ + // Place any configuration and per-node state here - /* Settings */ + // Settings int setting1; std::string setting2; - /* States */ + // States int state1; struct timespec start_time; @@ -57,7 +56,7 @@ public: virtual int parse(json_t *json); - /** Validate node configuration. */ + // Validate node configuration virtual int check(); @@ -92,6 +91,5 @@ public: const std::string & getDetails(); }; - } // namespace node } // namespace villas diff --git a/include/villas/nodes/exec.hpp b/include/villas/nodes/exec.hpp index 6f666cdd7..000222a57 100644 --- a/include/villas/nodes/exec.hpp +++ b/include/villas/nodes/exec.hpp @@ -1,10 +1,9 @@ -/** Node-type for exec node-types. +/* Node-type for exec node-types. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class ExecNode : public Node { diff --git a/include/villas/nodes/file.hpp b/include/villas/nodes/file.hpp index 72dd1bf4b..a5ebad8c2 100644 --- a/include/villas/nodes/file.hpp +++ b/include/villas/nodes/file.hpp @@ -1,10 +1,9 @@ -/** Node type: File +/* Node type: File * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -16,7 +15,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; #define FILE_MAX_PATHLEN 512 @@ -26,15 +25,15 @@ struct file { FILE *stream_in; FILE *stream_out; - char *uri_tmpl; /**< Format string for file name. */ - char *uri; /**< Real file name. */ + char *uri_tmpl; // Format string for file name. + char *uri; // Real file name. - unsigned skip_lines; /**< Skip the first n-th lines/samples of the file. */ - int flush; /**< Flush / upload file contents after each write. */ - struct Task task; /**< Timer file descriptor. Blocks until 1 / rate seconds are elapsed. */ - double rate; /**< The read rate. */ - size_t buffer_size_out; /**< Defines size of output stream buffer. No buffer is created if value is set to zero. */ - size_t buffer_size_in; /**< Defines size of input stream buffer. No buffer is created if value is set to zero. */ + unsigned skip_lines; // Skip the first n-th lines/samples of the file. + int flush; // Flush / upload file contents after each write. + struct Task task; // Timer file descriptor. Blocks until 1 / rate seconds are elapsed. + double rate; // The read rate. + size_t buffer_size_out; // Defines size of output stream buffer. No buffer is created if value is set to zero. + size_t buffer_size_in; // Defines size of input stream buffer. No buffer is created if value is set to zero. enum class EpochMode { DIRECT, @@ -42,17 +41,17 @@ struct file { RELATIVE, ABSOLUTE, ORIGINAL - } epoch_mode; /**< Specifies how file::offset is calculated. */ + } epoch_mode; // Specifies how file::offset is calculated. enum class EOFBehaviour { - STOP, /**< Terminate when EOF is reached. */ - REWIND, /**< Rewind the file when EOF is reached. */ - SUSPEND /**< Blocking wait when EOF is reached. */ + STOP, // Terminate when EOF is reached. + REWIND, // Rewind the file when EOF is reached. + SUSPEND // Blocking wait when EOF is reached. } eof_mode; - struct timespec first; /**< The first timestamp in the file file::{read,write}::uri */ - struct timespec epoch; /**< The epoch timestamp from the configuration. */ - struct timespec offset; /**< An offset between the timestamp in the input file and the current time */ + struct timespec first; // The first timestamp in the file file::{read,write}::uri + struct timespec epoch; // The epoch timestamp from the configuration. + struct timespec offset; // An offset between the timestamp in the input file and the current time }; char * file_print(NodeCompat *n); diff --git a/include/villas/nodes/fpga.hpp b/include/villas/nodes/fpga.hpp index 79edaf907..2c035716f 100644 --- a/include/villas/nodes/fpga.hpp +++ b/include/villas/nodes/fpga.hpp @@ -1,10 +1,9 @@ -/** Communicate with VILLASfpga Xilinx FPGA boards +/* Communicate with VILLASfpga Xilinx FPGA boards * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -73,7 +72,6 @@ public: std::vector getPollFDs(); }; - class FpgaNodeFactory : public NodeFactory { public: diff --git a/include/villas/nodes/iec60870.hpp b/include/villas/nodes/iec60870.hpp index e487f2040..45fc4f879 100644 --- a/include/villas/nodes/iec60870.hpp +++ b/include/villas/nodes/iec60870.hpp @@ -1,10 +1,9 @@ -/** Node type: IEC60870-5-104 +/* Node type: IEC60870-5-104 * - * @file - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -48,7 +47,8 @@ public: }; // Parse the config json - static ASDUData parse(json_t *json_signal, std::optional last_data, bool duplicate_ioa_is_sequence); + static + ASDUData parse(json_t *json_signal, std::optional last_data, bool duplicate_ioa_is_sequence); // Does this data include a timestamp bool hasTimestamp() const; @@ -89,7 +89,8 @@ private: SignalType signal_type; }; - inline static std::array const descriptors { + inline static + std::array const descriptors { ASDUData::Descriptor { Type::SINGLE_POINT, "single-point", "M_SP_NA_1", false, Type::SINGLE_POINT, SignalType::BOOLEAN }, ASDUData::Descriptor { Type::SINGLE_POINT_WITH_TIMESTAMP, "single-point", "M_SP_TB_1", true, Type::SINGLE_POINT, SignalType::BOOLEAN }, ASDUData::Descriptor { Type::DOUBLE_POINT, "double-point", "M_DP_NA_1", false, Type::DOUBLE_POINT, SignalType::INTEGER }, @@ -105,13 +106,16 @@ private: ASDUData(ASDUData::Descriptor const *descriptor, int ioa, int ioa_sequence_start); // Lookup datatype for config key asdu_type - static std::optional lookupName(char const *name, bool with_timestamp, int ioa, int ioa_sequence_start); + static + std::optional lookupName(char const *name, bool with_timestamp, int ioa, int ioa_sequence_start); // Lookup datatype for config key asdu_type_id - static std::optional lookupTypeId(char const *type_id, int ioa, int ioa_sequence_start); + static + std::optional lookupTypeId(char const *type_id, int ioa, int ioa_sequence_start); // Lookup datatype for numeric type identifier - static std::optional lookupType(int type, int ioa, int ioa_sequence_start); + static + std::optional lookupType(int type, int ioa, int ioa_sequence_start); // Descriptor within the descriptors table above ASDUData::Descriptor const *descriptor; @@ -186,6 +190,6 @@ public: int stop() override; }; -} /* namespace iec60870 */ +} // namespace iec60870 } // namespace node } // namespace villas diff --git a/include/villas/nodes/iec61850.hpp b/include/villas/nodes/iec61850.hpp index 786744129..c2182970b 100644 --- a/include/villas/nodes/iec61850.hpp +++ b/include/villas/nodes/iec61850.hpp @@ -1,10 +1,9 @@ -/** Some helpers to libiec61850 +/* Some helpers to libiec61850 * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -27,11 +26,11 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; enum class IEC61850Type { - /* According to IEC 61850-7-2 */ + // According to IEC 61850-7-2 BOOLEAN, INT8, INT16, @@ -52,7 +51,7 @@ enum class IEC61850Type { TIMESTAMP, ENTRYTIME, - /* According to IEC 61850-8-1 */ + // According to IEC 61850-8-1 BITSTRING }; diff --git a/include/villas/nodes/iec61850_goose.hpp b/include/villas/nodes/iec61850_goose.hpp index c11770b4e..7e2b20bc3 100644 --- a/include/villas/nodes/iec61850_goose.hpp +++ b/include/villas/nodes/iec61850_goose.hpp @@ -1,9 +1,9 @@ -/** Node type: IEC 61850 - GOOSE +/* Node type: IEC 61850 - GOOSE * - * @author Philipp Jungkamp - * @copyright 2023, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -254,6 +254,6 @@ public: int stop() override; }; -} /* namespace iec61850 */ +} // namespace iec61850 } // namespace node } // namespace villas diff --git a/include/villas/nodes/iec61850_sv.hpp b/include/villas/nodes/iec61850_sv.hpp index 51c7ef121..26b4e85e6 100644 --- a/include/villas/nodes/iec61850_sv.hpp +++ b/include/villas/nodes/iec61850_sv.hpp @@ -1,10 +1,9 @@ -/** Node type: IEC 61850-9-2 (Sampled Values) +/* Node type: IEC 61850-9-2 (Sampled Values) * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,7 +20,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct iec61850_sv { @@ -38,7 +37,7 @@ struct iec61850_sv { struct CQueueSignalled queue; struct Pool pool; - struct List signals; /**< Mappings of type struct iec61850_type_descriptor */ + struct List signals; // Mappings of type struct iec61850_type_descriptor int total_size; } in; @@ -56,7 +55,7 @@ struct iec61850_sv { int smprate; int confrev; - struct List signals; /**< Mappings of type struct iec61850_type_descriptor */ + struct List signals; // Mappings of type struct iec61850_type_descriptor int total_size; } out; }; diff --git a/include/villas/nodes/infiniband.hpp b/include/villas/nodes/infiniband.hpp index 0678b37a5..1b2651433 100644 --- a/include/villas/nodes/infiniband.hpp +++ b/include/villas/nodes/infiniband.hpp @@ -1,10 +1,9 @@ -/** Node type: infiniband +/* Node type: infiniband * - * @file - * @author Dennis Potter - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Dennis Potter + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -16,17 +15,17 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; -/* Constants */ +// Constants #define META_SIZE 24 #define GRH_SIZE 40 #define META_GRH_SIZE META_SIZE + GRH_SIZE #define CHK_PER_ITER 2048 struct infiniband { - /* IBV/RDMA CM structs */ + // IBV/RDMA CM structs struct context_s { struct rdma_cm_id *listen_id; struct rdma_cm_id *id; @@ -38,48 +37,48 @@ struct infiniband { struct ibv_comp_channel *comp_channel; } ctx; - /* Queue Pair init variables */ + // Queue Pair init variables struct ibv_qp_init_attr qp_init; - /* Size of receive and send completion queue */ + // Size of receive and send completion queue int recv_cq_size; int send_cq_size; - /* Bool, set if threads should be aborted */ + // Bool, set if threads should be aborted int stopThreads; - /* When most messages are sent inline, once every cycles a signal must be sent. */ + // When most messages are sent inline, once every cycles a signal must be sent. unsigned signaling_counter; unsigned periodic_signaling; - /* Connection specific variables */ + // Connection specific variables struct connection_s { struct addrinfo *src_addr; struct addrinfo *dst_addr; - /* RDMA_PS_TCP or RDMA_PS_UDP */ + // RDMA_PS_TCP or RDMA_PS_UDP enum rdma_port_space port_space; - /* Timeout for rdma_resolve_route */ + // Timeout for rdma_resolve_route int timeout; - /* Thread to monitor RDMA CM Event threads */ + // Thread to monitor RDMA CM Event threads pthread_t rdma_cm_event_thread; - /* Bool, should data be send inline if possible? */ + // Bool, should data be send inline if possible? int send_inline; - /* Bool, should node have a fallback if it can't connect to a remote host? */ + // Bool, should node have a fallback if it can't connect to a remote host? int use_fallback; - /* Counter to keep track of available recv. WRs */ + // Counter to keep track of available recv. WRs unsigned available_recv_wrs; /* Fixed number to substract from min. number available * WRs in receive queue */ unsigned buffer_subtraction; - /* Unrealiable connectionless data */ + // Unrealiable connectionless data struct ud_s { struct rdma_ud_param ud; struct ibv_ah *ah; @@ -89,7 +88,7 @@ struct infiniband { } conn; - /* Misc settings */ + // Misc settings int is_source; }; diff --git a/include/villas/nodes/influxdb.hpp b/include/villas/nodes/influxdb.hpp index 91e66e6bf..2352a12ed 100644 --- a/include/villas/nodes/influxdb.hpp +++ b/include/villas/nodes/influxdb.hpp @@ -1,10 +1,9 @@ -/** Node-type for InfluxDB. +/* Node-type for InfluxDB. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -13,7 +12,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct Sample; diff --git a/include/villas/nodes/kafka.hpp b/include/villas/nodes/kafka.hpp index a7bffb9c6..e00149324 100644 --- a/include/villas/nodes/kafka.hpp +++ b/include/villas/nodes/kafka.hpp @@ -1,10 +1,9 @@ -/** Node type: kafka +/* Node type: kafka * - * @file - * @author Juan Pablo Noreña - * @copyright 2021, Universidad Nacional de Colombia - * @license Apache 2.0 - *********************************************************************************/ + * Author: Juan Pablo Noreña + * SPDX-FileCopyrightText: 2021 Universidad Nacional de Colombia + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,19 +16,19 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct kafka { struct CQueueSignalled queue; struct Pool pool; - double timeout; /**< Timeout in seconds. */ - char *server; /**< Hostname/IP:Port address of the bootstrap server. */ - char *protocol; /**< Security protocol. */ - char *produce; /**< Producer topic. */ - char *consume; /**< Consumer topic. */ - char *client_id; /**< Client ID. */ + double timeout; // Timeout in seconds. + char *server; // Hostname/IP:Port address of the bootstrap server. + char *protocol; // Security protocol. + char *produce; // Producer topic. + char *consume; // Consumer topic. + char *client_id; // Client ID. struct { rd_kafka_t *client; @@ -38,17 +37,17 @@ struct kafka { struct { rd_kafka_t *client; - char *group_id; /**< Group id. */ + char *group_id; // Group id. } consumer; struct { - char *ca; /**< SSL CA file. */ + char *ca; // SSL CA file. } ssl; struct { - char *mechanisms; /**< SASL mechanisms. */ - char *username; /**< SSL CA path. */ - char *password; /**< SSL certificate. */ + char *mechanisms; // SASL mechanisms. + char *username; // SSL CA path. + char *password; // SSL certificate. } sasl; Format *formatter; diff --git a/include/villas/nodes/loopback.hpp b/include/villas/nodes/loopback.hpp index 7813e24e4..404ce1571 100644 --- a/include/villas/nodes/loopback.hpp +++ b/include/villas/nodes/loopback.hpp @@ -1,10 +1,9 @@ -/** Node-type for loopback connections. +/* Node-type for loopback connections. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/nodes/loopback_internal.hpp b/include/villas/nodes/loopback_internal.hpp index ff38604e2..7dcfc30a8 100644 --- a/include/villas/nodes/loopback_internal.hpp +++ b/include/villas/nodes/loopback_internal.hpp @@ -1,10 +1,9 @@ -/** Node type: internal loopback +/* Node type: internal loopback * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/nodes/modbus.hpp b/include/villas/nodes/modbus.hpp index b5472602d..27436d2be 100644 --- a/include/villas/nodes/modbus.hpp +++ b/include/villas/nodes/modbus.hpp @@ -1,9 +1,9 @@ -/** A Modbus node-type supporting RTU and TCP based transports. +/* A Modbus node-type supporting RTU and TCP based transports. * - * @author Philipp Jungkamp - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -65,7 +65,7 @@ struct Tcp { Tcp parse(json_t *json); }; -// Forward declaration. +// Forward declarations class RegisterMappingSingle; // A merged block of mappings. diff --git a/include/villas/nodes/mqtt.hpp b/include/villas/nodes/mqtt.hpp index 0e5ba87e0..7c852b163 100644 --- a/include/villas/nodes/mqtt.hpp +++ b/include/villas/nodes/mqtt.hpp @@ -1,10 +1,9 @@ -/** Node type: mqtt +/* Node type: mqtt * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -13,13 +12,13 @@ #include #include -/* Forward declarations */ +// Forward declarations struct mosquitto; namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct mqtt { @@ -27,26 +26,26 @@ struct mqtt { struct CQueueSignalled queue; struct Pool pool; - int keepalive; /**< Keep-alive interval in seconds. Zero for no keepalive. */ - int port; /**< Hostname / IP address of the broker. */ - int qos; /**< Integer value 0, 1 or 2 indicating the Quality of Service to be used for publishing messages. */ - int retain; /**< Mark published messages as retained. */ - char *host; /**< Hostname / IP address of the broker. */ - char *username; /**< Username for authentication to the broker. */ - char *password; /**< Password for authentication to the broker. */ - char *publish; /**< Publish topic. */ - char *subscribe; /**< Subscribe topic. */ + int keepalive; // Keep-alive interval in seconds. Zero for no keepalive. + int port; // Hostname / IP address of the broker. + int qos; // Integer value 0, 1 or 2 indicating the Quality of Service to be used for publishing messages. + int retain; // Mark published messages as retained. + char *host; // Hostname / IP address of the broker. + char *username; // Username for authentication to the broker. + char *password; // Password for authentication to the broker. + char *publish; // Publish topic. + char *subscribe; // Subscribe topic. struct { - int enabled; /**< Enable SSL encrypted connection to broker. */ - int insecure; /**< Allow insecure SSL connections. */ - char *cafile; /**< SSL CA file. */ - char *capath; /**< SSL CA path. */ - char *certfile; /**< SSL certificate. */ - char *keyfile; /**< SSL private key. */ - int cert_reqs; /**< SSL_VERIFY_NONE(0) or SSL_VERIFY_PEER(1) */ - char *tls_version; /**< SSL tls verion */ - char *ciphers; /**< SSL chipher list. */ + int enabled; // Enable SSL encrypted connection to broker. + int insecure; // Allow insecure SSL connections. + char *cafile; // SSL CA file. + char *capath; // SSL CA path. + char *certfile; // SSL certificate. + char *keyfile; // SSL private key. + int cert_reqs; // SSL_VERIFY_NONE(0) or SSL_VERIFY_PEER(1) + char *tls_version; // SSL tls verion + char *ciphers; // SSL chipher list. } ssl; Format *formatter; diff --git a/include/villas/nodes/nanomsg.hpp b/include/villas/nodes/nanomsg.hpp index b280a690a..05c786618 100644 --- a/include/villas/nodes/nanomsg.hpp +++ b/include/villas/nodes/nanomsg.hpp @@ -1,10 +1,9 @@ -/** Node type: nanomsg +/* Node type: nanomsg * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,10 +13,10 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; -/** The maximum length of a packet which contains stuct msg. */ +// The maximum length of a packet which contains stuct msg. #define NANOMSG_MAX_PACKET_LEN 1500 struct nanomsg { diff --git a/include/villas/nodes/ngsi.hpp b/include/villas/nodes/ngsi.hpp index 3202e7382..ff81e095d 100644 --- a/include/villas/nodes/ngsi.hpp +++ b/include/villas/nodes/ngsi.hpp @@ -1,4 +1,4 @@ -/** Node type: OMA Next Generation Services Interface 10 (NGSI) (FIWARE context broker) +/* Node type: OMA Next Generation Services Interface 10 (NGSI) (FIWARE context broker) * * This file implements the NGSI context interface. NGSI is RESTful HTTP is specified by * the Open Mobile Alliance (OMA). @@ -6,11 +6,10 @@ * * @see https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_NGSI-10_Open_RESTful_API_Specification * @see http://technical.openmobilealliance.org/Technical/Release_Program/docs/NGSI/V1_0-20120529-A/OMA-TS-NGSI_Context_Management-V1_0-20120529-A.pdf - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,33 +22,32 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct ngsi { - const char *endpoint; /**< The NGSI context broker endpoint URL. */ - const char *entity_id; /**< The context broker entity id related to this node */ - const char *entity_type; /**< The type of the entity */ - const char *access_token; /**< An optional authentication token which will be sent as HTTP header. */ + const char *endpoint; // The NGSI context broker endpoint URL. + const char *entity_id; // The context broker entity id related to this node + const char *entity_type; // The type of the entity + const char *access_token; // An optional authentication token which will be sent as HTTP header. - bool create; /**< Weather we want to create the context element during startup. */ - bool remove; /**< Weather we want to delete the context element during startup. */ + bool create; // Weather we want to create the context element during startup. + bool remove; // Weather we want to delete the context element during startup. - double timeout; /**< HTTP timeout in seconds */ - double rate; /**< Rate used for polling. */ + double timeout; // HTTP timeout in seconds + double rate; // Rate used for polling. - struct Task task; /**< Timer for periodic events. */ - int ssl_verify; /**< Boolean flag whether SSL server certificates should be verified or not. */ + struct Task task; // Timer for periodic events. + int ssl_verify; // Boolean flag whether SSL server certificates should be verified or not. - struct curl_slist *headers; /**< List of HTTP request headers for libcurl */ + struct curl_slist *headers; // List of HTTP request headers for libcurl struct { - CURL *curl; /**< libcurl: handle */ - struct List signals; /**< A mapping between indices of the VILLASnode samples and the attributes in ngsi::context */ + CURL *curl; // libcurl: handle + struct List signals; // A mapping between indices of the VILLASnode samples and the attributes in ngsi::context } in, out; }; - int ngsi_type_start(SuperNode *sn); int ngsi_type_stop(); diff --git a/include/villas/nodes/opal.hpp b/include/villas/nodes/opal.hpp index ba09adac5..038f8767e 100644 --- a/include/villas/nodes/opal.hpp +++ b/include/villas/nodes/opal.hpp @@ -1,10 +1,9 @@ -/** Node type: OPAL (libOpalAsync API) +/* Node type: OPAL (libOpalAsync API) * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; extern "C" { diff --git a/include/villas/nodes/redis.hpp b/include/villas/nodes/redis.hpp index d2cbd0181..0ecb4bc8f 100644 --- a/include/villas/nodes/redis.hpp +++ b/include/villas/nodes/redis.hpp @@ -1,10 +1,9 @@ -/** Redis node-type +/* Redis node-type * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -79,10 +78,10 @@ struct redis { std::string key; - bool notify; /**< Use Redis Keyspace notifications to listen for updates. */ + bool notify; // Use Redis Keyspace notifications to listen for updates. - struct Task task; /**< Timer for periodic events. */ - double rate; /**< Rate for polling key updates if keyspace notifications are disabled. */ + struct Task task; // Timer for periodic events. + double rate; // Rate for polling key updates if keyspace notifications are disabled. Format *formatter; diff --git a/include/villas/nodes/redis_helpers.hpp b/include/villas/nodes/redis_helpers.hpp index be967972c..3de183da5 100644 --- a/include/villas/nodes/redis_helpers.hpp +++ b/include/villas/nodes/redis_helpers.hpp @@ -1,10 +1,9 @@ -/** Redis node-type helpers +/* Redis node-type helpers * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -40,7 +39,7 @@ struct hash hash()(t.sni); #else return 0; -#endif /* REDISPP_WITH_TLS */ +#endif // REDISPP_WITH_TLS } }; @@ -79,7 +78,7 @@ bool operator==(const tls::TlsOptions &o1, const tls::TlsOptions &o2) o1.sni == o2.sni; #else return true; -#endif /* REDISPP_WITH_TLS */ +#endif // REDISPP_WITH_TLS } bool operator==(const ConnectionOptions &o1, const ConnectionOptions &o2) @@ -122,7 +121,7 @@ OStream &operator<<(OStream &os, const tls::TlsOptions &t) return os; } -#endif /* REDISPP_WITH_TLS */ +#endif // REDISPP_WITH_TLS template OStream &operator<<(OStream &os, const ConnectionType &t) diff --git a/include/villas/nodes/rtp.hpp b/include/villas/nodes/rtp.hpp index 1f3c96372..2005c6e0b 100644 --- a/include/villas/nodes/rtp.hpp +++ b/include/villas/nodes/rtp.hpp @@ -1,11 +1,10 @@ -/** Node type: rtp +/* Node type: rtp * - * @file - * @author Steffen Vogel - * @author Marvin Klimke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Marvin Klimke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -29,11 +28,11 @@ extern "C" { namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; class SuperNode; -/** The maximum length of a packet which contains rtp data. */ +// The maximum length of a packet which contains rtp data. #define RTP_INITIAL_BUFFER_LEN 1500 #define RTP_PACKET_TYPE 21 @@ -44,11 +43,11 @@ enum class RTPHookType { }; struct rtp { - struct rtp_sock *rs; /**< RTP socket */ + struct rtp_sock *rs; // RTP socket struct { - struct sa saddr_rtp; /**< Local/Remote address of the RTP socket */ - struct sa saddr_rtcp; /**< Local/Remote address of the RTCP socket */ + struct sa saddr_rtp; // Local/Remote address of the RTP socket + struct sa saddr_rtcp; // Local/Remote address of the RTCP socket } in, out; Format *formatter; @@ -68,16 +67,16 @@ struct rtp { LimitHook::Ptr rate_hook; dsp::PID rate_pid; - /* PID parameters for rate controller */ + // PID parameters for rate controller double Kp, Ki, Kd; double rate_min; double rate; - double rate_source; /**< Sample rate of source */ + double rate_source; // Sample rate of source std::ofstream *log; char *log_filename; - } aimd; /** AIMD state */ + } aimd; // AIMD state struct CQueueSignalled recv_queue; struct mbuf *send_mb; diff --git a/include/villas/nodes/shmem.hpp b/include/villas/nodes/shmem.hpp index ae94d446b..7fbf4d81e 100644 --- a/include/villas/nodes/shmem.hpp +++ b/include/villas/nodes/shmem.hpp @@ -1,10 +1,9 @@ -/** Node-type for shared memory communication. +/* Node-type for shared memory communication. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,15 +16,15 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct shmem { - const char* out_name; /**< Name of the shm object for the output queue. */ - const char* in_name; /**< Name of the shm object for the input queue. */ - struct ShmemConfig conf; /**< Interface configuration struct. */ - char **exec; /**< External program to execute on start. */ - struct ShmemInterface intf; /**< Shmem interface */ + const char* out_name; // Name of the shm object for the output queue. + const char* in_name; // Name of the shm object for the input queue. + struct ShmemConfig conf; // Interface configuration struct. + char **exec; // External program to execute on start. + struct ShmemInterface intf; // Shmem interface }; char * shmem_print(NodeCompat *n); diff --git a/include/villas/nodes/signal.hpp b/include/villas/nodes/signal.hpp index f63dcc328..e0a09a0e0 100644 --- a/include/villas/nodes/signal.hpp +++ b/include/villas/nodes/signal.hpp @@ -1,10 +1,9 @@ -/** Node-type for signal generation. +/* Node-type for signal generation. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class SignalNodeSignal { @@ -35,15 +34,15 @@ public: enum Type type; - double frequency; /**< Frequency of the generated signals. */ - double amplitude; /**< Amplitude of the generated signals. */ - double stddev; /**< Standard deviation of random signals (normal distributed). */ - double offset; /**< A constant bias. */ - double pulse_width; /**< Width of a pulse with respect to the rate (duration = pulse_width/rate) */ - double pulse_low; /**< Amplitude when pulse signal is off */ - double pulse_high; /**< Amplitude when pulse signal is on */ - double phase; /**< Phase (rad) offset with respect to program start */ - double last; /**< The values from the previous period which are required for random walk. */ + double frequency; // Frequency of the generated signals. + double amplitude; // Amplitude of the generated signals. + double stddev; // Standard deviation of random signals (normal distributed). + double offset; // A constant bias. + double pulse_width; // Width of a pulse with respect to the rate (duration = pulse_width/rate) + double pulse_low; // Amplitude when pulse signal is off + double pulse_high; // Amplitude when pulse signal is on + double phase; // Phase (rad) offset with respect to program start + double last; // The values from the previous period which are required for random walk. public: SignalNodeSignal(json_t *json); @@ -68,15 +67,15 @@ class SignalNode : public Node { protected: std::vector signals; - struct Task task; /**< Timer for periodic events. */ - int rt; /**< Real-time mode? */ + struct Task task; // Timer for periodic events. + int rt; // Real-time mode? - double rate; /**< Sampling rate. */ - bool monitor_missed; /**< Boolean, if set, node counts missed steps and warns user. */ - int limit; /**< The number of values which should be generated by this node. <0 for infinite. */ + double rate; // Sampling rate. + bool monitor_missed; // Boolean, if set, node counts missed steps and warns user. + int limit; // The number of values which should be generated by this node. <0 for infinite. - struct timespec started; /**< Point in time when this node was started. */ - unsigned missed_steps; /**< Total number of missed steps. */ + struct timespec started; // Point in time when this node was started. + unsigned missed_steps; // Total number of missed steps. virtual int _read(struct Sample *smps[], unsigned cnt); diff --git a/include/villas/nodes/signal_old.hpp b/include/villas/nodes/signal_old.hpp index c0200cf0d..9617d4a1a 100644 --- a/include/villas/nodes/signal_old.hpp +++ b/include/villas/nodes/signal_old.hpp @@ -1,10 +1,9 @@ -/** Node-type for signal generation. +/* Node-type for signal generation. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,13 +13,13 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct Sample; struct signal_node { - struct Task task; /**< Timer for periodic events. */ - int rt; /**< Real-time mode? */ + struct Task task; // Timer for periodic events. + int rt; // Real-time mode? enum class SignalType { RANDOM, @@ -32,27 +31,27 @@ struct signal_node { CONSTANT, MIXED, PULSE - } *type; /**< Signal type */ + } *type; // Signal type - double rate; /**< Sampling rate. */ - double *frequency; /**< Frequency of the generated signals. */ - double *amplitude; /**< Amplitude of the generated signals. */ - double *stddev; /**< Standard deviation of random signals (normal distributed). */ - double *offset; /**< A constant bias. */ - double *pulse_width; /**< Width of a pulse with respect to the rate (duration = pulse_width/rate) */ - double *pulse_low; /**< Amplitude when pulse signal is off */ - double *pulse_high; /**< Amplitude when pulse signal is on */ - double *phase; /**< Phase (rad) offset with respect to program start */ - int monitor_missed; /**< Boolean, if set, node counts missed steps and warns user. */ + double rate; // Sampling rate. + double *frequency; // Frequency of the generated signals. + double *amplitude; // Amplitude of the generated signals. + double *stddev; // Standard deviation of random signals (normal distributed). + double *offset; // A constant bias. + double *pulse_width; // Width of a pulse with respect to the rate (duration = pulse_width/rate) + double *pulse_low; // Amplitude when pulse signal is off + double *pulse_high; // Amplitude when pulse signal is on + double *phase; // Phase (rad) offset with respect to program start + int monitor_missed; // Boolean, if set, node counts missed steps and warns user. - double *last; /**< The values from the previous period which are required for random walk. */ + double *last; // The values from the previous period which are required for random walk. - unsigned values; /**< The number of values which will be emitted by this node. */ - int limit; /**< The number of values which should be generated by this node. <0 for infinitve. */ + unsigned values; // The number of values which will be emitted by this node. + int limit; // The number of values which should be generated by this node. <0 for infinitve. - struct timespec started; /**< Point in time when this node was started. */ - unsigned counter; /**< The number of packets already emitted. */ - unsigned missed_steps; /**< Total number of missed steps. */ + struct timespec started; // Point in time when this node was started. + unsigned counter; // The number of packets already emitted. + unsigned missed_steps; // Total number of missed steps. }; char * signal_node_print(NodeCompat *n); diff --git a/include/villas/nodes/socket.hpp b/include/villas/nodes/socket.hpp index f4fc53539..31284b387 100644 --- a/include/villas/nodes/socket.hpp +++ b/include/villas/nodes/socket.hpp @@ -1,10 +1,9 @@ -/** The socket node-type for Layer 2, 3, 4 BSD-style sockets +/* The socket node-type for Layer 2, 3, 4 BSD-style sockets * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,36 +14,35 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; -/** The maximum length of a packet which contains stuct msg. */ +// The maximum length of a packet which contains stuct msg. #define SOCKET_INITIAL_BUFFER_LEN (64*1024) struct Socket { - int sd; /**< The socket descriptor */ - int verify_source; /**< Verify the source address of incoming packets against socket::remote. */ + int sd; // The socket descriptor + int verify_source; // Verify the source address of incoming packets against socket::remote. - enum SocketLayer layer; /**< The OSI / IP layer which should be used for this socket */ + enum SocketLayer layer; // The OSI / IP layer which should be used for this socket Format *formatter; - /* Multicast options */ + // Multicast options struct multicast { - int enabled; /**< Is multicast enabled? */ - unsigned char loop; /** Loopback multicast packets to local host? */ - unsigned char ttl; /**< The time to live for multicast packets. */ - struct ip_mreq mreq; /**< A multicast group to join. */ + int enabled; // Is multicast enabled? + unsigned char loop; // Loopback multicast packets to local host? + unsigned char ttl; // The time to live for multicast packets. + struct ip_mreq mreq; // A multicast group to join. } multicast; struct { - char *buf; /**< Buffer for receiving messages */ + char *buf; // Buffer for receiving messages size_t buflen; - union sockaddr_union saddr; /**< Remote address of the socket */ + union sockaddr_union saddr; // Remote address of the socket } in, out; }; - int socket_type_start(SuperNode *sn); int socket_type_stop(); diff --git a/include/villas/nodes/stats.hpp b/include/villas/nodes/stats.hpp index 9b9c45b7b..f25dac4b5 100644 --- a/include/villas/nodes/stats.hpp +++ b/include/villas/nodes/stats.hpp @@ -1,10 +1,9 @@ -/** Node-type for stats streaming. +/* Node-type for stats streaming. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,7 +16,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct stats_node_signal { @@ -33,7 +32,7 @@ struct stats_node { struct Task task; - struct List signals; /** List of type struct stats_node_signal */ + struct List signals; // List of type struct stats_node_signal }; int stats_node_type_start(SuperNode *sn); diff --git a/include/villas/nodes/temper.hpp b/include/villas/nodes/temper.hpp index 9224b3540..4089d7aa7 100644 --- a/include/villas/nodes/temper.hpp +++ b/include/villas/nodes/temper.hpp @@ -1,10 +1,9 @@ -/** An temper get started with new implementations of new node-types +/* An temper get started with new implementations of new node-types * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,13 +16,14 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; class TEMPerDevice : public villas::usb::Device { protected: - constexpr static unsigned char question_temperature[] = { 0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00 }; + constexpr static + unsigned char question_temperature[] = { 0x01, 0x80, 0x33, 0x01, 0x00, 0x00, 0x00, 0x00 }; float scale; float offset; @@ -32,22 +32,31 @@ protected: villas::Logger logger; - virtual void decode(unsigned char *answer, float *temp) = 0; + virtual + void decode(unsigned char *answer, float *temp) = 0; public: - static TEMPerDevice * make(struct libusb_device *desc); + static + TEMPerDevice * make(struct libusb_device *desc); TEMPerDevice(struct libusb_device *dev); - virtual ~TEMPerDevice() + virtual + ~TEMPerDevice() { } void open(bool reset = true); void close(); - virtual int getNumSensors() const - { return 1; } + virtual + int getNumSensors() const + { + return 1; + } - virtual bool hasHumiditySensor() const - { return false; }; + virtual + bool hasHumiditySensor() const + { + return false; + } void read(struct Sample *smp); }; @@ -55,49 +64,70 @@ public: class TEMPer1Device : public TEMPerDevice { protected: - virtual void decode(unsigned char *answer, float *temp); + virtual + void decode(unsigned char *answer, float *temp); using TEMPerDevice::TEMPerDevice; public: - static bool match(struct libusb_device *dev); + static + bool match(struct libusb_device *dev); - static std::string getName() - { return "TEMPer1"; } + static + std::string getName() + { + return "TEMPer1"; + } }; class TEMPer2Device : public TEMPer1Device { protected: - virtual void decode(unsigned char *answer, float *temp); + virtual + void decode(unsigned char *answer, float *temp); using TEMPer1Device::TEMPer1Device; public: - static bool match(struct libusb_device *dev); + static + bool match(struct libusb_device *dev); - static std::string getName() - { return "TEMPer2"; } + static + std::string getName() + { + return "TEMPer2"; + } - virtual int getNumSensors() const - { return 2; } + virtual + int getNumSensors() const + { + return 2; + } }; class TEMPerHUMDevice : public TEMPerDevice { protected: - virtual void decode(unsigned char *answer, float *temp); + virtual + void decode(unsigned char *answer, float *temp); using TEMPerDevice::TEMPerDevice; public: - static bool match(struct libusb_device *dev); + static + bool match(struct libusb_device *dev); - static std::string getName() - { return "TEMPerHUM"; } + static + std::string getName() + { + return "TEMPerHUM"; + } - virtual bool hasHumiditySensor() const - { return true; } + virtual + bool hasHumiditySensor() const + { + return true; + } }; struct temper { diff --git a/include/villas/nodes/test_rtt.hpp b/include/villas/nodes/test_rtt.hpp index 0e357f090..1d04ef4a5 100644 --- a/include/villas/nodes/test_rtt.hpp +++ b/include/villas/nodes/test_rtt.hpp @@ -1,10 +1,9 @@ -/** Node type: Node-type for testing Round-trip Time. +/* Node type: Node-type for testing Round-trip Time. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct Sample; @@ -24,7 +23,7 @@ struct test_rtt; struct test_rtt_case { double rate; unsigned values; - unsigned limit; /**< The number of samples we take per test. */ + unsigned limit; // The number of samples we take per test. char *filename; char *filename_formatted; @@ -33,19 +32,19 @@ struct test_rtt_case { }; struct test_rtt { - struct Task task; /**< The periodic task for test_rtt_read() */ - Format *formatter;/**< The format of the output file */ + struct Task task; // The periodic task for test_rtt_read() + Format *formatter;// The format of the output file FILE *stream; - double cooldown; /**< Number of seconds to wait beween tests. */ + double cooldown; // Number of seconds to wait beween tests. - int current; /**< Index of current test in test_rtt::cases */ + int current; // Index of current test in test_rtt::cases int counter; - struct List cases; /**< List of test cases */ + struct List cases; // List of test cases - char *output; /**< The directory where we place the results. */ - char *prefix; /**< An optional prefix in the filename. */ + char *output; // The directory where we place the results. + char *prefix; // An optional prefix in the filename. }; char * test_rtt_print(NodeCompat *n); diff --git a/include/villas/nodes/uldaq.hpp b/include/villas/nodes/uldaq.hpp index 8378844ca..0a13c00fc 100644 --- a/include/villas/nodes/uldaq.hpp +++ b/include/villas/nodes/uldaq.hpp @@ -1,11 +1,10 @@ -/** Node-type for uldaq connections. +/* Node-type for uldaq connections. * - * @file - * @author Manuel Pitz - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -71,6 +70,5 @@ int uldaq_stop(NodeCompat *n); int uldaq_read(NodeCompat *n, struct Sample * const smps[], unsigned cnt); - } // namespace node } // namespace villas diff --git a/include/villas/nodes/webrtc.hpp b/include/villas/nodes/webrtc.hpp index 3d7593fd1..89d359ce6 100644 --- a/include/villas/nodes/webrtc.hpp +++ b/include/villas/nodes/webrtc.hpp @@ -1,12 +1,11 @@ -/** Node-type webrtc. +/* Node-type webrtc. * - * @file - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,7 +21,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class WebRTCNode : public Node { @@ -75,7 +74,6 @@ public: const std::string & getDetails(); }; - class WebRTCNodeFactory : public NodeFactory { public: @@ -116,6 +114,5 @@ public: int start(SuperNode *sn); }; - } // namespace node } // namespace villas diff --git a/include/villas/nodes/webrtc/peer_connection.hpp b/include/villas/nodes/webrtc/peer_connection.hpp index ebbfd42e7..9565b6eba 100644 --- a/include/villas/nodes/webrtc/peer_connection.hpp +++ b/include/villas/nodes/webrtc/peer_connection.hpp @@ -1,12 +1,11 @@ -/** WebRTC peer connection +/* WebRTC peer connection * - * @file - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -93,4 +92,3 @@ protected: } // namespace webrtc } // namespace node } // namespace villas - diff --git a/include/villas/nodes/webrtc/signaling_client.hpp b/include/villas/nodes/webrtc/signaling_client.hpp index 13e09eccd..e72bfc714 100644 --- a/include/villas/nodes/webrtc/signaling_client.hpp +++ b/include/villas/nodes/webrtc/signaling_client.hpp @@ -1,12 +1,11 @@ -/** WebRTC signaling client +/* WebRTC signaling client * - * @file - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -24,7 +23,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Web; namespace webrtc { @@ -33,24 +32,26 @@ class SignalingClient { protected: struct sul_offsetof_helper { - lws_sorted_usec_list_t sul; /**> Schedule connection retry */ + lws_sorted_usec_list_t sul; // Schedule connection retry SignalingClient *self; } sul_helper; - uint16_t retry_count; /**> Count of consecutive retries */ + uint16_t retry_count; // Count of consecutive retries struct lws *wsi; struct lws_client_connect_info info; - /* The retry and backoff policy we want to use for our client connections */ - static constexpr uint32_t backoff_ms[] = { 1<<4, 1<<6, 1<<8, 1<<10, 1<<12, 1<<14, 1<<16 }; - static constexpr lws_retry_bo_t retry = { + // The retry and backoff policy we want to use for our client connections + static constexpr + uint32_t backoff_ms[] = { 1<<4, 1<<6, 1<<8, 1<<10, 1<<12, 1<<14, 1<<16 }; + static constexpr + lws_retry_bo_t retry = { .retry_ms_table = backoff_ms, .retry_ms_table_count = LWS_ARRAY_SIZE(backoff_ms), .conceal_count = LWS_ARRAY_SIZE(backoff_ms) + 1, - .secs_since_valid_ping = 3, /* force PINGs after secs idle */ - .secs_since_valid_hangup = 10, /* hangup after secs idle */ + .secs_since_valid_ping = 3, // force PINGs after secs idle + .secs_since_valid_hangup = 10, // hangup after secs idle .jitter_percent = 20, }; @@ -116,4 +117,3 @@ public: } // namespace webrtc } // namespace node } // namespace villas - diff --git a/include/villas/nodes/webrtc/signaling_message.hpp b/include/villas/nodes/webrtc/signaling_message.hpp index b0d651691..f07b350e8 100644 --- a/include/villas/nodes/webrtc/signaling_message.hpp +++ b/include/villas/nodes/webrtc/signaling_message.hpp @@ -1,12 +1,11 @@ -/** WebRTC signaling messages. +/* WebRTC signaling messages. * - * @file - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -52,7 +51,8 @@ struct ControlMessage { struct SignalingMessage { std::variant message; - static SignalingMessage fromJson(json_t *j); + static + SignalingMessage fromJson(json_t *j); json_t * toJson() const; std::string toString() const; }; diff --git a/include/villas/nodes/websocket.hpp b/include/villas/nodes/websocket.hpp index 7a3d74017..581ef2b21 100644 --- a/include/villas/nodes/websocket.hpp +++ b/include/villas/nodes/websocket.hpp @@ -1,10 +1,9 @@ -/** Node type: WebSockets +/* Node type: WebSockets * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,7 +18,7 @@ #include #include -/* Forward declaration */ +// Forward declarations struct lws; namespace villas { @@ -27,14 +26,14 @@ namespace node { #define DEFAULT_WEBSOCKET_QUEUE_LENGTH (DEFAULT_QUEUE_LENGTH * 64) -/** Internal data per websocket node */ +// Internal data per websocket node struct websocket { - struct List destinations; /**< List of websocket servers connect to in client mode (struct websocket_destination). */ + struct List destinations; // List of websocket servers connect to in client mode (struct websocket_destination). - bool wait; /**< Wait until all destinations are connected. */ + bool wait; // Wait until all destinations are connected. struct Pool pool; - struct CQueueSignalled queue; /**< For samples which are received from WebSockets */ + struct CQueueSignalled queue; // For samples which are received from WebSockets }; struct websocket_destination { @@ -42,7 +41,7 @@ struct websocket_destination { struct lws_client_connect_info info; }; -/* Internal datastructures */ +// Internal datastructures struct websocket_connection { enum State { DESTROYED, @@ -53,7 +52,7 @@ struct websocket_connection { CLOSING, CLOSED, ERROR - } state; /**< The current status of this connection. */ + } state; // The current status of this connection. enum class Mode { CLIENT, @@ -63,16 +62,16 @@ struct websocket_connection { struct lws *wsi; NodeCompat *node; Format *formatter; - struct CQueue queue; /**< For samples which are sent to the Websocket */ + struct CQueue queue; // For samples which are sent to the Websocket struct websocket_destination *destination; struct { - villas::Buffer *recv; /**< A buffer for reconstructing fragmented messages. */ - villas::Buffer *send; /**< A buffer for constructing messages before calling lws_write() */ + villas::Buffer *recv; // A buffer for reconstructing fragmented messages. + villas::Buffer *send; // A buffer for constructing messages before calling lws_write() } buffers; - /** Custom formatter for spdlog */ + // Custom formatter for spdlog template friend OStream &operator<<(OStream &os, const struct websocket_connection &c) { diff --git a/include/villas/nodes/zeromq.hpp b/include/villas/nodes/zeromq.hpp index 40de65a29..af3cb5d7e 100644 --- a/include/villas/nodes/zeromq.hpp +++ b/include/villas/nodes/zeromq.hpp @@ -1,10 +1,9 @@ -/** Node type: ZeroMQ +/* Node type: ZeroMQ * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -22,7 +21,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class NodeCompat; struct Sample; @@ -47,7 +46,7 @@ struct zeromq { } pattern; struct Dir { - void *socket; /**< ZeroMQ socket. */ + void *socket; // ZeroMQ socket. void *mon_socket; struct List endpoints; char *filter; diff --git a/include/villas/path.hpp b/include/villas/path.hpp index 3f84f2ac3..a33c15042 100644 --- a/include/villas/path.hpp +++ b/include/villas/path.hpp @@ -1,10 +1,9 @@ -/** Message paths +/* Message paths * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -30,16 +29,16 @@ #include -/* Forward declarations */ +// Forward declarations struct pollfd; namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; -/** The datastructure for a path. */ +// The datastructure for a path. class Path { friend PathSource; friend SecondaryPathSource; @@ -54,16 +53,17 @@ protected: void startPoll(); - static int id; + static + int id; public: - enum State state; /**< Path state. */ + enum State state; // Path state. - /** The register mode determines under which condition the path is triggered. */ + // The register mode determines under which condition the path is triggered. enum class Mode { - ANY, /**< The path is triggered whenever one of the sources receives samples. */ - ALL /**< The path is triggered only after all sources have received at least 1 sample. */ - } mode; /**< Determines when this path is triggered. */ + ANY, // The path is triggered whenever one of the sources receives samples. + ALL // The path is triggered only after all sources have received at least 1 sample. + } mode; // Determines when this path is triggered. uuid_t uuid; @@ -74,32 +74,32 @@ public: int last_sequence; NodeList masked; - MappingList mappings; /**< List of all input mappings. */ - PathSourceList sources; /**< List of all incoming nodes. */ - PathDestinationList destinations; /**< List of all outgoing nodes. */ - HookList hooks; /**< List of processing hooks. */ - SignalList::Ptr signals; /**< List of signals which this path creates. */ + MappingList mappings; // List of all input mappings. + PathSourceList sources; // List of all incoming nodes. + PathDestinationList destinations; // List of all outgoing nodes. + HookList hooks; // List of processing hooks. + SignalList::Ptr signals; // List of signals which this path creates. struct Task timeout; - double rate; /**< A timeout for */ - int affinity; /**< Thread affinity. */ - bool enabled; /**< Is this path enabled? */ - int poll; /**< Weather or not to use poll(2). */ - bool reversed; /**< This path has a matching reverse path. */ - bool builtin; /**< This path should use built-in hooks by default. */ - int original_sequence_no; /**< Use original source sequence number when multiplexing */ - unsigned queuelen; /**< The queue length for each path_destination::queue */ + double rate; // A timeout for + int affinity; // Thread affinity. + bool enabled; // Is this path enabled? + int poll; // Weather or not to use poll(2). + bool reversed; // This path has a matching reverse path. + bool builtin; // This path should use built-in hooks by default. + int original_sequence_no; // Use original source sequence number when multiplexing + unsigned queuelen; // The queue length for each path_destination::queue - pthread_t tid; /**< The thread id for this path. */ - json_t *config; /**< A JSON object containing the configuration of the path. */ + pthread_t tid; // The thread id for this path. + json_t *config; // A JSON object containing the configuration of the path. Logger logger; - std::bitset mask; /**< A mask of PathSources which are enabled for poll(). */ - std::bitset received; /**< A mask of PathSources for which we already received samples. */ + std::bitset mask; // A mask of PathSources which are enabled for poll(). + std::bitset received; // A mask of PathSources for which we already received samples. - /** Custom formatter for spdlog */ + // Custom formatter for spdlog template friend OStream &operator<<(OStream &os, const Path &p) { @@ -138,27 +138,27 @@ public: void prepare(NodeList &nodes); - /** Check if path configuration is proper. */ + // Check if path configuration is proper. void check(); - /** Check prepared path. */ + // Check prepared path. void checkPrepared(); - /** Start a path. + /* Start a path. * * Start a new pthread for receiving/sending messages over this path. */ void start(); - /** Stop a path. */ + // Stop a path. void stop(); - /** Get a list of signals which is emitted by the path. */ + // Get a list of signals which is emitted by the path. SignalList::Ptr getOutputSignals(bool after_hooks = true); unsigned getOutputSignalsMaxCount(); - /** Parse a single path and add it to the global configuration. + /* Parse a single path and add it to the global configuration. * * @param json A JSON object containing the configuration of the path. * @param p Pointer to the allocated memory for this path @@ -188,7 +188,7 @@ public: return state; } - /** Get the UUID of this path. */ + // Get the UUID of this path. const uuid_t & getUuid() const { return uuid; diff --git a/include/villas/path_destination.hpp b/include/villas/path_destination.hpp index 9239c3a00..90117fe2c 100644 --- a/include/villas/path_destination.hpp +++ b/include/villas/path_destination.hpp @@ -1,10 +1,9 @@ -/** Path destination +/* Path destination * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,7 +14,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; class Path; struct Sample; diff --git a/include/villas/path_list.hpp b/include/villas/path_list.hpp index 220c8ebce..53198bfc6 100644 --- a/include/villas/path_list.hpp +++ b/include/villas/path_list.hpp @@ -1,11 +1,9 @@ -/** Node list +/* Node list * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -18,13 +16,13 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Path; class PathList : public std::list { public: - /** Lookup a path from the list based on its UUID */ + // Lookup a path from the list based on its UUID Path * lookup(const uuid_t &uuid) const; json_t * toJson() const; diff --git a/include/villas/path_source.hpp b/include/villas/path_source.hpp index ea7da31c7..28bec72fb 100644 --- a/include/villas/path_source.hpp +++ b/include/villas/path_source.hpp @@ -1,10 +1,9 @@ -/** Message source +/* Message source * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,7 +16,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class Node; class Path; @@ -36,11 +35,12 @@ protected: struct Pool pool; - MappingList mappings; /**< List of mappings (struct MappingEntry). */ + MappingList mappings; // List of mappings (struct MappingEntry). public: PathSource(Path *p, Node *n); - virtual ~PathSource(); + virtual + ~PathSource(); void check(); @@ -79,7 +79,7 @@ using SecondaryPathSourceList = std::vector; class MasterPathSource : public PathSource { protected: - SecondaryPathSourceList secondaries; /**< List of secondary path sources (PathSource). */ + SecondaryPathSourceList secondaries; // List of secondary path sources (PathSource). public: MasterPathSource(Path *p, Node *n); @@ -99,6 +99,5 @@ public: }; - } // namespace node } // namespace villas diff --git a/include/villas/pool.hpp b/include/villas/pool.hpp index 41932a395..41fb88caf 100644 --- a/include/villas/pool.hpp +++ b/include/villas/pool.hpp @@ -1,12 +1,11 @@ -/** Memory pool for fixed size objects. +/* Memory pool for fixed size objects. * * This datastructure is based on a lock-less stack (lstack). * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,22 +19,22 @@ namespace villas { namespace node { -/** A thread-safe memory pool */ +// A thread-safe memory pool struct Pool { enum State state; - off_t buffer_off; /**< Offset from the struct address to the underlying memory area */ + off_t buffer_off; // Offset from the struct address to the underlying memory area - size_t len; /**< Length of the underlying memory area */ - size_t blocksz; /**< Length of a block in bytes */ - size_t alignment; /**< Alignment of a block in bytes */ + size_t len; // Length of the underlying memory area + size_t blocksz; // Length of a block in bytes + size_t alignment; // Alignment of a block in bytes - struct CQueue queue; /**< The queue which is used to keep track of free blocks */ + struct CQueue queue; // The queue which is used to keep track of free blocks }; #define pool_buffer(p) ((char *) (p) + (p)->buffer_off) -/** Initiazlize a pool +/* Initiazlize a pool * * @param[inout] p The pool data structure. * @param[in] cnt The total number of blocks which are reserverd by this pool. @@ -46,10 +45,10 @@ struct Pool { */ int pool_init(struct Pool *p, size_t cnt, size_t blocksz, struct memory::Type *mem = memory::default_type) __attribute__ ((warn_unused_result)); -/** Destroy and release memory used by pool. */ +// Destroy and release memory used by pool. int pool_destroy(struct Pool *p) __attribute__ ((warn_unused_result)); -/** Pop up to \p cnt values from the stack an place them in the array \p blocks. +/* Pop up to \p cnt values from the stack an place them in the array \p blocks. * * @return The number of blocks actually retrieved from the pool. * This number can be smaller than the requested \p cnt blocks @@ -57,13 +56,13 @@ int pool_destroy(struct Pool *p) __attribute__ ((warn_unused_result)); */ ssize_t pool_get_many(struct Pool *p, void *blocks[], size_t cnt); -/** Push \p cnt values which are giving by the array values to the stack. */ +// Push \p cnt values which are giving by the array values to the stack. ssize_t pool_put_many(struct Pool *p, void *blocks[], size_t cnt); -/** Get a free memory block from pool. */ +// Get a free memory block from pool. void * pool_get(struct Pool *p); -/** Release a memory block back to the pool. */ +// Release a memory block back to the pool. int pool_put(struct Pool *p, void *buf); } // namespace node diff --git a/include/villas/queue.h b/include/villas/queue.h index 7906628ed..e4dc8d728 100644 --- a/include/villas/queue.h +++ b/include/villas/queue.h @@ -1,11 +1,11 @@ -/** Lock-free Multiple-Producer Multiple-consumer (MPMC) queue. +/* Lock-free Multiple-Producer Multiple-consumer (MPMC) queue. * * Based on Dmitry Vyukov#s Bounded MPMC queue: * http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue * - * @author Steffen Vogel - * @copyright 2014-2021, Steffen Vogel - * @license BSD 2-Clause License + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2021 Steffen Vogel + * SPDX-License-Identifier: BSD-2-Clause * * All rights reserved. * @@ -29,7 +29,7 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *********************************************************************************/ + */ #pragma once @@ -50,36 +50,36 @@ typedef char cacheline_pad_t[CACHELINE_SIZE]; struct CQueue_cell { std::atomic sequence; - off_t data_off; /**< Pointer relative to the queue struct */ + off_t data_off; // Pointer relative to the queue struct }; -/** A lock-free multiple-producer, multiple-consumer (MPMC) queue. */ +// A lock-free multiple-producer, multiple-consumer (MPMC) queue. struct CQueue { std::atomic state; - cacheline_pad_t _pad0; /**< Shared area: all threads read */ + cacheline_pad_t _pad0; // Shared area: all threads read size_t buffer_mask; - off_t buffer_off; /**< Relative pointer to struct CQueue_cell[] */ + off_t buffer_off; // Relative pointer to struct CQueue_cell[] - cacheline_pad_t _pad1; /**< Producer area: only producers read & write */ + cacheline_pad_t _pad1; // Producer area: only producers read & write - std::atomic tail; /**< Queue tail pointer */ + std::atomic tail; // Queue tail pointer - cacheline_pad_t _pad2; /**< Consumer area: only consumers read & write */ + cacheline_pad_t _pad2; // Consumer area: only consumers read & write - std::atomic head; /**< Queue head pointer */ + std::atomic head; // Queue head pointer - cacheline_pad_t _pad3; /**< @todo Why needed? */ + cacheline_pad_t _pad3; // @todo Why needed? }; -/** Initialize MPMC queue */ +// Initialize MPMC queue int queue_init(struct CQueue *q, size_t size, struct memory::Type *mem = memory::default_type) __attribute__ ((warn_unused_result)); -/** Desroy MPMC queue and release memory */ +// Desroy MPMC queue and release memory int queue_destroy(struct CQueue *q) __attribute__ ((warn_unused_result)); -/** Return estimation of current queue usage. +/* Return estimation of current queue usage. * * Note: This is only an estimation and not accurate as long other * threads are performing operations. @@ -90,14 +90,14 @@ int queue_push(struct CQueue *q, void *ptr); int queue_pull(struct CQueue *q, void **ptr); -/** Enqueue up to \p cnt pointers of the \p ptr array into the queue. +/* Enqueue up to \p cnt pointers of the \p ptr array into the queue. * * @return The number of pointers actually enqueued. * This number can be smaller then \p cnt in case the queue is filled. */ int queue_push_many(struct CQueue *q, void *ptr[], size_t cnt); -/** Dequeue up to \p cnt pointers from the queue and place them into the \p ptr array. +/* Dequeue up to \p cnt pointers from the queue and place them into the \p ptr array. * * @return The number of pointers actually dequeued. * This number can be smaller than \p cnt in case the queue contained less than @@ -105,7 +105,7 @@ int queue_push_many(struct CQueue *q, void *ptr[], size_t cnt); */ int queue_pull_many(struct CQueue *q, void *ptr[], size_t cnt); -/** Closes the queue, causing following writes to fail and following reads (after +/* Closes the queue, causing following writes to fail and following reads (after * the queue is empty) to fail. * * @return 0 on success. diff --git a/include/villas/queue.hpp b/include/villas/queue.hpp index 3e783b40d..d5b50046c 100644 --- a/include/villas/queue.hpp +++ b/include/villas/queue.hpp @@ -1,10 +1,9 @@ -/** Wrapper around queue that uses POSIX CV's for signalling writes. +/* Wrapper around queue that uses POSIX CV's for signalling writes. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/queue_signalled.h b/include/villas/queue_signalled.h index 6a50ce5a8..a33cd65e2 100644 --- a/include/villas/queue_signalled.h +++ b/include/villas/queue_signalled.h @@ -1,10 +1,9 @@ -/** Wrapper around queue that uses POSIX CV's for signalling writes. +/* Wrapper around queue that uses POSIX CV's for signalling writes. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -17,7 +16,7 @@ namespace villas { namespace node { enum class QueueSignalledMode { - AUTO, /**< We will choose the best method available on the platform */ + AUTO, // We will choose the best method available on the platform PTHREAD, POLLING, #ifdef HAS_EVENTFD @@ -30,17 +29,17 @@ enum class QueueSignalledFlags { PROCESS_SHARED = (1 << 4) }; -/** Wrapper around queue that uses POSIX CV's for signalling writes. */ +// Wrapper around queue that uses POSIX CV's for signalling writes. struct CQueueSignalled { - struct CQueue queue; /**< Actual underlying queue. */ + struct CQueue queue; // Actual underlying queue. enum QueueSignalledMode mode; enum QueueSignalledFlags flags; union { struct { - pthread_cond_t ready; /**< Condition variable to signal writes to the queue. */ - pthread_mutex_t mutex; /**< Mutex for ready. */ + pthread_cond_t ready; // Condition variable to signal writes to the queue. + pthread_mutex_t mutex; // Mutex for ready. } pthread; #ifdef __linux__ int eventfd; @@ -64,7 +63,7 @@ int queue_signalled_pull_many(struct CQueueSignalled *qs, void *ptr[], size_t cn int queue_signalled_close(struct CQueueSignalled *qs) __attribute__ ((warn_unused_result)); -/** Returns a file descriptor which can be used with poll / select to wait for new data */ +// Returns a file descriptor which can be used with poll / select to wait for new data int queue_signalled_fd(struct CQueueSignalled *qs); } // namespace node diff --git a/include/villas/queue_signalled.hpp b/include/villas/queue_signalled.hpp index a343181cf..6e474b533 100644 --- a/include/villas/queue_signalled.hpp +++ b/include/villas/queue_signalled.hpp @@ -1,10 +1,9 @@ -/** Wrapper around queue that uses POSIX CV's for signalling writes. +/* Wrapper around queue that uses POSIX CV's for signalling writes. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/sample.hpp b/include/villas/sample.hpp index 4964476e0..600037e00 100644 --- a/include/villas/sample.hpp +++ b/include/villas/sample.hpp @@ -1,10 +1,9 @@ -/** The internal datastructure for a sample of simulation data. +/* The internal datastructure for a sample of simulation data. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,57 +18,57 @@ #include #include -/** The length of a sample datastructure with \p values values in bytes. */ +// The length of a sample datastructure with \p values values in bytes. #define SAMPLE_LENGTH(len) (sizeof(struct Sample) + SAMPLE_DATA_LENGTH(len)) -/** The length of a sample data portion of a sample datastructure with \p values values in bytes. */ +// The length of a sample data portion of a sample datastructure with \p values values in bytes. #define SAMPLE_DATA_LENGTH(len) ((len) * sizeof(double)) -/** The number of values in a sample datastructure. */ +// The number of values in a sample datastructure. #define SAMPLE_NUMBER_OF_VALUES(len) ((len) / sizeof(double)) -/** The offset to the beginning of the data section. */ +// The offset to the beginning of the data section. #define SAMPLE_DATA_OFFSET(smp) ((char *) (smp) + offsetof(struct Sample, data)) namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Pool; -/** Parts of a sample that can be serialized / de-serialized by the IO formats */ +// Parts of a sample that can be serialized / de-serialized by the IO formats enum class SampleFlags { - HAS_TS_ORIGIN = (1 << 0), /**< Include origin timestamp in output. */ - HAS_TS_RECEIVED = (1 << 1), /**< Include receive timestamp in output. */ - HAS_OFFSET = (1 << 2), /**< Include offset (received - origin timestamp) in output. */ - HAS_SEQUENCE = (1 << 3), /**< Include sequence number in output. */ - HAS_DATA = (1 << 4), /**< Include values in output. */ + HAS_TS_ORIGIN = (1 << 0), // Include origin timestamp in output. + HAS_TS_RECEIVED = (1 << 1), // Include receive timestamp in output. + HAS_OFFSET = (1 << 2), // Include offset (received - origin timestamp) in output. + HAS_SEQUENCE = (1 << 3), // Include sequence number in output. + HAS_DATA = (1 << 4), // Include values in output. - HAS_TS = HAS_TS_ORIGIN | HAS_TS_RECEIVED, /**< Include origin timestamp in output. */ - HAS_ALL = (1 << 5) - 1, /**< Enable all output options. */ + HAS_TS = HAS_TS_ORIGIN | HAS_TS_RECEIVED, // Include origin timestamp in output. + HAS_ALL = (1 << 5) - 1, // Enable all output options. - IS_FIRST = (1 << 16), /**< This sample is the first of a new simulation case */ - IS_LAST = (1 << 17) /**< This sample is the last of a running simulation case */ + IS_FIRST = (1 << 16), // This sample is the first of a new simulation case + IS_LAST = (1 << 17) // This sample is the last of a running simulation case }; struct Sample { - uint64_t sequence; /**< The sequence number of this sample. */ - unsigned length; /**< The number of values in sample::values which are valid. */ - unsigned capacity; /**< The number of values in sample::values for which memory is reserved. */ - int flags; /**< Flags are used to store binary properties of a sample. */ + uint64_t sequence; // The sequence number of this sample. + unsigned length; // The number of values in sample::values which are valid. + unsigned capacity; // The number of values in sample::values for which memory is reserved. + int flags; // Flags are used to store binary properties of a sample. - SignalList::Ptr signals; /**< The list of signal descriptors. */ + SignalList::Ptr signals; // The list of signal descriptors. - std::atomic refcnt; /**< Reference counter. */ - ptrdiff_t pool_off; /**< This sample belongs to this memory pool (relative pointer). See sample_pool(). */ + std::atomic refcnt; // Reference counter. + ptrdiff_t pool_off; // This sample belongs to this memory pool (relative pointer). See sample_pool(). - /** All timestamps are seconds / nano seconds after 1.1.1970 UTC */ + // All timestamps are seconds / nano seconds after 1.1.1970 UTC struct { - struct timespec origin; /**< The point in time when this data was sampled. */ - struct timespec received; /**< The point in time when this data was received. */ + struct timespec origin; // The point in time when this data was sampled. + struct timespec received; // The point in time when this data was received. } ts; - /** The sample signal values. + /* The sample signal values. * * This variable length array (VLA) extends over the end of struct Sample. * Make sure that pointers to struct Sample point to memory blocks of adequate size. @@ -84,7 +83,7 @@ struct Sample { #define SAMPLE_NON_POOL PTRDIFF_MIN -/** Get the address of the pool to which the sample belongs. */ +// Get the address of the pool to which the sample belongs. #define sample_pool(s) ((s)->pool_off == SAMPLE_NON_POOL ? nullptr : (struct Pool *) ((char *) (s) + (s)->pool_off)) struct Sample * sample_alloc(struct Pool *p); @@ -97,26 +96,26 @@ struct Sample * sample_clone(struct Sample *smp); void sample_free(struct Sample *s); -/** Request \p cnt samples from memory pool \p p and initialize them. +/* Request \p cnt samples from memory pool \p p and initialize them. * The reference count will already be set to 1. * Use the sample_incref() function to increase it. */ int sample_alloc_many(struct Pool *p, struct Sample *smps[], int cnt); -/** Release an array of samples back to their pools */ +// Release an array of samples back to their pools void sample_free_many(struct Sample *smps[], int cnt); -/** Increase reference count of sample */ +// Increase reference count of sample int sample_incref(struct Sample *s); -/** Decrease reference count and release memory if last reference was held. */ +// Decrease reference count and release memory if last reference was held. int sample_decref(struct Sample *s); int sample_copy(struct Sample *dst, const struct Sample *src); -/** Dump all details about a sample to debug log */ +// Dump all details about a sample to debug log void sample_dump(villas::Logger logger, struct Sample *s); -/** Compare two samples */ +// Compare two samples int sample_cmp(struct Sample *a, struct Sample *b, double epsilon, int flags); int sample_clone_many(struct Sample *dsts[], const struct Sample * const srcs[], int cnt); diff --git a/include/villas/shmem.hpp b/include/villas/shmem.hpp index ebeefe0a3..d8940c24c 100644 --- a/include/villas/shmem.hpp +++ b/include/villas/shmem.hpp @@ -1,10 +1,9 @@ -/** Shared-memory interface: The interface functions that the external program should use. +/* Shared-memory interface: The interface functions that the external program should use. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,36 +18,36 @@ namespace villas { namespace node { -/** Struct containing all parameters that need to be known when creating a new +/* Struct containing all parameters that need to be known when creating a new * shared memory object. */ struct ShmemConfig { - int polling; /**< Whether to use polling instead of POSIX CVs */ - int queuelen; /**< Size of the queues (in elements) */ - int samplelen; /**< Maximum number of data entries in a single sample */ + int polling; // Whether to use polling instead of POSIX CVs + int queuelen; // Size of the queues (in elements) + int samplelen; // Maximum number of data entries in a single sample }; -/** The structure that actually resides in the shared memory. */ +// The structure that actually resides in the shared memory. struct ShmemShared { - int polling; /**< Whether to use a pthread_cond_t to signal if new samples are written to incoming queue. */ - struct CQueueSignalled queue; /**< Queue for samples passed in both directions. */ - struct Pool pool; /**< Pool for the samples in the queues. */ + int polling; // Whether to use a pthread_cond_t to signal if new samples are written to incoming queue. + struct CQueueSignalled queue; // Queue for samples passed in both directions. + struct Pool pool; // Pool for the samples in the queues. }; -/** Relevant information for one direction of the interface. */ +// Relevant information for one direction of the interface. struct shmem_dir { - void *base; /**< Base address of the region. */ - const char *name; /**< Name of the shmem object. */ - size_t len; /**< Total size of the region. */ - struct ShmemShared *shared; /**< Actually shared datastructure */ + void *base; // Base address of the region. + const char *name; // Name of the shmem object. + size_t len; // Total size of the region. + struct ShmemShared *shared; // Actually shared datastructure }; -/** Main structure representing the shared memory interface. */ +// Main structure representing the shared memory interface. struct ShmemInterface { struct shmem_dir read, write; std::atomic readers, writers, closed; }; -/** Open the shared memory objects and retrieve / initialize the shared data structures. +/* Open the shared memory objects and retrieve / initialize the shared data structures. * Blocks until another process connects by opening the same objects. * * @param[in] wname Name of the POSIX shared memory object containing the output queue. @@ -61,7 +60,7 @@ struct ShmemInterface { */ int shmem_int_open(const char* wname, const char* rname, struct ShmemInterface* shm, struct ShmemConfig* conf); -/** Close and destroy the shared memory interface and related structures. +/* Close and destroy the shared memory interface and related structures. * * @param shm The shared memory interface. * @retval 0 Closing successfull. @@ -69,7 +68,7 @@ int shmem_int_open(const char* wname, const char* rname, struct ShmemInterface* */ int shmem_int_close(struct ShmemInterface *shm); -/** Read samples from the interface. +/* Read samples from the interface. * * @param shm The shared memory interface. * @param smps An array where the pointers to the samples will be written. The samples @@ -80,7 +79,7 @@ int shmem_int_close(struct ShmemInterface *shm); */ int shmem_int_read(struct ShmemInterface *shm, struct Sample * const smps[], unsigned cnt); -/** Write samples to the interface. +/* Write samples to the interface. * * @param shm The shared memory interface. * @param smps The samples to be written. Must be allocated from shm_int_alloc. @@ -90,7 +89,7 @@ int shmem_int_read(struct ShmemInterface *shm, struct Sample * const smps[], uns */ int shmem_int_write(struct ShmemInterface *shm, const struct Sample * const smps[], unsigned cnt); -/** Allocate samples to be written to the interface. +/* Allocate samples to be written to the interface. * * The writing process must not free the samples; only the receiving process should free them using sample_decref after use. * @param shm The shared memory interface. @@ -100,7 +99,7 @@ int shmem_int_write(struct ShmemInterface *shm, const struct Sample * const smps */ int shmem_int_alloc(struct ShmemInterface *shm, struct Sample *smps[], unsigned cnt); -/** Returns the total size of the shared memory region with the given size of +/* Returns the total size of the shared memory region with the given size of * the input/output queues (in elements) and the given number of data elements * per struct Sample. */ size_t shmem_total_size(int queuelen, int samplelen); diff --git a/include/villas/signal.hpp b/include/villas/signal.hpp index e654431ea..58a9ef14a 100644 --- a/include/villas/signal.hpp +++ b/include/villas/signal.hpp @@ -1,10 +1,9 @@ -/** Signal meta data. +/* Signal meta data. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -15,13 +14,13 @@ #include #include -/* "I" defined by complex.h collides with a define in OpenSSL */ +// "I" defined by complex.h collides with a define in OpenSSL #undef I namespace villas { namespace node { -/** Signal descriptor. +/* Signal descriptor. * * This data structure contains meta data about samples values in struct Sample::data */ @@ -30,21 +29,21 @@ class Signal { public: using Ptr = std::shared_ptr; - std::string name; /**< The name of the signal. */ - std::string unit; /**< The unit of the signal. */ + std::string name; // The name of the signal. + std::string unit; // The unit of the signal. - union SignalData init; /**< The initial value of the signal. */ + union SignalData init; // The initial value of the signal. enum SignalType type; - /** Initialize a signal with default values. */ + // Initialize a signal with default values. Signal(const std::string &n = "", const std::string &u = "", enum SignalType t = SignalType::INVALID); - /** Parse signal description. */ + // Parse signal description. int parse(json_t *json); std::string toString(const union SignalData *d = nullptr) const; - /** Produce JSON representation of signal. */ + // Produce JSON representation of signal. json_t * toJson() const; bool isNext(const Signal &sig); diff --git a/include/villas/signal_data.hpp b/include/villas/signal_data.hpp index be6c91169..56ee7105f 100644 --- a/include/villas/signal_data.hpp +++ b/include/villas/signal_data.hpp @@ -1,10 +1,9 @@ -/** Signal data. +/* Signal data. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -19,21 +18,22 @@ namespace villas { namespace node { -/** A signal value. +/* A signal value. * * Data is in host endianess! */ union SignalData { - double f; /**< Floating point values. */ - int64_t i; /**< Integer values. */ - bool b; /**< Boolean values. */ - std::complex z; /**< Complex values. */ + double f; // Floating point values. + int64_t i; // Integer values. + bool b; // Boolean values. + std::complex z; // Complex values. SignalData() : i(0) { } - static union SignalData nan() + static + union SignalData nan() { union SignalData d; @@ -47,13 +47,13 @@ union SignalData { return f == std::numeric_limits::quiet_NaN(); } - /** Convert signal data from one description/format to another. */ + // Convert signal data from one description/format to another. SignalData cast(enum SignalType type, enum SignalType to) const; - /** Set data from double */ + // Set data from double void set(enum SignalType type, double val); - /** Print value of a signal to a character buffer. */ + // Print value of a signal to a character buffer. int printString(enum SignalType type, char *buf, size_t len, int precision = 5) const; int parseString(enum SignalType type, const char *ptr, char **end); diff --git a/include/villas/signal_list.hpp b/include/villas/signal_list.hpp index 77f34b06e..8fe04c777 100644 --- a/include/villas/signal_list.hpp +++ b/include/villas/signal_list.hpp @@ -1,10 +1,9 @@ -/** Signal metadata lits. +/* Signal metadata lits. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/include/villas/signal_type.hpp b/include/villas/signal_type.hpp index e606eba8f..f890afd67 100644 --- a/include/villas/signal_type.hpp +++ b/include/villas/signal_type.hpp @@ -1,10 +1,9 @@ -/** Signal type. +/* Signal type. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -14,11 +13,11 @@ namespace villas { namespace node { enum class SignalType { - INVALID = 0, /**< Signal type is invalid. */ - FLOAT = 1, /**< See SignalData::f */ - INTEGER = 2, /**< See SignalData::i */ - BOOLEAN = 3, /**< See SignalData::b */ - COMPLEX = 4 /**< See SignalData::z */ + INVALID = 0, // Signal type is invalid. + FLOAT = 1, // See SignalData::f + INTEGER = 2, // See SignalData::i + BOOLEAN = 3, // See SignalData::b + COMPLEX = 4 // See SignalData::z }; enum SignalType signalTypeFromString(const std::string &str); diff --git a/include/villas/socket_addr.hpp b/include/villas/socket_addr.hpp index f7312e987..adf0c1b51 100644 --- a/include/villas/socket_addr.hpp +++ b/include/villas/socket_addr.hpp @@ -1,10 +1,9 @@ -/** Node type: socket +/* Node type: socket * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -20,7 +19,7 @@ #include #include -#endif /* LIBNL3_ROUTE_FOUND */ +#endif // LIBNL3_ROUTE_FOUND union sockaddr_union { struct sockaddr sa; @@ -43,7 +42,7 @@ enum class SocketLayer { UNIX }; -/** Generate printable socket address depending on the address family +/* Generate printable socket address depending on the address family * * A IPv4 address is formatted as dotted decimals followed by the port/protocol number * A link layer address is formatted in hexadecimals digits seperated by colons and the inferface name @@ -53,7 +52,7 @@ enum class SocketLayer { */ char * socket_print_addr(struct sockaddr *saddr); -/** Parse a socket address depending on the address family +/* Parse a socket address depending on the address family * * A IPv4 address has the follwing format: [hostname/ip]:[port/protocol] * A link layer address has the following format: [mac]%[interface]:[ethertype] diff --git a/include/villas/stats.hpp b/include/villas/stats.hpp index 18d0671cb..696aa29c1 100644 --- a/include/villas/stats.hpp +++ b/include/villas/stats.hpp @@ -1,10 +1,9 @@ -/** Statistic collection. +/* Statistic collection. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -24,7 +23,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations struct Sample; class Node; @@ -42,20 +41,20 @@ public: }; enum class Metric { - SMPS_SKIPPED, /**< Counter for skipped samples due to hooks. */ - SMPS_REORDERED, /**< Counter for reordered samples. */ + SMPS_SKIPPED, // Counter for skipped samples due to hooks. + SMPS_REORDERED, // Counter for reordered samples. - /* Timings */ - GAP_SAMPLE, /**< Histogram for inter sample timestamps (as sent by remote). */ - GAP_RECEIVED, /**< Histogram for inter sample arrival time (as seen by this instance). */ - OWD, /**< Histogram for one-way-delay (OWD) of received samples. */ - AGE, /**< Processing time of packets within VILLASnode. */ - SIGNAL_COUNT, /**< Number of signals per sample. */ + // Timings + GAP_SAMPLE, // Histogram for inter sample timestamps (as sent by remote). + GAP_RECEIVED, // Histogram for inter sample arrival time (as seen by this instance). + OWD, // Histogram for one-way-delay (OWD) of received samples. + AGE, // Processing time of packets within VILLASnode. + SIGNAL_COUNT, // Number of signals per sample. - /* RTP metrics */ - RTP_LOSS_FRACTION, /**< Fraction lost since last RTP SR/RR. */ - RTP_PKTS_LOST, /**< Cumul. no. pkts lost. */ - RTP_JITTER /**< Interarrival jitter. */ + // RTP metrics + RTP_LOSS_FRACTION, // Fraction lost since last RTP SR/RR. + RTP_PKTS_LOST, // Cumul. no. pkts lost. + RTP_JITTER // Interarrival jitter. }; enum class Type { @@ -82,9 +81,11 @@ protected: enum node::SignalType signal_type; }; - static std::shared_ptr table; + static + std::shared_ptr
table; - static void setupTable(); + static + void setupTable(); Logger logger; @@ -118,9 +119,12 @@ public: const Hist & getHistogram(enum Metric sm) const; - static std::unordered_map metrics; - static std::unordered_map types; - static std::vector columns; + static + std::unordered_map metrics; + static + std::unordered_map types; + static + std::vector columns; }; } // namespace villas diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index 7711420e4..a843a8bc6 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -1,10 +1,9 @@ -/** The super node object holding the state of the application. +/* The super node object holding the state of the application. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -32,10 +31,10 @@ extern "C" { namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Node; -/** Global configuration */ +// Global configuration class SuperNode { protected: @@ -57,40 +56,40 @@ protected: Web web; #endif - int priority; /**< Process priority (lower is better) */ - int affinity; /**< Process affinity of the server and all created threads */ - int hugepages; /**< Number of hugepages to reserve. */ - double statsRate; /**< Rate at which we display the periodic stats. */ + int priority; // Process priority (lower is better) + int affinity; // Process affinity of the server and all created threads + int hugepages; // Number of hugepages to reserve. + double statsRate; // Rate at which we display the periodic stats. - struct Task task; /**< Task for periodic stats output */ + struct Task task; // Task for periodic stats output - uuid_t uuid; /**< A globally unique identifier of the instance */ + uuid_t uuid; // A globally unique identifier of the instance - struct timespec started; /**< The time at which the instance has been started. */ + struct timespec started; // The time at which the instance has been started. - std::string uri; /**< URI of configuration */ + std::string uri; // URI of configuration - Config config; /** The configuration file. */ + Config config; // The configuration file. public: - /** Inititalize configuration object before parsing the configuration. */ + // Inititalize configuration object before parsing the configuration. SuperNode(); int init(); - /** Wrapper for parse() which loads the config first. */ + // Wrapper for parse() which loads the config first. void parse(const std::string &name); - /** Parse super-node configuration. + /* Parse super-node configuration. * * @param json A libjansson object which contains the configuration. */ void parse(json_t *json); - /** Check validity of super node configuration. */ + // Check validity of super node configuration. void check(); - /** Initialize after parsing the configuration file. */ + // Initialize after parsing the configuration file. void prepare(); void start(); void stop(); @@ -113,7 +112,7 @@ public: graph_t * getGraph(); #endif - /** Run periodic hooks of this super node. */ + // Run periodic hooks of this super node. int periodic(); void setState(enum State st) @@ -190,7 +189,7 @@ public: return logger; } - /** Destroy configuration object. */ + // Destroy configuration object. ~SuperNode(); }; diff --git a/include/villas/usb.hpp b/include/villas/usb.hpp index 9ff70e184..12c280896 100644 --- a/include/villas/usb.hpp +++ b/include/villas/usb.hpp @@ -1,10 +1,9 @@ -/** Helpers for USB node-types +/* Helpers for USB node-types * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -42,7 +41,7 @@ public: usb::Error(e, fmt::format(what, std::forward(args)...)) { } - /* Same as above but with int */ + // Same as above but with int Error(int e, const std::string &what) : usb::Error((enum libusb_error) e, what) { } @@ -58,7 +57,8 @@ public: free(msg); } - virtual const char * what() const noexcept + virtual + const char * what() const noexcept { return msg; } diff --git a/include/villas/web.hpp b/include/villas/web.hpp index 64f43dc45..acf73edbd 100644 --- a/include/villas/web.hpp +++ b/include/villas/web.hpp @@ -1,10 +1,9 @@ -/** LWS-releated functions. +/* LWS-releated functions. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,7 +20,7 @@ namespace villas { namespace node { -/* Forward declarations */ +// Forward declarations class Api; class Web final { @@ -31,17 +30,17 @@ private: Logger logger; - lws_context *context; /**< The libwebsockets server context. */ - lws_vhost *vhost; /**< The libwebsockets vhost. */ + lws_context *context; // The libwebsockets server context. + lws_vhost *vhost; // The libwebsockets vhost. - Queue writables; /**< Queue of WSIs for which we will call lws_callback_on_writable() */ + Queue writables; // Queue of WSIs for which we will call lws_callback_on_writable() - int port; /**< Port of the build in HTTP / WebSocket server. */ - std::string ssl_cert; /**< Path to the SSL certitifcate for HTTPS / WSS. */ - std::string ssl_private_key; /**< Path to the SSL private key for HTTPS / WSS. */ + int port; // Port of the build in HTTP / WebSocket server. + std::string ssl_cert; // Path to the SSL certitifcate for HTTPS / WSS. + std::string ssl_private_key; // Path to the SSL private key for HTTPS / WSS. std::thread thread; - std::atomic running; /**< Atomic flag for signalizing thread termination. */ + std::atomic running; // Atomic flag for signalizing thread termination. Api *api; @@ -49,7 +48,7 @@ private: public: - /** Initialize the web interface. + /* Initialize the web interface. * * The web interface is based on the libwebsockets library. */ @@ -60,10 +59,12 @@ public: void start(); void stop(); - static void lwsLogger(int level, const char *msg); - static int lwsLogLevel(Log::Level lvl); + static + void lwsLogger(int level, const char *msg); + static + int lwsLogLevel(Log::Level lvl); - /** Parse HTTPd and WebSocket related options */ + // Parse HTTPd and WebSocket related options int parse(json_t *json); Api * getApi() @@ -71,7 +72,7 @@ public: return api; } - /* for C-compatability */ + // for C-compatability lws_context * getContext() { return context; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e9798795f..81a1a2975 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 add_compile_options(-fPIC) diff --git a/lib/api.cpp b/lib/api.cpp index 289e9e457..01b0e7547 100644 --- a/lib/api.cpp +++ b/lib/api.cpp @@ -1,9 +1,9 @@ -/** REST-API-releated functions. +/* REST-API-releated functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -64,7 +64,7 @@ void Api::stop() } running = false; - pending.push(nullptr); /* unblock thread */ + pending.push(nullptr); // unblock thread thread.join(); state = State::STOPPED; @@ -74,11 +74,11 @@ void Api::worker() { logger->info("Started worker"); - /* Process pending requests */ + // Process pending requests while (running) { Session *s = pending.pop(); if (s) { - /* Check that the session is still alive */ + // Check that the session is still alive auto it = std::find(sessions.begin(), sessions.end(), s); if (it != sessions.end()) s->execute(); diff --git a/lib/api/CMakeLists.txt b/lib/api/CMakeLists.txt index 452980a85..b52e3eee1 100644 --- a/lib/api/CMakeLists.txt +++ b/lib/api/CMakeLists.txt @@ -1,10 +1,9 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(API_SRC session.cpp diff --git a/lib/api/request.cpp b/lib/api/request.cpp index e735a4a49..2f9b20fda 100644 --- a/lib/api/request.cpp +++ b/lib/api/request.cpp @@ -1,10 +1,9 @@ -/** API Request. +/* API Request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/api/requests/capabiltities.cpp b/lib/api/requests/capabiltities.cpp index cf0a494c2..68c30346b 100644 --- a/lib/api/requests/capabiltities.cpp +++ b/lib/api/requests/capabiltities.cpp @@ -1,9 +1,9 @@ -/** The "capabiltities" API ressource. +/* The "capabiltities" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -18,7 +18,8 @@ class CapabilitiesRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -32,7 +33,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "capabilities"; static char r[] = "/capabilities"; static char d[] = "get capabiltities and details about this VILLASnode instance"; diff --git a/lib/api/requests/config.cpp b/lib/api/requests/config.cpp index c341402ac..ae8a76f29 100644 --- a/lib/api/requests/config.cpp +++ b/lib/api/requests/config.cpp @@ -1,9 +1,9 @@ -/** The "config" API ressource. +/* The "config" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +19,8 @@ class ConfigRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { json_t *json = session->getSuperNode()->getConfig(); @@ -37,7 +38,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "config"; static char r[] = "/config"; static char d[] = "get configuration of this VILLASnode instance"; diff --git a/lib/api/requests/graph.cpp b/lib/api/requests/graph.cpp index 963a00292..cddb698c3 100644 --- a/lib/api/requests/graph.cpp +++ b/lib/api/requests/graph.cpp @@ -1,9 +1,9 @@ -/** The "stats" API request. +/* The "stats" API request. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ extern "C" { #include @@ -40,7 +40,8 @@ public: gvFreeContext(gvc); } - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -107,7 +108,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "graph"; static char r[] = "/graph\\.([a-z]+)"; static char d[] = "get graph representation of configuration"; @@ -116,4 +117,3 @@ static RequestPlugin p; } // namespace api } // namespace node } // namespace villas - diff --git a/lib/api/requests/node.cpp b/lib/api/requests/node.cpp index ae32855aa..fd4452359 100644 --- a/lib/api/requests/node.cpp +++ b/lib/api/requests/node.cpp @@ -1,10 +1,9 @@ -/** Node API Request. +/* Node API Request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/api/requests/node_action.cpp b/lib/api/requests/node_action.cpp index eff4b24dc..d3d811601 100644 --- a/lib/api/requests/node_action.cpp +++ b/lib/api/requests/node_action.cpp @@ -1,9 +1,9 @@ -/** The API ressource for start/stop/pause/resume nodes. +/* The API ressource for start/stop/pause/resume nodes. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -25,7 +25,8 @@ class NodeActionRequest : public NodeRequest { public: using NodeRequest::NodeRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::POST) throw InvalidMethod(this); @@ -44,7 +45,7 @@ public: }; -/* Register API requests */ +// Register API requests static char n1[] = "node/start"; static char r1[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")/start"; static char d1[] = "start a node"; @@ -70,7 +71,6 @@ static char r5[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")/restart"; static char d5[] = "restart a node"; static RequestPlugin, n5, r5, d5> p5; - } // namespace api } // namespace node } // namespace villas diff --git a/lib/api/requests/node_file.cpp b/lib/api/requests/node_file.cpp index 2ecc6c661..200c61189 100644 --- a/lib/api/requests/node_file.cpp +++ b/lib/api/requests/node_file.cpp @@ -1,9 +1,9 @@ -/** The "file" API ressource. +/* The "file" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -23,7 +23,8 @@ class FileRequest : public NodeRequest { public: using NodeRequest::NodeRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET && method != Session::Method::POST) throw InvalidMethod(this); @@ -48,7 +49,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "node/file"; static char r[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")/file(?:/([^/]+))?"; static char d[] = "control instances of 'file' node-type"; diff --git a/lib/api/requests/node_info.cpp b/lib/api/requests/node_info.cpp index 9b31b8170..bd5ca0c27 100644 --- a/lib/api/requests/node_info.cpp +++ b/lib/api/requests/node_info.cpp @@ -1,9 +1,9 @@ -/** The "node" API ressource. +/* The "node" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -24,7 +24,8 @@ class NodeInfoRequest : public NodeRequest { public: using NodeRequest::NodeRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -45,7 +46,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "node"; static char r[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")"; static char d[] = "retrieve info of a node"; diff --git a/lib/api/requests/node_stats.cpp b/lib/api/requests/node_stats.cpp index 086ba4d10..271764d67 100644 --- a/lib/api/requests/node_stats.cpp +++ b/lib/api/requests/node_stats.cpp @@ -1,9 +1,9 @@ -/** The API ressource for querying statistics. +/* The API ressource for querying statistics. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -25,7 +25,8 @@ class StatsRequest : public NodeRequest { public: using NodeRequest::NodeRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -40,7 +41,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "node/stats"; static char r[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")/stats"; static char d[] = "get internal statistics counters"; diff --git a/lib/api/requests/node_stats_reset.cpp b/lib/api/requests/node_stats_reset.cpp index 889d68dde..778c15e44 100644 --- a/lib/api/requests/node_stats_reset.cpp +++ b/lib/api/requests/node_stats_reset.cpp @@ -1,9 +1,9 @@ -/** The API ressource for resetting statistics. +/* The API ressource for resetting statistics. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -25,7 +25,8 @@ class StatsRequest : public NodeRequest { public: using NodeRequest::NodeRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::POST) throw InvalidMethod(this); @@ -42,7 +43,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "node/stats/reset"; static char r[] = "/node/(" RE_NODE_NAME "|" RE_UUID ")/stats/reset"; static char d[] = "reset internal statistics counters"; diff --git a/lib/api/requests/nodes.cpp b/lib/api/requests/nodes.cpp index 167d3c866..b73230639 100644 --- a/lib/api/requests/nodes.cpp +++ b/lib/api/requests/nodes.cpp @@ -1,9 +1,9 @@ -/** The "nodes" API ressource. +/* The "nodes" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -24,7 +24,8 @@ class NodesRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -38,7 +39,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "nodes"; static char r[] = "/nodes"; static char d[] = "retrieve list of all known nodes"; diff --git a/lib/api/requests/path.cpp b/lib/api/requests/path.cpp index a3db85f86..f5dc2cd74 100644 --- a/lib/api/requests/path.cpp +++ b/lib/api/requests/path.cpp @@ -1,10 +1,9 @@ -/** Path API Request. +/* Path API Request. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/api/requests/path_action.cpp b/lib/api/requests/path_action.cpp index 30cb7957e..020ab91b1 100644 --- a/lib/api/requests/path_action.cpp +++ b/lib/api/requests/path_action.cpp @@ -1,9 +1,9 @@ -/** The API ressource for start/stop/pause/resume paths. +/* The API ressource for start/stop/pause/resume paths. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -25,7 +25,8 @@ class PathActionRequest : public PathRequest { public: using PathRequest::PathRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::POST) throw InvalidMethod(this); @@ -40,7 +41,7 @@ public: }; -/* Register API requests */ +// Register API requests static char n1[] = "path/start"; static char r1[] = "/path/(" RE_UUID ")/start"; static char d1[] = "start a path"; @@ -51,7 +52,6 @@ static char r2[] = "/path/(" RE_UUID ")/stop"; static char d2[] = "stop a path"; static RequestPlugin, n2, r2, d2> p2; - } // namespace api } // namespace node } // namespace villas diff --git a/lib/api/requests/path_info.cpp b/lib/api/requests/path_info.cpp index ad3f8549f..9b834d180 100644 --- a/lib/api/requests/path_info.cpp +++ b/lib/api/requests/path_info.cpp @@ -1,9 +1,9 @@ -/** The "path" API ressource. +/* The "path" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -24,7 +24,8 @@ class PathInfoRequest : public PathRequest { public: using PathRequest::PathRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -36,7 +37,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "path"; static char r[] = "/path/(" RE_UUID ")"; static char d[] = "retrieve info of a path"; diff --git a/lib/api/requests/paths.cpp b/lib/api/requests/paths.cpp index 7ee255641..8043d8dad 100644 --- a/lib/api/requests/paths.cpp +++ b/lib/api/requests/paths.cpp @@ -1,9 +1,9 @@ -/** The "paths" API ressource. +/* The "paths" API ressource. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -24,7 +24,8 @@ class PathsRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -38,7 +39,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "paths"; static char r[] = "/paths"; static char d[] = "retrieve list of all paths with details"; diff --git a/lib/api/requests/restart.cpp b/lib/api/requests/restart.cpp index 2fa383ede..9f481c26b 100644 --- a/lib/api/requests/restart.cpp +++ b/lib/api/requests/restart.cpp @@ -1,9 +1,9 @@ -/** The "restart" API request. +/* The "restart" API request. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -20,9 +20,11 @@ namespace api { class RestartRequest : public Request { protected: - static std::string configUri; + static + std::string configUri; - static void handler() + static + void handler() { int ret; const char *cfg = !configUri.empty() @@ -46,7 +48,8 @@ protected: public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { int ret; json_error_t err; @@ -83,18 +86,18 @@ public: else if (json_config != nullptr) throw BadRequest("Parameter 'config' must be either a URL (string) or a configuration (object)"); } - else /* If no config is provided via request, we will use the previous one */ + else // If no config is provided via request, we will use the previous one configUri = session->getSuperNode()->getConfigUri(); logger->info("Restarting to {}", configUri); - /* Increment API restart counter */ + // Increment API restart counter char *scnt = getenv("VILLAS_API_RESTART_COUNT"); int cnt = scnt ? atoi(scnt) : 0; char buf[32]; snprintf(buf, sizeof(buf), "%d", cnt + 1); - /* We pass some env variables to the new process */ + // We pass some env variables to the new process setenv("VILLAS_API_RESTART_COUNT", buf, 1); auto *json_response = json_pack("{ s: i, s: o }", @@ -104,12 +107,12 @@ public: : json_string(configUri.c_str()) ); - /* Register exit handler */ + // Register exit handler ret = atexit(handler); if (ret) throw Error(HTTP_STATUS_INTERNAL_SERVER_ERROR, "Failed to restart VILLASnode instance"); - /* Properly terminate current instance */ + // Properly terminate current instance utils::killme(SIGTERM); return new JsonResponse(session, HTTP_STATUS_OK, json_response); @@ -118,7 +121,7 @@ public: std::string RestartRequest::configUri; -/* Register API request */ +// Register API request static char n[] = "restart"; static char r[] = "/restart"; static char d[] = "restart VILLASnode with new configuration"; @@ -127,4 +130,3 @@ static RequestPlugin p; } // namespace api } // namespace node } // namespace villas - diff --git a/lib/api/requests/shutdown.cpp b/lib/api/requests/shutdown.cpp index 60b24b3d2..c7869f4e4 100644 --- a/lib/api/requests/shutdown.cpp +++ b/lib/api/requests/shutdown.cpp @@ -1,9 +1,9 @@ -/** The "shutdown" API request. +/* The "shutdown" API request. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,7 +20,8 @@ class ShutdownRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::POST) throw InvalidMethod(this); @@ -34,7 +35,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "shutdown"; static char r[] = "/shutdown"; static char d[] = "quit VILLASnode"; diff --git a/lib/api/requests/status.cpp b/lib/api/requests/status.cpp index 74be93763..a1895eef4 100644 --- a/lib/api/requests/status.cpp +++ b/lib/api/requests/status.cpp @@ -1,9 +1,9 @@ -/** The "status" API request. +/* The "status" API request. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -23,7 +23,8 @@ class StatusRequest : public Request { public: using Request::Request; - virtual Response * execute() + virtual + Response * execute() { int ret; @@ -108,7 +109,7 @@ public: } }; -/* Register API request */ +// Register API request static char n[] = "status"; static char r[] = "/status"; static char d[] = "get status and statistics of web server"; @@ -117,4 +118,3 @@ static RequestPlugin p; } // namespace api } // namespace node } // namespace villas - diff --git a/lib/api/requests/universal.cpp b/lib/api/requests/universal.cpp index 8d716c159..481c54b7c 100644 --- a/lib/api/requests/universal.cpp +++ b/lib/api/requests/universal.cpp @@ -1,10 +1,9 @@ -/** Universal Data-exchange API request +/* Universal Data-exchange API request * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/api/requests/universal/channel.cpp b/lib/api/requests/universal/channel.cpp index d8b1a971b..94e0851fa 100644 --- a/lib/api/requests/universal/channel.cpp +++ b/lib/api/requests/universal/channel.cpp @@ -1,9 +1,9 @@ -/** The Universal Data-exchange API. +/* The Universal Data-exchange API. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -127,7 +127,8 @@ public: return new JsonResponse(session, HTTP_STATUS_OK, json_object()); } - virtual Response * execute() + virtual + Response * execute() { auto const &signalName = matches[2]; auto const &subResource = matches[3]; @@ -151,7 +152,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "universal/channel/sample"; static char r[] = "/universal/(" RE_NODE_NAME ")/channel/([a-z0-9_-]+)/(sample|event)"; static char d[] = "retrieve or send samples via universal data-exchange API"; diff --git a/lib/api/requests/universal/channels.cpp b/lib/api/requests/universal/channels.cpp index 576a9216f..ae7a720a1 100644 --- a/lib/api/requests/universal/channels.cpp +++ b/lib/api/requests/universal/channels.cpp @@ -1,9 +1,9 @@ -/** The Universal Data-exchange API. +/* The Universal Data-exchange API. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -18,7 +18,8 @@ class SignalsRequest : public UniversalRequest { public: using UniversalRequest::UniversalRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -48,7 +49,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "universal/channels"; static char r[] = "/universal/(" RE_NODE_NAME ")/channels"; static char d[] = "get channels of universal data-exchange API node"; diff --git a/lib/api/requests/universal/info.cpp b/lib/api/requests/universal/info.cpp index efbc46023..6ec3b58bd 100644 --- a/lib/api/requests/universal/info.cpp +++ b/lib/api/requests/universal/info.cpp @@ -1,9 +1,9 @@ -/** The Universal Data-exchange API. +/* The Universal Data-exchange API. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +19,8 @@ class InfoRequest : public UniversalRequest { public: using UniversalRequest::UniversalRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -41,7 +42,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "universal/info"; static char r[] = "/universal/(" RE_NODE_NAME ")/info"; static char d[] = "get infos of universal data-exchange API"; diff --git a/lib/api/requests/universal/status.cpp b/lib/api/requests/universal/status.cpp index 222681e4c..dc4d43130 100644 --- a/lib/api/requests/universal/status.cpp +++ b/lib/api/requests/universal/status.cpp @@ -1,9 +1,9 @@ -/** The Universal Data-exchange API. +/* The Universal Data-exchange API. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -18,7 +18,8 @@ class StatusRequest : public UniversalRequest { public: using UniversalRequest::UniversalRequest; - virtual Response * execute() + virtual + Response * execute() { if (method != Session::Method::GET) throw InvalidMethod(this); @@ -35,7 +36,7 @@ public: } }; -/* Register API requests */ +// Register API requests static char n[] = "universal/status"; static char r[] = "/universal/(" RE_NODE_NAME ")/status"; static char d[] = "get status of universal data-exchange API"; diff --git a/lib/api/response.cpp b/lib/api/response.cpp index d48477d2d..8048a0890 100644 --- a/lib/api/response.cpp +++ b/lib/api/response.cpp @@ -1,10 +1,9 @@ -/** API Response. +/* API Response. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -65,7 +64,7 @@ int Response::writeHeaders(struct lws *wsi) if (ret) return 1; - /* Do we have a body to send? */ + // Do we have a body to send? if (buffer.size() > 0) lws_callback_on_writable(wsi); diff --git a/lib/api/session.cpp b/lib/api/session.cpp index d8e94f9d8..a734f015d 100644 --- a/lib/api/session.cpp +++ b/lib/api/session.cpp @@ -1,9 +1,9 @@ -/** API session. +/* API session. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -132,7 +132,7 @@ void Session::open(void *in, size_t len) else if (len == 0) api->pending.push(this); else { - /* This request has a HTTP body. We wait for more data to arrive */ + // This request has a HTTP body. We wait for more data to arrive } } catch (const Error &e) { response = std::make_unique(this, e); @@ -169,7 +169,7 @@ int Session::writeable() if (!headersSent) { response->writeHeaders(wsi); - /* Now wait, until we can send the body */ + // Now wait, until we can send the body headersSent = true; return 0; diff --git a/lib/api/universal.cpp b/lib/api/universal.cpp index 6f09dca25..ed2140125 100644 --- a/lib/api/universal.cpp +++ b/lib/api/universal.cpp @@ -1,10 +1,9 @@ -/** API Response. +/* API Response. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/capabilities.cpp b/lib/capabilities.cpp index b7b221045..0d19977d6 100644 --- a/lib/capabilities.cpp +++ b/lib/capabilities.cpp @@ -1,9 +1,9 @@ -/** Capabilities +/* Capabilities * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/config.cpp b/lib/config.cpp index 2c2e8a699..221cfdebd 100644 --- a/lib/config.cpp +++ b/lib/config.cpp @@ -1,9 +1,9 @@ -/** Configuration file parsing. +/* Configuration file parsing. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -110,11 +110,11 @@ json_t * Config::decode(FILE *f) json_t *root = json_loadf(f, 0, &err); if (root == nullptr) { #ifdef WITH_CONFIG - /* We try again to parse the config in the legacy format */ + // We try again to parse the config in the legacy format root = libconfigDecode(f); #else throw JanssonParseError(err); -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG } return root; @@ -193,7 +193,8 @@ out: std::list files; void Config::resolveEnvVars(std::string &text) { - static const std::regex env_re{R"--(\$\{([^}]+)\})--"}; + static + const std::regex env_re{R"--(\$\{([^}]+)\})--"}; std::smatch match; while (std::regex_search(text, match, env_re)) { @@ -244,7 +245,7 @@ json_t * Config::libconfigDecode(FILE *f) config_init(&cfg); config_set_auto_convert(&cfg, 1); - /* Setup libconfig include path. */ + // Setup libconfig include path #if (LIBCONFIG_VER_MAJOR > 1) || ((LIBCONFIG_VER_MAJOR == 1) && (LIBCONFIG_VER_MINOR >= 7)) config_set_hook(&cfg, this); @@ -262,7 +263,7 @@ json_t * Config::libconfigDecode(FILE *f) } #endif - /* Rewind before re-reading */ + // Rewind before re-reading rewind(f); ret = config_read(&cfg, f); @@ -279,7 +280,7 @@ json_t * Config::libconfigDecode(FILE *f) return root; } -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG json_t * Config::walkStrings(json_t *root, str_walk_fcn_t cb) { @@ -334,7 +335,8 @@ json_t * Config::expandIncludes(json_t *in) return walkStrings(in, [this](json_t *str) -> json_t * { int ret; std::string text = json_string_value(str); - static const std::string kw = "@include "; + static + const std::string kw = "@include "; if (text.find(kw) != 0) return json_incref(str); diff --git a/lib/config_helper.cpp b/lib/config_helper.cpp index d91f19e3d..5e0747518 100644 --- a/lib/config_helper.cpp +++ b/lib/config_helper.cpp @@ -1,9 +1,9 @@ -/** Helpers for configuration parsers. +/* Helpers for configuration parsers. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -100,7 +100,7 @@ int villas::node::json_to_config(json_t *json, config_setting_t *parent) if (config_setting_is_root(parent)) { if (!json_is_object(json)) - return -1; /* The root must be an object! */ + return -1; // The root must be an object! } switch (json_typeof(json)) { @@ -155,7 +155,7 @@ int villas::node::json_to_config(json_t *json, config_setting_t *parent) return 0; } -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG void villas::node::json_object_extend_key_value_token(json_t *obj, const char *key, const char *value) { @@ -183,7 +183,7 @@ void villas::node::json_object_extend_key_value(json_t *obj, const char *key, co json_t *arr, *add, *existing, *subobj; - /* Is the key pointing to an object? */ + // Is the key pointing to an object? subobj = obj; cpy = strdup(key); @@ -205,21 +205,21 @@ void villas::node::json_object_extend_key_value(json_t *obj, const char *key, co key2 = strtok_r(nullptr, ".", &lasts); } - /* Try to parse as integer */ + // Try to parse as integer integer = strtol(value, &end, 0); if (*end == 0) { add = json_integer(integer); goto success; } - /* Try to parse as floating point */ + // Try to parse as floating point real = strtod(value, &end); if (*end == 0) { add = json_real(real); goto success; } - /* Try to parse special types */ + // Try to parse special types if (!strcmp(value, "true")) { add = json_true(); goto success; @@ -235,7 +235,7 @@ void villas::node::json_object_extend_key_value(json_t *obj, const char *key, co goto success; } - /* Fallback to string */ + // Fallback to string add = json_string(value); success: @@ -270,15 +270,15 @@ json_t * villas::node::json_load_cli(int argc, const char *argv[]) for (int i = 1; i < argc; i++) { opt = argv[i]; - /* Long Option */ + // Long Option if (opt[0] == '-' && opt[1] == '-') { - /* Option without value? Abort. */ + // Option without value? Abort if (key != nullptr) return nullptr; key = opt + 2; - /* Does this option has the form "--option=value"? */ + // Does this option has the form "--option=value"? sep = strchr(key, '='); if (sep) { cpy = strdup(key); @@ -292,9 +292,9 @@ json_t * villas::node::json_load_cli(int argc, const char *argv[]) key = nullptr; } } - /* Value */ + // Value else { - /* Value without key. Abort. */ + // Value without key. Abort if (key == nullptr) return nullptr; diff --git a/lib/dumper.cpp b/lib/dumper.cpp index cbb737e40..f4e4f186a 100644 --- a/lib/dumper.cpp +++ b/lib/dumper.cpp @@ -1,9 +1,9 @@ -/** Dump fields and values in a socket to plot them with villasDump.py. +/* Dump fields and values in a socket to plot them with villasDump.py. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/format.cpp b/lib/format.cpp index c91ba39e2..02e7ae293 100644 --- a/lib/format.cpp +++ b/lib/format.cpp @@ -1,9 +1,9 @@ -/** Reading and writing simulation samples in various formats. +/* Reading and writing simulation samples in various formats. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/formats/CMakeLists.txt b/lib/formats/CMakeLists.txt index 410a2378c..67afa3cbc 100644 --- a/lib/formats/CMakeLists.txt +++ b/lib/formats/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 if(DEFINED PROTOBUF_COMPILER AND PROTOBUF_FOUND) add_custom_command( diff --git a/lib/formats/column.cpp b/lib/formats/column.cpp index 26d474574..12cbcdf67 100644 --- a/lib/formats/column.cpp +++ b/lib/formats/column.cpp @@ -1,9 +1,9 @@ -/** Comma-separated values. +/* Comma-separated values. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -103,7 +103,7 @@ size_t ColumnLineFormat::sscanLine(const char *buf, size_t len, struct Sample *s goto out; ret = smp->data[i].parseString(sig->type, ptr, &end); - if (ret || end == ptr) /* There are no valid values anymore. */ + if (ret || end == ptr) // There are no valid values anymore. goto out; } @@ -119,7 +119,7 @@ out: if (*end == delimiter) void ColumnLineFormat::header(FILE *f, const SignalList::Ptr sigs) { - /* Abort if we are not supposed to, or have already printed the header */ + // Abort if we are not supposed to, or have already printed the header if (!print_header || header_printed) return; @@ -181,7 +181,7 @@ void ColumnLineFormat::parse(json_t *json) LineFormat::parse(json); } - +// Register formats static char n1[] = "csv"; static char d1[] = "Comma-separated values"; static ColumnLineFormatPlugin p1; diff --git a/lib/formats/iotagent_ul.cpp b/lib/formats/iotagent_ul.cpp index 86fdc7e4b..069fa9d40 100644 --- a/lib/formats/iotagent_ul.cpp +++ b/lib/formats/iotagent_ul.cpp @@ -1,11 +1,11 @@ -/** UltraLight 2.0 format as used by FIWARE IotAgent. +/* UltraLight 2.0 format as used by FIWARE IotAgent. * * See: https://fiware-iotagent-ul.readthedocs.io/en/latest/usermanual/index.html * - * @author Iris Koester - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Iris Koester + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -47,6 +47,7 @@ int IotAgentUltraLightFormat::sscan(const char *buf, size_t len, size_t *rbytes, return -1; } +// Register format static char n[] = "iotagent_ul"; static char d[] = "FIWARE IotAgent UltraLight format"; static FormatPlugin p; diff --git a/lib/formats/json.cpp b/lib/formats/json.cpp index d42eaed3c..854255f8c 100644 --- a/lib/formats/json.cpp +++ b/lib/formats/json.cpp @@ -1,9 +1,9 @@ -/** JSON serializtion of sample data. +/* JSON serializtion of sample data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -30,7 +30,7 @@ enum SignalType JsonFormat::detect(const json_t *val) return SignalType::BOOLEAN; case JSON_OBJECT: - return SignalType::COMPLEX; /* must be a complex number */ + return SignalType::COMPLEX; // must be a complex number default: return SignalType::INVALID; @@ -367,6 +367,7 @@ void JsonFormat::parse(json_t *json) dump_flags |= JSON_REAL_PRECISION(real_precision); } +// Register format static char n[] = "json"; static char d[] = "Javascript Object Notation"; static FormatPlugin p; diff --git a/lib/formats/json_edgeflex.cpp b/lib/formats/json_edgeflex.cpp index 9b493f86e..eaee6236b 100644 --- a/lib/formats/json_edgeflex.cpp +++ b/lib/formats/json_edgeflex.cpp @@ -1,9 +1,9 @@ -/** JSON serializtion for edgeFlex project. +/* JSON serializtion for edgeFlex project. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -92,6 +92,7 @@ int JsonEdgeflexFormat::unpackSample(json_t *json_smp, struct Sample *smp) return 0; } +// Register format static char n[] = "json.edgeflex"; static char d[] = "EdgeFlex JSON format"; static FormatPlugin p; diff --git a/lib/formats/json_kafka.cpp b/lib/formats/json_kafka.cpp index b40e199b6..4bae33c7b 100644 --- a/lib/formats/json_kafka.cpp +++ b/lib/formats/json_kafka.cpp @@ -1,9 +1,9 @@ -/** JSON serializtion for Kafka schema/payloads. +/* JSON serializtion for Kafka schema/payloads. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -39,7 +39,7 @@ int JsonKafkaFormat::packSample(json_t **json_smp, const struct Sample *smp) json_fields = json_array(); json_payload = json_object(); - /* Include sample timestamp */ + // Include sample timestamp if (smp->flags & (int) SampleFlags::HAS_TS_ORIGIN) { json_field = json_pack("{ s: s, s: b, s: s }", "type", "int64", @@ -52,7 +52,7 @@ int JsonKafkaFormat::packSample(json_t **json_smp, const struct Sample *smp) json_object_set_new(json_payload, "timestamp", json_integer(ts_origin_ms)); } - /* Include sample sequence no */ + // Include sample sequence no if (smp->flags & (int) SampleFlags::HAS_SEQUENCE) { json_field = json_pack("{ s: s, s: b, s: s }", "type", "int64", @@ -64,7 +64,7 @@ int JsonKafkaFormat::packSample(json_t **json_smp, const struct Sample *smp) json_object_set_new(json_payload, "sequence", json_integer(smp->sequence)); } - /* Include sample data */ + // Include sample data for (size_t i = 0; i < MIN(smp->length, smp->signals->size()); i++) { const auto sig = smp->signals->getByIndex(i); const auto *data = &smp->data[i]; @@ -106,7 +106,7 @@ int JsonKafkaFormat::unpackSample(json_t *json_smp, struct Sample *smp) smp->flags = 0; smp->signals = signals; - /* Unpack timestamp */ + // Unpack timestamp json_value = json_object_get(json_payload, "timestamp"); if (json_value) { uint64_t ts_origin_ms = json_integer_value(json_value); @@ -115,7 +115,7 @@ int JsonKafkaFormat::unpackSample(json_t *json_smp, struct Sample *smp) smp->flags |= (int) SampleFlags::HAS_TS_ORIGIN; } - /* Unpack sequence no */ + // Unpack sequence no json_value = json_object_get(json_payload, "sequence"); if (json_value) { smp->sequence = json_integer_value(json_value); @@ -123,7 +123,7 @@ int JsonKafkaFormat::unpackSample(json_t *json_smp, struct Sample *smp) smp->flags |= (int) SampleFlags::HAS_SEQUENCE; } - /* Unpack signal data */ + // Unpack signal data for (size_t i = 0; i < signals->size(); i++) { auto sig = signals->getByIndex(i); @@ -176,6 +176,7 @@ JsonKafkaFormat::JsonKafkaFormat(int fl) : ); } +// Register format static char n[] = "json.kafka"; static char d[] = "JSON Kafka schema/payload messages"; static FormatPlugin p; diff --git a/lib/formats/json_reserve.cpp b/lib/formats/json_reserve.cpp index 54f0cef4a..29913a1b8 100644 --- a/lib/formats/json_reserve.cpp +++ b/lib/formats/json_reserve.cpp @@ -1,9 +1,9 @@ -/** JSON serializtion for RESERVE project. +/* JSON serializtion for RESERVE project. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -196,7 +196,7 @@ int JsonReserveFormat::unpackSample(json_t *json_smp, struct Sample *smp) return smp->length > 0 ? 1 : 0; } - +// Register format static char n[] = "json.reserve"; static char d[] = "RESERVE JSON format"; static FormatPlugin p; diff --git a/lib/formats/line.cpp b/lib/formats/line.cpp index 5692d0c5c..32a698aa3 100644 --- a/lib/formats/line.cpp +++ b/lib/formats/line.cpp @@ -1,9 +1,9 @@ -/** Line-based formats +/* Line-based formats * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -42,7 +42,7 @@ int LineFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample } for (i = 0; i < cnt && off < len; i++) { - /* Skip comment lines */ + // Skip comment lines if (buf[off] == comment) { while (off < len) { if (buf[++off] == delimiter) @@ -93,7 +93,7 @@ int LineFormat::scan(FILE *f, struct Sample * const smps[], unsigned cnt) if (!first_line_skipped) { bytes = getdelim(&in.buffer, &in.buflen, delimiter, f); if (bytes < 0) - return -1; /* An error or eof occured */ + return -1; // An error or eof occured first_line_skipped = true; } @@ -107,9 +107,9 @@ skip: bytes = getdelim(&in.buffer, &in.buflen, delimiter, f); if (feof(f)) break; else if (bytes < 0) - return -1; /* An error or eof occured */ + return -1; // An error or eof occured - /* Skip whitespaces, empty and comment lines */ + // Skip whitespaces, empty and comment lines for (ptr = in.buffer; isspace(*ptr); ptr++); if (ptr[0] == '\0' || ptr[0] == comment) diff --git a/lib/formats/msg.cpp b/lib/formats/msg.cpp index b01a17f7e..85b672b82 100644 --- a/lib/formats/msg.cpp +++ b/lib/formats/msg.cpp @@ -1,9 +1,9 @@ -/** Message related functions. +/* Message related functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/formats/opal_asyncip.cpp b/lib/formats/opal_asyncip.cpp index a3907589c..3e72fd547 100644 --- a/lib/formats/opal_asyncip.cpp +++ b/lib/formats/opal_asyncip.cpp @@ -1,9 +1,9 @@ -/** A custom format for OPAL-RTs AsyncIP example +/* A custom format for OPAL-RTs AsyncIP example * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -61,7 +61,7 @@ int OpalAsyncIPFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct auto *ptr = buf; if (len % 8 != 0) - return -1; /* Packet size is invalid: Must be multiple of 8 bytes */ + return -1; // Packet size is invalid: Must be multiple of 8 bytes for (i = 0; i < cnt && ptr - buf + sizeof(struct Payload) < len; i++) { auto *pl = (struct Payload *) ptr; @@ -113,4 +113,5 @@ void OpalAsyncIPFormat::parse(json_t *json) Format::parse(json); } -static OpalAsyncIPFormatPlugin p; +static +OpalAsyncIPFormatPlugin p; diff --git a/lib/formats/protobuf.cpp b/lib/formats/protobuf.cpp index 1d37e76d2..82699d1c9 100644 --- a/lib/formats/protobuf.cpp +++ b/lib/formats/protobuf.cpp @@ -1,9 +1,9 @@ -/** Protobuf IO format +/* Protobuf IO format * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -220,6 +220,7 @@ int ProtobufFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sa return i; } +// Register format static char n[] = "protobuf"; static char d[] = "Google Protobuf"; static FormatPlugin p; diff --git a/lib/formats/raw.cpp b/lib/formats/raw.cpp index 15526b922..dbec95da0 100644 --- a/lib/formats/raw.cpp +++ b/lib/formats/raw.cpp @@ -1,9 +1,9 @@ -/** RAW IO format +/* RAW IO format * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -13,29 +13,29 @@ typedef float flt32_t; typedef double flt64_t; -typedef long double flt128_t; /** @todo check */ +typedef long double flt128_t; // @todo check using namespace villas; using namespace villas::node; -/** Convert double to host byte order */ +// Convert double to host byte order #define SWAP_FLOAT_XTOH(o, b, n) ({ \ union { flt ## b ## _t f; uint ## b ## _t i; } x = { .f = n }; \ x.i = (o) ? be ## b ## toh(x.i) : le ## b ## toh(x.i); \ x.f; \ }) -/** Convert double to big/little endian byte order */ +// Convert double to big/little endian byte order #define SWAP_FLOAT_HTOX(o, b, n) ({ \ union { flt ## b ## _t f; uint ## b ## _t i; } x = { .f = n }; \ x.i = (o) ? htobe ## b (x.i) : htole ## b (x.i); \ x.f; \ }) -/** Convert integer of varying width to host byte order */ +// Convert integer of varying width to host byte order #define SWAP_INT_XTOH(o, b, n) (o ? be ## b ## toh(n) : le ## b ## toh(n)) -/** Convert integer of varying width to big/little endian byte order */ +// Convert integer of varying width to big/little endian byte order #define SWAP_INT_HTOX(o, b, n) (o ? htobe ## b (n) : htole ## b (n)) int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample * const smps[], unsigned cnt) @@ -43,7 +43,7 @@ int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample int o = 0; size_t nlen; - void *vbuf = (char *) buf; /* Avoid warning about invalid pointer cast */ + void *vbuf = (char *) buf; // Avoid warning about invalid pointer cast int8_t *i8 = (int8_t *) vbuf; int16_t *i16 = (int16_t *) vbuf; @@ -64,7 +64,7 @@ int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample * These fields are always encoded as integers! */ if (fake) { - /* Check length */ + // Check length nlen = (o + 3) * (bits / 8); if (nlen >= len) goto out; @@ -108,7 +108,7 @@ int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample enum SignalType fmt = sample_format(smp, j); const union SignalData *data = &smp->data[j]; - /* Check length */ + // Check length nlen = (o + (fmt == SignalType::COMPLEX ? 2 : 1)) * (bits / 8); if (nlen >= len) goto out; @@ -118,11 +118,11 @@ int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample switch (bits) { case 8: i8 [o++] = -1; - break; /* Not supported */ + break; // Not supported case 16: i16[o++] = -1; - break; /* Not supported */ + break; // Not supported case 32: f32[o++] = SWAP_FLOAT_HTOX(endianess == Endianess::BIG, 32, (float) data->f); @@ -193,12 +193,12 @@ int RawFormat::sprint(char *buf, size_t len, size_t *wbytes, const struct Sample case SignalType::COMPLEX: switch (bits) { case 8: - i8 [o++] = -1; /* Not supported */ + i8 [o++] = -1; // Not supported i8 [o++] = -1; break; case 16: - i16[o++] = -1; /* Not supported */ + i16[o++] = -1; // Not supported i16[o++] = -1; break; @@ -234,7 +234,7 @@ out: if (wbytes) int RawFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample * const smps[], unsigned cnt) { - void *vbuf = (void *) buf; /* Avoid warning about invalid pointer cast */ + void *vbuf = (void *) buf; // Avoid warning about invalid pointer cast int8_t *i8 = (int8_t *) vbuf; int16_t *i16 = (int16_t *) vbuf; @@ -258,11 +258,11 @@ int RawFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample return -1; if (len % (bits / 8)) - return -1; /* Invalid RAW Payload length */ + return -1; // Invalid RAW Payload length if (fake) { if (nlen < o + 3) - return -1; /* Received a packet with no fake header. Skipping... */ + return -1; // Received a packet with no fake header. Skipping... switch (bits) { case 8: @@ -317,8 +317,8 @@ int RawFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample switch (fmt) { case SignalType::FLOAT: switch (bits) { - case 8: data->f = -1; o++; break; /* Not supported */ - case 16: data->f = -1; o++; break; /* Not supported */ + case 8: data->f = -1; o++; break; // Not supported + case 16: data->f = -1; o++; break; // Not supported case 32: data->f = SWAP_FLOAT_XTOH(endianess == Endianess::BIG, 32, f32[o++]); break; case 64: data->f = SWAP_FLOAT_XTOH(endianess == Endianess::BIG, 64, f64[o++]); break; @@ -354,8 +354,8 @@ int RawFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample case SignalType::COMPLEX: switch (bits) { - case 8: data->z = std::complex(-1, -1); o += 2; break; /* Not supported */ - case 16: data->z = std::complex(-1, -1); o += 2; break; /* Not supported */ + case 8: data->z = std::complex(-1, -1); o += 2; break; // Not supported + case 16: data->z = std::complex(-1, -1); o += 2; break; // Not supported case 32: data->z = std::complex( SWAP_FLOAT_XTOH(endianess == Endianess::BIG, 32, f32[o++]), @@ -378,14 +378,14 @@ int RawFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sample break; case SignalType::INVALID: - return -1; /* Unsupported format in RAW payload */ + return -1; // Unsupported format in RAW payload } } smp->length = i; if (smp->length > smp->capacity) - smp->length = smp->capacity; /* Received more values than supported */ + smp->length = smp->capacity; // Received more values than supported if (rbytes) *rbytes = o * (bits / 8); @@ -433,6 +433,7 @@ void RawFormat::parse(json_t *json) BinaryFormat::parse(json); } +// Register formats static char n1[] = "raw"; static char d1[] = "Raw binary data"; static FormatPlugin p1; diff --git a/lib/formats/value.cpp b/lib/formats/value.cpp index 018bfa698..33f3b416e 100644 --- a/lib/formats/value.cpp +++ b/lib/formats/value.cpp @@ -1,9 +1,9 @@ -/** Bare text values. +/* Bare text values. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -55,7 +55,7 @@ int ValueFormat::sscan(const char *buf, size_t len, size_t *rbytes, struct Sampl return -1; ret = smp->data[i].parseString(sig->type, ptr, &end); - if (ret || end == ptr) /* There are no valid values anymore. */ + if (ret || end == ptr) // There are no valid values anymore. goto out; i++; @@ -74,6 +74,7 @@ out: smp->flags = 0; return i; } +// Register format static char n[] = "value"; static char d[] = "A bare text value without any headers"; static FormatPlugin p; diff --git a/lib/formats/villas.proto b/lib/formats/villas.proto index af9e0dec9..27a581b2b 100644 --- a/lib/formats/villas.proto +++ b/lib/formats/villas.proto @@ -1,9 +1,9 @@ /// Protobuf schema based on msg_format.h /// /// @file -/// @author Steffen Vogel -/// @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -/// @license Apache 2.0 +/// Author: Steffen Vogel +/// SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +/// SPDX-License-Identifier: Apache-2.0 //////////////////////////////////////////////////////////////////////////////////// syntax = "proto2"; diff --git a/lib/formats/villas_binary.cpp b/lib/formats/villas_binary.cpp index b74154b1c..f9e1cad5e 100644 --- a/lib/formats/villas_binary.cpp +++ b/lib/formats/villas_binary.cpp @@ -1,9 +1,9 @@ -/** Message related functions. +/* Message related functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -36,7 +36,7 @@ int VillasBinaryFormat::sprint(char *buf, size_t len, size_t *wbytes, const stru return ret; if (web) { - /** @todo convert to little endian */ + // @todo convert to little endian } else msg_hton(msg); @@ -58,7 +58,7 @@ int VillasBinaryFormat::sscan(const char *buf, size_t len, size_t *rbytes, struc uint8_t sid; // source_index if (len % 4 != 0) - return -1; /* Packet size is invalid: Must be multiple of 4 bytes */ + return -1; // Packet size is invalid: Must be multiple of 4 bytes for (i = 0, j = 0; i < cnt; i++) { struct Message *msg = (struct Message *) ptr; @@ -66,29 +66,29 @@ int VillasBinaryFormat::sscan(const char *buf, size_t len, size_t *rbytes, struc smp->signals = signals; - /* Complete buffer has been parsed */ + // Complete buffer has been parsed if (ptr == buf + len) break; - /* Check if header is still in buffer bounaries */ + // Check if header is still in buffer bounaries if (ptr + sizeof(struct Message) > buf + len) - return -2; /* Invalid msg received */ + return -2; // Invalid msg received values = web ? msg->length : ntohs(msg->length); - /* Check if remainder of message is in buffer boundaries */ + // Check if remainder of message is in buffer boundaries if (ptr + MSG_LEN(values) > buf + len) - return -3; /* Invalid msg receive */ + return -3; // Invalid msg receive if (web) { - /** @todo convert from little endian */ + // @todo convert from little endian } else msg_ntoh(msg); ret = msg_to_sample(msg, smp, signals, &sid); if (ret) - return ret; /* Invalid msg received */ + return ret; // Invalid msg received if (validate_source_index && sid != source_index) { // source index mismatch: we skip this sample @@ -128,5 +128,8 @@ void VillasBinaryFormat::parse(json_t *json) Format::parse(json); } -static VillasBinaryFormatPlugin p1; -static VillasBinaryFormatPlugin p2; +// Register formats +static +VillasBinaryFormatPlugin p1; +static +VillasBinaryFormatPlugin p2; diff --git a/lib/formats/villas_human.cpp b/lib/formats/villas_human.cpp index efacb7284..a6cb49dab 100644 --- a/lib/formats/villas_human.cpp +++ b/lib/formats/villas_human.cpp @@ -1,9 +1,9 @@ -/** The internal datastructure for a sample of simulation data. +/* The internal datastructure for a sample of simulation data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -72,14 +72,14 @@ size_t VILLASHumanFormat::sscanLine(const char *buf, size_t len, struct Sample * * Please note that only the seconds and at least one value are mandatory */ - /* Mandatory: seconds */ + // Mandatory: seconds smp->ts.origin.tv_sec = (uint32_t) strtoul(ptr, &end, 10); if (ptr == end || *end == delimiter) return -1; smp->flags |= (int) SampleFlags::HAS_TS_ORIGIN; - /* Optional: nano seconds */ + // Optional: nano seconds if (*end == '.') { ptr = end + 1; @@ -90,18 +90,18 @@ size_t VILLASHumanFormat::sscanLine(const char *buf, size_t len, struct Sample * else smp->ts.origin.tv_nsec = 0; - /* Optional: offset / delay */ + // Optional: offset / delay if (*end == '+' || *end == '-') { ptr = end; - offset = strtof(ptr, &end); /* offset is ignored for now */ + offset = strtof(ptr, &end); // offset is ignored for now if (ptr != end) smp->flags |= (int) SampleFlags::HAS_OFFSET; else return -4; } - /* Optional: sequence */ + // Optional: sequence if (*end == '(') { ptr = end + 1; @@ -125,7 +125,7 @@ size_t VILLASHumanFormat::sscanLine(const char *buf, size_t len, struct Sample * goto out; ret = smp->data[i].parseString(sig->type, ptr, &end); - if (ret || end == ptr) /* There are no valid values anymore. */ + if (ret || end == ptr) // There are no valid values anymore. goto out; } @@ -148,7 +148,7 @@ out: if (*end == delimiter) void VILLASHumanFormat::header(FILE *f, const SignalList::Ptr sigs) { - /* Abort if we are not supposed to, or have already printed the header */ + // Abort if we are not supposed to, or have already printed the header if (!print_header || header_printed) return; @@ -184,6 +184,7 @@ void VILLASHumanFormat::header(FILE *f, const SignalList::Ptr sigs) LineFormat::header(f, sigs); } +// Register format static char n[] = "villas.human"; static char d[] = "VILLAS human readable format"; static LineFormatPlugin p; diff --git a/lib/hook.cpp b/lib/hook.cpp index 17bc84be8..ed61459a1 100644 --- a/lib/hook.cpp +++ b/lib/hook.cpp @@ -1,9 +1,9 @@ -/** Hook-releated functions. +/* Hook-releated functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -28,7 +28,7 @@ Hook::Hook(Path *p, Node *n, int fl, int prio, bool en) : factory(nullptr), state(fl & (int) Hook::Flags::BUILTIN ? State::CHECKED - : State::INITIALIZED), /* We dont need to parse builtin hooks. */ + : State::INITIALIZED), // We dont need to parse builtin hooks flags(fl), priority(prio), enabled(en), @@ -97,12 +97,11 @@ void SingleSignalHook::parse(json_t *json) signalName = json_string_value(json_signal); } - void SingleSignalHook::prepare() { Hook::prepare(); - /* Setup mask */ + // Setup mask int index = signals->getIndexByName(signalName.c_str()); if (index < 0) throw RuntimeError("Failed to find signal {}", signalName); @@ -110,7 +109,7 @@ void SingleSignalHook::prepare() signalIndex = (unsigned) index; } -/* Multi Signal Hook */ +// Multi Signal Hook void MultiSignalHook::parse(json_t *json) { @@ -155,7 +154,6 @@ void MultiSignalHook::parse(json_t *json) throw ConfigError(json, "node-config-hook-signals", "Missing 'signals' setting"); } - void MultiSignalHook::prepare() { Hook::prepare(); diff --git a/lib/hook_list.cpp b/lib/hook_list.cpp index 20b7d2711..5e3452aac 100644 --- a/lib/hook_list.cpp +++ b/lib/hook_list.cpp @@ -1,9 +1,9 @@ -/** Hook-releated functions. +/* Hook-releated functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -71,7 +71,7 @@ void HookList::prepare(SignalList::Ptr signals, int m, Path *p, Node *n) if (!m) goto skip_add; - /* Add internal hooks if they are not already in the list */ + // Add internal hooks if they are not already in the list for (auto f : plugin::registry->lookup()) { if ((f->getFlags() & m) == m) { auto h = f->make(p, n); @@ -80,10 +80,10 @@ void HookList::prepare(SignalList::Ptr signals, int m, Path *p, Node *n) } skip_add: - /* Remove filters which are not enabled */ + // Remove filters which are not enabled remove_if([](Hook::Ptr h) { return !h->isEnabled(); }); - /* We sort the hooks according to their priority */ + // We sort the hooks according to their priority sort([](const value_type &a, const value_type b) { return a->getPriority() < b->getPriority(); }); unsigned i = 0; diff --git a/lib/hooks/CMakeLists.txt b/lib/hooks/CMakeLists.txt index ed2f1e0f7..16c27a575 100644 --- a/lib/hooks/CMakeLists.txt +++ b/lib/hooks/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(HOOK_SRC average.cpp diff --git a/lib/hooks/average.cpp b/lib/hooks/average.cpp index db8d6bd6f..e6b77d264 100644 --- a/lib/hooks/average.cpp +++ b/lib/hooks/average.cpp @@ -1,9 +1,9 @@ -/** Average hook. +/* Average hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -27,13 +27,14 @@ public: offset(0) { } - virtual void prepare() + virtual + void prepare() { assert(state == State::CHECKED); MultiSignalHook::prepare(); - /* Add averaged signal */ + // Add averaged signal auto avg_sig = std::make_shared("average", "", SignalType::FLOAT); if (!avg_sig) throw RuntimeError("Failed to create new signal"); @@ -43,7 +44,8 @@ public: state = State::PREPARED; } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -61,7 +63,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { double avg, sum = 0; int n = 0; @@ -81,7 +84,7 @@ public: case SignalType::INVALID: case SignalType::COMPLEX: case SignalType::BOOLEAN: - return Hook::Reason::ERROR; /* not supported */ + return Hook::Reason::ERROR; // not supported } n++; @@ -98,7 +101,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "average"; static char d[] = "Calculate average over some signals"; static HookPlugin p; diff --git a/lib/hooks/cast.cpp b/lib/hooks/cast.cpp index 6dfe0179f..8fb373830 100644 --- a/lib/hooks/cast.cpp +++ b/lib/hooks/cast.cpp @@ -1,9 +1,9 @@ -/** Cast hook. +/* Cast hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -26,7 +26,8 @@ public: new_type(SignalType::INVALID) { } - virtual void prepare() + virtual + void prepare() { assert(state == State::CHECKED); @@ -45,7 +46,8 @@ public: state = State::PREPARED; } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; @@ -73,7 +75,7 @@ public: throw RuntimeError("Invalid signal type: {}", type); } else - /* We use this constant to indicate that we dont want to change the type. */ + // We use this constant to indicate that we dont want to change the type. new_type = SignalType::INVALID; if (name) @@ -85,7 +87,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -100,11 +103,10 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "cast"; static char d[] = "Cast signals types"; static HookPlugin p; } // namespace node } // namespace villas - diff --git a/lib/hooks/decimate.cpp b/lib/hooks/decimate.cpp index e6c397400..a8124aa16 100644 --- a/lib/hooks/decimate.cpp +++ b/lib/hooks/decimate.cpp @@ -1,9 +1,9 @@ -/** Decimate hook. +/* Decimate hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -52,7 +52,7 @@ Hook::Reason DecimateHook::process(struct Sample *smp) return Reason::OK; } -/* Register hook */ +// Register hook static char n[] = "decimate"; static char d[] = "Downsamping by integer factor"; static HookPlugin p; diff --git a/lib/hooks/dp.cpp b/lib/hooks/dp.cpp index 010c77f24..c6a1c69fd 100644 --- a/lib/hooks/dp.cpp +++ b/lib/hooks/dp.cpp @@ -1,9 +1,9 @@ -/** Dynamic Phasor Interface Algorithm hook. +/* Dynamic Phasor Interface Algorithm hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -51,21 +51,21 @@ protected: for (int k = 0; k < fharmonics_len; k++) { om_k = 2.0i * M_PI * (double) fharmonics[k] / (double) N; - /* Correction for stationary phasor */ + // Correction for stationary phasor corr = std::exp(-om_k * (steps - (N + 1))); //corr = 1; #if 0 - /* Recursive update */ + // Recursive update coeffs[k] = std::exp(om) * (coeffs[k] + (newest - oldest)); out[k] = (2.0 / N) * (coeffs[i] * corr); - /* DC component */ + // DC component if (fharmonics[k] == 0) out[k] /= 2.0; #else - /* Full DFT */ + // Full DFT std::complex X_k = 0; for (int n = 0; n < N; n++) { @@ -83,7 +83,7 @@ protected: { std::complex value = 0; - /* Reconstruct the original signal */ + // Reconstruct the original signal for (int k = 0; k < fharmonics_len; k++) { double freq = fharmonics[k]; // cppcheck-suppress objectIndex @@ -113,9 +113,10 @@ public: fharmonics_len(0) { } - virtual ~DPHook() + virtual + ~DPHook() { - /* Release memory */ + // Release memory if (fharmonics) delete fharmonics; @@ -126,7 +127,8 @@ public: free(signal_name); } - virtual void start() + virtual + void start() { assert(state == State::PREPARED); @@ -141,7 +143,8 @@ public: state = State::STARTED; } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -203,7 +206,8 @@ public: state = State::PARSED; } - virtual void prepare() + virtual + void prepare() { assert(state == State::CHECKED); @@ -218,7 +222,7 @@ public: } if (inverse) { - /* Remove complex-valued coefficient signals */ + // Remove complex-valued coefficient signals for (int i = 0; i < fharmonics_len; i++) { auto orig_sig = signals->getByIndex(signal_index + i); if (!orig_sig) @@ -230,7 +234,7 @@ public: signals->erase(signals->begin() + signal_index + i); } - /* Add new real-valued reconstructed signals */ + // Add new real-valued reconstructed signals auto new_sig = std::make_shared("dp", "idp", SignalType::FLOAT); if (!new_sig) throw RuntimeError("Failed to create signal"); @@ -261,7 +265,8 @@ public: state = State::PREPARED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { if (signal_index >= smp->length) return Hook::Reason::ERROR; @@ -292,7 +297,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "dp"; static char d[] = "Transform to/from dynamic phasor domain"; static HookPlugin p; diff --git a/lib/hooks/drop.cpp b/lib/hooks/drop.cpp index 0ea53ca65..516e9e3f6 100644 --- a/lib/hooks/drop.cpp +++ b/lib/hooks/drop.cpp @@ -1,9 +1,9 @@ -/** Drop hook. +/* Drop hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -21,7 +21,8 @@ protected: public: using Hook::Hook; - virtual void start() + virtual + void start() { assert(state == State::PREPARED || state == State::STOPPED); @@ -30,7 +31,8 @@ public: state = State::STARTED; } - virtual void stop() + virtual + void stop() { assert(state == State::STARTED); @@ -40,7 +42,8 @@ public: state = State::STOPPED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { int dist; @@ -64,7 +67,8 @@ public: return Reason::OK; } - virtual void restart() + virtual + void restart() { assert(state == State::STARTED); @@ -75,7 +79,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "drop"; static char d[] = "Drop messages with reordered sequence numbers"; static HookPlugin p; diff --git a/lib/hooks/dump.cpp b/lib/hooks/dump.cpp index 4571707eb..5dceb1fd1 100644 --- a/lib/hooks/dump.cpp +++ b/lib/hooks/dump.cpp @@ -1,9 +1,9 @@ -/** Dump hook. +/* Dump hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -16,7 +16,8 @@ class DumpHook : public Hook { public: using Hook::Hook; - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -26,7 +27,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "dump"; static char d[] = "Dump data to stdout"; static HookPlugin p; diff --git a/lib/hooks/ebm.cpp b/lib/hooks/ebm.cpp index f2d054f40..231236efc 100644 --- a/lib/hooks/ebm.cpp +++ b/lib/hooks/ebm.cpp @@ -1,9 +1,9 @@ -/** Energy-based Metric hook. +/* Energy-based Metric hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -26,7 +26,8 @@ protected: public: using Hook::Hook; - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; @@ -60,7 +61,8 @@ public: state = State::PARSED; } - virtual void start() + virtual + void start() { assert(state == State::PREPARED); @@ -70,14 +72,16 @@ public: state = State::STARTED; } - virtual void periodic() + virtual + void periodic() { assert(state == State::STARTED); logger->info("Energy: {}", energy); } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { double P, P_last, dt; @@ -85,7 +89,7 @@ public: if (last) { for (auto phase : phases) { - /* Trapazoidal rule */ + // Trapazoidal rule dt = time_delta(&last->ts.origin, &smp->ts.origin); P = smp->data[phase.first].f * smp->data[phase.second].f; @@ -104,7 +108,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "ebm"; static char d[] = "Energy-based Metric"; static HookPlugin p; diff --git a/lib/hooks/fix.cpp b/lib/hooks/fix.cpp index 5e50ffc60..ea653a773 100644 --- a/lib/hooks/fix.cpp +++ b/lib/hooks/fix.cpp @@ -1,9 +1,9 @@ -/** Drop hook. +/* Drop hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,7 +20,8 @@ class FixHook : public Hook { public: using Hook::Hook; - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -45,11 +46,10 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "fix"; static char d[] = "Fix received data by adding missing fields"; static HookPlugin p; } // namespace node } // namespace villas - diff --git a/lib/hooks/gate.cpp b/lib/hooks/gate.cpp index cd4ae43b1..347d2dc30 100644 --- a/lib/hooks/gate.cpp +++ b/lib/hooks/gate.cpp @@ -1,9 +1,9 @@ -/** Gate hook. +/* Gate hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -48,7 +48,8 @@ public: startSequence(0) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; @@ -83,13 +84,14 @@ public: state = State::PARSED; } - virtual void prepare() + virtual + void prepare() { assert(state == State::CHECKED); SingleSignalHook::prepare(); - /* Check if signal type is float */ + // Check if signal type is float auto sig = signals->getByIndex(signalIndex); if (sig->type != SignalType::FLOAT) throw RuntimeError("Gate signal must be of type float"); @@ -97,7 +99,8 @@ public: state = State::PREPARED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -150,7 +153,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "gate"; static char d[] = "Skip samples only if an enable signal is under a specified threshold"; static HookPlugin p; diff --git a/lib/hooks/jitter_calc.cpp b/lib/hooks/jitter_calc.cpp index d32b047c2..63c6ec1ee 100644 --- a/lib/hooks/jitter_calc.cpp +++ b/lib/hooks/jitter_calc.cpp @@ -1,9 +1,9 @@ -/** Calc jitter, mean and variance of GPS vs NTP TS. +/* Calc jitter, mean and variance of GPS vs NTP TS. * - * @author Umar Farooq - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Umar Farooq + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -44,15 +44,15 @@ public: curr_count(0) { } - /** - * Hook to calculate jitter between GTNET-SKT GPS timestamp and Villas node NTP timestamp. + /* Hook to calculate jitter between GTNET-SKT GPS timestamp and Villas node NTP timestamp. * * Drawbacks: No protection for out of order packets. Default positive delay assumed, * so GPS timestamp should be earlier than NTP timestamp. If difference b/w NTP and GPS ts * is high (i.e. several mins depending on GPS_NTP_DELAY_WIN_SIZE), * the variance value will overrun the 64bit value. */ - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -66,12 +66,12 @@ public: curr_delay_us = delay_sec * 1000000 + delay_nsec / 1000; delay_mov_sum = delay_mov_sum + curr_delay_us - delay_series[curr_count]; - moving_avg[curr_count] = delay_mov_sum / GPS_NTP_DELAY_WIN_SIZE; /* Will be valid after GPS_NTP_DELAY_WIN_SIZE initial values */ + moving_avg[curr_count] = delay_mov_sum / GPS_NTP_DELAY_WIN_SIZE; // Will be valid after GPS_NTP_DELAY_WIN_SIZE initial values delay_mov_sum_sqrd = delay_mov_sum_sqrd + (curr_delay_us * curr_delay_us) - (delay_series[curr_count] * delay_series[curr_count]); moving_var[curr_count] = (delay_mov_sum_sqrd - (delay_mov_sum * delay_mov_sum) / GPS_NTP_DELAY_WIN_SIZE) / (GPS_NTP_DELAY_WIN_SIZE - 1); - delay_series[curr_count] = curr_delay_us; /* Update the last delay value */ + delay_series[curr_count] = curr_delay_us; // Update the last delay value /* Jitter calc formula as used in Wireshark according to RFC3550 (RTP) D(i,j) = (Rj-Ri)-(Sj-Si) = (Rj-Sj)-(Ri-Si) @@ -92,7 +92,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "jitter_calc"; static char d[] = "Calc jitter, mean and variance of GPS vs NTP TS"; static HookPlugin p; diff --git a/lib/hooks/limit_rate.cpp b/lib/hooks/limit_rate.cpp index e07fe7909..4dd0a8527 100644 --- a/lib/hooks/limit_rate.cpp +++ b/lib/hooks/limit_rate.cpp @@ -1,9 +1,9 @@ -/** Rate-limiting hook. +/* Rate-limiting hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -76,7 +76,7 @@ Hook::Reason LimitRateHook::process(struct Sample *smp) return Reason::OK; } -/* Register hook */ +// Register hook static char n[] = "limit_rate"; static char d[] = "Limit sending rate"; static HookPlugin p; diff --git a/lib/hooks/limit_value.cpp b/lib/hooks/limit_value.cpp index 7b23512b1..9a4b0311d 100644 --- a/lib/hooks/limit_value.cpp +++ b/lib/hooks/limit_value.cpp @@ -1,9 +1,9 @@ -/** Limit hook. +/* Limit hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -32,7 +32,8 @@ public: max(0) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -51,7 +52,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -76,7 +78,7 @@ public: case SignalType::INVALID: case SignalType::COMPLEX: case SignalType::BOOLEAN: - return Hook::Reason::ERROR; /* not supported */ + return Hook::Reason::ERROR; // not supported } } @@ -84,7 +86,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "limit_value"; static char d[] = "Limit signal values"; static HookPlugin p; diff --git a/lib/hooks/lua.cpp b/lib/hooks/lua.cpp index d75392cd2..4219eb061 100644 --- a/lib/hooks/lua.cpp +++ b/lib/hooks/lua.cpp @@ -1,9 +1,9 @@ -/** Lua expressions hook. +/* Lua expressions hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -40,7 +40,8 @@ public: err(e) { } - virtual const char * what() const noexcept + virtual + const char * what() const noexcept { const char *msg; switch (err) { @@ -121,7 +122,7 @@ bool lua_pushsignaldata(lua_State *L, const union SignalData *data, const Signal case SignalType::COMPLEX: case SignalType::INVALID: default: - return false; /* we skip unknown types. Lua will see a nil value in the table */ + return false; // we skip unknown types. Lua will see a nil value in the table } return true; @@ -361,7 +362,7 @@ json_t * lua_tojson(lua_State *L, int index = -1) } else { const char *key = lua_tostring(L, -2); - if (key) /* Skip table entries whose keys are neither string or number! */ + if (key) // Skip table entries whose keys are neither string or number! json_object_set(json, key, val); } lua_pop(L, 1); @@ -386,7 +387,7 @@ LuaSignalExpression::LuaSignalExpression(lua_State *l, json_t *json_sig) : json_error_t err; const char *expr; - /* Parse expression */ + // Parse expression ret = json_unpack_ex(json_sig, &err, 0, "{ s: s }", "expression", &expr ); @@ -405,7 +406,7 @@ void LuaSignalExpression::prepare() void LuaSignalExpression::parseExpression(const std::string &expr) { - /* Release previous expression */ + // Release previous expression if (cookie) luaL_unref(L, LUA_REGISTRYINDEX, cookie); @@ -532,7 +533,7 @@ void LuaHook::loadScript() int ret; if (script.empty()) - return; /* No script given. */ + return; // No script given ret = luaL_loadfile(L, script.c_str()); if (ret) @@ -588,10 +589,10 @@ void LuaHook::setupEnvironment() void LuaHook::prepare() { - /* Load Lua standard libraries */ + // Load Lua standard libraries luaL_openlibs(L); - /* Load our Lua script */ + // Load our Lua script logger->debug("Loading Lua script: {}", script); setupEnvironment(); @@ -604,14 +605,14 @@ void LuaHook::prepare() */ needsLocking = functions.periodic > 0; - /* Prepare Lua process() */ + // Prepare Lua process() if (functions.process) { /* We currently do not support the alteration of * signal metadata in process() */ signalsProcessed = signals; } - /* Prepare Lua expressions */ + // Prepare Lua expressions if (hasExpressions) { for (auto &expr : expressions) expr.prepare(); @@ -721,7 +722,7 @@ Hook::Reason LuaHook::process(struct Sample *smp) ? std::unique_lock(mutex) : std::unique_lock(); - /* First, run the process() function of the script */ + // First, run the process() function of the script if (functions.process) { logger->debug("Executing Lua function: process(smp)"); @@ -749,7 +750,7 @@ Hook::Reason LuaHook::process(struct Sample *smp) else reason = Reason::OK; - /* After that evaluate expressions */ + // After that evaluate expressions if (hasExpressions) { lua_pushsample(L, smp, useNames); lua_setglobal(L, "smp"); @@ -768,7 +769,7 @@ Hook::Reason LuaHook::process(struct Sample *smp) return reason; } -/* Register hook */ +// Register hook static char n[] = "lua"; static char d[] = "Implement hook functions or expressions in Lua"; static HookPlugin p; diff --git a/lib/hooks/ma.cpp b/lib/hooks/ma.cpp index baf507f21..996767ab0 100644 --- a/lib/hooks/ma.cpp +++ b/lib/hooks/ma.cpp @@ -1,9 +1,9 @@ -/** Moving average filter. +/* Moving average filter. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -34,16 +34,16 @@ public: { MultiSignalHook::prepare(); - /* Add signals */ + // Add signals for (auto index : signalIndices) { auto origSig = signals->getByIndex(index); - /* Check that signal has float type */ + // Check that signal has float type if (origSig->type != SignalType::FLOAT) throw RuntimeError("The ma hook can only operate on signals of type float!"); } - /* Initialize sample memory */ + // Initialize sample memory smpMemory.clear(); for (unsigned i = 0; i < signalIndices.size(); i++) smpMemory.emplace_back(windowSize, 0.0); @@ -77,16 +77,16 @@ public: unsigned i = 0; for (auto index : signalIndices) { - /* The new value */ + // The new value double newValue = smp->data[index].f; - /* Append the new value to the history memory */ + // Append the new value to the history memory smpMemory[i][smpMemoryPosition % windowSize] = newValue; - /* Get the old value from the history */ + // Get the old value from the history double oldValue = smpMemory[i][(smpMemoryPosition + 1) % windowSize]; - /* Update the accumulator */ + // Update the accumulator accumulator += newValue; accumulator -= oldValue; @@ -100,7 +100,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "ma"; static char d[] = "A simple moving average filter over a fixed number of past samples"; static HookPlugin p; diff --git a/lib/hooks/pmu.cpp b/lib/hooks/pmu.cpp index 491b6f004..a93ccd535 100644 --- a/lib/hooks/pmu.cpp +++ b/lib/hooks/pmu.cpp @@ -1,9 +1,9 @@ -/** PMU hook. +/* PMU hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -40,7 +40,7 @@ void PmuHook::prepare() signals->clear(); for (unsigned i = 0; i < signalIndices.size(); i++) { - /* Add signals */ + // Add signals auto freqSig = std::make_shared("frequency", "Hz", SignalType::FLOAT); auto amplSig = std::make_shared("amplitude", "V", SignalType::FLOAT); auto phaseSig = std::make_shared("phase", (angleUnitFactor)?"rad":"deg", SignalType::FLOAT);//angleUnitFactor==1 means rad @@ -166,7 +166,6 @@ void PmuHook::parse(json_t *json) else throw ConfigError(json, "node-config-hook-dft-timestamp-alignment", "Timestamp alignment {} not recognized", timeAlignC); - } Hook::Reason PmuHook::process(struct Sample *smp) @@ -212,18 +211,18 @@ Hook::Reason PmuHook::process(struct Sample *smp) phasorTimestamp = (*windowsTs)[tsPos]; } - /* Update sample memory */ + // Update sample memory unsigned i = 0; for (auto index : signalIndices) windows[i++]->update(smp->data[index].f); windowsTs->update(smp->ts.origin); - /* Make sure to update phasors after window update but estimate them before */ + // Make sure to update phasors after window update but estimate them before if(run) { for (unsigned i = 0; i < signalIndices.size(); i++) { - smp->data[i * 4 + 0].f = lastPhasors[i].frequency + frequencyOffset; /* Frequency */ - smp->data[i * 4 + 1].f = (lastPhasors[i].amplitude / pow(2, 0.5)) + amplitudeOffset; /* Amplitude */ - smp->data[i * 4 + 2].f = (lastPhasors[i].phase * 180 / M_PI) + phaseOffset; /* Phase */ + smp->data[i * 4 + 0].f = lastPhasors[i].frequency + frequencyOffset; // Frequency + smp->data[i * 4 + 1].f = (lastPhasors[i].amplitude / pow(2, 0.5)) + amplitudeOffset; // Amplitude + smp->data[i * 4 + 2].f = (lastPhasors[i].phase * 180 / M_PI) + phaseOffset; // Phase smp->data[i * 4 + 3].f = lastPhasors[i].rocof + rocofOffset; /* ROCOF */; } smp->ts.origin = phasorTimestamp; @@ -242,7 +241,7 @@ PmuHook::Phasor PmuHook::estimatePhasor(dsp::CosineWindow *window, Phaso return {0., 0., 0., 0., Status::INVALID}; } -/* Register hook */ +// Register hook static char n[] = "pmu"; static char d[] = "This hook estimates a phsor"; static HookPlugin p; diff --git a/lib/hooks/pmu_dft.cpp b/lib/hooks/pmu_dft.cpp index a5c0118bf..e0687eb00 100644 --- a/lib/hooks/pmu_dft.cpp +++ b/lib/hooks/pmu_dft.cpp @@ -1,9 +1,9 @@ -/** DFT hook. +/* DFT hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -16,7 +16,7 @@ #include #include -/* Uncomment to enable dumper of memory windows */ +// Uncomment to enable dumper of memory windows //#define DFT_MEM_DUMP namespace villas { @@ -64,7 +64,7 @@ protected: double frequency; double amplitude; double phase; - double rocof; /**< Rate of change of frequency. */ + double rocof; // Rate of change of frequency. }; enum WindowType windowType; @@ -91,9 +91,9 @@ protected: unsigned rate; unsigned ppsIndex; unsigned windowSize; - unsigned windowMultiplier; /**< Multiplyer for the window to achieve frequency resolution */ - unsigned freqCount; /**< Number of requency bins that are calculated */ - bool channelNameEnable; /**< Rename the output values with channel name or only descriptive name */ + unsigned windowMultiplier; // Multiplyer for the window to achieve frequency resolution + unsigned freqCount; // Number of requency bins that are calculated + bool channelNameEnable; // Rename the output values with channel name or only descriptive name uint64_t smpMemPos; uint64_t lastSequence; @@ -176,7 +176,8 @@ public: rocofOffset(0.0) { } - virtual void prepare() + virtual + void prepare() { MultiSignalHook::prepare(); @@ -184,7 +185,7 @@ public: signals->clear(); for (unsigned i = 0; i < signalIndices.size(); i++) { - /* Add signals */ + // Add signals auto freqSig = std::make_shared("frequency", "Hz", SignalType::FLOAT); auto amplSig = std::make_shared("amplitude", "V", SignalType::FLOAT); auto phaseSig = std::make_shared("phase", (angleUnitFactor)?"rad":"deg", SignalType::FLOAT);//angleUnitFactor==1 means rad @@ -208,7 +209,7 @@ public: signals->push_back(rocofSig); } - /* Initialize sample memory */ + // Initialize sample memory smpMemoryData.clear(); for (unsigned i = 0; i < signalIndices.size(); i++) { smpMemoryData.emplace_back(windowSize, 0.0); @@ -224,26 +225,25 @@ public: lastResult.push_back({0,0,0,0}); } - #ifdef DFT_MEM_DUMP - /* Initialize temporary ppsMemory */ + // Initialize temporary ppsMemory ppsMemory.clear(); ppsMemory.resize(windowSize, 0.0); #endif - /* Calculate how much zero padding ist needed for a needed resolution */ + // Calculate how much zero padding ist needed for a needed resolution windowMultiplier = ceil(((double) sampleRate / windowSize) / frequencyResolution); if (windowMultiplier > 1 && estType == EstimationType::IpDFT) throw RuntimeError("Window multiplyer must be 1 if lpdft is used. Change resolution, window_size_factor or frequency range! Current window multiplyer factor is {}", windowMultiplier); freqCount = ceil((endFreqency - startFrequency) / frequencyResolution) + 1; - /* Initialize matrix of dft coeffients */ + // Initialize matrix of dft coeffients matrix.clear(); for (unsigned i = 0; i < freqCount; i++) matrix.emplace_back(windowSize * windowMultiplier, 0.0); - /* Initalize dft results matrix */ + // Initalize dft results matrix results.clear(); for (unsigned i = 0; i < signalIndices.size(); i++) { results.emplace_back(freqCount, 0.0); @@ -261,7 +261,8 @@ public: state = State::PREPARED; } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { MultiSignalHook::parse(json); int ret; @@ -354,7 +355,8 @@ public: state = State::PARSED; } - virtual void check() + virtual + void check() { assert(state == State::PARSED); @@ -367,11 +369,12 @@ public: state = State::CHECKED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); - /* Update sample memory */ + // Update sample memory unsigned i = 0; for (auto index : signalIndices) { smpMemoryData[i++][smpMemPos % windowSize] = smp->data[index].f; @@ -446,9 +449,9 @@ public: if (windowSize <= smpMemPos) { - smp->data[i * 4 + 0].f = currentResult.frequency + frequencyOffset; /* Frequency */ - smp->data[i * 4 + 1].f = (currentResult.amplitude / pow(2, 0.5)) + amplitudeOffset; /* Amplitude */ - smp->data[i * 4 + 2].f = currentResult.phase + phaseOffset; /* Phase */ + smp->data[i * 4 + 0].f = currentResult.frequency + frequencyOffset; // Frequency + smp->data[i * 4 + 1].f = (currentResult.amplitude / pow(2, 0.5)) + amplitudeOffset; // Amplitude + smp->data[i * 4 + 2].f = currentResult.phase + phaseOffset; // Phase smp->data[i * 4 + 3].f = ((currentResult.frequency - lastResult[i].frequency) * (double)rate) + rocofOffset; /* ROCOF */; lastResult[i] = currentResult; } @@ -498,7 +501,7 @@ public: return Reason::SKIP_SAMPLE; } - /** + /* * This function generates the furie coeffients for the calculateDft function */ void generateDftMatrix() @@ -514,7 +517,7 @@ public: } } - /** + /* * This function calculates the discrete furie transform of the input signal */ void calculateDft(enum PaddingType padding, std::vector &ringBuffer, std::vector> &results, unsigned ringBufferPos) @@ -541,13 +544,13 @@ public: else results[i] += 0; } - else if (padding == PaddingType::SIG_REPEAT) /* Repeat samples */ + else if (padding == PaddingType::SIG_REPEAT) // Repeat samples results[i] += tmpSmpWindow[j % windowSize] * matrix[i][j]; } } } - /** + /* * This function prepares the selected window coefficents */ void calculateWindow(enum WindowType windowTypeIn) @@ -566,7 +569,7 @@ public: case WindowType::HAMMING: case WindowType::HANN: { - double a0 = 0.5; /* This is the hann window */ + double a0 = 0.5; // This is the hann window if (windowTypeIn == WindowType::HAMMING) a0 = 25./46; @@ -603,7 +606,7 @@ public: return { a_est, f_est , phase_est}; } - /** + /* * This function is calculation the IpDFT based on the following paper: * * https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7980868&tag=1 @@ -627,14 +630,13 @@ public: double a_est = abs(b.y) * abs( (M_PI * delta) / sin( M_PI * delta) ) * abs( pow(delta, 2) - 1); a_est *= 2 / (windowSize * windowCorrectionFactor * multiplier); - //Phase estimation (eq 10) double phase_est = atan2(b.y.imag(), b.y.real()) - M_PI * delta; return { a_est, f_est , phase_est}; } - /** + /* * This function is calculating the mximum based on a quadratic interpolation * * This function is based on the following paper: @@ -666,7 +668,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "pmu_dft"; static char d[] = "This hook calculates the dft on a window"; static HookPlugin p; diff --git a/lib/hooks/pmu_ipdft.cpp b/lib/hooks/pmu_ipdft.cpp index 99a3a8c44..fd5275c4c 100644 --- a/lib/hooks/pmu_ipdft.cpp +++ b/lib/hooks/pmu_ipdft.cpp @@ -1,9 +1,9 @@ -/** ipDFT PMU hook. +/* ipDFT PMU hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -17,8 +17,8 @@ protected: std::vector>> dftMatrix; std::vector> dftResult; - unsigned frequencyCount; /* Number of requency bins that are calculated */ - double estimationRange; /* The range around nominalFreq used for estimation */ + unsigned frequencyCount; // Number of requency bins that are calculated + double estimationRange; // The range around nominalFreq used for estimation public: IpDftPmuHook(Path *p, Node *n, int fl, int prio, bool en = true): @@ -38,7 +38,7 @@ public: frequencyCount = ceil((endFrequency - startFrequency) / frequencyResolution); - /* Initialize matrix of dft coeffients */ + // Initialize matrix of dft coeffients dftMatrix.clear(); for (unsigned i = 0; i < frequencyCount; i++) dftMatrix.emplace_back(windowSize, 0.0); @@ -82,7 +82,7 @@ public: { PmuHook::Phasor phasor = {0}; - /* Calculate DFT */ + // Calculate DFT for (unsigned i = 0; i < frequencyCount; i++) { dftResult[i] = 0; @@ -90,9 +90,9 @@ public: for (unsigned j = 0; j < size; j++) dftResult[i] += (*window)[j] * dftMatrix[i][j]; } - /* End calculate DFT */ + // End calculate DFT - /* Find max bin */ + // Find max bin unsigned maxBin = 0; double absAmplitude = 0; @@ -102,7 +102,7 @@ public: maxBin = j; } } - /* End find max bin */ + // End find max bin if (maxBin == 0 || maxBin == (frequencyCount - 1)) { logger->warn("Maximum frequency bin lies on window boundary. Using non-estimated results!"); @@ -116,40 +116,40 @@ public: double c = abs(dftResult[ maxBin + 1 ]); double bPhase = atan2(dftResult[maxBin].imag(), dftResult[maxBin].real()); - /* Estimate phasor */ - /* Based on https://ieeexplore.ieee.org/document/7980868 */ + // Estimate phasor + // Based on https://ieeexplore.ieee.org/document/7980868 double delta = 0; - /* Paper eq 8 */ + // Paper eq 8 if (c > a) { delta = 1. * (2. * c - b) / (b + c); } else { delta = -1. * (2. * a - b) / (b + a); } - /* Frequency estimation (eq 4) */ + // Frequency estimation (eq 4) phasor.frequency = startFrequency + ( (double) maxBin + delta) * frequencyResolution; - /* Amplitude estimation (eq 9) */ + // Amplitude estimation (eq 9) phasor.amplitude = b * abs( (M_PI * delta) / sin( M_PI * delta) ) * abs( pow(delta, 2) - 1); phasor.amplitude *= 2 / (windowSize * window->getCorrectionFactor()); - /* Phase estimation (eq 10) */ + // Phase estimation (eq 10) phasor.phase = bPhase - M_PI * delta; - /* ROCOF estimation */ + // ROCOF estimation phasor.rocof = ((phasor.frequency - lastPhasor.frequency) * (double)phasorRate); - /* End estimate phasor */ + // End estimate phasor } - if (lastPhasor.frequency != 0) /* Check if we already calculated a phasor before */ + if (lastPhasor.frequency != 0) // Check if we already calculated a phasor before phasor.valid = Status::VALID; return phasor; } }; -/* Register hook */ +// Register hook static char n[] = "ip-dft-pmu"; static char d[] = "This hook calculates a phasor based on ipDFT"; static HookPlugin p; diff --git a/lib/hooks/power.cpp b/lib/hooks/power.cpp index 414fe5b49..6716f8262 100644 --- a/lib/hooks/power.cpp +++ b/lib/hooks/power.cpp @@ -1,9 +1,9 @@ -/** RMS hook. +/* RMS hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -13,14 +13,12 @@ namespace villas { namespace node { -/********************************************************************************** - * Concept: - * Based on RMS Hook +/* Concept: Based on RMS Hook * * For each window, calculate integrals for U, I, U*I * Formulas from: https://de.wikipedia.org/wiki/Scheinleistung * Calculate S and P from these - ***********************************************************************************/ + */ class PowerHook : public MultiSignalHook { protected: @@ -55,7 +53,7 @@ protected: bool calcReactivePower; bool caclApparentPower; bool calcCosPhi; - bool channelNameEnable; /**< Rename the output values with channel name or only descriptive name */ + bool channelNameEnable; // Rename the output values with channel name or only descriptive name double angleUnitFactor; enum TimeAlign timeAlignType; @@ -76,7 +74,8 @@ public: timeAlignType(TimeAlign::CENTER) { } - virtual void prepare() + virtual + void prepare() { MultiSignalHook::prepare(); @@ -98,7 +97,7 @@ public: for (auto index : signalIndices) { auto origSig = signals->getByIndex(index); - /* Check that signal has float type */ + // Check that signal has float type if (origSig->type != SignalType::FLOAT) throw RuntimeError("The power hook can only operate on signals of type float!"); } @@ -109,7 +108,7 @@ public: if (channelNameEnable) suffix = fmt::format("_{}", signalNames[i]); - /* Add signals */ + // Add signals if (calcActivePower) { auto activeSig = std::make_shared("active", "W", SignalType::FLOAT); activeSig->name += suffix; @@ -164,7 +163,8 @@ public: } // Read configuration JSON and configure hook accordingly - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { // Ensure hook is not yet running assert(state != State::STARTED); @@ -244,7 +244,8 @@ public: } // This function does the actual processing of the hook when a new sample is passed through. - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -326,7 +327,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "power"; static char d[] = "This hook calculates the Active and Reactive Power for a given signal "; static HookPlugin p; diff --git a/lib/hooks/pps_ts.cpp b/lib/hooks/pps_ts.cpp index b2541e37c..33084ffa6 100644 --- a/lib/hooks/pps_ts.cpp +++ b/lib/hooks/pps_ts.cpp @@ -1,9 +1,9 @@ -/** Timestamp hook. +/* Timestamp hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -31,10 +31,10 @@ protected: bool isSynced; bool isLocked; struct timespec tsVirt; - double timeError; /**< In seconds */ - double periodEstimate; /**< In seconds */ - double periodErrorCompensation; /**< In seconds */ - double period; /**< In seconds */ + double timeError; // In seconds + double periodEstimate; // In seconds + double periodErrorCompensation; // In seconds + double period; // In seconds uintmax_t cntEdges; uintmax_t cntSmps; uintmax_t cntSmpsTotal; @@ -65,7 +65,8 @@ public: filterWindow(horizonEstimation + 1, 0) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -102,7 +103,8 @@ public: state = State::PARSED; } - virtual villas::node::Hook::Reason process(struct Sample *smp) + virtual + villas::node::Hook::Reason process(struct Sample *smp) { switch (mode) { case Mode::SIMPLE: @@ -120,10 +122,10 @@ public: { assert(state == State::STARTED); - /* Get value of PPS signal */ + // Get value of PPS signal float value = smp->data[signalIndex].f; // TODO check if it is really float - /* Detect Edge */ + // Detect Edge bool isEdge = lastValue < threshold && value > threshold; if (isEdge) { tsVirt.tv_sec = currentSecond + 1; @@ -160,10 +162,10 @@ public: { assert(state == State::STARTED); - /* Get value of PPS signal */ + // Get value of PPS signal float value = smp->data[signalIndex].f; // TODO check if it is really float - /* Detect Edge */ + // Detect Edge bool isEdge = lastValue < threshold && value > threshold; lastValue = value; @@ -175,9 +177,8 @@ public: else timeError -= (tsVirt.tv_nsec / 1.0e9); - filterWindow[cntEdges % filterWindow.size()] = cntSmpsTotal; - /* Estimated sample period over last 'horizonEstimation' seconds */ + // Estimated sample period over last 'horizonEstimation' seconds unsigned int tmp = cntEdges < filterWindow.size() ? cntEdges : horizonEstimation; double cntSmpsAvg = (cntSmpsTotal - filterWindow[(cntEdges - tmp) % filterWindow.size()]) / tmp; periodEstimate = 1.0 / cntSmpsAvg; @@ -209,7 +210,6 @@ public: struct timespec tsPeriod = time_from_double(period); tsVirt = time_add(&tsVirt, &tsPeriod); - if ((smp->sequence - lastSequence) > 1) logger->warn("Samples missed: {} sampled missed", smp->sequence - lastSequence); @@ -219,7 +219,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "pps_ts"; static char d[] = "Timestamp samples based GPS PPS signal"; static HookPlugin p; diff --git a/lib/hooks/print.cpp b/lib/hooks/print.cpp index e93de76e0..d4c10e372 100644 --- a/lib/hooks/print.cpp +++ b/lib/hooks/print.cpp @@ -1,9 +1,9 @@ -/** Print hook. +/* Print hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -92,7 +92,7 @@ public: if (o) output_path = o; - /* Format */ + // Format auto *fmt = json_format ? FormatFactory::make(json_format) : FormatFactory::make("villas.human"); @@ -131,11 +131,10 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "print"; static char d[] = "Print the message to stdout or a file"; static HookPlugin p; } // namespace node } // namespace villas - diff --git a/lib/hooks/restart.cpp b/lib/hooks/restart.cpp index 5aad7d077..d0e07d7e4 100644 --- a/lib/hooks/restart.cpp +++ b/lib/hooks/restart.cpp @@ -1,9 +1,9 @@ -/** Path restart hook. +/* Path restart hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -22,7 +22,8 @@ protected: public: using Hook::Hook; - virtual void start() + virtual + void start() { assert(state == State::PREPARED); @@ -31,7 +32,8 @@ public: state = State::STARTED; } - virtual void stop() + virtual + void stop() { assert(state == State::STARTED); @@ -41,19 +43,20 @@ public: state = State::STOPPED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); if (prev) { - /* A wrap around of the sequence no should not be treated as a simulation restart */ + // A wrap around of the sequence no should not be treated as a simulation restart if (smp->sequence == 0 && prev->sequence != 0 && prev->sequence < UINT64_MAX - 16) { logger->warn("Simulation from node {} restarted (previous->sequence={}, current->sequence={})", node->getName(), prev->sequence, smp->sequence); smp->flags |= (int) SampleFlags::IS_FIRST; - /* Restart hooks */ + // Restart hooks for (auto k : node->in.hooks) k->restart(); @@ -72,7 +75,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "restart"; static char d[] = "Call restart hooks for current node"; static HookPlugin p; diff --git a/lib/hooks/rms.cpp b/lib/hooks/rms.cpp index f33efbaea..44689d24c 100644 --- a/lib/hooks/rms.cpp +++ b/lib/hooks/rms.cpp @@ -1,9 +1,9 @@ -/** RMS hook. +/* RMS hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -33,11 +33,11 @@ public: { MultiSignalHook::prepare(); - /* Add signals */ + // Add signals for (auto index : signalIndices) { auto origSig = signals->getByIndex(index); - /* Check that signal has float type */ + // Check that signal has float type if (origSig->type != SignalType::FLOAT) throw RuntimeError("The rms hook can only operate on signals of type float!"); } @@ -84,16 +84,16 @@ public: unsigned i = 0; for (auto index : signalIndices) { - /* Square the new value */ + // Square the new value double newValue = pow(smp->data[index].f, 2); - /* Get the old value from the history */ + // Get the old value from the history double oldValue = smpMemory[i][smpMemoryPosition % windowSize]; - /* Append the new value to the history memory */ + // Append the new value to the history memory smpMemory[i][smpMemoryPosition % windowSize] = newValue; - /* Update the accumulator */ + // Update the accumulator accumulator[index] += newValue; accumulator[index] -= oldValue; @@ -109,7 +109,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "rms"; static char d[] = "This hook calculates the root-mean-square (RMS) on a window"; static HookPlugin p; diff --git a/lib/hooks/round.cpp b/lib/hooks/round.cpp index 49ea6f2f0..658e7ec85 100644 --- a/lib/hooks/round.cpp +++ b/lib/hooks/round.cpp @@ -1,9 +1,9 @@ -/** Round hook. +/* Round hook. * - * @author Manuel Pitz - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -24,7 +24,8 @@ public: precision(1) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -42,7 +43,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { for (auto index : signalIndices) { assert(index < smp->length); @@ -67,7 +69,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "round"; static char d[] = "Round signals to a set number of digits"; static HookPlugin p; diff --git a/lib/hooks/scale.cpp b/lib/hooks/scale.cpp index d9daa6c3c..956abfcf7 100644 --- a/lib/hooks/scale.cpp +++ b/lib/hooks/scale.cpp @@ -1,9 +1,9 @@ -/** Scale hook. +/* Scale hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -26,7 +26,8 @@ public: offset(0.0) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -45,7 +46,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { for (auto index : signalIndices) { assert(index < smp->length); @@ -75,7 +77,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "scale"; static char d[] = "Scale signals by a factor and add offset"; static HookPlugin p; diff --git a/lib/hooks/shift_seq.cpp b/lib/hooks/shift_seq.cpp index a56797b88..d37c7a820 100644 --- a/lib/hooks/shift_seq.cpp +++ b/lib/hooks/shift_seq.cpp @@ -1,9 +1,9 @@ -/** Shift sequence number of samples +/* Shift sequence number of samples * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -20,7 +20,8 @@ public: using Hook::Hook; - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { json_error_t err; int ret; @@ -38,7 +39,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -48,7 +50,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "shift_seq"; static char d[] = "Shift sequence number of samples"; static HookPlugin p; diff --git a/lib/hooks/shift_ts.cpp b/lib/hooks/shift_ts.cpp index 55b6e2f69..a06ad428d 100644 --- a/lib/hooks/shift_ts.cpp +++ b/lib/hooks/shift_ts.cpp @@ -1,9 +1,9 @@ -/** Shift timestamps of samples. +/* Shift timestamps of samples. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -29,7 +29,8 @@ public: mode(SHIFT_ORIGIN) { } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { double o; const char *m = nullptr; @@ -61,7 +62,8 @@ public: state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { timespec *ts; @@ -86,7 +88,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "shift_ts"; static char d[] = "Shift timestamps of samples"; static HookPlugin p; diff --git a/lib/hooks/skip_first.cpp b/lib/hooks/skip_first.cpp index 4bff92e76..a90fc5881 100644 --- a/lib/hooks/skip_first.cpp +++ b/lib/hooks/skip_first.cpp @@ -1,9 +1,9 @@ -/** Skip first hook. +/* Skip first hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -16,9 +16,9 @@ class SkipFirstHook : public Hook { protected: enum class SkipState { - STARTED, /**< Path just started. First sample not received yet. */ - SKIPPING, /**< First sample received. Skipping samples now. */ - NORMAL /**< All samples skipped. Normal operation. */ + STARTED, // Path just started. First sample not received yet. + SKIPPING, // First sample received. Skipping samples now. + NORMAL // All samples skipped. Normal operation. } skip_state; enum class Mode { @@ -29,7 +29,7 @@ protected: union { struct { timespec until; - timespec wait; /**< Absolute point in time from where we accept samples. */ + timespec wait; // Absolute point in time from where we accept samples. } seconds; struct { @@ -41,7 +41,8 @@ protected: public: using Hook::Hook; - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { double s; @@ -72,22 +73,25 @@ public: throw ConfigError(json, err, "node-config-hook-skip_first"); } - virtual void start() + virtual + void start() { skip_state = SkipState::STARTED; state = State::STARTED; } - virtual void restart() + virtual + void restart() { skip_state = SkipState::STARTED; } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); - /* Remember sequence no or timestamp of first sample. */ + // Remember sequence no or timestamp of first sample. if (skip_state == SkipState::STARTED) { switch (mode) { case Mode::SAMPLES: @@ -121,7 +125,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "skip_first"; static char d[] = "Skip the first samples"; static HookPlugin p; diff --git a/lib/hooks/stats.cpp b/lib/hooks/stats.cpp index 801c1784b..df5b75ac3 100644 --- a/lib/hooks/stats.cpp +++ b/lib/hooks/stats.cpp @@ -1,9 +1,9 @@ -/** Statistic hooks. +/* Statistic hooks. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -29,11 +29,12 @@ public: Hook(p, n, fl, prio, en), parent(pa) { - /* This hook has no config. We never call parse() for it */ + // This hook has no config. We never call parse() for it state = State::PARSED; } - virtual Hook::Reason process(struct Sample *smp); + virtual + Hook::Reason process(struct Sample *smp); }; class StatsReadHook : public Hook { @@ -49,11 +50,12 @@ public: last(nullptr), parent(pa) { - /* This hook has no config. We never call parse() for it */ + // This hook has no config. We never call parse() for it state = State::PARSED; } - virtual void start() + virtual + void start() { assert(state == State::PREPARED); @@ -62,7 +64,8 @@ public: state = State::STARTED; } - virtual void stop() + virtual + void stop() { assert(state == State::STARTED); @@ -72,7 +75,8 @@ public: state = State::STOPPED; } - virtual Hook::Reason process(struct Sample *smp); + virtual + Hook::Reason process(struct Sample *smp); }; class StatsHook : public Hook { @@ -111,7 +115,7 @@ public: if (!readHook || !writeHook) throw MemoryAllocationError(); - /* Add child hooks */ + // Add child hooks if (node) { node->in.hooks.push_back(readHook); node->out.hooks.push_back(writeHook); @@ -121,7 +125,8 @@ public: StatsHook & operator=(const StatsHook&) = delete; StatsHook(const StatsHook&) = delete; - virtual void start() + virtual + void start() { assert(state == State::PREPARED); @@ -134,7 +139,8 @@ public: state = State::STARTED; } - virtual void stop() + virtual + void stop() { assert(state == State::STARTED); @@ -146,14 +152,16 @@ public: state = State::STOPPED; } - virtual void restart() + virtual + void restart() { assert(state == State::STARTED); stats->reset(); } - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { // Only call readHook if it hasnt been added to the node's hook list if (!node) @@ -162,14 +170,16 @@ public: return Hook::Reason::OK; } - virtual void periodic() + virtual + void periodic() { assert(state == State::STARTED); stats->printPeriodic(uri.empty() ? stdout : output, format, node); } - virtual void parse(json_t *json) + virtual + void parse(json_t *json) { int ret; json_error_t err; @@ -205,7 +215,8 @@ public: state = State::PARSED; } - virtual void prepare() + virtual + void prepare() { assert(state == State::CHECKED); @@ -258,11 +269,10 @@ Hook::Reason StatsReadHook::process(struct Sample *smp) return Reason::OK; } -/* Register hook */ +// Register hook static char n[] = "stats"; static char d[] = "Collect statistics for the current node"; static HookPlugin p; } // namespace node } // namespace villas - diff --git a/lib/hooks/ts.cpp b/lib/hooks/ts.cpp index bfe8ec548..85c58b28a 100644 --- a/lib/hooks/ts.cpp +++ b/lib/hooks/ts.cpp @@ -1,9 +1,9 @@ -/** Timestamp hook. +/* Timestamp hook. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -17,7 +17,8 @@ class TsHook : public Hook { public: using Hook::Hook; - virtual Hook::Reason process(struct Sample *smp) + virtual + Hook::Reason process(struct Sample *smp) { assert(state == State::STARTED); @@ -27,7 +28,7 @@ public: } }; -/* Register hook */ +// Register hook static char n[] = "ts"; static char d[] = "Overwrite origin timestamp of samples with receive timestamp"; static HookPlugin p; diff --git a/lib/kernel/if.cpp b/lib/kernel/if.cpp index e12c6ec62..8dd2eb549 100644 --- a/lib/kernel/if.cpp +++ b/lib/kernel/if.cpp @@ -1,9 +1,9 @@ -/** Interface related functions. +/* Interface related functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -54,30 +54,30 @@ int Interface::start() { logger->info("Starting interface which is used by {} nodes", nodes.size()); - /* Set affinity for network interfaces (skip _loopback_ dev) */ + // Set affinity for network interfaces (skip _loopback_ dev) if (affinity) setAffinity(affinity); - /* Assign fwmark's to nodes which have netem options */ + // Assign fwmark's to nodes which have netem options int ret, fwmark = 0; for (auto *n : nodes) { if (n->tc_qdisc && n->fwmark < 0) n->fwmark = 1 + fwmark++; } - /* Abort if no node is using netem */ + // Abort if no node is using netem if (fwmark == 0) return 0; if (getuid() != 0) throw RuntimeError("Network emulation requires super-user privileges!"); - /* Replace root qdisc */ + // Replace root qdisc ret = tc::prio(this, &tc_qdisc, TC_HANDLE(1, 0), TC_H_ROOT, fwmark); if (ret) throw RuntimeError("Failed to setup priority queuing discipline: {}", nl_geterror(ret)); - /* Create netem qdisks and appropriate filter per netem node */ + // Create netem qdisks and appropriate filter per netem node for (auto *n : nodes) { if (n->tc_qdisc) { ret = tc::mark(this, &n->tc_classifier, TC_HANDLE(1, n->fwmark), n->fwmark); @@ -126,18 +126,18 @@ Interface * Interface::getEgress(struct sockaddr *sa, SuperNode *sn) auto & interfaces = sn->getInterfaces(); auto affinity = sn->getAffinity(); - /* Determine outgoing interface */ + // Determine outgoing interface link = nl::get_egress_link(sa); if (!link) throw RuntimeError("Failed to get interface for socket address '{}'", socket_print_addr(sa)); - /* Search of existing interface with correct ifindex */ + // Search of existing interface with correct ifindex for (auto *i : interfaces) { if (rtnl_link_get_ifindex(i->nl_link) == rtnl_link_get_ifindex(link)) return i; } - /* If not found, create a new interface */ + // If not found, create a new interface auto *i = new Interface(link, affinity); if (!i) throw MemoryAllocationError(); diff --git a/lib/kernel/nl.cpp b/lib/kernel/nl.cpp index b1f341be9..e84360b75 100644 --- a/lib/kernel/nl.cpp +++ b/lib/kernel/nl.cpp @@ -1,11 +1,11 @@ -/** Netlink related functions. +/* Netlink related functions. * * VILLASnode uses libnl3 to talk to the Linux kernel to gather networking related information * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -18,8 +18,9 @@ #include #include -/** Singleton for global netlink socket */ -static struct nl_sock *sock = nullptr; +// Singleton for global netlink socket +static +struct nl_sock *sock = nullptr; using namespace villas; using namespace villas::kernel::nl; @@ -29,7 +30,7 @@ struct nl_sock * villas::kernel::nl::init() int ret; if (!sock) { - /* Create connection to netlink */ + // Create connection to netlink sock = nl_socket_alloc(); if (!sock) throw MemoryAllocationError(); @@ -38,7 +39,7 @@ struct nl_sock * villas::kernel::nl::init() if (ret) throw RuntimeError("Failed to connect to kernel: {}", nl_geterror(ret)); - /* Fill some caches */ + // Fill some caches struct nl_cache *cache; ret = rtnl_link_alloc_cache(sock, AF_UNSPEC, &cache); if (ret) @@ -58,7 +59,8 @@ void villas::kernel::nl::shutdown() sock = nullptr; } -static int egress_cb(struct nl_msg *msg, void *arg) +static +int egress_cb(struct nl_msg *msg, void *arg) { struct rtnl_route **route = (struct rtnl_route **) arg; @@ -76,7 +78,7 @@ int villas::kernel::nl::get_egress(struct nl_addr *addr) struct nl_msg *msg = nlmsg_alloc_simple(RTM_GETROUTE, 0); struct rtnl_route *route = nullptr; - /* Build message */ + // Build message struct rtmsg rmsg = { .rtm_family = (unsigned char) nl_addr_get_family(addr), .rtm_dst_len = (unsigned char) nl_addr_get_prefixlen(addr), @@ -90,20 +92,20 @@ int villas::kernel::nl::get_egress(struct nl_addr *addr) if (ret) goto out; - /* Send message */ + // Send message ret = nl_send_auto(sock, msg); if (ret < 0) goto out; - /* Hook into receive chain */ + // Hook into receive chain cb = nl_cb_alloc(NL_CB_CUSTOM); nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, egress_cb, &route); - /* Receive message */ + // Receive message nl_recvmsgs_report(sock, cb); nl_wait_for_ack(sock); - /* Check result */ + // Check result if (!route || rtnl_route_get_nnexthops(route) != 1) { ret = -1; goto out2; diff --git a/lib/kernel/tc.cpp b/lib/kernel/tc.cpp index 87627d20e..241f5d996 100644 --- a/lib/kernel/tc.cpp +++ b/lib/kernel/tc.cpp @@ -1,11 +1,11 @@ -/** Traffic control (tc): setup interface queuing desciplines. +/* Traffic control (tc): setup interface queuing desciplines. * * VILLASnode uses these functions to setup the network emulation feature. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -89,6 +89,6 @@ int villas::kernel::tc::reset(Interface *i) { struct nl_sock *sock = nl::init(); - /* We restore the default pfifo_fast qdisc, by deleting ours */ + // We restore the default pfifo_fast qdisc, by deleting ours return rtnl_qdisc_delete(sock, i->tc_qdisc); } diff --git a/lib/kernel/tc_netem.cpp b/lib/kernel/tc_netem.cpp index eeb59c0d1..2b4acb38a 100644 --- a/lib/kernel/tc_netem.cpp +++ b/lib/kernel/tc_netem.cpp @@ -1,11 +1,11 @@ -/** Traffic control (tc): setup network emulation qdisc +/* Traffic control (tc): setup network emulation qdisc * * VILLASnode uses these functions to setup the network emulation feature. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -24,14 +24,16 @@ using namespace villas; using namespace villas::utils; using namespace villas::kernel; -static const double max_percent_value = 0xffffffff; +static +const double max_percent_value = 0xffffffff; -/** +/* * Set the delay distribution. Latency/jitter must be set before applying. * @arg qdisc Netem qdisc. * @return 0 on success, error code on failure. */ -static int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *qdisc, short *data, size_t len) +static +int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *qdisc, short *data, size_t len) { struct rtnl_netem *netem; @@ -53,8 +55,9 @@ static int rtnl_netem_set_delay_distribution_data(struct rtnl_qdisc *qdisc, shor return 0; } -/** Customized version of rtnl_netem_set_delay_distribution() of libnl */ -static int set_delay_distribution(struct rtnl_qdisc *qdisc, json_t *json) +// Customized version of rtnl_netem_set_delay_distribution() of libnl +static +int set_delay_distribution(struct rtnl_qdisc *qdisc, json_t *json) { if (json_is_string(json)) return rtnl_netem_set_delay_distribution(qdisc, json_string_value(json)); diff --git a/lib/mapping.cpp b/lib/mapping.cpp index f7c3793ed..f4ad98fa3 100644 --- a/lib/mapping.cpp +++ b/lib/mapping.cpp @@ -1,9 +1,9 @@ -/** Sample value remapping for mux. +/* Sample value remapping for mux. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -82,7 +82,7 @@ int MappingEntry::parseString(const std::string &str) type = Type::HEADER; } - /* Only node name given.. We map all data */ + // Only node name given.. We map all data else if (!nodeName.empty()) { data.first = nullptr; data.last = nullptr; @@ -211,7 +211,7 @@ int MappingEntry::prepare(NodeList &nodes) } } else { - /* Map all signals */ + // Map all signals data.offset = 0; length = -1; goto end; @@ -229,7 +229,7 @@ int MappingEntry::prepare(NodeList &nodes) } } else - last = first; /* single element: data[5] => data[5-5] */ + last = first; // single element: data[5] => data[5-5] if (last < first) throw RuntimeError("Invalid data range indices for mapping: {} < {}", last, first); diff --git a/lib/mapping_list.cpp b/lib/mapping_list.cpp index dcbbfb1ab..504b606fb 100644 --- a/lib/mapping_list.cpp +++ b/lib/mapping_list.cpp @@ -1,10 +1,9 @@ -/** Sample value remapping for path source muxing. +/* Sample value remapping for path source muxing. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/memory.cpp b/lib/memory.cpp index 6777628b5..739ca737d 100644 --- a/lib/memory.cpp +++ b/lib/memory.cpp @@ -1,9 +1,9 @@ -/** Memory allocators. +/* Memory allocators. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -25,8 +25,10 @@ using namespace villas; using namespace villas::node; using namespace villas::node::memory; -static std::unordered_map allocations; -static Logger logger; +static +std::unordered_map allocations; +static +Logger logger; int villas::node::memory::init(int hugepages) { @@ -62,7 +64,7 @@ int villas::node::memory::lock(size_t sz) #ifndef __arm__ struct rlimit l; - /* Increase ressource limit for locked memory */ + // Increase ressource limit for locked memory ret = getrlimit(RLIMIT_MEMLOCK, &l); if (ret) return ret; @@ -88,15 +90,15 @@ int villas::node::memory::lock(size_t sz) logger->debug("Increased ressource limit of locked memory to {} bytes", sz); } -#endif /* __arm__ */ +#endif // __arm__ #ifdef _POSIX_MEMLOCK - /* Lock all current and future memory allocations */ + // Lock all current and future memory allocations ret = mlockall(MCL_CURRENT | MCL_FUTURE); if (ret) return -1; -#endif /* _POSIX_MEMLOCK */ +#endif // _POSIX_MEMLOCK -#endif /* __linux__ */ +#endif // __linux__ return 0; } @@ -125,7 +127,7 @@ int villas::node::memory::free(void *ptr) { int ret; - /* Find corresponding memory allocation entry */ + // Find corresponding memory allocation entry struct Allocation *ma = allocations[ptr]; if (!ma) return -1; @@ -136,7 +138,7 @@ int villas::node::memory::free(void *ptr) if (ret) return ret; - /* Remove allocation entry */ + // Remove allocation entry auto iter = allocations.find(ptr); if (iter == allocations.end()) return -1; diff --git a/lib/memory/heap.cpp b/lib/memory/heap.cpp index 682da1f1c..bb891324a 100644 --- a/lib/memory/heap.cpp +++ b/lib/memory/heap.cpp @@ -1,9 +1,9 @@ -/** Heap memory allocator. +/* Heap memory allocator. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -49,7 +49,7 @@ int heap_free(struct Allocation *ma, struct Type *m) return 0; } -/* List of available memory types */ +// List of available memory types struct Type villas::node::memory::heap = { .name = "heap", .flags = (int) Flags::HEAP, diff --git a/lib/memory/ib.cpp b/lib/memory/ib.cpp index f6d014804..6421488f5 100644 --- a/lib/memory/ib.cpp +++ b/lib/memory/ib.cpp @@ -1,9 +1,9 @@ -/** Infiniband memory allocator. +/* Infiniband memory allocator. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/memory/managed.cpp b/lib/memory/managed.cpp index f167500ab..e977e502a 100644 --- a/lib/memory/managed.cpp +++ b/lib/memory/managed.cpp @@ -1,9 +1,9 @@ -/** Managed memory allocator. +/* Managed memory allocator. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -28,7 +28,7 @@ using namespace villas::node::memory; static struct Allocation * managed_alloc(size_t len, size_t alignment, struct Type *m) { - /* Simple first-fit allocation */ + // Simple first-fit allocation struct Block *first = (struct Block *) m->_vd; struct Block *block; @@ -47,7 +47,7 @@ struct Allocation * managed_alloc(size_t len, size_t alignment, struct Type *m) if (rem != 0) { gap = alignment - rem; if (gap > avail) - continue; /* Next aligned address isn't in this block anymore */ + continue; // Next aligned address isn't in this block anymore cptr += gap; avail -= gap; @@ -75,7 +75,7 @@ struct Allocation * managed_alloc(size_t len, size_t alignment, struct Type *m) } if (avail > len + sizeof(struct Block)) { - /* Imperfect fit, so create another block for the remaining part */ + // Imperfect fit, so create another block for the remaining part struct Block *newblock = (struct Block *) (cptr + len); newblock->prev = block; newblock->next = block->next; @@ -110,7 +110,7 @@ struct Allocation * managed_alloc(size_t len, size_t alignment, struct Type *m) } } - /* No suitable block found */ + // No suitable block found return nullptr; } @@ -119,10 +119,10 @@ int managed_free(struct Allocation *ma, struct Type *m) { struct Block *block = ma->managed.block; - /* Try to merge it with neighbouring free blocks */ + // Try to merge it with neighbouring free blocks if (block->prev && !block->prev->used && block->next && !block->next->used) { - /* Special case first: both previous and next block are unused */ + // Special case first: both previous and next block are unused block->prev->length += block->length + block->next->length + 2 * sizeof(struct Block); block->prev->next = block->next->next; if (block->next->next) @@ -141,7 +141,7 @@ int managed_free(struct Allocation *ma, struct Type *m) block->next->prev = block; } else { - /* no neighbouring free block, so just mark it as free */ + // no neighbouring free block, so just mark it as free block->used = false; } @@ -160,7 +160,7 @@ struct Type * villas::node::memory::managed(void *ptr, size_t len) return nullptr; } - /* Initialize type */ + // Initialize type mt->name = "managed"; mt->flags = 0; mt->alloc = managed_alloc; @@ -169,7 +169,7 @@ struct Type * villas::node::memory::managed(void *ptr, size_t len) cptr += ALIGN(sizeof(struct Type), sizeof(void *)); - /* Initialize first free memory block */ + // Initialize first free memory block mb = (struct Block *) cptr; mb->prev = nullptr; mb->next = nullptr; diff --git a/lib/memory/mmap.cpp b/lib/memory/mmap.cpp index eab73ec73..5b18bb57d 100644 --- a/lib/memory/mmap.cpp +++ b/lib/memory/mmap.cpp @@ -1,9 +1,9 @@ -/** mmap memory allocator. +/* mmap memory allocator. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -14,10 +14,10 @@ #include #include -/* Required to allocate hugepages on Apple OS X */ +// Required to allocate hugepages on Apple OS X #ifdef __MACH__ #include -#endif /* __MACH__ */ +#endif // __MACH__ #include #include @@ -95,7 +95,7 @@ int villas::node::memory::mmap_init(int hugepages) return 0; } -/** Allocate memory backed by mmaps with malloc() like interface */ +// Allocate memory backed by mmaps with malloc() like interface static struct Allocation * mmap_alloc(size_t len, size_t alignment, struct Type *m) { @@ -127,7 +127,7 @@ struct Allocation * mmap_alloc(size_t len, size_t alignment, struct Type *m) sz = pgsz; } - /** We must make sure that len is a multiple of the page size + /* We must make sure that len is a multiple of the page size * * See: https://lkml.org/lkml/2014/10/22/925 */ @@ -159,7 +159,7 @@ int mmap_free(struct Allocation *ma, struct Type *m) struct Type memory::mmap = { .name = "mmap", .flags = (int) Flags::MMAP, - .alignment = 12, /* 4k page */ + .alignment = 12, // 4k page .alloc = mmap_alloc, .free = mmap_free }; @@ -167,7 +167,7 @@ struct Type memory::mmap = { struct Type memory::mmap_hugetlb = { .name = "mmap_hugetlb", .flags = (int) Flags::MMAP | (int) Flags::HUGEPAGE, - .alignment = 21, /* 2 MiB hugepage */ + .alignment = 21, // 2 MiB hugepage .alloc = mmap_alloc, .free = mmap_free }; diff --git a/lib/node.cpp b/lib/node.cpp index 54dea752f..99597b5db 100644 --- a/lib/node.cpp +++ b/lib/node.cpp @@ -1,9 +1,9 @@ -/** Nodes. +/* Nodes. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -35,7 +35,7 @@ #include #include #include -#endif /* WITH_NETEM */ +#endif // WITH_NETEM using namespace villas; using namespace villas::node; @@ -49,16 +49,16 @@ Node::Node(const uuid_t &id, const std::string &name) : out(NodeDirection::Direction::OUT, this), #ifdef __linux__ fwmark(-1), -#endif /* __linux__ */ +#endif // __linux__ #ifdef WITH_NETEM tc_qdisc(nullptr), tc_classifier(nullptr), -#endif /* WITH_NETEM */ +#endif // WITH_NETEM state(State::INITIALIZED), enabled(true), config(nullptr), name_short(name), - affinity(-1), /* all cores */ + affinity(-1), // all cores factory(nullptr) { if (uuid_is_null(id)) { @@ -81,7 +81,7 @@ Node::~Node() #ifdef WITH_NETEM rtnl_qdisc_put(tc_qdisc); rtnl_cls_put(tc_classifier); -#endif /* WITH_NETEM */ +#endif // WITH_NETEM factory->instances.remove(this); } @@ -132,7 +132,7 @@ int Node::parse(json_t *json) ); if (ret) return ret; -#endif /* __linux__ */ +#endif // __linux__ enabled = en; @@ -148,7 +148,7 @@ int Node::parse(json_t *json) kernel::tc::netem_parse(&tc_qdisc, json_netem); else tc_qdisc = nullptr; -#endif /* WITH_NETEM */ +#endif // WITH_NETEM } struct { @@ -164,12 +164,12 @@ int Node::parse(json_t *json) for (unsigned j = 0; j < ARRAY_LEN(dirs); j++) { json_t *json_dir = json_object_get(json, dirs[j].str); - /* Skip if direction is unused */ + // Skip if direction is unused if (!json_dir) { json_dir = json_pack("{ s: b }", "enabled", 0); } - /* Copy missing fields from main node config to direction config */ + // Copy missing fields from main node config to direction config for (unsigned i = 0; i < ARRAY_LEN(fields); i++) { json_t *json_field_dir = json_object_get(json_dir, fields[i]); json_t *json_field_node = json_object_get(json, fields[i]); @@ -219,7 +219,7 @@ int Node::start() return ret; #ifdef __linux__ - /* Set fwmark for outgoing packets if netem is enabled for this node */ + // Set fwmark for outgoing packets if netem is enabled for this node if (fwmark >= 0) { for (int fd : getNetemFDs()) { ret = setsockopt(fd, SOL_SOCKET, SO_MARK, &fwmark, sizeof(fwmark)); @@ -229,7 +229,7 @@ int Node::start() logger->debug("Set FW mark for socket (sd={}) to {}", fd, fwmark); } } -#endif /* __linux__ */ +#endif // __linux__ state = State::STARTED; sequence = sequence_init; @@ -304,7 +304,7 @@ int Node::read(struct Sample * smps[], unsigned cnt) } #ifdef WITH_HOOKS - /* Run read hooks */ + // Run read hooks int rread = in.hooks.process(smps, nread); if (rread < 0) return rread; @@ -324,7 +324,7 @@ int Node::read(struct Sample * smps[], unsigned cnt) logger->debug("Received {} samples", nread); return nread; -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS } int Node::write(struct Sample * smps[], unsigned cnt) @@ -338,11 +338,11 @@ int Node::write(struct Sample * smps[], unsigned cnt) return -1; #ifdef WITH_HOOKS - /* Run write hooks */ + // Run write hooks cnt = out.hooks.process(smps, cnt); if (cnt <= 0) return cnt; -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS vect = getFactory()->getVectorize(); if (!vect) @@ -377,7 +377,7 @@ const std::string & Node::getNameFull() if (tc_qdisc) name_full += fmt::format(", fwmark={}", fwmark); -#endif /* WITH_NETEM */ +#endif // WITH_NETEM if (out.path) { name_full += fmt::format(", #out.signals={}/{}", @@ -387,7 +387,7 @@ const std::string & Node::getNameFull() name_full += fmt::format(", out.path={}", out.path->toString()); } - /* Append node-type specific details */ + // Append node-type specific details auto details = getDetails(); if (!details.empty()) name_full += fmt::format(", {}", details); diff --git a/lib/node_capi.cpp b/lib/node_capi.cpp index 38f280482..e1241858d 100644 --- a/lib/node_capi.cpp +++ b/lib/node_capi.cpp @@ -1,11 +1,9 @@ -/** Node C-API +/* Node C-API * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -184,7 +182,6 @@ unsigned sample_length(vsample *s) return smp->length; } - vsample * sample_pack(unsigned seq, struct timespec *ts_origin, struct timespec *ts_received, unsigned len, double *values) { auto *smp = sample_alloc_mem(len); diff --git a/lib/node_compat.cpp b/lib/node_compat.cpp index d4719bc33..588ec531b 100644 --- a/lib/node_compat.cpp +++ b/lib/node_compat.cpp @@ -1,9 +1,9 @@ -/** Legacy nodes. +/* Legacy nodes. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -174,7 +174,7 @@ int NodeCompat::_write(struct Sample * smps[], unsigned cnt) : -1; } -/** Reverse local and remote socket address. +/* Reverse local and remote socket address. * * @see node_type::reverse */ diff --git a/lib/node_direction.cpp b/lib/node_direction.cpp index 9d2e55bf7..16d3d174d 100644 --- a/lib/node_direction.cpp +++ b/lib/node_direction.cpp @@ -1,9 +1,9 @@ -/** Node direction +/* Node direction * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -50,7 +50,7 @@ int NodeDirection::parse(json_t *json) throw ConfigError(json, err, "node-config-node-in"); if (node->getFactory()->getFlags() & (int) NodeFactory::Flags::PROVIDES_SIGNALS) { - /* Do nothing.. Node-type will provide signals */ + // Do nothing.. Node-type will provide signals signals = std::make_shared(); if (!signals) throw MemoryAllocationError(); @@ -118,7 +118,7 @@ int NodeDirection::parse(json_t *json) hooks.parse(json_hooks, m, nullptr, node); } -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return 0; } @@ -130,7 +130,7 @@ void NodeDirection::check() #ifdef WITH_HOOKS hooks.check(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS } int NodeDirection::prepare() @@ -140,7 +140,7 @@ int NodeDirection::prepare() int m = builtin ? t | (int) Hook::Flags::BUILTIN : 0; hooks.prepare(signals, m, nullptr, node); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return 0; } @@ -149,7 +149,7 @@ int NodeDirection::start() { #ifdef WITH_HOOKS hooks.start(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return 0; } @@ -158,7 +158,7 @@ int NodeDirection::stop() { #ifdef WITH_HOOKS hooks.stop(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return 0; } @@ -168,7 +168,7 @@ SignalList::Ptr NodeDirection::getSignals(int after_hooks) const #ifdef WITH_HOOKS if (after_hooks && hooks.size() > 0) return hooks.getSignals(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return signals; } @@ -178,7 +178,7 @@ unsigned NodeDirection::getSignalsMaxCount() const #ifdef WITH_HOOKS if (hooks.size() > 0) return MAX(signals->size(), hooks.getSignalsMaxCount()); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return signals->size(); } diff --git a/lib/node_list.cpp b/lib/node_list.cpp index e77282191..bbd89bed9 100644 --- a/lib/node_list.cpp +++ b/lib/node_list.cpp @@ -1,10 +1,9 @@ -/** Node list +/* Node list * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/nodes/CMakeLists.txt b/lib/nodes/CMakeLists.txt index 04c4719fd..25340dda4 100644 --- a/lib/nodes/CMakeLists.txt +++ b/lib/nodes/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(NODE_SRC loopback_internal.cpp diff --git a/lib/nodes/amqp.cpp b/lib/nodes/amqp.cpp index 87aa35d2e..61f6ceb6c 100644 --- a/lib/nodes/amqp.cpp +++ b/lib/nodes/amqp.cpp @@ -1,9 +1,9 @@ -/** Node type: nanomsg +/* Node type: nanomsg * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -135,7 +135,7 @@ int villas::node::amqp_init(NodeCompat *n) { auto *a = n->getData(); - /* Default values */ + // Default values amqp_default_ssl_info(&a->ssl_info); amqp_default_connection_info(&a->connection_info); @@ -214,7 +214,7 @@ int villas::node::amqp_parse(NodeCompat *n, json_t *json) a->ssl_info.client_key = strdup(client_key); } - /* Format */ + // Format if (a->formatter) delete a->formatter; a->formatter = json_format @@ -272,23 +272,23 @@ int villas::node::amqp_start(NodeCompat *n) a->formatter->start(n->getInputSignals(false), ~(int) SampleFlags::HAS_OFFSET); - /* Connect producer */ + // Connect producer a->producer = amqp_connect(n, &a->connection_info, &a->ssl_info); if (!a->producer) return -1; - /* Connect consumer */ + // Connect consumer a->consumer = amqp_connect(n, &a->connection_info, &a->ssl_info); if (!a->consumer) return -1; - /* Declare exchange */ + // Declare exchange amqp_exchange_declare(a->producer, 1, a->exchange, amqp_cstring_bytes("direct"), 0, 0, 0, 0, amqp_empty_table); rep = amqp_get_rpc_reply(a->consumer); if (rep.reply_type != AMQP_RESPONSE_NORMAL) return -1; - /* Declare private queue */ + // Declare private queue r = amqp_queue_declare(a->consumer, 1, amqp_empty_bytes, 0, 0, 0, 1, amqp_empty_table); rep = amqp_get_rpc_reply(a->consumer); if (rep.reply_type != AMQP_RESPONSE_NORMAL) @@ -298,13 +298,13 @@ int villas::node::amqp_start(NodeCompat *n) if (queue.bytes == nullptr) return -1; - /* Bind queue to exchange */ + // Bind queue to exchange amqp_queue_bind(a->consumer, 1, queue, a->exchange, a->routing_key, amqp_empty_table); rep = amqp_get_rpc_reply(a->consumer); if (rep.reply_type != AMQP_RESPONSE_NORMAL) return -1; - /* Start consumer */ + // Start consumer amqp_basic_consume(a->consumer, 1, queue, amqp_empty_bytes, 0, 1, 0, amqp_empty_table); rep = amqp_get_rpc_reply(a->consumer); if (rep.reply_type != AMQP_RESPONSE_NORMAL) @@ -365,7 +365,7 @@ int villas::node::amqp_write(NodeCompat *n, struct Sample * const smps[], unsign .bytes = data }; - /* Send message */ + // Send message ret = amqp_basic_publish(a->producer, 1, a->exchange, a->routing_key, @@ -416,10 +416,11 @@ int villas::node::amqp_destroy(NodeCompat *n) return 0; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "amqp"; p.description = "Advanced Message Queueing Protoocl (rabbitmq-c)"; p.vectorize = 0; @@ -434,5 +435,6 @@ static void register_plugin() { p.write = amqp_write; p.poll_fds = amqp_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/api.cpp b/lib/nodes/api.cpp index 3c2dcd379..dfcad29ef 100644 --- a/lib/nodes/api.cpp +++ b/lib/nodes/api.cpp @@ -1,10 +1,10 @@ -/** Node type: Universal Data-exchange API (v2) +/* Node type: Universal Data-exchange API (v2) * * @see https://github.com/ERIGrid2/JRA-3.1-api - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -122,6 +122,7 @@ int APINode::parse(json_t *json) return 0; } +// Register node static char n[] = "api"; static char d[] = "A node providing a HTTP REST interface"; static NodePlugin p; diff --git a/lib/nodes/can.cpp b/lib/nodes/can.cpp index 3432e4ee5..6b1369fcb 100644 --- a/lib/nodes/can.cpp +++ b/lib/nodes/can.cpp @@ -1,9 +1,9 @@ -/** Node-type: CAN bus +/* Node-type: CAN bus * - * @author Niklas Eiling - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Niklas Eiling + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -30,8 +30,9 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -/* Forward declarations */ -static NodeCompatType p; +// Forward declarations +static +NodeCompatType p; int villas::node::can_init(NodeCompat *n) { @@ -408,7 +409,7 @@ int villas::node::can_read(NodeCompat *n, struct Sample * const smps[], unsigned n->logger->debug("Received {} signals", c->sample_buf_num); - /* Copy signal data to sample only when all signals have been received */ + // Copy signal data to sample only when all signals have been received if (c->sample_buf_num == n->getInputSignals(false)->size()) { smps[nread]->length = c->sample_buf_num; memcpy(smps[nread]->data, c->sample_buf, c->sample_buf_num*sizeof(union SignalData)); @@ -421,7 +422,7 @@ int villas::node::can_read(NodeCompat *n, struct Sample * const smps[], unsigned ret = 0; } - out: /* Set signals, because other VILLASnode parts expect us to */ + out: // Set signals, because other VILLASnode parts expect us to smps[nread]->signals = n->getInputSignals(false); return ret; @@ -432,7 +433,7 @@ int villas::node::can_write(NodeCompat *n, struct Sample * const smps[], unsigne int nbytes; unsigned nwrite; struct can_frame *frame; - size_t fsize = 0; /* number of frames in use */ + size_t fsize = 0; // number of frames in use auto *c = n->getData(); @@ -442,7 +443,7 @@ int villas::node::can_write(NodeCompat *n, struct Sample * const smps[], unsigne for (nwrite=0; nwrite < cnt; nwrite++) { for (size_t i=0; i < n->getOutputSignals()->size(); i++) { - if (c->out[i].offset != 0) /* frame is shared */ + if (c->out[i].offset != 0) // frame is shared continue; frame[fsize].can_dlc = c->out[i].size; @@ -458,7 +459,7 @@ int villas::node::can_write(NodeCompat *n, struct Sample * const smps[], unsigne } for (size_t i=0; i < n->getOutputSignals(false)->size(); i++) { - if (c->out[i].offset == 0) { /* frame already stored */ + if (c->out[i].offset == 0) { // frame already stored continue; } @@ -502,11 +503,11 @@ int villas::node::can_poll_fds(NodeCompat *n, int fds[]) fds[0] = c->socket; - return 1; /* The number of file descriptors which have been set in fds */ + return 1; // The number of file descriptors which have been set in fds } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "can"; p.description = "Receive CAN messages using the socketCAN driver"; p.vectorize = 0; @@ -524,5 +525,6 @@ static void register_plugin() { p.write = can_write; p.poll_fds = can_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/comedi.cpp b/lib/nodes/comedi.cpp index dd6f0eb05..9b40cf4eb 100644 --- a/lib/nodes/comedi.cpp +++ b/lib/nodes/comedi.cpp @@ -1,10 +1,10 @@ -/** Node type: comedi +/* Node type: comedi * - * @author Steffen Vogel - * @author Daniel Krebs - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Daniel Krebs + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -21,9 +21,11 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -/* Utility functions to dump a comedi_cmd graciously taken from comedilib demo */ -static char* comedi_cmd_trigger_src(unsigned int src, char *buf); -static void comedi_dump_cmd(Logger logger, comedi_cmd *cmd); +// Utility functions to dump a comedi_cmd graciously taken from comedilib demo +static +char* comedi_cmd_trigger_src(unsigned int src, char *buf); +static +void comedi_dump_cmd(Logger logger, comedi_cmd *cmd); static int comedi_parse_direction(struct comedi *c, struct comedi_direction *d, json_t *json) @@ -33,7 +35,7 @@ int comedi_parse_direction(struct comedi *c, struct comedi_direction *d, json_t json_t *json_chans; json_error_t err; - /* Default values */ + // Default values d->subdevice = -1; d->buffer_size = 16; @@ -49,7 +51,7 @@ int comedi_parse_direction(struct comedi *c, struct comedi_direction *d, json_t if (!json_is_array(json_chans)) return -1; - /* Convert kilobytes to bytes */ + // Convert kilobytes to bytes d->buffer_size = d->buffer_size << 10; size_t i; @@ -101,7 +103,7 @@ int comedi_start_common(NodeCompat *n) if (!d->present) continue; - /* Sanity-check channel config and populate chanspec for later */ + // Sanity-check channel config and populate chanspec for later for (unsigned i = 0; i < d->chanlist_len; i++) { const unsigned int channel = CR_CHAN(d->chanlist[i]); const int range = CR_RANGE(d->chanlist[i]); @@ -129,7 +131,7 @@ int comedi_start_common(NodeCompat *n) const int flags = comedi_get_subdevice_flags(c->dev, d->subdevice); d->sample_size = (flags & SDF_LSAMPL) ? sizeof(lsampl_t) : sizeof(sampl_t); - /* Set buffer size */ + // Set buffer size comedi_set_buffer_size(c->dev, d->subdevice, d->buffer_size); comedi_set_max_buffer_size(c->dev, d->subdevice, d->buffer_size); ret = comedi_get_buffer_size(c->dev, d->subdevice); @@ -153,14 +155,14 @@ int comedi_start_in(NodeCompat *n) auto *c = n->getData(); struct comedi_direction *d = &c->in; - /* Try to find first analog input subdevice if not specified in config */ + // Try to find first analog input subdevice if not specified in config if (d->subdevice < 0) { d->subdevice = comedi_find_subdevice_by_type(c->dev, COMEDI_SUBD_AI, 0); if (d->subdevice < 0) throw RuntimeError("Cannot find analog input device for node '{}'"); } else { - /* Check if subdevice is usable */ + // Check if subdevice is usable ret = comedi_get_subdevice_type(c->dev, d->subdevice); if (ret != COMEDI_SUBD_AI) throw RuntimeError("Input subdevice is not an analog input"); @@ -184,28 +186,28 @@ int comedi_start_in(NodeCompat *n) * full (TODO: evaluate if this makes sense, leave as reminder) */ //cmd.flags = TRIG_WAKE_EOS; - /* Start right now */ + // Start right now cmd.start_src = TRIG_NOW; - /* Trigger scans periodically */ + // Trigger scans periodically cmd.scan_begin_src = TRIG_TIMER; cmd.scan_begin_arg = 1e9 / d->sample_rate_hz; - /* Do conversions in serial with 1ns inter-conversion delay */ + // Do conversions in serial with 1ns inter-conversion delay cmd.convert_src = TRIG_TIMER; - cmd.convert_arg = 1; /* Inter-conversion delay in nanoseconds */ + cmd.convert_arg = 1; // Inter-conversion delay in nanoseconds - /* Terminate scan after each channel has been converted */ + // Terminate scan after each channel has been converted cmd.scan_end_src = TRIG_COUNT; cmd.scan_end_arg = d->chanlist_len; - /* Contionous sampling */ + // Contionous sampling cmd.stop_src = TRIG_NONE; cmd.chanlist = d->chanlist; cmd.chanlist_len = d->chanlist_len; - /* First run might change command, second should return successfully */ + // First run might change command, second should return successfully ret = comedi_command_test(c->dev, &cmd); ret = comedi_command_test(c->dev, &cmd); if (ret < 0) @@ -223,7 +225,7 @@ int comedi_start_in(NodeCompat *n) d->running = true; #if COMEDI_USE_READ - /* Be prepared to consume one entire buffer */ + // Be prepared to consume one entire buffer c->buf = new char[c->in.buffer_size]; c->bufptr = c->buf; if (!c->buf) @@ -244,7 +246,7 @@ int comedi_start_out(NodeCompat *n) auto *c = n->getData(); struct comedi_direction *d = &c->out; - /* Try to find first analog output subdevice if not specified in config */ + // Try to find first analog output subdevice if not specified in config if (d->subdevice < 0) { d->subdevice = comedi_find_subdevice_by_type(c->dev, COMEDI_SUBD_AO, 0); if (d->subdevice < 0) @@ -272,7 +274,7 @@ int comedi_start_out(NodeCompat *n) cmd.flags = CMDF_WRITE; - /* Wait for internal trigger, we will have to fill the buffer first */ + // Wait for internal trigger, we will have to fill the buffer first cmd.start_src = TRIG_INT; cmd.start_arg = 0; @@ -285,14 +287,14 @@ int comedi_start_out(NodeCompat *n) cmd.scan_end_src = TRIG_COUNT; cmd.scan_end_arg = d->chanlist_len; - /* Continous sampling */ + // Continous sampling cmd.stop_src = TRIG_NONE; cmd.stop_arg = 0; cmd.chanlist = d->chanlist; cmd.chanlist_len = d->chanlist_len; - /* First run might change command, second should return successfully */ + // First run might change command, second should return successfully ret = comedi_command_test(c->dev, &cmd); if (ret < 0) throw RuntimeError("Invalid command for input subdevice"); @@ -308,19 +310,19 @@ int comedi_start_out(NodeCompat *n) if (ret < 0) throw RuntimeError("Failed to issue command to input subdevice of node '{}'"); - /* Output will only start after the internal trigger */ + // Output will only start after the internal trigger d->running = false; d->last_debug = time_now(); - /* Allocate buffer for one complete VILLAS sample */ - /** @todo maybe increase buffer size according to c->vectorize */ + // Allocate buffer for one complete VILLAS sample + // @todo maybe increase buffer size according to c->vectorize const size_t local_buffer_size = d->sample_size * d->chanlist_len; d->buffer = new char[local_buffer_size]; d->bufptr = d->buffer; if (!d->buffer) throw MemoryAllocationError(); - /* Initialize local buffer used for write() syscalls */ + // Initialize local buffer used for write() syscalls for (unsigned channel = 0; channel < d->chanlist_len; channel++) { const unsigned raw = comedi_from_phys(0.0f, d->chanspecs[channel].range, d->chanspecs[channel].maxdata); @@ -332,7 +334,7 @@ int comedi_start_out(NodeCompat *n) d->bufptr += d->sample_size; } - /* Preload comedi output buffer */ + // Preload comedi output buffer for (unsigned i = 0; i < d->buffer_size / local_buffer_size; i++) { size_t written = write(comedi_fileno(c->dev), d->buffer, local_buffer_size); if (written != local_buffer_size) { @@ -445,8 +447,8 @@ int villas::node::comedi_start(NodeCompat *n) if (!c->dev) throw RuntimeError("Failed to open device: {}", comedi_strerror(comedi_errno())); - /* Enable non-blocking syscalls */ - /** @todo verify if this works with both input and output, so comment out */ + // Enable non-blocking syscalls + // @todo verify if this works with both input and output, so comment out //if (fcntl(comedi_fileno(c->dev), F_SETFL, O_NONBLOCK)) // throw RuntimeError("Failed to set non-blocking flag in Comedi FD"); @@ -528,9 +530,9 @@ int villas::node::comedi_read(NodeCompat *n, struct Sample * const smps[], unsig ret = select(comedi_fileno(c->dev) + 1, &rdset, nullptr, nullptr, &timeout); if (ret < 0) throw RuntimeError("Failed select()"); - else if (ret == 0) /* hit timeout */ + else if (ret == 0) // hit timeout return 0; - else if (FD_ISSET(comedi_fileno(c->dev), &rdset)) { /* comedi file descriptor became ready */ + else if (FD_ISSET(comedi_fileno(c->dev), &rdset)) { // comedi file descriptor became ready const size_t buffer_bytes_free = d->buffer_size - (c->bufptr - c->buf); const size_t bytes_requested = cnt * villas_sample_size; @@ -546,7 +548,7 @@ int villas::node::comedi_read(NodeCompat *n, struct Sample * const smps[], unsig return 0; } else { - /* Sample handling here */ + // Sample handling here const size_t bytes_available = ret; const size_t raw_samples_available = bytes_available / d->sample_size; const size_t villas_samples_available = raw_samples_available / d->chanlist_len; @@ -592,21 +594,21 @@ int villas::node::comedi_read(NodeCompat *n, struct Sample * const smps[], unsig const size_t bytes_consumed = cnt * villas_sample_size; const size_t bytes_left = bytes_available - bytes_consumed; if (bytes_left > 0) { - /* Move leftover bytes to the beginning of buffer */ - /** @todo optimize? */ + // Move leftover bytes to the beginning of buffer + // @todo optimize? memmove(c->buf, c->bufptr, bytes_left); } n->logger->info("Consumed {} bytes", bytes_consumed); - /* Start at the beginning again */ + // Start at the beginning again c->bufptr = c->buf; return cnt; } } else - /* unknown file descriptor became ready */ + // unknown file descriptor became ready n->logger->warn("Unknown file descriptor ready"); return -1; @@ -660,7 +662,7 @@ int villas::node::comedi_read(NodeCompat *n, struct Sample * const smps[], unsig n->logger->info("front={} back={} bufpos={}", c->front, c->back, c->bufpos); if ((c->bufpos + bytes_available) >= d->buffer_size) { - /* Let comedi do the wraparound, only consume until end of buffer */ + // Let comedi do the wraparound, only consume until end of buffer villas_sample_count = (d->buffer_size - c->bufpos) / villas_sample_size; n->logger->warn("Reducing consumption from {} to {} bytes", ret, bytes_available); n->logger->warn("Only consume {} VILLAS samples b/c of buffer wraparound", villas_sample_count); @@ -696,7 +698,7 @@ int villas::node::comedi_read(NodeCompat *n, struct Sample * const smps[], unsig else n->logger->info("Consume {} bytes", ret); - /* Align front to whole samples */ + // Align front to whole samples c->front = c->back + samples_total_bytes; for (size_t i = 0; i < cnt; i++) { @@ -804,7 +806,7 @@ int villas::node::comedi_write(NodeCompat *n, struct Sample * const smps[], unsi } if (!d->running) { - /* Output was not yet running, so start now */ + // Output was not yet running, so start now ret = comedi_internal_trigger(c->dev, d->subdevice, 0); if (ret < 0) throw RuntimeError("Failed to trigger-start output"); @@ -856,7 +858,7 @@ int villas::node::comedi_write(NodeCompat *n, struct Sample * const smps[], unsi d->bufptr = d->buffer; - /* Move samples from villas into local buffer for comedi */ + // Move samples from villas into local buffer for comedi for (unsigned si = 0; si < sample->length; si++) { unsigned raw_value = 0; @@ -866,7 +868,7 @@ int villas::node::comedi_write(NodeCompat *n, struct Sample * const smps[], unsi break; case SignalType::INTEGER: - /* Treat sample as already raw DAC value */ + // Treat sample as already raw DAC value raw_value = sample->data[si].i; break; @@ -875,7 +877,7 @@ int villas::node::comedi_write(NodeCompat *n, struct Sample * const smps[], unsi break; case SignalType::COMPLEX: - /* We only output the real part */ + // We only output the real part raw_value = comedi_from_phys(std::real(sample->data[si].z), d->chanspecs[si].range, d->chanspecs[si].maxdata); break; @@ -892,12 +894,12 @@ int villas::node::comedi_write(NodeCompat *n, struct Sample * const smps[], unsi d->bufptr += d->sample_size; } - /* Try to write one complete villas sample to comedi */ + // Try to write one complete villas sample to comedi size_t written = write(comedi_fileno(c->dev), d->buffer, villas_sample_size); if (written < 0) throw RuntimeError("write() failed"); else if (written == 0) - break; /* Comedi doesn't accept any more samples at the moment */ + break; // Comedi doesn't accept any more samples at the moment else if (written == villas_sample_size) villas_samples_written++; else @@ -967,10 +969,11 @@ int villas::node::comedi_poll_fds(NodeCompat *n, int fds[]) return 0; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "comedi"; p.description = "Comedi-compatible DAQ/ADC cards"; p.vectorize = 0; @@ -983,5 +986,6 @@ static void register_plugin() { p.write = comedi_write; p.poll_fds = comedi_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/ethercat.cpp b/lib/nodes/ethercat.cpp index c219855c4..2bd7c5a4e 100644 --- a/lib/nodes/ethercat.cpp +++ b/lib/nodes/ethercat.cpp @@ -1,11 +1,11 @@ -/** Node type: Ethercat +/* Node type: Ethercat * - * @author Niklas Eiling - * @author Steffen Vogel - * @author Divya Laxetti - * @copyright 2018-2020, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Niklas Eiling + * Author: Steffen Vogel + * Author: Divya Laxetti + * SPDX-FileCopyrightText: 2018-2020 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -18,18 +18,20 @@ using namespace villas; using namespace villas::node; -/* Forward declartions */ -static NodeCompatType p; +// Forward declartions +static +NodeCompatType p; -/* Constants */ +// Constants #define NSEC_PER_SEC (1000000000) #define FREQUENCY (NSEC_PER_SEC / PERIOD_NS) -/* Global state and config */ +// Global state and config int master_id = 0; int alias = 0; -static ec_master_t *master = nullptr; +static +ec_master_t *master = nullptr; struct coupler { int position; @@ -54,11 +56,11 @@ void ethercat_cyclic_task(NodeCompat *n) while (true) { w->task.wait(); - /* Receive process data */ + // Receive process data ecrt_master_receive(master); ecrt_domain_process(w->domain); - /* Receive process data */ + // Receive process data smp = sample_alloc(&w->pool); if (!smp) { n->logger->warn("Pool underrun"); @@ -69,7 +71,7 @@ void ethercat_cyclic_task(NodeCompat *n) smp->flags = (int) SampleFlags::HAS_DATA; smp->signals = n->getInputSignals(false); - /* Read process data */ + // Read process data for (unsigned i = 0; i < smp->length; i++) { int16_t ain_value = EC_READ_S16(w->domain_pd + w->in.offsets[i]); @@ -80,7 +82,7 @@ void ethercat_cyclic_task(NodeCompat *n) if (ret) n->logger->warn("Failed to enqueue samples"); - /* Write process data */ + // Write process data smp = w->send.exchange(nullptr); for (unsigned i = 0; i < w->out.num_channels; i++) { @@ -124,7 +126,7 @@ int villas::node::ethercat_type_start(villas::node::SuperNode *sn) if (!master) return -1; - /* Create configuration for bus coupler */ + // Create configuration for bus coupler coupler.sc = ecrt_master_slave_config(master, alias, coupler.position, coupler.vendor_id, coupler.product_code); if (!coupler.sc) return -1; @@ -187,7 +189,7 @@ int villas::node::ethercat_check(NodeCompat *n) { auto *w = n->getData(); - /* Some parts of the configuration are still hard-coded for this specific setup */ + // Some parts of the configuration are still hard-coded for this specific setup if (w->in.product_code != ETHERCAT_PID_EL3008 || w->in.vendor_id != ETHERCAT_VID_BECKHOFF || w->out.product_code != ETHERCAT_PID_EL4038 || @@ -227,7 +229,7 @@ int villas::node::ethercat_prepare(NodeCompat *n) memset(w->domain_regs, 0, (w->in.num_channels + w->out.num_channels + 1) * sizeof(ec_pdo_entry_reg_t)); - /* Prepare list of domain registers */ + // Prepare list of domain registers int o = 0; for (unsigned i = 0; i < w->out.num_channels; i++) { w->out.offsets[i] = 0; @@ -243,7 +245,7 @@ int villas::node::ethercat_prepare(NodeCompat *n) o++; }; - /* Prepare list of domain registers */ + // Prepare list of domain registers for (unsigned i = 0; i < w->in.num_channels; i++) { w->in.offsets[i] = 0; @@ -270,7 +272,7 @@ int villas::node::ethercat_start(NodeCompat *n) int ret; auto *w = n->getData(); - /* Configure analog in */ + // Configure analog in w->in.sc = ecrt_master_slave_config(master, alias, w->in.position, w->in.vendor_id, w->in.product_code); if (!w->in.sc) throw RuntimeError("Failed to get slave configuration."); @@ -279,7 +281,7 @@ int villas::node::ethercat_start(NodeCompat *n) if (ret) throw RuntimeError("Failed to configure PDOs."); - /* Configure analog out */ + // Configure analog out w->out.sc = ecrt_master_slave_config(master, alias, w->out.position, w->out.vendor_id, w->out.product_code); if (!w->out.sc) throw RuntimeError("Failed to get slave configuration."); @@ -292,7 +294,7 @@ int villas::node::ethercat_start(NodeCompat *n) if (ret) throw RuntimeError("PDO entry registration failed!"); - /** @todo Check that master is not already active... */ + // @todo Check that master is not already active... ret = ecrt_master_activate(master); if (ret) return -1; @@ -301,10 +303,10 @@ int villas::node::ethercat_start(NodeCompat *n) if (!w->domain_pd) return -1; - /* Start cyclic timer */ + // Start cyclic timer w->task.setRate(w->rate); - /* Start cyclic task */ + // Start cyclic task w->thread = std::thread(ethercat_cyclic_task, n); return 0; @@ -363,7 +365,7 @@ int villas::node::ethercat_init(NodeCompat *n) { auto *w = n->getData(); - /* Default values */ + // Default values w->rate = 1000; w->in.num_channels = 8; @@ -386,7 +388,7 @@ int villas::node::ethercat_init(NodeCompat *n) w->domain_pd = nullptr; w->domain_regs = nullptr; - /* Placement new for C++ objects */ + // Placement new for C++ objects new (&w->send) std::atomic(); new (&w->thread) std::thread(); new (&w->task) Task(CLOCK_REALTIME); @@ -418,7 +420,7 @@ int villas::node::ethercat_destroy(NodeCompat *n) w->task.~Task(); - /** @todo Destroy domain? */ + // @todo Destroy domain? return 0; } @@ -432,11 +434,11 @@ int villas::node::ethercat_poll_fds(NodeCompat *n, int *fds) return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "ethercat"; p.description = "Send and receive samples of an ethercat connection"; - p.vectorize = 1; /* we only process a single sample per call */ + p.vectorize = 1; // we only process a single sample per call p.size = sizeof(struct ethercat); p.type.start = ethercat_type_start; p.type.stop = ethercat_type_stop; @@ -452,6 +454,6 @@ static void register_plugin() { p.write = ethercat_write; p.poll_fds = ethercat_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } - diff --git a/lib/nodes/example.cpp b/lib/nodes/example.cpp index ad421e701..f21db14a2 100644 --- a/lib/nodes/example.cpp +++ b/lib/nodes/example.cpp @@ -1,12 +1,12 @@ -/** An example get started with new implementations of new node-types +/* An example get started with new implementations of new node-types * * This example does not do any particulary useful. * It is just a skeleton to get you started with new node-types. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -42,7 +42,7 @@ int ExampleNode::prepare() int ExampleNode::parse(json_t *json) { - /* TODO: Add implementation here. The following is just an example */ + // TODO: Add implementation here. The following is just an example const char *setting2_str = nullptr; @@ -138,7 +138,7 @@ int ExampleNode::_read(struct Sample *smps[], unsigned cnt) int read; struct timespec now; - /* TODO: Add implementation here. The following is just an example */ + // TODO: Add implementation here. The following is just an example assert(cnt >= 1 && smps[0]->capacity >= 1); @@ -151,7 +151,7 @@ int ExampleNode::_read(struct Sample *smps[], unsigned cnt) smps[0]->flags = (int) SampleFlags::HAS_DATA; smps[0]->signals = getInputSignals(false); - read = 1; /* The number of samples read */ + read = 1; // The number of samples read return read; } @@ -160,14 +160,14 @@ int ExampleNode::_write(struct Sample *smps[], unsigned cnt) { int written; - /* TODO: Add implementation here. */ + // TODO: Add implementation here. - written = 0; /* The number of samples written */ + written = 0; // The number of samples written return written; } - +// Register node static char n[] = "example"; static char d[] = "An example for staring new node-type implementations"; static NodePlugin p; diff --git a/lib/nodes/exec.cpp b/lib/nodes/exec.cpp index 15a33423d..ef4269688 100644 --- a/lib/nodes/exec.cpp +++ b/lib/nodes/exec.cpp @@ -1,9 +1,9 @@ -/** Node-type for subprocess node-types. +/* Node-type for subprocess node-types. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -86,7 +86,7 @@ int ExecNode::parse(json_t *json) } if (json_env) { - /* obj is a JSON object */ + // obj is a JSON object const char *key; json_t *json_value; @@ -98,7 +98,7 @@ int ExecNode::parse(json_t *json) } } - /* Format */ + // Format auto *fmt = json_format ? FormatFactory::make(json_format) : FormatFactory::make("villas.human"); @@ -116,7 +116,7 @@ int ExecNode::prepare() { assert(state == State::CHECKED); - /* Initialize IO */ + // Initialize IO formatter->start(getInputSignals(false)); return Node::prepare(); @@ -124,7 +124,7 @@ int ExecNode::prepare() int ExecNode::start() { - /* Start subprocess */ + // Start subprocess proc = std::make_unique(command, arguments, environment, working_dir, shell); logger->debug("Started sub-process with pid={}", proc->getPid()); @@ -149,14 +149,14 @@ int ExecNode::stop() if (ret) return ret; - /* Stop subprocess */ + // Stop subprocess logger->debug("Killing sub-process with pid={}", proc->getPid()); proc->kill(SIGINT); logger->debug("Waiting for sub-process with pid={} to terminate", proc->getPid()); proc->close(); - /** @todo Check exit code of subprocess? */ + // @todo Check exit code of subprocess? return 0; } @@ -206,6 +206,7 @@ std::vector ExecNode::getPollFDs() return { proc->getFdIn() }; } +// Register node static char n[] = "exec"; static char d[] = "run subprocesses with stdin/stdout communication"; static NodePlugin p; diff --git a/lib/nodes/file.cpp b/lib/nodes/file.cpp index 631cd02f8..d3fbfb22c 100644 --- a/lib/nodes/file.cpp +++ b/lib/nodes/file.cpp @@ -1,9 +1,9 @@ -/** Node type: File +/* Node type: File * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -32,7 +32,7 @@ char * file_format_name(const char *format, struct timespec *ts) if (!buf) throw MemoryAllocationError(); - /* Convert time */ + // Convert time gmtime_r(&ts->tv_sec, &tm); strftime(buf, FILE_MAX_PATHLEN, format, &tm); @@ -43,24 +43,24 @@ char * file_format_name(const char *format, struct timespec *ts) static struct timespec file_calc_offset(const struct timespec *first, const struct timespec *epoch, enum file::EpochMode mode) { - /* Get current time */ + // Get current time struct timespec now = time_now(); struct timespec offset; - /* Set offset depending on epoch */ + // Set offset depending on epoch switch (mode) { - case file::EpochMode::DIRECT: /* read first value at now + epoch */ + case file::EpochMode::DIRECT: // read first value at now + epoch offset = time_diff(first, &now); return time_add(&offset, epoch); - case file::EpochMode::WAIT: /* read first value at now + first + epoch */ + case file::EpochMode::WAIT: // read first value at now + first + epoch offset = now; return time_add(&now, epoch); - case file::EpochMode::RELATIVE: /* read first value at first + epoch */ + case file::EpochMode::RELATIVE: // read first value at first + epoch return *epoch; - case file::EpochMode::ABSOLUTE: /* read first value at f->epoch */ + case file::EpochMode::ABSOLUTE: // read first value at f->epoch return time_diff(first, epoch); default: @@ -101,7 +101,7 @@ int villas::node::file_parse(NodeCompat *n, json_t *json) f->epoch = time_from_double(epoch_flt); f->uri_tmpl = uri_tmpl ? strdup(uri_tmpl) : nullptr; - /* Format */ + // Format if (f->formatter) delete f->formatter; f->formatter = json_format @@ -230,13 +230,13 @@ int villas::node::file_start(NodeCompat *n) struct timespec now = time_now(); int ret; - /* Prepare file name */ + // Prepare file name if (f->uri) delete[] f->uri; f->uri = file_format_name(f->uri_tmpl, &now); - /* Check if directory exists */ + // Check if directory exists struct stat sb; char *cpy = strdup(f->uri); char *dir = dirname(cpy); @@ -261,7 +261,7 @@ int villas::node::file_start(NodeCompat *n) f->formatter->start(n->getInputSignals(false)); - /* Open file */ + // Open file f->stream_out = fopen(f->uri, "a+"); if (!f->stream_out) return -1; @@ -282,10 +282,10 @@ int villas::node::file_start(NodeCompat *n) return ret; } - /* Create timer */ + // Create timer f->task.setRate(f->rate); - /* Get timestamp of first line */ + // Get timestamp of first line if (f->epoch_mode != file::EpochMode::ORIGINAL) { rewind(f->stream_in); @@ -309,7 +309,7 @@ int villas::node::file_start(NodeCompat *n) rewind(f->stream_in); - /* Fast-forward */ + // Fast-forward struct Sample *smp = sample_alloc_mem(n->getInputSignals(false)->size()); for (unsigned i = 0; i < f->skip_lines; i++) f->formatter->scan(f->stream_in, smp); @@ -351,10 +351,10 @@ retry: ret = f->formatter->scan(f->stream_in, smps, cnt); goto retry; case file::EOFBehaviour::SUSPEND: - /* We wait 10ms before fetching again. */ + // We wait 10ms before fetching again. usleep(100000); - /* Try to download more data if this is a remote file. */ + // Try to download more data if this is a remote file. clearerr(f->stream_in); goto retry; @@ -374,7 +374,7 @@ retry: ret = f->formatter->scan(f->stream_in, smps, cnt); return 0; } - /* We dont wait in FILE_EPOCH_ORIGINAL mode */ + // We dont wait in FILE_EPOCH_ORIGINAL mode if (f->epoch_mode == file::EpochMode::ORIGINAL) return cnt; @@ -390,7 +390,7 @@ retry: ret = f->formatter->scan(f->stream_in, smps, cnt); steps = f->task.wait(); } - /* Check for overruns */ + // Check for overruns if (steps == 0) throw SystemError("Failed to wait for timer"); else if (steps != 1) @@ -431,7 +431,7 @@ int villas::node::file_poll_fds(NodeCompat *n, int fds[]) return 1; } - return -1; /** @todo not supported yet */ + return -1; // @todo not supported yet } int villas::node::file_init(NodeCompat *n) @@ -440,7 +440,7 @@ int villas::node::file_init(NodeCompat *n) new (&f->task) Task(CLOCK_REALTIME); - /* Default values */ + // Default values f->rate = 0; f->eof_mode = file::EOFBehaviour::STOP; f->epoch_mode = file::EpochMode::DIRECT; @@ -469,10 +469,11 @@ int villas::node::file_destroy(NodeCompat *n) return 0; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "file"; p.description = "support for file log / replay node type"; p.vectorize = 1; @@ -487,5 +488,6 @@ static void register_plugin() { p.write = file_write; p.poll_fds = file_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/fpga.cpp b/lib/nodes/fpga.cpp index af884406e..76e44d941 100644 --- a/lib/nodes/fpga.cpp +++ b/lib/nodes/fpga.cpp @@ -1,9 +1,9 @@ -/** Communicate with VILLASfpga Xilinx FPGA boards +/* Communicate with VILLASfpga Xilinx FPGA boards * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -32,12 +32,16 @@ using namespace villas::node; using namespace villas::fpga; using namespace villas::utils; -/* Global state */ -static std::list> cards; -static std::map dmaMap; +// Global state +static +std::list> cards; +static +std::map dmaMap; -static std::shared_ptr pciDevices; -static std::shared_ptr vfioContainer; +static +std::shared_ptr pciDevices; +static +std::shared_ptr vfioContainer; using namespace villas; using namespace villas::node; @@ -204,7 +208,7 @@ int FpgaNode::_write(Sample *smps[], unsigned cnt) if (!state) return -1; - written = 0; /* The number of samples written */ + written = 0; // The number of samples written return written; } diff --git a/lib/nodes/iec60870.cpp b/lib/nodes/iec60870.cpp index 8c71ab4f2..437f41f80 100644 --- a/lib/nodes/iec60870.cpp +++ b/lib/nodes/iec60870.cpp @@ -1,9 +1,9 @@ -/** Node type: IEC60870-5-104 +/* Node type: IEC60870-5-104 * - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,14 +20,16 @@ using namespace villas::utils; using namespace villas::node::iec60870; using namespace std::literals::chrono_literals; -static CP56Time2a timespec_to_cp56time2a(timespec time) { +static +CP56Time2a timespec_to_cp56time2a(timespec time) { time_t time_ms = static_cast(time.tv_sec) * 1000 + static_cast(time.tv_nsec) / 1000000; return CP56Time2a_createFromMsTimestamp(NULL, time_ms); } -static timespec cp56time2a_to_timespec(CP56Time2a cp56time2a) { +static +timespec cp56time2a_to_timespec(CP56Time2a cp56time2a) { auto time_ms = CP56Time2a_toMsTimestamp(cp56time2a); timespec time {}; time.tv_nsec = time_ms % 1000 * 1000; @@ -798,6 +800,7 @@ int SlaveNode::stop() return Node::stop(); } +// Register node static char name[] = "iec60870-5-104"; static char description[] = "Provide values as protocol slave"; static NodePlugin p; diff --git a/lib/nodes/iec61850.cpp b/lib/nodes/iec61850.cpp index 8c380c963..33ffedc9f 100644 --- a/lib/nodes/iec61850.cpp +++ b/lib/nodes/iec61850.cpp @@ -1,9 +1,9 @@ -/** Node type: IEC 61850-9-2 (Sampled Values) +/* Node type: IEC 61850-9-2 (Sampled Values) * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -25,7 +25,7 @@ using namespace villas::node; using namespace villas::utils; const struct iec61850_type_descriptor type_descriptors[] = { - /* name, iec_type, type, size, supported */ + // name, iec_type, type, size, supported { "boolean", IEC61850Type::BOOLEAN, SignalType::BOOLEAN, 1, false, false }, { "int8", IEC61850Type::INT8, SignalType::INTEGER, 1, false, false }, { "int16", IEC61850Type::INT16, SignalType::INTEGER, 2, false, false }, @@ -48,11 +48,15 @@ const struct iec61850_type_descriptor type_descriptors[] = { { "bitstring", IEC61850Type::BITSTRING, SignalType::INVALID, 4, false, false } }; -/** Each network interface needs a separate receiver */ -static struct List receivers; -static pthread_t thread; -static EthernetHandleSet hset; -static int users = 0; +// Each network interface needs a separate receiver +static +struct List receivers; +static +pthread_t thread; +static +EthernetHandleSet hset; +static +int users = 0; static void * iec61850_thread(void *ctx) @@ -106,7 +110,7 @@ int villas::node::iec61850_parse_signals(json_t *json_signals, struct List *sign "iec_type", &iec_type ); - /* Try to deduct the IEC 61850 data type from VILLAS signal format */ + // Try to deduct the IEC 61850 data type from VILLAS signal format if (!iec_type) { if (!node_signals) return -1; @@ -165,7 +169,7 @@ int villas::node::iec61850_type_start(villas::node::SuperNode *sn) { int ret; - /* Check if already initialized */ + // Check if already initialized if (users > 0) return 0; @@ -279,7 +283,7 @@ struct iec61850_receiver * villas::node::iec61850_receiver_create(enum iec61850_ { struct iec61850_receiver *r; - /* Check if there is already a SVReceiver for this interface */ + // Check if there is already a SVReceiver for this interface r = iec61850_receiver_lookup(t, intf); if (!r) { r = new struct iec61850_receiver; diff --git a/lib/nodes/iec61850_goose.cpp b/lib/nodes/iec61850_goose.cpp index 40c01efec..8a76c7fda 100644 --- a/lib/nodes/iec61850_goose.cpp +++ b/lib/nodes/iec61850_goose.cpp @@ -1,9 +1,9 @@ -/** Node type: IEC 61850 - GOOSE +/* Node type: IEC 61850 - GOOSE * - * @author Philipp Jungkamp - * @copyright 2023, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -909,6 +909,7 @@ int GooseNode::stop() return Node::stop(); } +// Register node static char name[] = "iec61850-8-1"; static char description[] = "IEC 61850-8-1 (GOOSE)"; static NodePlugin p; diff --git a/lib/nodes/iec61850_sv.cpp b/lib/nodes/iec61850_sv.cpp index 74f3e5b3f..6db86e0fb 100644 --- a/lib/nodes/iec61850_sv.cpp +++ b/lib/nodes/iec61850_sv.cpp @@ -1,9 +1,9 @@ -/** Node type: IEC 61850-9-2 (Sampled Values) +/* Node type: IEC 61850-9-2 (Sampled Values) * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -139,11 +139,11 @@ int villas::node::iec61850_sv_parse(NodeCompat *n, json_t *json) json_t *json_signals = nullptr; json_error_t err; - /* Default values */ + // Default values i->out.enabled = false; i->in.enabled = false; - i->out.smpmod = -1; /* do not set smpmod */ - i->out.smprate = -1; /* do not set smpmod */ + i->out.smpmod = -1; // do not set smpmod + i->out.smprate = -1; // do not set smpmod i->out.confrev = 1; i->out.vlan_priority = CONFIG_SV_DEFAULT_PRIORITY; i->out.vlan_id = CONFIG_SV_DEFAULT_VLAN_ID; @@ -231,7 +231,7 @@ char * villas::node::iec61850_sv_print(NodeCompat *n) buf = strf("interface=%s, app_id=%#x, dst_address=%s", i->interface, i->app_id, ether_ntoa(&i->dst_address)); - /* Publisher part */ + // Publisher part if (i->out.enabled) { strcatf(&buf, ", pub.svid=%s, pub.vlan_prio=%d, pub.vlan_id=%#x, pub.confrev=%d, pub.#fields=%zu", i->out.svid, @@ -242,7 +242,7 @@ char * villas::node::iec61850_sv_print(NodeCompat *n) ); } - /* Subscriber part */ + // Subscriber part if (i->in.enabled) strcatf(&buf, ", sub.#fields=%zu", list_length(&i->in.signals)); @@ -254,7 +254,7 @@ int villas::node::iec61850_sv_start(NodeCompat *n) int ret; auto *i = n->getData(); - /* Initialize publisher */ + // Initialize publisher if (i->out.enabled) { i->out.publisher = SVPublisher_create(nullptr, i->interface); i->out.asdu = SVPublisher_addASDU(i->out.publisher, i->out.svid, n->getNameShort().c_str(), i->out.confrev); @@ -291,24 +291,24 @@ int villas::node::iec61850_sv_start(NodeCompat *n) // if (s->out.smprate >= 0) // SV_ASDU_setSmpRate(i->out.asdu, i->out.smprate); - /* Start publisher */ + // Start publisher SVPublisher_setupComplete(i->out.publisher); } - /* Start subscriber */ + // Start subscriber if (i->in.enabled) { struct iec61850_receiver *r = iec61850_receiver_create(iec61850_receiver::Type::SAMPLED_VALUES, i->interface); i->in.receiver = r->sv; i->in.subscriber = SVSubscriber_create(i->dst_address.ether_addr_octet, i->app_id); - /* Install a callback handler for the subscriber */ + // Install a callback handler for the subscriber SVSubscriber_setListener(i->in.subscriber, iec61850_sv_listener, n); - /* Connect the subscriber to the receiver */ + // Connect the subscriber to the receiver SVReceiver_addSubscriber(i->in.receiver, i->in.subscriber); - /* Initialize pool and queue to pass samples between threads */ + // Initialize pool and queue to pass samples between threads ret = pool_init(&i->in.pool, 1024, SAMPLE_LENGTH(n->getInputSignals(false)->size())); if (ret) return ret; @@ -351,11 +351,11 @@ int villas::node::iec61850_sv_destroy(NodeCompat *n) int ret; auto *i = n->getData(); - /* Deinitialize publisher */ + // Deinitialize publisher if (i->out.enabled && i->out.publisher) SVPublisher_destroy(i->out.publisher); - /* Deinitialise subscriber */ + // Deinitialise subscriber if (i->in.enabled) { ret = queue_signalled_destroy(&i->in.queue); if (ret) @@ -461,10 +461,11 @@ int villas::node::iec61850_sv_poll_fds(NodeCompat *n, int fds[]) return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "iec61850-9-2"; p.description = "IEC 61850-9-2 (Sampled Values)"; p.vectorize = 0; @@ -480,5 +481,6 @@ static void register_plugin() { p.write = iec61850_sv_write; p.poll_fds = iec61850_sv_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/infiniband.cpp b/lib/nodes/infiniband.cpp index 263f62cf6..e91c0357f 100644 --- a/lib/nodes/infiniband.cpp +++ b/lib/nodes/infiniband.cpp @@ -1,9 +1,9 @@ -/** Node type: infiniband +/* Node type: infiniband * - * @author Dennis Potter - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Dennis Potter + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -34,7 +34,7 @@ int ib_disconnect(NodeCompat *n) rdma_disconnect(ib->ctx.id); - /* If there is anything in the Completion Queue, it should be given back to the framework Receive Queue. */ + // If there is anything in the Completion Queue, it should be given back to the framework Receive Queue. while (ib->conn.available_recv_wrs) { wcs = ibv_poll_cq(ib->ctx.recv_cq, ib->recv_cq_size, wc); @@ -44,13 +44,13 @@ int ib_disconnect(NodeCompat *n) sample_decref((struct Sample *) (intptr_t) (wc[j].wr_id)); } - /* Send Queue */ + // Send Queue while ((wcs = ibv_poll_cq(ib->ctx.send_cq, ib->send_cq_size, wc))) for (int j = 0; j < wcs; j++) if (wc[j].wr_id > 0) sample_decref((struct Sample *) (intptr_t) (wc[j].wr_id)); - /* Destroy QP */ + // Destroy QP rdma_destroy_qp(ib->ctx.id); n->logger->debug("Destroyed QP"); @@ -66,7 +66,7 @@ void ib_build_ibv(NodeCompat *n) n->logger->debug("Starting to build IBV components"); - /* Create completion queues (No completion channel!) */ + // Create completion queues (No completion channel!) ib->ctx.recv_cq = ibv_create_cq(ib->ctx.id->verbs, ib->recv_cq_size, nullptr, nullptr, 0); if (!ib->ctx.recv_cq) throw RuntimeError("Could not create receive completion queue"); @@ -79,11 +79,11 @@ void ib_build_ibv(NodeCompat *n) n->logger->debug("Created send Completion Queue"); - /* Prepare remaining Queue Pair (QP) attributes */ + // Prepare remaining Queue Pair (QP) attributes ib->qp_init.send_cq = ib->ctx.send_cq; ib->qp_init.recv_cq = ib->ctx.recv_cq; - /* Create the actual QP */ + // Create the actual QP ret = rdma_create_qp(ib->ctx.id, ib->ctx.pd, &ib->qp_init); if (ret) throw RuntimeError("Failed to create Queue Pair"); @@ -103,10 +103,10 @@ int ib_addr_resolved(NodeCompat *n) n->logger->debug("Successfully resolved address"); - /* Build all components from IB Verbs */ + // Build all components from IB Verbs ib_build_ibv(n); - /* Resolve address */ + // Resolve address ret = rdma_resolve_route(ib->ctx.id, ib->conn.timeout); if (ret) throw RuntimeError("Failed to resolve route"); @@ -123,7 +123,7 @@ int ib_route_resolved(NodeCompat *n) struct rdma_conn_param cm_params; memset(&cm_params, 0, sizeof(cm_params)); - /* Send connection request */ + // Send connection request ret = rdma_connect(ib->ctx.id, &cm_params); if (ret) throw RuntimeError("Failed to connect"); @@ -147,7 +147,7 @@ int ib_connect_request(NodeCompat *n, struct rdma_cm_id *id) struct rdma_conn_param cm_params; memset(&cm_params, 0, sizeof(cm_params)); - /* Accept connection request */ + // Accept connection request ret = rdma_accept(ib->ctx.id, &cm_params); if (ret) throw RuntimeError("Failed to connect"); @@ -187,7 +187,7 @@ int villas::node::ib_parse(NodeCompat *n, json_t *json) int buffer_subtraction = 16; int use_fallback = 1; - /* Parse JSON files and copy to local variables */ + // Parse JSON files and copy to local variables json_t *json_in = nullptr; json_t *json_out = nullptr; json_error_t err; @@ -200,7 +200,6 @@ int villas::node::ib_parse(NodeCompat *n, json_t *json) if (ret) throw ConfigError(json, err, "node-config-node-ib"); - if (json_in) { ret = json_unpack_ex(json_in, &err, 0, "{ s?: s, s?: i, s?: i, s?: i, s?: i}", "address", &local, @@ -240,19 +239,19 @@ int villas::node::ib_parse(NodeCompat *n, json_t *json) n->logger->debug("Setup as target"); } - /* Set fallback mode */ + // Set fallback mode ib->conn.use_fallback = use_fallback; - /* Set vectorize mode. Do not print, since framework will print this information */ + // Set vectorize mode. Do not print, since framework will print this information n->in.vectorize = vectorize_in; n->out.vectorize = vectorize_out; - /* Set buffer subtraction */ + // Set buffer subtraction ib->conn.buffer_subtraction = buffer_subtraction; n->logger->debug("Set buffer subtraction to {}", buffer_subtraction); - /* Translate IP:PORT to a struct addrinfo */ + // Translate IP:PORT to a struct addrinfo char *ip_adr = strtok_r(local, ":", &lasts); char *port = strtok_r(nullptr, ":", &lasts); @@ -262,7 +261,7 @@ int villas::node::ib_parse(NodeCompat *n, json_t *json) n->logger->debug("Translated {}:{} to a struct addrinfo", ip_adr, port); - /* Translate port space */ + // Translate port space if (strcmp(transport_mode, "RC") == 0) { ib->conn.port_space = RDMA_PS_TCP; ib->qp_init.qp_type = IBV_QPT_RC; @@ -285,44 +284,43 @@ int villas::node::ib_parse(NodeCompat *n, json_t *json) n->logger->debug("Set transport mode to {}", transport_mode); - /* Set timeout */ + // Set timeout ib->conn.timeout = timeout; n->logger->debug("Set timeout to {}", timeout); - /* Set completion queue size */ + // Set completion queue size ib->recv_cq_size = recv_cq_size; ib->send_cq_size = send_cq_size; n->logger->debug("Set Completion Queue size to {} & {} (in & out)", recv_cq_size, send_cq_size); - - /* Translate inline mode */ + // Translate inline mode ib->conn.send_inline = send_inline; n->logger->debug("Set send_inline to {}", send_inline); - /* Set max. send and receive Work Requests */ + // Set max. send and receive Work Requests ib->qp_init.cap.max_send_wr = max_send_wr; ib->qp_init.cap.max_recv_wr = max_recv_wr; n->logger->debug("Set max_send_wr and max_recv_wr to {} and {}, respectively", max_send_wr, max_recv_wr); - /* Set available receive Work Requests to 0 */ + // Set available receive Work Requests to 0 ib->conn.available_recv_wrs = 0; - /* Set remaining QP attributes */ + // Set remaining QP attributes ib->qp_init.cap.max_send_sge = 4; ib->qp_init.cap.max_recv_sge = (ib->conn.port_space == RDMA_PS_UDP) ? 5 : 4; - /* Set number of bytes to be send inline */ + // Set number of bytes to be send inline ib->qp_init.cap.max_inline_data = max_inline_data; - /* If node will send data, set remote address */ + // If node will send data, set remote address if (ib->is_source) { - /* Translate address info */ + // Translate address info char *ip_adr = strtok_r(remote, ":", &lasts); char *port = strtok_r(nullptr, ":", &lasts); @@ -340,14 +338,14 @@ int villas::node::ib_check(NodeCompat *n) { auto *ib = n->getData(); - /* Check if read substraction makes sense */ + // Check if read substraction makes sense if (ib->conn.buffer_subtraction < 2 * n->in.vectorize) throw RuntimeError("The buffer substraction value must be bigger than 2 * in.vectorize"); if (ib->conn.buffer_subtraction >= ib->qp_init.cap.max_recv_wr - n->in.vectorize) throw RuntimeError("The buffer substraction value cannot be bigger than in.max_wrs - in.vectorize"); - /* Check if the set value is a power of 2, and warn the user if this is not the case */ + // Check if the set value is a power of 2, and warn the user if this is not the case unsigned max_send_pow = (int) pow(2, ceil(log2(ib->qp_init.cap.max_send_wr))); unsigned max_recv_pow = (int) pow(2, ceil(log2(ib->qp_init.cap.max_recv_wr))); @@ -355,7 +353,7 @@ int villas::node::ib_check(NodeCompat *n) n->logger->warn("Max nr. of send WRs ({}) is not a power of 2! It will be changed to a power of 2: {}", ib->qp_init.cap.max_send_wr, max_send_pow); - /* Change it now, because otherwise errors are possible in ib_start(). */ + // Change it now, because otherwise errors are possible in ib_start(). ib->qp_init.cap.max_send_wr = max_send_pow; } @@ -363,11 +361,11 @@ int villas::node::ib_check(NodeCompat *n) n->logger->warn("Max nr. of recv WRs ({}) is not a power of 2! It will be changed to a power of 2: {}", ib->qp_init.cap.max_recv_wr, max_recv_pow); - /* Change it now, because otherwise errors are possible in ib_start(). */ + // Change it now, because otherwise errors are possible in ib_start(). ib->qp_init.cap.max_recv_wr = max_recv_pow; } - /* Check maximum size of max_recv_wr and max_send_wr */ + // Check maximum size of max_recv_wr and max_send_wr if (ib->qp_init.cap.max_send_wr > 8192) n->logger->warn("Max number of send WRs ({}) is bigger than send queue!", ib->qp_init.cap.max_send_wr); @@ -379,7 +377,7 @@ int villas::node::ib_check(NodeCompat *n) if (ib->periodic_signaling == 0) ib->periodic_signaling = ib->qp_init.cap.max_send_wr / 2; - /* Warn user if he changed the default inline value */ + // Warn user if he changed the default inline value if (ib->qp_init.cap.max_inline_data != 0) n->logger->warn("You changed the default value of max_inline_data. This might influence the maximum number " "of outstanding Work Requests in the Queue Pair and can be a reason for the Queue Pair creation to fail"); @@ -444,7 +442,7 @@ void ib_create_bind_id(NodeCompat *n) n->logger->debug("Created rdma_cm_id"); - /* Bind rdma_cm_id to the HCA */ + // Bind rdma_cm_id to the HCA ret = rdma_bind_addr(ib->ctx.id, ib->conn.src_addr->ai_addr); if (ret) throw RuntimeError("Failed to bind to local device: {}", gai_strerror(ret)); @@ -472,21 +470,21 @@ void ib_continue_as_listen(NodeCompat *n, struct rdma_cm_event *event) n->setState(State::STARTED); - /* Acknowledge event */ + // Acknowledge event rdma_ack_cm_event(event); - /* Destroy ID */ + // Destroy ID rdma_destroy_id(ib->ctx.listen_id); - /* Create rdma_cm_id and bind to device */ + // Create rdma_cm_id and bind to device ib_create_bind_id(n); - /* Listen to id for events */ + // Listen to id for events ret = rdma_listen(ib->ctx.listen_id, 10); if (ret) throw RuntimeError("Failed to listen to rdma_cm_id"); - /* Node is not a source (and will not send data */ + // Node is not a source (and will not send data ib->is_source = 0; n->logger->info("Use listening mode"); @@ -502,10 +500,10 @@ void * ib_rdma_cm_event_thread(void *ctx) n->logger->debug("Started rdma_cm_event thread"); - /* Wait until node is completely started */ + // Wait until node is completely started while (n->getState() != State::STARTED); - /* Monitor event channel */ + // Monitor event channel while (rdma_get_cm_event(ib->ctx.ec, &event) == 0) { n->logger->debug("Received communication event: {}", rdma_event_str(event->event)); @@ -567,7 +565,7 @@ void * ib_rdma_cm_event_thread(void *ctx) break; case RDMA_CM_EVENT_ESTABLISHED: - /* If the connection is unreliable connectionless, set appropriate variables */ + // If the connection is unreliable connectionless, set appropriate variables if (ib->conn.port_space == RDMA_PS_UDP) { ib->conn.ud.ud = event->param.ud; ib->conn.ud.ah = ibv_create_ah(ib->ctx.pd, &ib->conn.ud.ud.ah_attr); @@ -612,27 +610,27 @@ int villas::node::ib_start(NodeCompat *n) n->logger->debug("Started ib_start"); - /* Create event channel */ + // Create event channel ib->ctx.ec = rdma_create_event_channel(); if (!ib->ctx.ec) throw RuntimeError("Failed to create event channel!"); n->logger->debug("Created event channel"); - /* Create rdma_cm_id and bind to device */ + // Create rdma_cm_id and bind to device ib_create_bind_id(n); n->logger->debug("Initialized Work Completion Buffer"); - /* Resolve address or listen to rdma_cm_id */ + // Resolve address or listen to rdma_cm_id if (ib->is_source) { - /* Resolve address */ + // Resolve address ret = rdma_resolve_addr(ib->ctx.id, nullptr, ib->conn.dst_addr->ai_addr, ib->conn.timeout); if (ret) throw RuntimeError("Failed to resolve remote address after {}ms: {}", ib->conn.timeout, gai_strerror(ret)); } else { - /* Listen on rdma_cm_id for events */ + // Listen on rdma_cm_id for events ret = rdma_listen(ib->ctx.listen_id, 10); if (ret) throw RuntimeError("Failed to listen to rdma_cm_id"); @@ -640,14 +638,14 @@ int villas::node::ib_start(NodeCompat *n) n->logger->debug("Started to listen to rdma_cm_id"); } - /* Allocate protection domain */ + // Allocate protection domain ib->ctx.pd = ibv_alloc_pd(ib->ctx.id->verbs); if (!ib->ctx.pd) throw RuntimeError("Could not allocate protection domain"); n->logger->debug("Allocated Protection Domain"); - /* Allocate space for 40 Byte GHR. We don't use this. */ + // Allocate space for 40 Byte GHR. We don't use this. if (ib->conn.port_space == RDMA_PS_UDP) { ib->conn.ud.grh_ptr = new char[GRH_SIZE]; if (!ib->conn.ud.grh_ptr) @@ -661,7 +659,7 @@ int villas::node::ib_start(NodeCompat *n) */ n->logger->debug("Starting to monitor events on rdma_cm_id"); - /* Create thread to monitor rdma_cm_event channel */ + // Create thread to monitor rdma_cm_event channel ret = pthread_create(&ib->conn.rdma_cm_event_thread, nullptr, ib_rdma_cm_event_thread, n); if (ret) throw RuntimeError("Failed to create thread to monitor rdma_cm events: {}", gai_strerror(ret)); @@ -698,22 +696,22 @@ int villas::node::ib_stop(NodeCompat *n) n->logger->info("Disconnecting... Waiting for threads to join."); - /* Wait for event thread to join */ + // Wait for event thread to join ret = pthread_join(ib->conn.rdma_cm_event_thread, nullptr); if (ret) throw RuntimeError("Error while joining rdma_cm_event_thread: {}", ret); n->logger->debug("Joined rdma_cm_event_thread"); - /* Destroy RDMA CM ID */ + // Destroy RDMA CM ID rdma_destroy_id(ib->ctx.id); n->logger->debug("Destroyed rdma_cm_id"); - /* Dealloc Protection Domain */ + // Dealloc Protection Domain ibv_dealloc_pd(ib->ctx.pd); n->logger->debug("Destroyed protection domain"); - /* Destroy event channel */ + // Destroy event channel rdma_destroy_event_channel(ib->ctx.ec); n->logger->debug("Destroyed event channel"); @@ -752,13 +750,13 @@ int villas::node::ib_read(NodeCompat *n, struct Sample * const smps[], unsigned wcs = ibv_poll_cq(ib->ctx.recv_cq, cnt, wc); if (wcs) { - /* Get time directly after something arrived in Completion Queue */ + // Get time directly after something arrived in Completion Queue ts_receive = time_now(); n->logger->debug("Received {} Work Completions", wcs); - read_values = wcs; /* Value to return */ - max_wr_post = wcs; /* Make space free in smps[] */ + read_values = wcs; // Value to return + max_wr_post = wcs; // Make space free in smps[] break; } @@ -774,18 +772,18 @@ int villas::node::ib_read(NodeCompat *n, struct Sample * const smps[], unsigned ib->conn.available_recv_wrs += max_wr_post; // TODO: fix release logic - // *release = 0; /* While we fill the receive queue, we always use all samples */ + // *release = 0; // While we fill the receive queue, we always use all samples } - /* Get Memory Region */ + // Get Memory Region mr = memory::ib_get_mr(pool_buffer(sample_pool(smps[0]))); for (int i = 0; i < max_wr_post; i++) { int j = 0; - /* Prepare receive Scatter/Gather element */ + // Prepare receive Scatter/Gather element - /* First 40 byte of UD data are GRH and unused in our case */ + // First 40 byte of UD data are GRH and unused in our case if (ib->conn.port_space == RDMA_PS_UDP) { sge[i][j].addr = (uint64_t) ib->conn.ud.grh_ptr; sge[i][j].length = GRH_SIZE; @@ -794,14 +792,14 @@ int villas::node::ib_read(NodeCompat *n, struct Sample * const smps[], unsigned j++; } - /* Sequence */ + // Sequence sge[i][j].addr = (uint64_t) &smps[i]->sequence; sge[i][j].length = sizeof(smps[i]->sequence); sge[i][j].lkey = mr->lkey; j++; - /* Timespec origin */ + // Timespec origin sge[i][j].addr = (uint64_t) &smps[i]->ts.origin; sge[i][j].length = sizeof(smps[i]->ts.origin); sge[i][j].lkey = mr->lkey; @@ -814,7 +812,7 @@ int villas::node::ib_read(NodeCompat *n, struct Sample * const smps[], unsigned j++; - /* Prepare a receive Work Request */ + // Prepare a receive Work Request wr[i].wr_id = (uintptr_t) smps[i]; wr[i].next = &wr[i+1]; wr[i].sg_list = sge[i]; @@ -826,17 +824,17 @@ int villas::node::ib_read(NodeCompat *n, struct Sample * const smps[], unsigned n->logger->debug("Prepared {} new receive Work Requests", max_wr_post); n->logger->debug("{} receive Work Requests in Receive Queue", ib->conn.available_recv_wrs); - /* Post list of Work Requests */ + // Post list of Work Requests ret = ibv_post_recv(ib->ctx.id->qp, &wr[0], &bad_wr); if (ret) throw RuntimeError("Was unable to post receive WR: {}, bad WR ID: {:#x}", ret, bad_wr->wr_id); n->logger->debug("Succesfully posted receive Work Requests"); - /* Doesn't start if wcs == 0 */ + // Doesn't start if wcs == 0 for (int j = 0; j < wcs; j++) { if ( !( (wc[j].opcode & IBV_WC_RECV) && wc[j].status == IBV_WC_SUCCESS) ) { - /* Drop all values, we don't know where the error occured */ + // Drop all values, we don't know where the error occured read_values = 0; } @@ -874,7 +872,7 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned struct ibv_mr *mr; int ret; - unsigned sent = 0; /* Used for first loop: prepare work requests to post to send queue */ + unsigned sent = 0; // Used for first loop: prepare work requests to post to send queue n->logger->debug("ib_write is called"); @@ -882,38 +880,38 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned // TODO: fix release logic // *release = 0; - /* First, write */ + // First, write - /* Get Memory Region */ + // Get Memory Region mr = memory::ib_get_mr(pool_buffer(sample_pool(smps[0]))); for (sent = 0; sent < cnt; sent++) { int j = 0; - /* Set Scatter/Gather element to data of sample */ + // Set Scatter/Gather element to data of sample - /* Sequence */ + // Sequence sge[sent][j].addr = (uint64_t) &smps[sent]->sequence; sge[sent][j].length = sizeof(smps[sent]->sequence); sge[sent][j].lkey = mr->lkey; j++; - /* Timespec origin */ + // Timespec origin sge[sent][j].addr = (uint64_t) &smps[sent]->ts.origin; sge[sent][j].length = sizeof(smps[sent]->ts.origin); sge[sent][j].lkey = mr->lkey; j++; - /* Actual Payload */ + // Actual Payload sge[sent][j].addr = (uint64_t) &smps[sent]->data; sge[sent][j].length = SAMPLE_DATA_LENGTH(smps[sent]->length); sge[sent][j].lkey = mr->lkey; j++; - /* Check if connection is connected or unconnected and set appropriate values */ + // Check if connection is connected or unconnected and set appropriate values if (ib->conn.port_space == RDMA_PS_UDP) { wr[sent].wr.ud.ah = ib->conn.ud.ah; wr[sent].wr.ud.remote_qkey = ib->conn.ud.ud.qkey; @@ -932,7 +930,7 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned n->logger->debug("Sample will be send inline [0/1]: {}", send_inline); - /* Set Send Work Request */ + // Set Send Work Request wr[sent].wr_id = (uintptr_t) smps[sent]; wr[sent].sg_list = sge[sent]; wr[sent].num_sge = j; @@ -945,7 +943,7 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned n->logger->debug("Prepared {} send Work Requests", cnt); wr[cnt-1].next = nullptr; - /* Send linked list of Work Requests */ + // Send linked list of Work Requests ret = ibv_post_send(ib->ctx.id->qp, wr, &bad_wr); n->logger->debug("Posted send Work Requests"); @@ -966,8 +964,8 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned while (1) { // TODO: fix release logic // smps[*release] = smps[m]; - // (*release)++; /* Increment number of samples to be released */ - sent--; /* Decrement the number of successfully posted elements */ + // (*release)++; // Increment number of samples to be released + sent--; // Decrement the number of successfully posted elements if (++m == cnt) break; } @@ -1002,10 +1000,11 @@ int villas::node::ib_write(NodeCompat *n, struct Sample * const smps[], unsigned return sent; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "infiniband"; p.description = "Infiniband interface (libibverbs, librdmacm)"; p.vectorize = 0; @@ -1023,5 +1022,6 @@ static void register_plugin() { p.reverse = ib_reverse; p.memory_type = memory::ib; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/influxdb.cpp b/lib/nodes/influxdb.cpp index d0224f734..7080f56bb 100644 --- a/lib/nodes/influxdb.cpp +++ b/lib/nodes/influxdb.cpp @@ -1,9 +1,9 @@ -/** Node-type for InfluxDB. +/* Node-type for InfluxDB. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -70,7 +70,7 @@ int villas::node::influxdb_open(NodeCompat *n) if (ret) throw RuntimeError("Failed to lookup server: {}", gai_strerror(ret)); - /* Loop through all the results and connect to the first we can */ + // Loop through all the results and connect to the first we can for (p = servinfo; p != nullptr; p = p->ai_next) { i->sd = socket(p->ai_family, p->ai_socktype, p->ai_protocol); if (i->sd == -1) @@ -83,7 +83,7 @@ int villas::node::influxdb_open(NodeCompat *n) continue; } - /* If we get here, we must have connected successfully */ + // If we get here, we must have connected successfully break; } @@ -116,10 +116,10 @@ int villas::node::influxdb_write(NodeCompat *n, struct Sample * const smps[], un for (unsigned k = 0; k < cnt; k++) { const struct Sample *smp = smps[k]; - /* Key */ + // Key strcatf(&buf, "%s", i->key); - /* Fields */ + // Fields for (unsigned j = 0; j < smp->length; j++) { const auto *data = &smp->data[j]; auto sig = smp->signals->getByIndex(j); @@ -164,7 +164,7 @@ int villas::node::influxdb_write(NodeCompat *n, struct Sample * const smps[], un } } - /* Timestamp */ + // Timestamp strcatf(&buf, " %lld%09lld\n", (long long) smp->ts.origin.tv_sec, (long long) smp->ts.origin.tv_nsec); } @@ -191,10 +191,11 @@ char * villas::node::influxdb_print(NodeCompat *n) return buf; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "influxdb"; p.description = "Write results to InfluxDB"; p.vectorize = 0; @@ -205,5 +206,6 @@ static void register_plugin() { p.stop = influxdb_close; p.write = influxdb_write; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/kafka.cpp b/lib/nodes/kafka.cpp index ac5d89052..5b3f81fcf 100644 --- a/lib/nodes/kafka.cpp +++ b/lib/nodes/kafka.cpp @@ -1,9 +1,9 @@ -/** Node type: kafka +/* Node type: kafka * - * @author Juan Pablo Noreña - * @copyright 2021, Universidad Nacional de Colombia - * @license Apache 2.0 - *********************************************************************************/ + * Author: Juan Pablo Noreña + * SPDX-FileCopyrightText: 2021 Universidad Nacional de Colombia + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,9 +19,12 @@ using namespace villas::node; using namespace villas::utils; // Each process has a list of clients for which a thread invokes the kafka loop -static struct List clients; -static pthread_t thread; -static Logger logger; +static +struct List clients; +static +pthread_t thread; +static +Logger logger; static void kafka_logger_cb(const rd_kafka_t *rk, int level, const char *fac, const char *buf) @@ -127,7 +130,7 @@ int villas::node::kafka_init(NodeCompat *n) { auto *k = n->getData(); - /* Default values */ + // Default values k->server = nullptr; k->protocol = nullptr; k->produce = nullptr; @@ -231,7 +234,7 @@ int villas::node::kafka_parse(NodeCompat *n, json_t *json) k->sasl.password = strdup(password); } - /* Format */ + // Format if (k->formatter) delete k->formatter; k->formatter = json_format @@ -273,7 +276,7 @@ char * villas::node::kafka_print(NodeCompat *n) k->protocol ); - /* Only show if not default */ + // Only show if not default if (k->produce) strcatf(&buf, ", out.produce=%s", k->produce); @@ -571,10 +574,11 @@ int villas::node::kafka_poll_fds(NodeCompat *n, int fds[]) return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "kafka"; p.description = "Kafka event message streaming (rdkafka)"; p.vectorize = 0; @@ -595,5 +599,6 @@ static void register_plugin() { p.reverse = kafka_reverse; p.poll_fds = kafka_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/loopback.cpp b/lib/nodes/loopback.cpp index cb3e53ce8..55cd70d91 100644 --- a/lib/nodes/loopback.cpp +++ b/lib/nodes/loopback.cpp @@ -1,9 +1,9 @@ -/** Node-type for loopback connections. +/* Node-type for loopback connections. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -79,7 +79,7 @@ int LoopbackNode::_write(struct Sample * smps[], unsigned cnt) return pushed; } - /* Released unpushed samples */ + // Released unpushed samples if ((unsigned) pushed < cnt) { sample_decref_many(smps + pushed, cnt - pushed); logger->warn("Queue overrun"); @@ -134,6 +134,7 @@ int LoopbackNode::parse(json_t *json) return Node::parse(json); } +// Register node static char n[] = "loopback"; static char d[] = "loopback node-type"; static NodePlugin - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -17,7 +17,8 @@ using namespace villas; using namespace villas::node; -static InternalLoopbackNodeFactory nf; +static +InternalLoopbackNodeFactory nf; InternalLoopbackNode::InternalLoopbackNode(Node *src, unsigned id, unsigned ql) : queuelen(ql), @@ -90,7 +91,7 @@ int InternalLoopbackNode::_write(struct Sample * smps[], unsigned cnt) return pushed; } - /* Released unpushed samples */ + // Released unpushed samples if ((unsigned) pushed < cnt) { sample_decref_many(smps + pushed, cnt - pushed); logger->warn("Queue overrun"); diff --git a/lib/nodes/modbus.cpp b/lib/nodes/modbus.cpp index 5d3987d1f..13bd07beb 100644 --- a/lib/nodes/modbus.cpp +++ b/lib/nodes/modbus.cpp @@ -1,4 +1,4 @@ -/** A Modbus node-type supporting RTU and TCP transports. +/* A Modbus node-type supporting RTU and TCP transports. * * The modbus communication using the libmodbus library is fairly simple. * @@ -30,10 +30,10 @@ * - The special case in blockDistance makes causes the bit mappings to be grouped * first, before any adjacent registers. * - * @author Philipp Jungkamp - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -260,7 +260,6 @@ modbus_addr_t modbus::blockEnd(RegisterMapping const &mapping) }, mapping); } - modbus_addr_t modbus::mappedRegisters(RegisterMappingSingle const &single) { return single.num_registers(); @@ -942,6 +941,7 @@ const std::string & ModbusNode::getDetails() return details; } +// Register node static char name[] = "modbus"; static char description[] = "Read and write Modbus registers"; static NodePlugin p; diff --git a/lib/nodes/mqtt.cpp b/lib/nodes/mqtt.cpp index 304b3941e..3444a9e45 100644 --- a/lib/nodes/mqtt.cpp +++ b/lib/nodes/mqtt.cpp @@ -1,9 +1,9 @@ -/** Node type: mqtt +/* Node type: mqtt * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -141,11 +141,11 @@ int villas::node::mqtt_init(NodeCompat *n) m->formatter = nullptr; - /* Default values */ + // Default values m->port = 1883; m->qos = 0; m->retain = 0; - m->keepalive = 5; /* 5 second, minimum required for libmosquitto */ + m->keepalive = 5; // 5 second, minimum required for libmosquitto m->host = nullptr; m->username = nullptr; @@ -242,7 +242,7 @@ int villas::node::mqtt_parse(NodeCompat *n, json_t *json) m->ssl.ciphers = ciphers ? strdup(ciphers) : nullptr; } - /* Format */ + // Format if (m->formatter) delete m->formatter; m->formatter = json_format @@ -301,7 +301,7 @@ char * villas::node::mqtt_print(NodeCompat *n) m->ssl.enabled ? "yes" : "no" ); - /* Only show if not default */ + // Only show if not default if (m->username) strcatf(&buf, ", username=%s", m->username); @@ -499,10 +499,11 @@ int villas::node::mqtt_poll_fds(NodeCompat *n, int fds[]) return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "mqtt"; p.description = "Message Queuing Telemetry Transport (libmosquitto)"; p.vectorize = 0; @@ -524,5 +525,6 @@ static void register_plugin() { p.reverse = mqtt_reverse; p.poll_fds = mqtt_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/nanomsg.cpp b/lib/nodes/nanomsg.cpp index 4b111d403..7abe4a3d6 100644 --- a/lib/nodes/nanomsg.cpp +++ b/lib/nodes/nanomsg.cpp @@ -1,9 +1,9 @@ -/** Node type: nanomsg +/* Node type: nanomsg * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -126,7 +126,7 @@ int villas::node::nanomsg_parse(NodeCompat *n, json_t *json) throw RuntimeError("Invalid type for 'subscribe' setting"); } - /* Format */ + // Format if (m->formatter) delete m->formatter; m->formatter = json_format @@ -180,12 +180,12 @@ int villas::node::nanomsg_start(NodeCompat *n) if (ret < 0) throw RuntimeError("Failed to create nanomsg socket: {}", nn_strerror(errno)); - /* Subscribe to all topics */ + // Subscribe to all topics ret = nn_setsockopt(ret = m->in.socket, NN_SUB, NN_SUB_SUBSCRIBE, "", 0); if (ret < 0) return ret; - /* Bind publisher to socket */ + // Bind publisher to socket for (size_t i = 0; i < list_length(&m->out.endpoints); i++) { char *ep = (char *) list_at(&m->out.endpoints, i); @@ -194,7 +194,7 @@ int villas::node::nanomsg_start(NodeCompat *n) throw RuntimeError("Failed to connect nanomsg socket to endpoint {}: {}", ep, nn_strerror(errno)); } - /* Connect subscribers socket */ + // Connect subscribers socket for (size_t i = 0; i < list_length(&m->in.endpoints); i++) { char *ep = (char *) list_at(&m->in.endpoints, i); @@ -235,7 +235,7 @@ int villas::node::nanomsg_read(NodeCompat *n, struct Sample * const smps[], unsi int bytes; char data[NANOMSG_MAX_PACKET_LEN]; - /* Receive payload */ + // Receive payload bytes = nn_recv(m->in.socket, data, sizeof(data), 0); if (bytes < 0) return -1; @@ -289,10 +289,11 @@ int villas::node::nanomsg_netem_fds(NodeCompat *n, int fds[]) return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "nanomsg"; p.description = "scalability protocols library (libnanomsg)"; p.vectorize = 0; @@ -310,5 +311,6 @@ static void register_plugin() { p.poll_fds = nanomsg_poll_fds; p.netem_fds = nanomsg_netem_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/ngsi.cpp b/lib/nodes/ngsi.cpp index d3813afad..0353c286e 100644 --- a/lib/nodes/ngsi.cpp +++ b/lib/nodes/ngsi.cpp @@ -1,8 +1,9 @@ -/** Node type: OMA Next Generation Services Interface 9 (NGSI) (FIWARE context broker) +/* Node type: OMA Next Generation Services Interface 9 (NGSI) (FIWARE context broker) * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - **********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -27,7 +28,7 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -/* Some global settings */ +// Some global settings #if OPENSSL_VERSION_NUMBER < 0x010003000L // See: https://curl.haxx.se/libcurl/c/opensslthreadlock.html @@ -35,8 +36,10 @@ using namespace villas::utils; #endif #ifdef CURL_SSL_REQUIRES_LOCKING -/** This array will store all of the mutexes available to OpenSSL. */ -static pthread_mutex_t *mutex_buf = NULL; + +// This array will store all of the mutexes available to OpenSSL. +static +pthread_mutex_t *mutex_buf = NULL; static void handle_error(const char *file, int lineno, const char *msg) @@ -47,7 +50,7 @@ void handle_error(const char *file, int lineno, const char *msg) ERR_print_errors_fp(stderr); - /* exit(-1); */ + // exit(-1); } static @@ -64,7 +67,7 @@ unsigned long curl_ssl_thread_id_function(void) { return ((unsigned long) pthread_self()); } -#endif /* CURL_SSL_REQUIRES_LOCKING */ +#endif // CURL_SSL_REQUIRES_LOCKING enum NgsiFlags { NGSI_ENTITY_ATTRIBUTES_IN = (1 << 0), @@ -145,7 +148,7 @@ public: if (ret) throw ConfigError(json, err, "node-config-node-ngsi", "Failed to parse NGSI attribute"); - /* Copy values from node signal, if 'ngsi_attribute' settings not provided */ + // Copy values from node signal, if 'ngsi_attribute' settings not provided if (s && !nam) nam = !s->name.empty() ? s->name.c_str() : ""; @@ -167,7 +170,7 @@ public: metadata.emplace_back(json_metadata); } - /* Metadata: index(integer)=j */ + // Metadata: index(integer)=j metadata.emplace_back("index", "integer", fmt::format("{}", j)); } @@ -180,7 +183,7 @@ public: if (flags & NGSI_ENTITY_VALUES) { #if NGSI_VECTORS - /* Build value vector */ + // Build value vector json_t *json_value = json_array(); for (unsigned k = 0; k < cnt; k++) { @@ -205,7 +208,7 @@ public: json_object_set(json_attribute, "value", json_value); } - if (flags & NGSI_ENTITY_METADATA) { /* Create Metadata for attribute */ + if (flags & NGSI_ENTITY_METADATA) { // Create Metadata for attribute json_t *json_metadatas = json_array(); for (auto &meta : metadata) { @@ -299,7 +302,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const char *end; const char *value; - /* Parse JSON */ + // Parse JSON ret = json_unpack_ex(json_attr, &err, 0, "{ s: s, s: s, s: o, s?: o }", "name", &name, "type", &type, @@ -309,14 +312,14 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const if (ret) return -3; - /* Check attribute name and type */ + // Check attribute name and type attr = list_lookup_name(&i->in.signals, name); if (!attr || attr->type != type) - continue; /* skip unknown attributes */ + continue; // skip unknown attributes length++; - /* Check metadata */ + // Check metadata if (!json_is_array(json_metadata)) return -5; @@ -324,7 +327,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const json_t *json_tuple; const char *ts, *seq; - /* Check number of values */ + // Check number of values if (!json_is_array(json_value) || json_array_size(json_value) != cnt) return -6; @@ -332,7 +335,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const json_array_foreach(json_value, k, json_tuple) { struct Sample *smp = smps[k]; - /* Check sample format */ + // Check sample format if (!json_is_array(json_tuple) || json_array_size(json_tuple) != 3) return -7; @@ -353,7 +356,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const if (!sig) return -11; - if (value[0] == '\0') /* No data on Orion CB? -> Use init value */ + if (value[0] == '\0') // No data on Orion CB? -> Use init value *sd = sig->init; else { signal_data_parse_str(sd, sig->type, value, &end); @@ -364,7 +367,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const #else struct Sample *smp = smps[0]; - /* Check number of values */ + // Check number of values if (!json_is_string(json_value)) return -6; @@ -375,7 +378,7 @@ int ngsi_parse_entity(NodeCompat *n, json_t *json_entity, struct Sample * const if (!sig) return -11; - if (value[0] == '\0') /* No data on Orion CB? -> Use init value */ + if (value[0] == '\0') // No data on Orion CB? -> Use init value *data = sig->init; else { data->parseString(sig->type, value, &end); @@ -456,7 +459,7 @@ size_t ngsi_request_writer(void *contents, size_t size, size_t nmemb, void *user struct ngsi_response *mem = (struct ngsi_response *) userp; mem->data = (char *) realloc(mem->data, mem->len + realsize + 1); - if (mem->data == nullptr) /* out of memory! */ + if (mem->data == nullptr) // out of memory! throw MemoryAllocationError(); memcpy(&(mem->data[mem->len]), contents, realsize); @@ -486,7 +489,7 @@ int ngsi_request(CURL *handle, const char *endpoint, const char *operation, json logger->debug("Request to context broker: {}\n{}", url, post); - /* We don't want to leave the handle in an invalid state */ + // We don't want to leave the handle in an invalid state pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old); CURLcode ret = curl_easy_perform(handle); pthread_setcancelstate(old, nullptr); @@ -579,7 +582,7 @@ int villas::node::ngsi_type_start(villas::node::SuperNode *sn) auto logger = logging.get("curl"); logger->info("Setup libcurl/openssl locking primitives"); -#endif /* CURL_SSL_REQUIRES_LOCKING */ +#endif // CURL_SSL_REQUIRES_LOCKING return curl_global_init(CURL_GLOBAL_ALL); } @@ -597,7 +600,7 @@ int villas::node::ngsi_type_stop() pthread_mutex_destroy(&mutex_buf[i]); delete mutex_buf; -#endif /* CURL_SSL_REQUIRES_LOCKING */ +#endif // CURL_SSL_REQUIRES_LOCKING curl_global_cleanup(); @@ -674,7 +677,7 @@ int villas::node::ngsi_start(NodeCompat *n) i->headers = curl_slist_append(i->headers, buf); } - /* Create task */ + // Create task if (i->timeout > 1 / i->rate) n->logger->warn("Timeout is to large for given rate: {}", i->rate); @@ -692,7 +695,7 @@ int villas::node::ngsi_start(NodeCompat *n) curl_easy_setopt(handles[p], CURLOPT_USERAGENT, HTTP_USER_AGENT); } - /* Create entity and atributes */ + // Create entity and atributes if (i->create) { json_t *json_entity = ngsi_build_entity(n, nullptr, 0, NGSI_ENTITY_ATTRIBUTES | NGSI_ENTITY_METADATA); @@ -713,7 +716,7 @@ int villas::node::ngsi_stop(NodeCompat *n) i->task.stop(); - /* Delete complete entity (not just attributes) */ + // Delete complete entity (not just attributes) json_t *json_entity = ngsi_build_entity(n, nullptr, 0, 0); ret = ngsi_request_context_update(i->out.curl, i->endpoint, "DELETE", json_entity, n->logger); @@ -790,11 +793,11 @@ int villas::node::ngsi_init(NodeCompat *n) if (ret) return ret; - /* Default values */ - i->access_token = nullptr; /* disabled by default */ - i->ssl_verify = 1; /* verify by default */ - i->timeout = 1; /* default value */ - i->rate = 1; /* default value */ + // Default values + i->access_token = nullptr; // disabled by default + i->ssl_verify = 1; // verify by default + i->timeout = 1; // default value + i->rate = 1; // default value return 0; } @@ -804,7 +807,6 @@ int villas::node::ngsi_destroy(NodeCompat *n) int ret; auto *i = n->getData(); - for (size_t j = 0; j < list_length(&i->in.signals); j++) { auto *attr = (NgsiAttribute *) list_at(&i->in.signals, j); @@ -840,15 +842,15 @@ int villas::node::ngsi_reverse(NodeCompat *n) return 0; } +static +NodeCompatType p; -static NodeCompatType p; - -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "ngsi"; p.description = "OMA Next Generation Services Interface 10 (libcurl, libjansson)"; #ifdef NGSI_VECTORS - p.vectorize = 0, /* unlimited */ + p.vectorize = 0, // unlimited #else p.vectorize = 1, #endif @@ -866,5 +868,6 @@ static void register_plugin() { p.poll_fds = ngsi_poll_fds; p.reverse = ngsi_reverse; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/opal.cpp b/lib/nodes/opal.cpp index 1341c40cd..94d90ea6e 100644 --- a/lib/nodes/opal.cpp +++ b/lib/nodes/opal.cpp @@ -1,11 +1,11 @@ -/** Node type: OPAL (AsyncApi) +/* Node type: OPAL (AsyncApi) * * This file implements the opal subtype for nodes. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -29,22 +29,27 @@ extern "C" { #include } +// Private static storage +static +std::string asyncShmemName; // Shared Memory identifiers and size, provided via argv. +static +std::string printShmemName; // Shared Memory identifiers and size, provided via argv. +static +size_t asyncShmemSize; // Shared Memory identifiers and size, provided via argv. -/* Private static storage */ -static std::string asyncShmemName; /**< Shared Memory identifiers and size, provided via argv. */ -static std::string printShmemName; /**< Shared Memory identifiers and size, provided via argv. */ -static size_t asyncShmemSize; /**< Shared Memory identifiers and size, provided via argv. */ +static +std::vector sendIDs, recvIDs; // A dynamically allocated array of SendIDs. -static std::vector sendIDs, recvIDs; /** A dynamically allocated array of SendIDs. */ +static +Opal_GenAsyncParam_Ctrl params; // String and Float parameters, provided by the OPAL AsyncProcess block. -static Opal_GenAsyncParam_Ctrl params; /** String and Float parameters, provided by the OPAL AsyncProcess block. */ - -static pthread_mutex_t lock; /** Big Global Lock for libOpalAsync API */ +static +pthread_mutex_t lock; // Big Global Lock for libOpalAsync API using namespace villas; using namespace villas::utils; -/** A bunch of symbols which are used by the libOpal libraries +/* A bunch of symbols which are used by the libOpal libraries * and undefined by GCC. We replace them by GCC variants here. */ extern "C" { @@ -107,12 +112,12 @@ int villas::node::opal_type_start(villas::node::SuperNode *sn) pthread_mutex_init(&lock, nullptr); - /* Enable the OpalPrint function. This prints to the OpalDisplay. */ + // Enable the OpalPrint function. This prints to the OpalDisplay. err = OpalSystemCtrl_Register((char *) printShmemName.c_str()); if (err != EOK) throw RuntimeError("OpalPrint() access not available ({})", err); - /* Open Share Memory created by the model. */ + // Open Share Memory created by the model. err = OpalOpenAsyncMem(asyncShmemSize, asyncShmemName.c_str()); if (err != EOK) throw RuntimeError("Model shared memory not available ({})", err); @@ -121,7 +126,7 @@ int villas::node::opal_type_start(villas::node::SuperNode *sn) if (err != EOK) throw RuntimeError("Could not get OPAL controller parameters ({})", err); - /* Get list of Send and RecvIDs */ + // Get list of Send and RecvIDs err = OpalGetNbAsyncSendIcon(&noSendIcons); if (err != EOK) throw RuntimeError("Failed to get number of send blocks ({})", err); @@ -216,7 +221,7 @@ char * villas::node::opal_print(NodeCompat *n) { auto *o = n->getData(); - /** @todo Print send_params, recv_params */ + // @todo Print send_params, recv_params return strf("sendID=%u, recvID=%u, reply=%u", o->sendID, o->recvID, o->reply); @@ -226,7 +231,7 @@ int villas::node::opal_start(NodeCompat *n) { auto *o = n->getData(); - /* Search for valid send and recv ids */ + // Search for valid send and recv ids int sfound = 0, rfound = 0; for (auto i : sendIDs) sfound += i == o->sendID; @@ -238,7 +243,7 @@ int villas::node::opal_start(NodeCompat *n) if (!rfound) throw RuntimeError("Invalid recv_id '{}'", o->recvID); - /* Get some more informations and paramters from OPAL-RT */ + // Get some more informations and paramters from OPAL-RT OpalGetAsyncSendIconMode(&o->mode, o->sendID); OpalGetAsyncSendParameters(&o->sendParams, sizeof(Opal_SendAsyncParam), o->sendID); OpalGetAsyncRecvParameters(&o->recvParams, sizeof(Opal_RecvAsyncParam), o->recvID); @@ -262,7 +267,7 @@ int villas::node::opal_read(NodeCompat *n, struct Sample * const smps[], unsigne if (cnt != 1) throw RuntimeError("The OPAL-RT node type does not support combining!"); - /* This call unblocks when the 'Data Ready' line of a send icon is asserted. */ + // This call unblocks when the 'Data Ready' line of a send icon is asserted. do { ret = OpalWaitForAsyncSendRequest(&id); if (ret != EOK) { @@ -270,14 +275,14 @@ int villas::node::opal_read(NodeCompat *n, struct Sample * const smps[], unsigne if ((state == STATE_RESET) || (state == STATE_STOP)) throw RuntimeError("OpalGetAsyncModelState(): Model stopped or resetted!"); - return -1; /* @todo correct return value */ + return -1; // @todo correct return value } } while (id != o->sendID); - /* No errors encountered yet */ + // No errors encountered yet OpalSetAsyncSendIconError(0, o->sendID); - /* Get the size of the data being sent by the unblocking SendID */ + // Get the size of the data being sent by the unblocking SendID OpalGetAsyncSendIconDataLength(&len, o->sendID); if ((unsigned) len > s->capacity * sizeof(s->data[0])) { n->logger->warn("Ignoring the last {} of {} values for OPAL (send_id={}).", @@ -286,14 +291,14 @@ int villas::node::opal_read(NodeCompat *n, struct Sample * const smps[], unsigne len = sizeof(data); } - /* Read data from the model */ + // Read data from the model OpalGetAsyncSendIconData(data, len, o->sendID); s->sequence = htons(o->sequenceNo++); s->length = (unsigned) len / sizeof(double); for (unsigned i = 0; i < s->length; i++) - s->data[i].f = (float) data[i]; /* OPAL provides double precission */ + s->data[i].f = (float) data[i]; // OPAL provides double precission /* This next call allows the execution of the "asynchronous" process * to actually be synchronous with the model. To achieve this, you @@ -330,26 +335,27 @@ int villas::node::opal_write(NodeCompat *n, struct Sample * const smps[], unsign if ((state == STATE_RESET) || (state == STATE_STOP)) throw RuntimeError("OpalGetAsyncModelState(): Model stopped or resetted!"); - OpalSetAsyncRecvIconStatus(s->sequence, o->recvID); /* Set the Status to the message ID */ - OpalSetAsyncRecvIconError(0, o->recvID); /* Set the Error to 0 */ + OpalSetAsyncRecvIconStatus(s->sequence, o->recvID); // Set the Status to the message ID + OpalSetAsyncRecvIconError(0, o->recvID); // Set the Error to 0 - /* Get the number of signals to send back to the model */ + // Get the number of signals to send back to the model OpalGetAsyncRecvIconDataLength(&len, o->recvID); if (len > (int) sizeof(data)) n->logger->warn("Node expecting more signals ({}) than values in message ({})", len / sizeof(double), s->length); for (unsigned i = 0; i < s->length; i++) - data[i] = (double) s->data[i].f; /* OPAL expects double precission */ + data[i] = (double) s->data[i].f; // OPAL expects double precission OpalSetAsyncRecvIconData(data, s->length * sizeof(double), o->recvID); return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "opal"; p.description = "run as OPAL Asynchronous Process (libOpalAsyncApi)"; p.vectorize = 1; @@ -362,5 +368,6 @@ static void register_plugin() { p.read = opal_read; p.write = opal_write; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/redis.cpp b/lib/nodes/redis.cpp index ec33a83ca..600f01e25 100644 --- a/lib/nodes/redis.cpp +++ b/lib/nodes/redis.cpp @@ -1,9 +1,9 @@ -/** Redis node-type +/* Redis node-type * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -27,18 +27,21 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -/* Forward declartions */ -static NodeCompatType p; -static void redis_on_message(NodeCompat *n, const std::string &channel, const std::string &msg); +// Forward declartions +static +NodeCompatType p; +static +void redis_on_message(NodeCompat *n, const std::string &channel, const std::string &msg); -static std::unordered_map connections; +static +std::unordered_map connections; RedisConnection::RedisConnection(const sw::redis::ConnectionOptions &opts) : context(opts), subscriber(context.subscriber()), logger(logging.get("nodes:redis")) { - /* Enable keyspace notifications */ + // Enable keyspace notifications context.command("config", "set", "notify-keyspace-events", "K$h"); subscriber.on_message([this](const std::string &channel, const std::string &msg) { @@ -102,7 +105,7 @@ void RedisConnection::unsubscribe(NodeCompat *n, const std::string &channel) void RedisConnection::start() { if (state == State::RUNNING) - return; /* Already running */ + return; // Already running state = State::RUNNING; @@ -135,7 +138,7 @@ void RedisConnection::loop() catch (const sw::redis::Error &e) { logger->error("Error: {}. Recreating subscriber", e.what()); - /* Create a new subscriber */ + // Create a new subscriber subscriber = context.subscriber(); } } @@ -384,10 +387,10 @@ int villas::node::redis_parse(NodeCompat *n, json_t *json) r->options.tls.sni = host; #else throw ConfigError(json_ssl, "node-config-node-redis-ssl", "This built of the redis++ library does not support SSL"); -#endif /* REDISPP_WITH_TLS */ +#endif // REDISPP_WITH_TLS } - /* Mode */ + // Mode if (mode) { if (!strcmp(mode, "key") || !strcmp(mode, "set-get")) r->mode = RedisMode::KEY; @@ -399,7 +402,7 @@ int villas::node::redis_parse(NodeCompat *n, json_t *json) throw ConfigError(json, "node-config-node-redis-mode", "Invalid Redis mode: {}", mode); } - /* Format */ + // Format if (r->formatter) delete r->formatter; r->formatter = json_format @@ -416,7 +419,7 @@ int villas::node::redis_parse(NodeCompat *n, json_t *json) if (notify >= 0) r->notify = notify != 0; - /* Connection options */ + // Connection options if (uri) r->options = make_redis_connection_options(uri); @@ -568,7 +571,7 @@ int villas::node::redis_read(NodeCompat *n, struct Sample * const smps[], unsign { auto *r = n->getData(); - /* Wait for new data */ + // Wait for new data if (r->notify || r->mode == RedisMode::CHANNEL) { int pulled_cnt; struct Sample *pulled_smps[cnt]; @@ -624,7 +627,7 @@ int villas::node::redis_write(NodeCompat *n, struct Sample * const smps[], unsig } case RedisMode::HASH: { - /* We only update the signals with their latest value here. */ + // We only update the signals with their latest value here. struct Sample *smp = smps[cnt - 1]; std::unordered_map kvs; @@ -656,8 +659,8 @@ int villas::node::redis_poll_fds(NodeCompat *n, int fds[]) return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "redis"; p.description = "Redis key-value store"; p.vectorize = 0; @@ -674,5 +677,6 @@ static void register_plugin() { p.write = redis_write; p.poll_fds = redis_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/rtp.cpp b/lib/nodes/rtp.cpp index f44eb1fab..ff8cf1d94 100644 --- a/lib/nodes/rtp.cpp +++ b/lib/nodes/rtp.cpp @@ -1,10 +1,10 @@ -/** Node type: Real-time Protocol (RTP) +/* Node type: Real-time Protocol (RTP) * - * @author Steffen Vogel - * @author Marvin Klimke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Marvin Klimke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -34,17 +34,20 @@ extern "C" { #ifdef WITH_NETEM #include -#endif /* WITH_NETEM */ +#endif // WITH_NETEM -static pthread_t re_pthread; +static +pthread_t re_pthread; using namespace villas; using namespace villas::utils; using namespace villas::node; using namespace villas::kernel; -static NodeCompatType p; -static NodeCompatFactory ncp(&p); +static +NodeCompatType p; +static +NodeCompatFactory ncp(&p); static int rtp_aimd(NodeCompat *n, double loss_frac) @@ -82,7 +85,7 @@ int villas::node::rtp_init(NodeCompat *n) n->logger = villas::logging.get("node:rtp"); - /* Default values */ + // Default values r->aimd.a = 10; r->aimd.b = 0.5; r->aimd.Kp = 1; @@ -140,7 +143,7 @@ int villas::node::rtp_parse(NodeCompat *n, json_t *json) if (ret) throw ConfigError(json, err, "node-config-node-rtp"); - /* AIMD */ + // AIMD if (json_aimd) { ret = json_unpack_ex(json_aimd, &err, 0, "{ s?: F, s?: F, s?: F, s?: F, s?: F, s?: F, s?: F, s?: F, s?: s, s?: s }", "a", &r->aimd.a, @@ -157,7 +160,7 @@ int villas::node::rtp_parse(NodeCompat *n, json_t *json) if (ret) throw ConfigError(json_aimd, err, "node-config-node-rtp-aimd"); - /* AIMD Hook type */ + // AIMD Hook type if (!r->rtcp.enabled) r->aimd.rate_hook_type = RTPHookType::DISABLED; else if (hook_type) { @@ -175,7 +178,7 @@ int villas::node::rtp_parse(NodeCompat *n, json_t *json) if (log) r->aimd.log_filename = strdup(log); - /* Format */ + // Format if (r->formatter) delete r->formatter; r->formatter = json_format @@ -184,29 +187,29 @@ int villas::node::rtp_parse(NodeCompat *n, json_t *json) if (!r->formatter) throw ConfigError(json_format, "node-config-node-rtp-format", "Invalid format configuration"); - /* Remote address */ + // Remote address ret = sa_decode(&r->out.saddr_rtp, remote, strlen(remote)); if (ret) throw RuntimeError("Failed to resolve remote address '{}': {}", remote, strerror(ret)); - /* Assign even port number to RTP socket, next odd number to RTCP socket */ + // Assign even port number to RTP socket, next odd number to RTCP socket port = sa_port(&r->out.saddr_rtp) & ~1; sa_set_sa(&r->out.saddr_rtcp, &r->out.saddr_rtp.u.sa); sa_set_port(&r->out.saddr_rtp, port); sa_set_port(&r->out.saddr_rtcp, port+1); - /* Local address */ + // Local address ret = sa_decode(&r->in.saddr_rtp, local, strlen(local)); if (ret) throw RuntimeError("Failed to resolve local address '{}': {}", local, strerror(ret)); - /* Assign even port number to RTP socket, next odd number to RTCP socket */ + // Assign even port number to RTP socket, next odd number to RTCP socket port = sa_port(&r->in.saddr_rtp) & ~1; sa_set_sa(&r->in.saddr_rtcp, &r->in.saddr_rtp.u.sa); sa_set_port(&r->in.saddr_rtp, port); sa_set_port(&r->in.saddr_rtcp, port+1); - /** @todo parse * in addresses */ + /* @todo parse * in addresses */ return 0; } @@ -260,7 +263,7 @@ void rtp_handler(const struct sa *src, const struct rtp_header *hdr, struct mbuf auto *n = (NodeCompat *) arg; auto *r = n->getData(); - /* source, header not used */ + // source, header not used (void) src; (void) hdr; @@ -279,7 +282,7 @@ void rtcp_handler(const struct sa *src, struct rtcp_msg *msg, void *arg) auto *n = (NodeCompat *) arg; auto *r = n->getData(); - /* source not used */ + // source not used (void) src; n->logger->debug("RTCP: recv {}", rtcp_type_name((enum rtcp_type) msg->hdr.pt)); @@ -313,15 +316,15 @@ int villas::node::rtp_start(NodeCompat *n) int ret; auto *r = n->getData(); - /* Initialize queue */ + // Initialize queue ret = queue_signalled_init(&r->recv_queue, 1024, &memory::heap); if (ret) return ret; - /* Initialize IO */ + // Initialize IO r->formatter->start(n->getInputSignals(false), ~(int) SampleFlags::HAS_OFFSET); - /* Initialize memory buffer for sending */ + // Initialize memory buffer for sending r->send_mb = mbuf_alloc(RTP_INITIAL_BUFFER_LEN); if (!r->send_mb) return -1; @@ -330,7 +333,7 @@ int villas::node::rtp_start(NodeCompat *n) if (ret) return -1; - /* Initialize AIMD hook */ + // Initialize AIMD hook if (r->aimd.rate_hook_type != RTPHookType::DISABLED) { #ifdef WITH_HOOKS switch (r->aimd.rate_hook_type) { @@ -365,11 +368,11 @@ int villas::node::rtp_start(NodeCompat *n) r->aimd.rate_pid = villas::dsp::PID(dt, r->aimd.rate_source, r->aimd.rate_min, r->aimd.Kp, r->aimd.Ki, r->aimd.Kd); - /* Initialize RTP socket */ + // Initialize RTP socket uint16_t port = sa_port(&r->in.saddr_rtp) & ~1; ret = rtp_listen(&r->rs, IPPROTO_UDP, &r->in.saddr_rtp, port, port+1, r->rtcp.enabled, rtp_handler, rtcp_handler, n); - /* Start RTCP session */ + // Start RTCP session if (r->rtcp.enabled) { r->rtcp.num_rrs = 0; @@ -381,7 +384,7 @@ int villas::node::rtp_start(NodeCompat *n) time_t ts = time(nullptr); struct tm tm; - /* Convert time */ + // Convert time gmtime_r(&ts, &tm); strftime(fn, sizeof(fn), r->aimd.log_filename, &tm); @@ -449,12 +452,12 @@ int villas::node::rtp_type_start(villas::node::SuperNode *sn) { int ret; - /* Initialize library */ + // Initialize library ret = libre_init(); if (ret) throw RuntimeError("Error initializing libre"); - /* Add worker thread */ + // Add worker thread ret = pthread_create(&re_pthread, nullptr, (pthread_start_routine) re_main, nullptr); if (ret) throw RuntimeError("Error creating rtp node type pthread"); @@ -481,7 +484,7 @@ int villas::node::rtp_type_start(villas::node::SuperNode *sn) j->addNode(n); } } -#endif /* WITH_NETEM */ +#endif // WITH_NETEM return 0; } @@ -490,7 +493,7 @@ int villas::node::rtp_type_stop() { int ret; - /* Join worker thread */ + // Join worker thread pthread_kill(re_pthread, SIGUSR1); ret = pthread_join(re_pthread, nullptr); if (ret) @@ -507,12 +510,12 @@ int villas::node::rtp_read(NodeCompat *n, struct Sample * const smps[], unsigned auto *r = n->getData(); struct mbuf *mb; - /* Get data from queue */ + // Get data from queue ret = queue_signalled_pull(&r->recv_queue, (void **) &mb); if (ret < 0) throw RuntimeError("Failed to pull from queue"); - /* Unpack data */ + // Unpack data ret = r->formatter->sscan((char *) mb->buf + mb->pos, mbuf_get_left(mb), nullptr, smps, cnt); mem_deref(mb); @@ -548,7 +551,7 @@ retry: mbuf_set_pos(r->send_mb, RTP_HEADER_SIZE); mbuf_set_pos(r->send_mb, RTP_HEADER_SIZE); - /* Send dataset */ + // Send dataset ret = rtp_send(r->rs, &r->out.saddr_rtp, false, false, RTP_PACKET_TYPE, ts, 0, r->send_mb); if (ret) throw RuntimeError("Error from rtp_send, reason: {}", ret); @@ -565,8 +568,8 @@ int villas::node::rtp_poll_fds(NodeCompat *n, int fds[]) return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "rtp"; #ifdef WITH_NETEM p.description = "real-time transport protocol (libre, libnl3 netem support)"; diff --git a/lib/nodes/shmem.cpp b/lib/nodes/shmem.cpp index 88d4bc4a7..f2252f8d8 100644 --- a/lib/nodes/shmem.cpp +++ b/lib/nodes/shmem.cpp @@ -1,10 +1,9 @@ -/** Node-type for shared memory communication. +/* Node-type for shared memory communication. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -30,7 +29,7 @@ int villas::node::shmem_init(NodeCompat *n) { auto *shm = n->getData(); - /* Default values */ + // Default values shm->conf.queuelen = -1; shm->conf.samplelen = -1; shm->conf.polling = false; @@ -164,7 +163,7 @@ int villas::node::shmem_read(NodeCompat *n, struct Sample * const smps[], unsign sample_copy_many(smps, shared_smps, recv); sample_decref_many(shared_smps, recv); - /** @todo signal descriptions are currently not shared between processes */ + // @todo signal descriptions are currently not shared between processes for (int i = 0; i < recv; i++) smps[i]->signals = n->getInputSignals(false); @@ -174,7 +173,7 @@ int villas::node::shmem_read(NodeCompat *n, struct Sample * const smps[], unsign int villas::node::shmem_write(NodeCompat *n, struct Sample * const smps[], unsigned cnt) { auto *shm = n->getData(); - struct Sample *shared_smps[cnt]; /* Samples need to be copied to the shared pool first */ + struct Sample *shared_smps[cnt]; // Samples need to be copied to the shared pool first int avail, pushed, copied; avail = sample_alloc_many(&shm->intf.write.shared->pool, shared_smps, cnt); @@ -212,10 +211,11 @@ char * villas::node::shmem_print(NodeCompat *n) return buf; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "shmem"; p.description = "POSIX shared memory interface with external processes"; p.vectorize = 0; @@ -229,5 +229,6 @@ static void register_plugin() { p.prepare = shmem_prepare; p.init = shmem_init; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/signal.cpp b/lib/nodes/signal.cpp index c2a9400d1..798569229 100644 --- a/lib/nodes/signal.cpp +++ b/lib/nodes/signal.cpp @@ -1,10 +1,9 @@ -/** Node-type for signal generation. +/* Node-type for signal generation. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -270,7 +269,7 @@ int SignalNode::start() for (auto sig : signals) sig.start(); - /* Setup task */ + // Setup task if (rt) task.setRate(rate); @@ -339,9 +338,9 @@ int SignalNode::_read(struct Sample *smps[], unsigned cnt) return -1; } - /* Throttle output if desired */ + // Throttle output if desired if (rt) { - /* Block until 1/p->rate seconds elapsed */ + // Block until 1/p->rate seconds elapsed steps = task.wait(); if (steps > 1 && monitor_missed) { logger->debug("Missed steps: {}", steps-1); @@ -377,6 +376,7 @@ std::vector SignalNode::getPollFDs() return {}; } +// Register node static char n[] = "signal.v2"; static char d[] = "Signal generator"; static NodePlugin p; diff --git a/lib/nodes/signal_v1.cpp b/lib/nodes/signal_v1.cpp index be94579b0..f9d17b0e6 100644 --- a/lib/nodes/signal_v1.cpp +++ b/lib/nodes/signal_v1.cpp @@ -1,10 +1,9 @@ -/** Node-type for signal generation. +/* Node-type for signal generation. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -304,7 +303,7 @@ int villas::node::signal_node_start(NodeCompat *n) for (unsigned i = 0; i < s->values; i++) s->last[i] = s->offset[i]; - /* Setup task */ + // Setup task if (s->rt) s->task.setRate(s->rate); @@ -405,9 +404,9 @@ int villas::node::signal_node_read(NodeCompat *n, struct Sample * const smps[], return -1; } - /* Throttle output if desired */ + // Throttle output if desired if (s->rt) { - /* Block until 1/p->rate seconds elapsed */ + // Block until 1/p->rate seconds elapsed steps = s->task.wait(); if (steps > 1 && s->monitor_missed) { n->logger->debug("Missed steps: {}", steps-1); @@ -446,10 +445,11 @@ int villas::node::signal_node_poll_fds(NodeCompat *n, int fds[]) return 0; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "signal"; p.description = "Legacy Signal generator"; p.vectorize = 1; @@ -465,5 +465,6 @@ static void register_plugin() { p.read = signal_node_read; p.poll_fds = signal_node_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/socket.cpp b/lib/nodes/socket.cpp index ab09dd00f..2d880fa37 100644 --- a/lib/nodes/socket.cpp +++ b/lib/nodes/socket.cpp @@ -1,9 +1,9 @@ -/** The socket node-type for Layer 2, 3, 4 BSD-style sockets +/* The socket node-type for Layer 2, 3, 4 BSD-style sockets * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -21,21 +21,23 @@ #ifdef WITH_SOCKET_LAYER_ETH #include -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH #ifdef WITH_NETEM #include #include -#endif /* WITH_NETEM */ +#endif // WITH_NETEM using namespace villas; using namespace villas::utils; using namespace villas::node; using namespace villas::kernel; -/* Forward declartions */ -static NodeCompatType p; -static NodeCompatFactory ncp(&p); +// Forward declartions +static +NodeCompatType p; +static +NodeCompatFactory ncp(&p); int villas::node::socket_type_start(villas::node::SuperNode *sn) { @@ -49,13 +51,13 @@ int villas::node::socket_type_start(villas::node::SuperNode *sn) if (s->layer == SocketLayer::UNIX) continue; - /* Determine outgoing interface */ + // Determine outgoing interface Interface *j = Interface::getEgress((struct sockaddr *) &s->out.saddr, sn); j->addNode(n); } } -#endif /* WITH_NETEM */ +#endif // WITH_NETEM return 0; } @@ -132,7 +134,7 @@ int villas::node::socket_check(NodeCompat *n) { auto *s = n->getData(); - /* Some checks on the addresses */ + // Some checks on the addresses if (s->layer != SocketLayer::UNIX) { if (s->in.saddr.sa.sa_family != s->out.saddr.sa.sa_family) throw RuntimeError("Address families of local and remote must match!"); @@ -150,7 +152,7 @@ int villas::node::socket_check(NodeCompat *n) if (ntohs(s->in.saddr.sll.sll_protocol) <= 0x5DC) throw RuntimeError("Ethertype must be large than {} or it is interpreted as an IEEE802.3 length field!", 0x5DC); } -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH if (s->multicast.enabled) { if (s->in.saddr.sa.sa_family != AF_INET) @@ -169,10 +171,10 @@ int villas::node::socket_start(NodeCompat *n) auto *s = n->getData(); int ret; - /* Initialize IO */ + // Initialize IO s->formatter->start(n->getInputSignals(false), ~(int) SampleFlags::HAS_OFFSET); - /* Create socket */ + // Create socket switch (s->layer) { case SocketLayer::UDP: s->sd = socket(s->in.saddr.sa.sa_family, SOCK_DGRAM, IPPROTO_UDP); @@ -186,7 +188,7 @@ int villas::node::socket_start(NodeCompat *n) case SocketLayer::ETH: s->sd = socket(s->in.saddr.sa.sa_family, SOCK_DGRAM, s->in.saddr.sll.sll_protocol); break; -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH case SocketLayer::UNIX: s->sd = socket(s->in.saddr.sa.sa_family, SOCK_DGRAM, 0); @@ -199,14 +201,14 @@ int villas::node::socket_start(NodeCompat *n) if (s->sd < 0) throw SystemError("Failed to create socket"); - /* Delete Unix domain socket if already existing */ + // Delete Unix domain socket if already existing if (s->layer == SocketLayer::UNIX) { ret = unlink(s->in.saddr.sun.sun_path); if (ret && errno != ENOENT) return ret; } - /* Bind socket for receiving */ + // Bind socket for receiving socklen_t addrlen = 0; switch(s->in.saddr.ss.ss_family) { case AF_INET: @@ -225,7 +227,7 @@ int villas::node::socket_start(NodeCompat *n) case AF_PACKET: addrlen = sizeof(struct sockaddr_ll); break; -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH default: addrlen = sizeof(s->in.saddr); } @@ -248,7 +250,7 @@ int villas::node::socket_start(NodeCompat *n) throw SystemError("Failed to join multicast group"); } - /* Set socket priority, QoS or TOS IP options */ + // Set socket priority, QoS or TOS IP options int prio; switch (s->layer) { case SocketLayer::UDP: @@ -270,7 +272,7 @@ int villas::node::socket_start(NodeCompat *n) break; #else { } -#endif /* __linux__ */ +#endif // __linux__ } s->out.buflen = SOCKET_INITIAL_BUFFER_LEN; @@ -333,7 +335,7 @@ int villas::node::socket_read(NodeCompat *n, struct Sample * const smps[], unsig union sockaddr_union src; socklen_t srclen = sizeof(src); - /* Receive next sample */ + // Receive next sample bytes = recvfrom(s->sd, s->in.buf, s->in.buflen, 0, &src.sa, &srclen); if (bytes < 0) { if (errno == EINTR) @@ -346,7 +348,7 @@ int villas::node::socket_read(NodeCompat *n, struct Sample * const smps[], unsig ptr = s->in.buf; - /* Strip IP header from packet */ + // Strip IP header from packet if (s->layer == SocketLayer::IP) { struct ip *iphdr = (struct ip *) ptr; @@ -413,7 +415,7 @@ retry: ret = s->formatter->sprint(s->out.buf, s->out.buflen, &wbytes, smps, cnt) goto retry; } - /* Send message */ + // Send message socklen_t addrlen = 0; switch(s->in.saddr.ss.ss_family) { case AF_INET: @@ -432,7 +434,7 @@ retry: ret = s->formatter->sprint(s->out.buf, s->out.buflen, &wbytes, smps, cnt) case AF_PACKET: addrlen = sizeof(struct sockaddr_ll); break; -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH default: addrlen = sizeof(s->in.saddr); } @@ -467,7 +469,7 @@ int villas::node::socket_parse(NodeCompat *n, json_t *json) json_t *json_multicast = nullptr; json_t *json_format = nullptr; - /* Default values */ + // Default values s->layer = SocketLayer::UDP; s->verify_source = 0; @@ -484,7 +486,7 @@ int villas::node::socket_parse(NodeCompat *n, json_t *json) if (ret) throw ConfigError(json, err, "node-config-node-socket"); - /* Format */ + // Format if (s->formatter) delete s->formatter; s->formatter = json_format @@ -493,14 +495,14 @@ int villas::node::socket_parse(NodeCompat *n, json_t *json) if (!s->formatter) throw ConfigError(json_format, "node-config-node-socket-format", "Invalid format configuration"); - /* IP layer */ + // IP layer if (layer) { if (!strcmp(layer, "ip")) s->layer = SocketLayer::IP; #ifdef WITH_SOCKET_LAYER_ETH else if (!strcmp(layer, "eth")) s->layer = SocketLayer::ETH; -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH else if (!strcmp(layer, "udp")) s->layer = SocketLayer::UDP; else if (!strcmp(layer, "unix") || !strcmp(layer, "local")) @@ -520,7 +522,7 @@ int villas::node::socket_parse(NodeCompat *n, json_t *json) if (json_multicast) { const char *group, *interface = nullptr; - /* Default values */ + // Default values s->multicast.enabled = true; s->multicast.mreq.imr_interface.s_addr = INADDR_ANY; s->multicast.loop = 0; @@ -559,8 +561,8 @@ int villas::node::socket_fds(NodeCompat *n, int fds[]) return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "socket"; #ifdef WITH_NETEM p.description = "BSD network sockets for Ethernet / IP / UDP (libnl3, netem support)"; diff --git a/lib/nodes/stats.cpp b/lib/nodes/stats.cpp index c130dfdd1..000915f9c 100644 --- a/lib/nodes/stats.cpp +++ b/lib/nodes/stats.cpp @@ -1,9 +1,9 @@ -/** Sending statistics to another node. +/* Sending statistics to another node. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,7 +20,8 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -static NodeList nodes; /** The global list of nodes */ +static +NodeList nodes; // The global list of nodes int villas::node::stats_node_signal_destroy(struct stats_node_signal *s) { @@ -86,7 +87,7 @@ int villas::node::stats_node_prepare(NodeCompat *n) assert(n->getInputSignals(false)->size() == 0); - /* Generate signal list */ + // Generate signal list for (size_t i = 0; i < list_length(&s->signals); i++) { struct stats_node_signal *stats_sig = (struct stats_node_signal *) list_at(&s->signals, i); @@ -241,10 +242,11 @@ int villas::node::stats_node_poll_fds(NodeCompat *n, int fds[]) return 0; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "stats"; p.description = "Send statistics to another node"; p.vectorize = 1; @@ -261,5 +263,6 @@ static void register_plugin() { p.read = stats_node_read; p.poll_fds = stats_node_poll_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/temper.cpp b/lib/nodes/temper.cpp index 25c5a76a3..20e61316f 100644 --- a/lib/nodes/temper.cpp +++ b/lib/nodes/temper.cpp @@ -1,33 +1,19 @@ -/** PCSensor / TEMPer node-type +/* PCSensor / TEMPer node-type * - * Based on pcsensor.c by Juan Carlos Perez (c) 2011 (cray@isp-sl.com) - * Based on Temper.c by Robert Kavaler (c) 2009 (relavak.com) + * The driver will work with some TEMPer usb devices from RDing (www.PCsensor.com). + * + * Based on pcsensor.c by Juan Carlos Perez + * Based on Temper.c by Robert Kavaler + * + * SPDX-FileCopyrightText: 2011 Juan Carlos Perez + * SPDX-FileCopyrightText: 2009 Robert Kavaler (relavak.com) + * SPDX-License-Identifier: BSD-1-Clause * * All rights reserved. * * 2011/08/30 Thanks to EdorFaus: bugfix to support negative temperatures * 2017/08/30 Improved by K.Cima: changed libusb-0.1 -> libusb-1.0 * https://github.com/shakemid/pcsensor - * - * Temper driver for linux. This program can be compiled either as a library - * or as a standalone program (-DUNIT_TEST). The driver will work with some - * TEMPer usb devices from RDing (www.PCsensor.com). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY Juan Carlos Perez ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Robert kavaler BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include @@ -39,15 +25,18 @@ using namespace villas; using namespace villas::utils; using namespace villas::node; -static Logger logger; +static +Logger logger; -static std::list devices; +static +std::list devices; -static struct libusb_context *context; - -/* Forward declartions */ -static NodeCompatType p; +static +struct libusb_context *context; +// Forward declartions +static +NodeCompatType p; TEMPerDevice::TEMPerDevice(struct libusb_device *dev) : usb::Device(dev), @@ -97,7 +86,7 @@ void TEMPerDevice::read(struct Sample *smp) float temp[2]; int i = 0, al, ret; - /* Read from device */ + // Read from device unsigned char question[sizeof(question_temperature)]; memcpy(question, question_temperature, sizeof(question_temperature)); @@ -113,14 +102,14 @@ void TEMPerDevice::read(struct Sample *smp) decode(answer, temp); - /* Temperature 1 */ + // Temperature 1 smp->data[i++].f = temp[0]; - /* Temperature 2 */ + // Temperature 2 if (getNumSensors() == 2) smp->data[i++].f = temp[1]; - /* Humidity */ + // Humidity if (hasHumiditySensor()) smp->data[i++].f = temp[1]; @@ -129,7 +118,7 @@ void TEMPerDevice::read(struct Sample *smp) smp->flags |= (int) SampleFlags::HAS_DATA; } -/* Thanks to https://github.com/edorfaus/TEMPered */ +// Thanks to https://github.com/edorfaus/TEMPered void TEMPer1Device::decode(unsigned char *answer, float *temp) { int buf; @@ -250,7 +239,7 @@ int villas::node::temper_type_start(villas::node::SuperNode *sn) logger = logging.get("node:temper"); - /* Enumerate temper devices */ + // Enumerate temper devices devices.clear(); struct libusb_device **devs; @@ -347,7 +336,7 @@ int villas::node::temper_prepare(NodeCompat *n) { auto *t = n->getData(); - /* Find matching USB device */ + // Find matching USB device t->device = nullptr; for (auto *dev : devices) { if (dev->match(&t->filter)) { @@ -359,20 +348,20 @@ int villas::node::temper_prepare(NodeCompat *n) if (t->device == nullptr) throw RuntimeError("No matching TEMPer USB device found!"); - /* Create signal list */ + // Create signal list assert(n->getInputSignals(false)->size() == 0); - /* Temperature 1 */ + // Temperature 1 auto sig1 = std::make_shared(t->device->getNumSensors() == 2 ? "temp_int" : "temp", "°C", SignalType::FLOAT); n->in.signals->push_back(sig1); - /* Temperature 2 */ + // Temperature 2 if (t->device->getNumSensors() == 2) { auto sig2 = std::make_shared(t->device->getNumSensors() == 2 ? "temp_int" : "temp", "°C", SignalType::FLOAT); n->in.signals->push_back(sig2); } - /* Humidity */ + // Humidity if (t->device->hasHumiditySensor()) { auto sig3 = std::make_shared("humidity", "%", SignalType::FLOAT); n->in.signals->push_back(sig3); @@ -410,8 +399,8 @@ int villas::node::temper_read(NodeCompat *n, struct Sample * const smps[], unsig return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "temper"; p.description = "An temper for staring new node-type implementations"; p.vectorize = 1; @@ -428,5 +417,6 @@ static void register_plugin() { p.stop = temper_stop; p.read = temper_read; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/test_rtt.cpp b/lib/nodes/test_rtt.cpp index 6280f8313..bb5ea6223 100644 --- a/lib/nodes/test_rtt.cpp +++ b/lib/nodes/test_rtt.cpp @@ -1,9 +1,9 @@ -/** Node type: Node-type for testing Round-trip Time. +/* Node type: Node-type for testing Round-trip Time. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -23,7 +23,8 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -static NodeCompatType p; +static +NodeCompatType p; static int test_rtt_case_start(NodeCompat *n, int id) @@ -33,12 +34,12 @@ int test_rtt_case_start(NodeCompat *n, int id) n->logger->info("Starting case #{}: filename={}, rate={}, values={}, limit={}", t->current, c->filename_formatted, c->rate, c->values, c->limit); - /* Open file */ + // Open file t->stream = fopen(c->filename_formatted, "a+"); if (!t->stream) return -1; - /* Start timer. */ + // Start timer t->task.setRate(c->rate); t->counter = 0; @@ -53,7 +54,7 @@ int test_rtt_case_stop(NodeCompat *n, int id) int ret; auto *t = n->getData(); - /* Stop timer */ + // Stop timer t->task.stop(); ret = fclose(t->stream); @@ -83,7 +84,7 @@ int villas::node::test_rtt_prepare(NodeCompat *n) unsigned max_values = 0; - /* Take current for time for test case prefix */ + // Take current for time for test case prefix time_t ts = time(nullptr); struct tm tm; gmtime_r(&ts, &tm); @@ -124,7 +125,7 @@ int villas::node::test_rtt_parse(NodeCompat *n, json_t *json) t->cooldown = 0; - /* Generate list of test cases */ + // Generate list of test cases ret = list_init(&t->cases); if (ret) return ret; @@ -142,7 +143,7 @@ int villas::node::test_rtt_parse(NodeCompat *n, json_t *json) t->output = strdup(output); t->prefix = strdup(prefix ? prefix : n->getNameShort().c_str()); - /* Initialize IO module */ + // Initialize IO module if (!json_format) json_format = json_string("villas.binary"); @@ -150,13 +151,13 @@ int villas::node::test_rtt_parse(NodeCompat *n, json_t *json) if (!t->formatter) throw ConfigError(json, "node-config-node-test-rtt-format", "Invalid value for setting 'format'"); - /* Construct List of test cases */ + // Construct List of test cases if (!json_is_array(json_cases)) throw ConfigError(json_cases, "node-config-node-test-rtt-format", "The 'cases' setting must be an array."); json_array_foreach(json_cases, i, json_case) { int limit = -1; - double duration = -1; /* in secs */ + double duration = -1; // in secs ret = json_unpack_ex(json_case, &err, 0, "{ s: o, s: o, s?: i, s?: F }", "rates", &json_rates, @@ -219,7 +220,7 @@ int villas::node::test_rtt_parse(NodeCompat *n, json_t *json) else if (duration > 0) c->limit = duration * c->rate; else - c->limit = 1000; /* default value */ + c->limit = 1000; // default value c->filename = strf("%s/%s_values%d_rate%.0f.log", t->output, t->prefix, c->values, c->rate); @@ -279,7 +280,7 @@ int villas::node::test_rtt_start(NodeCompat *n) auto *t = n->getData(); struct test_rtt_case *c = (struct test_rtt_case *) list_first(&t->cases); - /* Create folder for results if not present */ + // Create folder for results if not present ret = stat(t->output, &st); if (ret || !S_ISDIR(st.st_mode)) { ret = mkdir(t->output, 0777); @@ -321,7 +322,7 @@ int villas::node::test_rtt_read(NodeCompat *n, struct Sample * const smps[], uns auto *t = n->getData(); - /* Handle start/stop of new cases */ + // Handle start/stop of new cases if (t->counter == -1) { if (t->current < 0) { t->current = 0; @@ -350,7 +351,7 @@ int villas::node::test_rtt_read(NodeCompat *n, struct Sample * const smps[], uns struct test_rtt_case *c = (struct test_rtt_case *) list_at(&t->cases, t->current); - /* Wait */ + // Wait steps = t->task.wait(); if (steps > 1) n->logger->warn("Skipped {} steps", steps - 1); @@ -370,7 +371,7 @@ int villas::node::test_rtt_read(NodeCompat *n, struct Sample * const smps[], uns else { struct timespec now = time_now(); - /* Prepare samples */ + // Prepare samples for (i = 0; i < cnt; i++) { smps[i]->length = c->values; smps[i]->sequence = t->counter; @@ -416,8 +417,8 @@ int villas::node::test_rtt_poll_fds(NodeCompat *n, int fds[]) return 1; } -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "test_rtt"; p.description = "Test round-trip time with loopback"; p.vectorize = 0; @@ -433,5 +434,6 @@ static void register_plugin() { p.read = test_rtt_read; p.write = test_rtt_write; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/uldaq.cpp b/lib/nodes/uldaq.cpp index d824bdb39..f6a907913 100644 --- a/lib/nodes/uldaq.cpp +++ b/lib/nodes/uldaq.cpp @@ -1,11 +1,10 @@ -/** Node-type for uldaq connections. +/* Node-type for uldaq connections. * - * @file - * @author Manuel Pitz - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Manuel Pitz + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -20,10 +19,13 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -static unsigned num_devs = ULDAQ_MAX_DEV_COUNT; -static DaqDeviceDescriptor descriptors[ULDAQ_MAX_DEV_COUNT]; +static +unsigned num_devs = ULDAQ_MAX_DEV_COUNT; +static +DaqDeviceDescriptor descriptors[ULDAQ_MAX_DEV_COUNT]; -static const struct { +static +const struct { const char *name; AiInputMode mode; } input_modes[] = { @@ -32,7 +34,8 @@ static const struct { { "pseudo-differential", AI_PSEUDO_DIFFERENTIAL } }; -static const struct { +static +const struct { const char *name; DaqDeviceInterface interface; } interface_types[] = { @@ -42,7 +45,8 @@ static const struct { { "any", ANY_IFC } }; -static const struct { +static +const struct { const char *name; Range range; float min, max; @@ -171,27 +175,27 @@ int uldaq_connect(NodeCompat *n) auto *u = n->getData(); UlError err; - /* Find Matching device */ + // Find Matching device if (!u->device_descriptor) { u->device_descriptor = uldaq_find_device(u); if (!u->device_descriptor) throw RuntimeError("Unable to find a matching device"); } - /* Get a handle to the DAQ device associated with the first descriptor */ + // Get a handle to the DAQ device associated with the first descriptor if (!u->device_handle) { u->device_handle = ulCreateDaqDevice(*u->device_descriptor); if (!u->device_handle) throw RuntimeError("Unable to create handle for DAQ device"); } - /* Check if device is already connected */ + // Check if device is already connected int connected; err = ulIsDaqDeviceConnected(u->device_handle, &connected); if (err != ERR_NO_ERROR) return -1; - /* Connect to device */ + // Connect to device if (!connected) { err = ulConnectDaqDevice(u->device_handle); if (err != ERR_NO_ERROR) { @@ -208,7 +212,7 @@ int villas::node::uldaq_type_start(villas::node::SuperNode *sn) { UlError err; - /* Get descriptors for all of the available DAQ devices */ + // Get descriptors for all of the available DAQ devices err = ulGetDaqDeviceInventory(ANY_IFC, descriptors, &num_devs); if (err != ERR_NO_ERROR) throw RuntimeError("Failed to retrieve DAQ device list"); @@ -488,7 +492,7 @@ void uldaq_data_available(DaqDeviceHandle device_handle, DaqEventType event_type pthread_mutex_unlock(&u->in.mutex); - /* Signal uldaq_read() about new data */ + // Signal uldaq_read() about new data pthread_cond_signal(&u->in.cv); } @@ -502,7 +506,7 @@ int villas::node::uldaq_start(NodeCompat *n) int ret; UlError err; - /* Allocate a buffer to receive the data */ + // Allocate a buffer to receive the data u->in.buffer_len = u->in.channel_count * n->in.vectorize * 50; u->in.buffer = new double[u->in.buffer_len]; if (!u->in.buffer) @@ -516,10 +520,10 @@ int villas::node::uldaq_start(NodeCompat *n) if (err != ERR_NO_ERROR) throw RuntimeError("Failed to load input queue to DAQ device"); - /* Enable the event to be notified every time samples are available */ + // Enable the event to be notified every time samples are available err = ulEnableEvent(u->device_handle, DE_ON_DATA_AVAILABLE, n->in.vectorize, uldaq_data_available, n); - /* Start the acquisition */ + // Start the acquisition err = ulAInScan(u->device_handle, 0, 0, (AiInputMode) 0, (Range) 0, u->in.buffer_len / u->in.channel_count, &u->in.sample_rate, u->in.scan_options, u->in.flags, u->in.buffer); if (err != ERR_NO_ERROR) { char buf[ERR_MSG_LEN]; @@ -527,7 +531,7 @@ int villas::node::uldaq_start(NodeCompat *n) throw RuntimeError("Failed to start acquisition on DAQ device: {}", buf); } - /* Get the initial status of the acquisition */ + // Get the initial status of the acquisition err = ulAInScanStatus(u->device_handle, &u->in.status, &u->in.transfer_status); if (err != ERR_NO_ERROR) { char buf[ERR_MSG_LEN]; @@ -550,15 +554,15 @@ int villas::node::uldaq_stop(NodeCompat *n) UlError err; - /* @todo Fix deadlock */ + // @todo Fix deadlock //pthread_mutex_lock(&u->in.mutex); - /* Get the current status of the acquisition */ + // Get the current status of the acquisition err = ulAInScanStatus(u->device_handle, &u->in.status, &u->in.transfer_status); if (err != ERR_NO_ERROR) return -1; - /* Stop the acquisition if it is still running */ + // Stop the acquisition if it is still running if (u->in.status == SS_RUNNING) { err = ulAInScanStop(u->device_handle); if (err != ERR_NO_ERROR) @@ -589,7 +593,7 @@ int villas::node::uldaq_read(NodeCompat *n, struct Sample * const smps[], unsign size_t start_index = u->in.buffer_pos; - /* Wait for data available condition triggered by event callback */ + // Wait for data available condition triggered by event callback if (start_index + n->in.vectorize * u->in.channel_count > u->in.transfer_status.currentTotalCount) pthread_cond_wait(&u->in.cv, &u->in.mutex); @@ -617,10 +621,11 @@ int villas::node::uldaq_read(NodeCompat *n, struct Sample * const smps[], unsign return cnt; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "uldaq"; p.description = "Measurement Computing DAQ devices like UL201 (libuldaq)"; p.vectorize = 0; @@ -635,5 +640,6 @@ static void register_plugin() { p.stop = uldaq_stop; p.read = uldaq_read; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/nodes/webrtc.cpp b/lib/nodes/webrtc.cpp index 85a0d0bf4..13b61cf74 100644 --- a/lib/nodes/webrtc.cpp +++ b/lib/nodes/webrtc.cpp @@ -1,11 +1,11 @@ -/** Node-type: webrtc +/* Node-type: webrtc * - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -22,7 +22,8 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -static villas::node::Web *web; +static +villas::node::Web *web; WebRTCNode::WebRTCNode(const uuid_t &id, const std::string &name) : Node(id, name), @@ -248,5 +249,5 @@ int WebRTCNodeFactory::start(SuperNode *sn) return 0; } - -static WebRTCNodeFactory p; +static +WebRTCNodeFactory p; diff --git a/lib/nodes/webrtc/peer_connection.cpp b/lib/nodes/webrtc/peer_connection.cpp index 4b66bf6f5..959a1138d 100644 --- a/lib/nodes/webrtc/peer_connection.cpp +++ b/lib/nodes/webrtc/peer_connection.cpp @@ -1,12 +1,11 @@ -/** WebRTC peer connection +/* WebRTC peer connection * - * @file - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/nodes/webrtc/signaling_client.cpp b/lib/nodes/webrtc/signaling_client.cpp index 9fb2caf1d..b132d5eab 100644 --- a/lib/nodes/webrtc/signaling_client.cpp +++ b/lib/nodes/webrtc/signaling_client.cpp @@ -1,11 +1,11 @@ -/** WebRTC signaling client +/* WebRTC signaling client * - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/nodes/webrtc/signaling_message.cpp b/lib/nodes/webrtc/signaling_message.cpp index 068bd6bc5..99a5518d9 100644 --- a/lib/nodes/webrtc/signaling_message.cpp +++ b/lib/nodes/webrtc/signaling_message.cpp @@ -1,11 +1,11 @@ -/** WebRTC signaling messages. +/* WebRTC signaling messages. * - * @author Steffen Vogel - * @author Philipp Jungkamp - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @copyright 2023, OPAL-RT Germany GmbH - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * Author: Philipp Jungkamp + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/nodes/websocket.cpp b/lib/nodes/websocket.cpp index d43f4926f..09f4d1fae 100644 --- a/lib/nodes/websocket.cpp +++ b/lib/nodes/websocket.cpp @@ -1,9 +1,9 @@ -/** Node type: Websockets (libwebsockets) +/* Node type: Websockets (libwebsockets) * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -26,16 +26,22 @@ using namespace villas::utils; #define DEFAULT_WEBSOCKET_BUFFER_SIZE (1 << 12) -/* Private static storage */ -static std::list connections; /**< List of active libwebsocket connections which receive samples from all nodes (catch all) */ -static std::mutex connections_lock; +// Private static storage +static +std::list connections; // List of active libwebsocket connections which receive samples from all nodes (catch all) +static +std::mutex connections_lock; -static villas::node::Web *web; -static villas::Logger logger = logging.get("websocket"); +static +villas::node::Web *web; +static +villas::Logger logger = logging.get("websocket"); -/* Forward declarations */ -static NodeCompatType p; -static NodeCompatFactory ncp(&p); +// Forward declarations +static +NodeCompatType p; +static +NodeCompatFactory ncp(&p); static void websocket_destination_destroy(struct websocket_destination *d) @@ -75,7 +81,7 @@ int websocket_connection_destroy(struct websocket_connection *c) assert(c->state != websocket_connection::State::DESTROYED); - /* Return all samples to pool */ + // Return all samples to pool int avail; struct Sample *smp; @@ -112,7 +118,7 @@ int websocket_connection_write(struct websocket_connection *c, struct Sample * c c->node->logger->debug("Enqueued {} samples to {}", pushed, c->toString()); - /* Client connections which are currently connecting don't have an associate c->wsi yet */ + // Client connections which are currently connecting don't have an associate c->wsi yet if (c->wsi) web->callbackOnWritable(c->wsi); else @@ -151,7 +157,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso * and format 'json'. */ - /* Get path of incoming request */ + // Get path of incoming request char *node, *format, *lasts; char uri[64]; @@ -173,7 +179,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso if (!format) format = (char *) "villas.web"; - /* Search for node whose name matches the URI. */ + // Search for node whose name matches the URI auto *n = ncp.instances.lookup(node); if (!n) { websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_POLICY_VIOLATION, "Unknown node"); @@ -226,7 +232,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso c->node->logger->debug("Closed WebSocket connection: {}", c->toString()); if (c->state != websocket_connection::State::CLOSING) { - /** @todo Attempt reconnect here */ + // @todo Attempt reconnect here } { @@ -280,7 +286,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso c->buffers.recv->append((char *) in, len); - /* We dont try to parse the frame yet, as we have to wait for the remaining fragments */ + // We dont try to parse the frame yet, as we have to wait for the remaining fragments if (lws_is_final_fragment(wsi)) { struct timespec ts_recv = time_now(); auto *n = c->node; @@ -301,7 +307,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso c->node->logger->debug("Received {} samples from connection: {}", recvd, c->toString()); - /* Set receive timestamp */ + // Set receive timestamp for (int i = 0; i < recvd; i++) { smps[i]->ts.received = ts_recv; smps[i]->flags |= (int) SampleFlags::HAS_TS_RECEIVED; @@ -311,7 +317,7 @@ int villas::node::websocket_protocol_cb(struct lws *wsi, enum lws_callback_reaso if (enqueued < recvd) c->node->logger->warn("Queue overrun in connection: {}", c->toString()); - /* Release unused samples back to pool */ + // Release unused samples back to pool if (enqueued < avail) sample_decref_many(&smps[enqueued], avail - enqueued); @@ -381,7 +387,7 @@ int villas::node::websocket_start(NodeCompat *n) format = strchr(d->info.path, '.'); if (format) - format = format + 1; /* Removes "." */ + format = format + 1; // Removes "." else format = "villas.web"; @@ -399,7 +405,7 @@ int villas::node::websocket_start(NodeCompat *n) lws_client_connect_via_info(&d->info); } - /* Wait until all destinations are connected */ + // Wait until all destinations are connected if (w->wait) { unsigned connected = 0, total = list_length(&w->destinations); do { @@ -505,7 +511,7 @@ int villas::node::websocket_write(NodeCompat *n, struct Sample * const smps[], u auto *w = n->getData(); struct Sample *cpys[cnt]; - /* Make copies of all samples */ + // Make copies of all samples avail = sample_alloc_many(&w->pool, cpys, cnt); if (avail < (int) cnt) n->logger->warn("Pool underrun: avail={}", avail); @@ -536,7 +542,6 @@ int villas::node::websocket_parse(NodeCompat *n, json_t *json) json_error_t err; int wc = -1; - ret = json_unpack_ex(json, &err, 0, "{ s?: o, s?: b }", "destinations", &json_dests, "wait_connected", &wc @@ -619,7 +624,8 @@ int villas::node::websocket_poll_fds(NodeCompat *n, int fds[]) return 1; } -__attribute__((constructor(110))) static void UNIQUE(__ctor)() { +__attribute__((constructor(110))) static +void UNIQUE(__ctor)() { p.name = "websocket"; p.description = "Send and receive samples of a WebSocket connection (libwebsockets)"; p.vectorize = 0; diff --git a/lib/nodes/zeromq.cpp b/lib/nodes/zeromq.cpp index 13163f8d7..8e72ff4dc 100644 --- a/lib/nodes/zeromq.cpp +++ b/lib/nodes/zeromq.cpp @@ -1,9 +1,9 @@ -/** Node type: ZeroMQ +/* Node type: ZeroMQ * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -23,20 +23,21 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -static void *context; +static +void *context; -/** Read one event off the monitor socket; return value and address +/* Read one event off the monitor socket; return value and address * by reference, if not null, and event number by value. * * @returnval -1 In case of error. */ static int get_monitor_event(void *monitor, int *value, char **address) { - /* First frame in message contains event number and value */ + // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) - return -1; /* Interruped, presumably. */ + return -1; // Interruped, presumably assert(zmq_msg_more (&msg)); @@ -45,10 +46,10 @@ int get_monitor_event(void *monitor, int *value, char **address) if (value) *value = *(uint32_t *) (data + 2); - /* Second frame in message contains event address */ + // Second frame in message contains event address zmq_msg_init(&msg); if (zmq_msg_recv(&msg, monitor, 0) == -1) - return -1; /* Interruped, presumably. */ + return -1; // Interruped, presumably assert(!zmq_msg_more(&msg)); @@ -172,7 +173,7 @@ int villas::node::zeromq_parse(NodeCompat *n, json_t *json) z->in.filter = in_filter ? strdup(in_filter) : nullptr; z->out.filter = out_filter ? strdup(out_filter) : nullptr; - /* Format */ + // Format if (z->formatter) delete z->formatter; z->formatter = json_format @@ -216,7 +217,7 @@ int villas::node::zeromq_parse(NodeCompat *n, json_t *json) memcpy(z->curve.server.secret_key, secret_key, 41); } - /** @todo We should fix this. Its mostly done. */ + // @todo We should fix this. Its mostly done. if (z->curve.enabled) throw ConfigError(json_curve, "node-config-zeromq-curve", "CurveZMQ support is currently broken"); @@ -337,7 +338,7 @@ int villas::node::zeromq_start(NodeCompat *n) goto fail; } - /* Join group */ + // Join group switch (z->pattern) { #ifdef ZMQ_BUILD_DISH case zeromq::Pattern::RADIODISH: @@ -357,7 +358,7 @@ int villas::node::zeromq_start(NodeCompat *n) goto fail; if (z->curve.enabled) { - /* Publisher has server role */ + // Publisher has server role ret = zmq_setsockopt(z->out.socket, ZMQ_CURVE_SECRETKEY, z->curve.server.secret_key, 41); if (ret) goto fail; @@ -371,12 +372,12 @@ int villas::node::zeromq_start(NodeCompat *n) if (ret) goto fail; - /* Create temporary client keys first */ + // Create temporary client keys first ret = zmq_curve_keypair(z->curve.client.public_key, z->curve.client.secret_key); if (ret) goto fail; - /* Subscriber has client role */ + // Subscriber has client role ret = zmq_setsockopt(z->in.socket, ZMQ_CURVE_SECRETKEY, z->curve.client.secret_key, 41); if (ret) goto fail; @@ -402,24 +403,24 @@ int villas::node::zeromq_start(NodeCompat *n) if (ret) goto fail; - /* Monitor events on the server */ + // Monitor events on the server ret = zmq_socket_monitor(d->socket, mon_ep, ZMQ_EVENT_ALL); if (ret < 0) goto fail; - /* Create socket for collecting monitor events */ + // Create socket for collecting monitor events d->mon_socket = zmq_socket(context, ZMQ_PAIR); if (!d->mon_socket) { ret = -1; goto fail; } - /* Connect it to the inproc endpoints so they'll get events */ + // Connect it to the inproc endpoints so they'll get events ret = zmq_connect(d->mon_socket, mon_ep); if (ret < 0) goto fail; - /* Connect / bind sockets to endpoints */ + // Connect / bind sockets to endpoints for (size_t i = 0; i < list_length(&d->endpoints); i++) { char *ep = (char *) list_at(&d->endpoints, i); @@ -438,7 +439,7 @@ int villas::node::zeromq_start(NodeCompat *n) } } - /* Wait for all connections to be connected */ + // Wait for all connections to be connected for (auto d : dirs) { while (d->pending > 0) { int evt = d->bind ? ZMQ_EVENT_LISTENING : ZMQ_EVENT_CONNECTED; @@ -455,7 +456,7 @@ int villas::node::zeromq_start(NodeCompat *n) return ret == ZMQ_EVENT_HANDSHAKE_SUCCEEDED; } else - return 0; /* The handshake events are only emitted for CurveZMQ sessions. */ + return 0; // The handshake events are only emitted for CurveZMQ sessions #else return 0; #endif @@ -521,7 +522,7 @@ int villas::node::zeromq_read(NodeCompat *n, struct Sample * const smps[], unsig if (z->in.filter) { switch (z->pattern) { case zeromq::Pattern::PUBSUB: - /* Discard envelope */ + // Discard envelope zmq_recv(z->in.socket, nullptr, 0, 0); break; @@ -529,7 +530,7 @@ int villas::node::zeromq_read(NodeCompat *n, struct Sample * const smps[], unsig } } - /* Receive payload */ + // Receive payload ret = zmq_msg_recv(&m, z->in.socket, 0); if (ret < 0) return ret; @@ -569,7 +570,7 @@ int villas::node::zeromq_write(NodeCompat *n, struct Sample * const smps[], unsi break; #endif - case zeromq::Pattern::PUBSUB: /* Send envelope */ + case zeromq::Pattern::PUBSUB: // Send envelope zmq_send(z->out.socket, z->out.filter, strlen(z->out.filter), ZMQ_SNDMORE); break; } @@ -627,10 +628,11 @@ int villas::node::zeromq_netem_fds(NodeCompat *n, int fds[]) return 1; } -static NodeCompatType p; +static +NodeCompatType p; -__attribute__((constructor(110))) -static void register_plugin() { +__attribute__((constructor(110))) static +void register_plugin() { p.name = "zeromq"; p.description = "ZeroMQ Distributed Messaging (libzmq)"; p.vectorize = 0; @@ -650,5 +652,6 @@ static void register_plugin() { p.poll_fds = zeromq_poll_fds; p.netem_fds = zeromq_netem_fds; - static NodeCompatFactory ncp(&p); + static + NodeCompatFactory ncp(&p); } diff --git a/lib/path.cpp b/lib/path.cpp index 1c2354de8..4855623b2 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -1,9 +1,9 @@ -/** Message paths. +/* Message paths. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -47,7 +47,7 @@ void * Path::runWrapper(void *arg) : p->runSingle(); } -/** Main thread function per path: +/* Main thread function per path: * read samples from source -> write samples to destinations * * This is an optimized version of runPoll() which is @@ -58,7 +58,7 @@ void * Path::runWrapper(void *arg) void * Path::runSingle() { int ret; - auto ps = sources.front(); /* there is only a single source */ + auto ps = sources.front(); // there is only a single source while (state == State::STARTED) { pthread_testcancel(); @@ -74,7 +74,7 @@ void * Path::runSingle() return nullptr; } -/** Main thread function per path: +/* Main thread function per path: * read samples from source -> write samples to destinations * * This variant of the path uses poll() to listen on an event from @@ -93,7 +93,7 @@ void * Path::runPoll() auto &pfd = pfds[i]; if (pfd.revents & POLLIN) { - /* Timeout: re-enqueue the last sample */ + // Timeout: re-enqueue the last sample if (pfd.fd == timeout.getFD()) { timeout.wait(); @@ -101,7 +101,7 @@ void * Path::runPoll() PathDestination::enqueueAll(this, &last_sample, 1); } - /* A source is ready to receive samples */ + // A source is ready to receive samples else { auto ps = sources[i]; @@ -121,7 +121,7 @@ Path::Path() : state(State::INITIALIZED), mode(Mode::ANY), timeout(CLOCK_MONOTONIC), - rate(0), /* Disabled */ + rate(0), // Disabled affinity(0), enabled(true), poll(-1), @@ -146,7 +146,7 @@ void Path::startPoll() if (fd < 0) throw RuntimeError("Failed to get file descriptor for node {}", ps->getNode()->getName()); - /* This slot is only used if it is not masked */ + // This slot is only used if it is not masked struct pollfd pfd = { .fd = fd, .events = POLLIN @@ -156,7 +156,7 @@ void Path::startPoll() } } - /* We use the last slot for the timeout timer. */ + // We use the last slot for the timeout timer if (rate > 0) { timeout.setRate(rate); @@ -183,12 +183,12 @@ void Path::prepare(NodeList &nodes) mask.reset(); signals = std::make_shared(); - /* Prepare mappings */ + // Prepare mappings ret = mappings.prepare(nodes); if (ret) throw RuntimeError("Failed to prepare mappings of path: {}", this->toString()); - /* Create path sources */ + // Create path sources std::map psm; unsigned i = 0, j = 0; for (auto me : mappings) { @@ -196,7 +196,7 @@ void Path::prepare(NodeList &nodes) PathSource::Ptr ps; if (psm.find(n) != psm.end()) - /* We already have a path source for this mapping entry */ + // We already have a path source for this mapping entry ps = psm[n]; else { /* Depending on weather the node belonging to this mapping is already @@ -207,9 +207,9 @@ void Path::prepare(NodeList &nodes) */ bool isSecondary = n->sources.size() > 0; - /* Create new path source */ + // Create new path source if (isSecondary) { - /* Get master path source */ + // Get master path source auto mps = std::dynamic_pointer_cast(n->sources.front()); if (!mps) throw RuntimeError("Failed to find master path source"); @@ -247,7 +247,7 @@ void Path::prepare(NodeList &nodes) SignalList::Ptr sigs = me->node->getInputSignals(); - /* Update signals of path */ + // Update signals of path for (unsigned j = 0; j < (unsigned) me->length; j++) { Signal::Ptr sig; @@ -260,7 +260,7 @@ void Path::prepare(NodeList &nodes) continue; } } - /* For other mappings we create new signal descriptors */ + // For other mappings we create new signal descriptors else { sig = me->toSignal(j); if (!sig) @@ -275,7 +275,7 @@ void Path::prepare(NodeList &nodes) i++; } - /* Prepare path destinations */ + // Prepare path destinations int mt_cnt = 0; for (auto pd : destinations) { auto *pd_mt = pd->node->getMemoryType(); @@ -293,11 +293,11 @@ void Path::prepare(NodeList &nodes) throw RuntimeError("Failed to prepare path destination {} of path {}", pd->node->getName(), this->toString()); } - /* Autodetect whether to use original sequence numbers or not */ + // Autodetect whether to use original sequence numbers or not if (original_sequence_no == -1) original_sequence_no = sources.size() == 1; - /* Autodetect whether to use poll() for this path or not */ + // Autodetect whether to use poll() for this path or not if (poll == -1) { if (rate > 0) poll = 1; @@ -308,18 +308,18 @@ void Path::prepare(NodeList &nodes) } #ifdef WITH_HOOKS - /* Prepare path hooks */ + // Prepare path hooks int m = builtin ? (int) Hook::Flags::PATH | (int) Hook::Flags::BUILTIN : 0; - /* Add internal hooks if they are not already in the list */ + // Add internal hooks if they are not already in the list hooks.prepare(signals, m, this, nullptr); hooks.dump(logger, fmt::format("path {}", this->toString())); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS - /* Prepare pool */ + // Prepare pool auto osigs = getOutputSignals(); unsigned pool_size = MAX(1UL, destinations.size()) * queuelen; @@ -374,7 +374,7 @@ void Path::parse(json_t *json, NodeList &nodes, const uuid_t sn_uuid) if (rev >= 0) reversed = rev != 0; - /* Optional settings */ + // Optional settings if (mode_str) { if (!strcmp(mode_str, "any")) mode = Mode::ANY; @@ -384,22 +384,22 @@ void Path::parse(json_t *json, NodeList &nodes, const uuid_t sn_uuid) throw ConfigError(json, "node-config-path", "Invalid path mode '{}'", mode_str); } - /* UUID */ + // UUID if (uuid_str) { ret = uuid_parse(uuid_str, uuid); if (ret) throw ConfigError(json, "node-config-path-uuid", "Failed to parse UUID: {}", uuid_str); } else - /* Generate UUID from hashed config */ + // Generate UUID from hashed config uuid::generateFromJson(uuid, json, sn_uuid); - /* Input node(s) */ + // Input node(s) ret = mappings.parse(json_in); if (ret) throw ConfigError(json_in, "node-config-path-in", "Failed to parse input mapping of path {}", this->toString()); - /* Output node(s) */ + // Output node(s) NodeList dests; if (json_out) { ret = dests.parse(json_out, nodes); @@ -424,7 +424,7 @@ void Path::parse(json_t *json, NodeList &nodes, const uuid_t sn_uuid) #ifdef WITH_HOOKS if (json_hooks) hooks.parse(json_hooks, (int) Hook::Flags::PATH, this, nullptr); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS if (json_mask) parseMask(json_mask, nodes); @@ -471,7 +471,7 @@ void Path::check() #ifdef WITH_HOOKS hooks.check(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS state = State::CHECKED; } @@ -479,17 +479,17 @@ void Path::check() void Path::checkPrepared() { if (poll == 0) { - /* Check that we do not need to multiplex between multiple sources when polling is disabled */ + // Check that we do not need to multiplex between multiple sources when polling is disabled if (sources.size() > 1) throw RuntimeError("Setting 'poll' must be active if the path has more than one source"); - /* Check that we do not use the fixed rate feature when polling is disabled */ + // Check that we do not use the fixed rate feature when polling is disabled if (rate > 0) throw RuntimeError("Setting 'poll' must be activated when used together with setting 'rate'"); } else { if (rate <= 0) { - /* Check that all path sources provide a file descriptor for polling if fixed rate is disabled */ + // Check that all path sources provide a file descriptor for polling if fixed rate is disabled for (auto ps : sources) { if (!(ps->getNode()->getFactory()->getFlags() & (int) NodeFactory::Flags::SUPPORTS_POLL)) throw RuntimeError("Node {} can not be used in polling mode with path {}", ps->getNode()->getName(), this->toString()); @@ -540,13 +540,13 @@ void Path::start() #ifdef WITH_HOOKS hooks.start(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS last_sequence = 0; received.reset(); - /* We initialize the intial sample */ + // We initialize the intial sample last_sample = sample_alloc(&pool); if (!last_sample) throw MemoryAllocationError(); @@ -615,7 +615,7 @@ void Path::stop() #ifdef WITH_HOOKS hooks.stop(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS sample_decref(last_sample); @@ -679,7 +679,7 @@ SignalList::Ptr Path::getOutputSignals(bool after_hooks) #ifdef WITH_HOOKS if (after_hooks && hooks.size() > 0) return hooks.getSignals(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return signals; } @@ -689,7 +689,7 @@ unsigned Path::getOutputSignalsMaxCount() #ifdef WITH_HOOKS if (hooks.size() > 0) return MAX(signals->size(), hooks.getSignalsMaxCount()); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS return signals->size(); } @@ -701,7 +701,7 @@ json_t * Path::toJson() const json_t *json_hooks = hooks.toJson(); #else json_t *json_hooks = json_array(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS json_t *json_sources = json_array(); json_t *json_destinations = json_array(); diff --git a/lib/path_destination.cpp b/lib/path_destination.cpp index d8d8f4d19..79685a4ee 100644 --- a/lib/path_destination.cpp +++ b/lib/path_destination.cpp @@ -1,9 +1,9 @@ -/** Path destination +/* Path destination * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -56,7 +56,7 @@ void PathDestination::enqueueAll(Path *p, const struct Sample * const smps[], un if (enqueued != cnt) p->logger->warn("Queue overrun for path {}", p->toString()); - /* Increase reference counter of these samples as they are now also owned by the queue. */ + // Increase reference counter of these samples as they are now also owned by the queue sample_incref_many(clones, cloned); p->logger->debug("Enqueued {} samples to destination {} of path {}", enqueued, pd->node->getName(), p->toString()); @@ -73,7 +73,7 @@ void PathDestination::write() struct Sample *smps[cnt]; - /* As long as there are still samples in the queue */ + // As long as there are still samples in the queue while (true) { allocated = queue_pull_many(&queue, (void **) smps, cnt); if (allocated == 0) diff --git a/lib/path_list.cpp b/lib/path_list.cpp index 57c835e08..38868f2b5 100644 --- a/lib/path_list.cpp +++ b/lib/path_list.cpp @@ -1,10 +1,9 @@ -/** Path list +/* Path list * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/path_source.cpp b/lib/path_source.cpp index 1ddd015c1..e608ad036 100644 --- a/lib/path_source.cpp +++ b/lib/path_source.cpp @@ -1,9 +1,9 @@ -/** Path source +/* Path source * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -52,12 +52,12 @@ int PathSource::read(int i) struct Sample *muxed_smps[cnt]; struct Sample **tomux_smps; - /* Fill smps[] free sample blocks from the pool */ + // Fill smps[] free sample blocks from the pool allocated = sample_alloc_many(&pool, read_smps, cnt); if (allocated != cnt) path->logger->warn("Pool underrun for path source {}", node->getName()); - /* Read ready samples and store them to blocks pointed by smps[] */ + // Read ready samples and store them to blocks pointed by smps[] recv = node->read(read_smps, allocated); if (recv == 0) { enqueued = 0; @@ -79,14 +79,14 @@ int PathSource::read(int i) else if (recv < allocated) path->logger->warn("Partial read for path {}: read={}, expected={}", path->toString(), recv, allocated); - /* Let the master path sources forward received samples to their secondaries */ + // Let the master path sources forward received samples to their secondaries writeToSecondaries(read_smps, recv); - if (path->mode == Path::Mode::ANY) { /* Mux all samples */ + if (path->mode == Path::Mode::ANY) { // Mux all samples tomux_smps = read_smps; tomux = recv; } - else { /* Mux only last sample and discard others */ + else { // Mux only last sample and discard others tomux_smps = read_smps + recv - 1; tomux = 1; } @@ -154,12 +154,12 @@ int PathSource::read(int i) path->logger->debug("received=0b{:b}, mask=0b{:b}", path->received.to_ullong(), path->mask.to_ullong()); if (path->mask.test(i)) { - /* Enqueue always */ + // Enqueue always if (path->mode == Path::Mode::ANY) { enqueued = toenqueue; PathDestination::enqueueAll(path, muxed_smps, toenqueue); } - /* Enqueue only if received == mask bitset */ + // Enqueue only if received == mask bitset else if (path->mode == Path::Mode::ALL) { if (path->mask == path->received) { PathDestination::enqueueAll(path, muxed_smps, toenqueue); @@ -217,6 +217,6 @@ SecondaryPathSource::SecondaryPathSource(Path *p, Node *n, NodeList &nodes, Path if (!node) throw RuntimeError("Failed to create internal loopback"); - /* Register new loopback node in node list of super node */ + // Register new loopback node in node list of super node nodes.push_back(node); } diff --git a/lib/pool.cpp b/lib/pool.cpp index 5225a40e2..a34cf839d 100644 --- a/lib/pool.cpp +++ b/lib/pool.cpp @@ -1,9 +1,9 @@ -/** Memory pool for fixed size objects. +/* Memory pool for fixed size objects. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +19,7 @@ int villas::node::pool_init(struct Pool *p, size_t cnt, size_t blocksz, struct m int ret; auto logger = logging.get("pool"); - /* Make sure that we use a block size that is aligned to the size of a cache line */ + // Make sure that we use a block size that is aligned to the size of a cache line p->alignment = kernel::getCachelineSize(); p->blocksz = p->alignment * CEIL(blocksz, p->alignment); p->len = cnt * p->blocksz; diff --git a/lib/queue.cpp b/lib/queue.cpp index d0b6a2523..27d79b83a 100644 --- a/lib/queue.cpp +++ b/lib/queue.cpp @@ -1,11 +1,11 @@ -/** Lock-free Multiple-Producer Multiple-consumer (MPMC) queue. +/* Lock-free Multiple-Producer Multiple-consumer (MPMC) queue. * * Based on Dmitry Vyukov#s Bounded MPMC queue: * http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue * - * @author Steffen Vogel - * @copyright 2017 Steffen Vogel - * @license BSD 2-Clause License + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2017 Steffen Vogel + * SPDX-License-Identifier: BSD-2-Clause * * All rights reserved. * @@ -29,7 +29,7 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *********************************************************************************/ + */ #include #include @@ -38,10 +38,10 @@ using namespace villas; -/** Initialize MPMC queue */ +// Initialize MPMC queue int villas::node::queue_init(struct CQueue *q, size_t size, struct memory::Type *m) { - /* Queue size must be 2 exponent */ + // Queue size must be 2 exponent if (!IS_POW2(size)) { size_t old_size = size; size = LOG2_CEIL(size); diff --git a/lib/queue_signalled.cpp b/lib/queue_signalled.cpp index 3bad38ebb..f8fbeaad2 100644 --- a/lib/queue_signalled.cpp +++ b/lib/queue_signalled.cpp @@ -1,10 +1,9 @@ -/** Wrapper around queue that uses POSIX CV's for signalling writes. +/* Wrapper around queue that uses POSIX CV's for signalling writes. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -69,7 +68,7 @@ int villas::node::queue_signalled_init(struct CQueueSignalled *qs, size_t size, pthread_condattr_destroy(&cvattr); } else if (qs->mode == QueueSignalledMode::POLLING) { - /* Nothing todo */ + // Nothing todo } #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { @@ -97,7 +96,7 @@ int villas::node::queue_signalled_destroy(struct CQueueSignalled *qs) pthread_mutex_destroy(&qs->pthread.mutex); } else if (qs->mode == QueueSignalledMode::POLLING) { - /* Nothing todo */ + // Nothing todo } #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { @@ -126,7 +125,7 @@ int villas::node::queue_signalled_push(struct CQueueSignalled *qs, void *ptr) pthread_mutex_unlock(&qs->pthread.mutex); } else if (qs->mode == QueueSignalledMode::POLLING) { - /* Nothing todo */ + // Nothing todo } #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { @@ -157,7 +156,7 @@ int villas::node::queue_signalled_push_many(struct CQueueSignalled *qs, void *pt pthread_mutex_unlock(&qs->pthread.mutex); } else if (qs->mode == QueueSignalledMode::POLLING) { - /* Nothing todo */ + // Nothing todo } #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { @@ -178,7 +177,7 @@ int villas::node::queue_signalled_pull(struct CQueueSignalled *qs, void **ptr) { int pulled = 0; - /* Make sure that qs->mutex is unlocked if this thread gets cancelled. */ + // Make sure that qs->mutex is unlocked if this thread gets cancelled pthread_cleanup_push(queue_signalled_cleanup, qs); if (qs->mode == QueueSignalledMode::PTHREAD) @@ -192,7 +191,7 @@ int villas::node::queue_signalled_pull(struct CQueueSignalled *qs, void **ptr) if (qs->mode == QueueSignalledMode::PTHREAD) pthread_cond_wait(&qs->pthread.ready, &qs->pthread.mutex); else if (qs->mode == QueueSignalledMode::POLLING) - continue; /* Try again */ + continue; // Try again #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { int ret; @@ -219,7 +218,7 @@ int villas::node::queue_signalled_pull_many(struct CQueueSignalled *qs, void *pt { int pulled = 0; - /* Make sure that qs->mutex is unlocked if this thread gets cancelled. */ + // Make sure that qs->mutex is unlocked if this thread gets cancelled pthread_cleanup_push(queue_signalled_cleanup, qs); if (qs->mode == QueueSignalledMode::PTHREAD) @@ -233,7 +232,7 @@ int villas::node::queue_signalled_pull_many(struct CQueueSignalled *qs, void *pt if (qs->mode == QueueSignalledMode::PTHREAD) pthread_cond_wait(&qs->pthread.ready, &qs->pthread.mutex); else if (qs->mode == QueueSignalledMode::POLLING) - continue; /* Try again */ + continue; // Try again #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { int ret; @@ -270,7 +269,7 @@ int villas::node::queue_signalled_close(struct CQueueSignalled *qs) pthread_mutex_unlock(&qs->pthread.mutex); } else if (qs->mode == QueueSignalledMode::POLLING) { - /* Nothing todo */ + // Nothing todo } #ifdef HAS_EVENTFD else if (qs->mode == QueueSignalledMode::EVENTFD) { diff --git a/lib/sample.cpp b/lib/sample.cpp index 2c56322a0..b4ebc1015 100644 --- a/lib/sample.cpp +++ b/lib/sample.cpp @@ -1,9 +1,9 @@ -/** The internal datastructure for a sample of simulation data. +/* The internal datastructure for a sample of simulation data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -135,7 +135,7 @@ int villas::node::sample_decref(struct Sample *s) { int prev = atomic_fetch_sub(&s->refcnt, 1); - /* Did we had the last reference? */ + // Did we had the last reference? if (prev == 1) sample_free(s); @@ -208,7 +208,7 @@ int villas::node::sample_cmp(struct Sample *a, struct Sample *b, double epsilon, return -1; } - /* Compare sequence no */ + // Compare sequence no if (flags & (int) SampleFlags::HAS_SEQUENCE) { if (a->sequence != b->sequence) { printf("sequence no: %" PRIu64 " != %" PRIu64 "\n", a->sequence, b->sequence); @@ -216,7 +216,7 @@ int villas::node::sample_cmp(struct Sample *a, struct Sample *b, double epsilon, } } - /* Compare timestamp */ + // Compare timestamp if (flags & (int) SampleFlags::HAS_TS_ORIGIN) { if (time_delta(&a->ts.origin, &b->ts.origin) > epsilon) { printf("ts.origin: %f != %f\n", time_to_double(&a->ts.origin), time_to_double(&b->ts.origin)); @@ -224,7 +224,7 @@ int villas::node::sample_cmp(struct Sample *a, struct Sample *b, double epsilon, } } - /* Compare data */ + // Compare data if (flags & (int) SampleFlags::HAS_DATA) { if (a->length != b->length) { printf("length: %u != %u\n", a->length, b->length); @@ -232,7 +232,7 @@ int villas::node::sample_cmp(struct Sample *a, struct Sample *b, double epsilon, } for (unsigned i = 0; i < a->length; i++) { - /* Compare format */ + // Compare format if (sample_format(a, i) != sample_format(b, i)) return 6; diff --git a/lib/shmem.cpp b/lib/shmem.cpp index 70712d084..8ca3a1223 100644 --- a/lib/shmem.cpp +++ b/lib/shmem.cpp @@ -1,10 +1,9 @@ -/** Shared-memory interface: The interface functions that the external program should use. +/* Shared-memory interface: The interface functions that the external program should use. * - * @file - * @author Georg Martin Reinke - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Georg Martin Reinke + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -23,17 +22,17 @@ using namespace villas::node; size_t villas::node::shmem_total_size(int queuelen, int samplelen) { - /* We have the constant const of the memory_type header */ + // We have the constant const of the memory_type header return sizeof(struct memory::Type) - /* and the shared struct itself */ + // and the shared struct itself + sizeof(struct ShmemShared) - /* the size of the actual queue and the queue for the pool */ + // the size of the actual queue and the queue for the pool + queuelen * (2 * sizeof(struct CQueue_cell)) - /* the size of the pool */ + // the size of the pool + queuelen * kernel::getCachelineSize() * CEIL(SAMPLE_LENGTH(samplelen), kernel::getCachelineSize()) - /* a memblock for each allocation (1 shmem_shared, 2 queues, 1 pool) */ + // a memblock for each allocation (1 shmem_shared, 2 queues, 1 pool) + 4 * sizeof(struct memory::Block) - /* and some extra buffer for alignment */ + // and some extra buffer for alignment + 1024; } @@ -48,7 +47,7 @@ int villas::node::shmem_int_open(const char *wname, const char* rname, struct Sh struct stat stat_buf; sem_t *sem_own, *sem_other; - /* Ensure both semaphores exist */ + // Ensure both semaphores exist sem_own = sem_open(wname, O_CREAT, 0600, 0); if (sem_own == SEM_FAILED) return -1; @@ -57,7 +56,7 @@ int villas::node::shmem_int_open(const char *wname, const char* rname, struct Sh if (sem_other == SEM_FAILED) return -2; - /* Open and initialize the shared region for the output queue */ + // Open and initialize the shared region for the output queue retry: fd = shm_open(wname, O_RDWR|O_CREAT|O_EXCL, 0600); if (fd < 0) { if (errno == EEXIST) { @@ -117,7 +116,7 @@ retry: fd = shm_open(wname, O_RDWR|O_CREAT|O_EXCL, 0600); sem_post(sem_own); sem_wait(sem_other); - /* Open and map the other region */ + // Open and map the other region fd = shm_open(rname, O_RDWR, 0); if (fd < 0) return -8; @@ -142,7 +141,7 @@ retry: fd = shm_open(wname, O_RDWR|O_CREAT|O_EXCL, 0600); shm->writers = 0; shm->closed = 0; - /* Unlink the semaphores; we don't need them anymore */ + // Unlink the semaphores; we don't need them anymore sem_unlink(wname); return 0; diff --git a/lib/signal.cpp b/lib/signal.cpp index 7be7139f9..65c0a3c42 100644 --- a/lib/signal.cpp +++ b/lib/signal.cpp @@ -1,9 +1,9 @@ -/** Signal meta data. +/* Signal meta data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -101,20 +101,20 @@ std::string Signal::toString(const union SignalData *d) const return ss.str(); } -/** Check if two signal names are numbered ascendingly +/* Check if two signal names are numbered ascendingly * * E.g. signal3 -> signal4 */ static bool isNextName(const std::string &a, const std::string &b) { - /* Find common prefix */ + // Find common prefix std::string::const_iterator ia, ib; for (ia = a.cbegin(), ib = b.cbegin(); ia != b.cend() && ib != b.cend() && *ia == *ib; ++ia, ++ib); - /* Suffixes */ + // Suffixes auto sa = std::string(ia, a.cend()); auto sb = std::string(ib, b.cend()); diff --git a/lib/signal_data.cpp b/lib/signal_data.cpp index 710249de8..5d7d09575 100644 --- a/lib/signal_data.cpp +++ b/lib/signal_data.cpp @@ -1,9 +1,9 @@ -/** Signal data. +/* Signal data. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/signal_list.cpp b/lib/signal_list.cpp index e64d53e31..18717d0d4 100644 --- a/lib/signal_list.cpp +++ b/lib/signal_list.cpp @@ -1,9 +1,9 @@ -/** Signal metadata list. +/* Signal metadata list. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -91,7 +91,7 @@ void SignalList::dump(Logger logger, const union SignalData *data, unsigned len) Signal::Ptr prevSig; unsigned i = 0; for (auto sig : *this) { - /* Check if this is a sequence of similar signals which can be abbreviated */ + // Check if this is a sequence of similar signals which can be abbreviated if (i >= 1 && i < size() - 1) { if (prevSig->isNext(*sig)) { abbrev = true; diff --git a/lib/signal_type.cpp b/lib/signal_type.cpp index 3766693d3..40c770822 100644 --- a/lib/signal_type.cpp +++ b/lib/signal_type.cpp @@ -1,9 +1,9 @@ -/** Signal types. +/* Signal types. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/socket_addr.cpp b/lib/socket_addr.cpp index d643661f5..b5aad4bd4 100644 --- a/lib/socket_addr.cpp +++ b/lib/socket_addr.cpp @@ -1,9 +1,9 @@ -/** Various functions to work with socket addresses +/* Various functions to work with socket addresses * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -16,7 +16,7 @@ #ifdef WITH_SOCKET_LAYER_ETH #include -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH using namespace villas; using namespace villas::node; @@ -29,7 +29,7 @@ char * villas::node::socket_print_addr(struct sockaddr *saddr) if (!buf) throw MemoryAllocationError(); - /* Address */ + // Address switch (sa->sa.sa_family) { case AF_INET6: inet_ntop(AF_INET6, &sa->sin6.sin6_addr, buf, 64); @@ -45,7 +45,7 @@ char * villas::node::socket_print_addr(struct sockaddr *saddr) for (int i = 1; i < sa->sll.sll_halen; i++) strcatf(&buf, ":%02x", sa->sll.sll_addr[i]); break; -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH case AF_UNIX: snprintf(buf, 256, "%s", sa->sun.sun_path); break; @@ -54,7 +54,7 @@ char * villas::node::socket_print_addr(struct sockaddr *saddr) throw RuntimeError("Unknown address family: '{}'", sa->sa.sa_family); } - /* Port / Interface */ + // Port / Interface switch (sa->sa.sa_family) { case AF_INET6: case AF_INET: @@ -72,7 +72,7 @@ char * villas::node::socket_print_addr(struct sockaddr *saddr) strcatf(&buf, ":%hu", ntohs(sa->sll.sll_protocol)); break; } -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH } return buf; @@ -80,13 +80,13 @@ char * villas::node::socket_print_addr(struct sockaddr *saddr) int villas::node::socket_parse_address(const char *addr, struct sockaddr *saddr, enum SocketLayer layer, int flags) { - /** @todo Add support for IPv6 */ + // @todo Add support for IPv6 union sockaddr_union *sa = (union sockaddr_union *) saddr; char *copy = strdup(addr); int ret; - if (layer == SocketLayer::UNIX) { /* Format: "/path/to/socket" */ + if (layer == SocketLayer::UNIX) { // Format: "/path/to/socket" sa->sun.sun_family = AF_UNIX; if (strlen(addr) > sizeof(sa->sun.sun_path) - 1) @@ -97,21 +97,21 @@ int villas::node::socket_parse_address(const char *addr, struct sockaddr *saddr, ret = 0; } #ifdef WITH_SOCKET_LAYER_ETH - else if (layer == SocketLayer::ETH) { /* Format: "ab:cd:ef:12:34:56%ifname:protocol" */ - /* Split string */ + else if (layer == SocketLayer::ETH) { // Format: "ab:cd:ef:12:34:56%ifname:protocol" + // Split string char *lasts; char *node = strtok_r(copy, "%", &lasts); char *ifname = strtok_r(nullptr, ":", &lasts); char *proto = strtok_r(nullptr, "\0", &lasts); - /* Parse link layer (MAC) address */ + // Parse link layer (MAC) address struct ether_addr *mac = ether_aton(node); if (!mac) throw RuntimeError("Failed to parse MAC address: {}", node); memcpy(&sa->sll.sll_addr, &mac->ether_addr_octet, ETHER_ADDR_LEN); - /* Get interface index from name */ + // Get interface index from name kernel::nl::init(); struct nl_cache *cache = nl_cache_mngt_require("route/link"); @@ -126,14 +126,14 @@ int villas::node::socket_parse_address(const char *addr, struct sockaddr *saddr, ret = 0; } -#endif /* WITH_SOCKET_LAYER_ETH */ - else { /* Format: "192.168.0.10:12001" */ +#endif // WITH_SOCKET_LAYER_ETH + else { // Format: "192.168.0.10:12001" struct addrinfo hint = { .ai_flags = flags, .ai_family = AF_UNSPEC }; - /* Split string */ + // Split string char *lasts; char *node = strtok_r(copy, ":", &lasts); char *service = strtok_r(nullptr, "\0", &lasts); @@ -160,12 +160,12 @@ int villas::node::socket_parse_address(const char *addr, struct sockaddr *saddr, throw RuntimeError("Invalid address type"); } - /* Lookup address */ + // Lookup address struct addrinfo *result; ret = getaddrinfo(node, (layer == SocketLayer::IP) ? nullptr : service, &hint, &result); if (!ret) { if (layer == SocketLayer::IP) { - /* We mis-use the sin_port field to store the IP protocol number on RAW sockets */ + // We mis-use the sin_port field to store the IP protocol number on RAW sockets struct sockaddr_in *sin = (struct sockaddr_in *) result->ai_addr; sin->sin_port = htons(result->ai_protocol); } @@ -215,7 +215,7 @@ int villas::node::socket_compare_addr(struct sockaddr *x, struct sockaddr *y) CMP(xu->sll.sll_halen, yu->sll.sll_halen); return memcmp(xu->sll.sll_addr, yu->sll.sll_addr, xu->sll.sll_halen); -#endif /* WITH_SOCKET_LAYER_ETH */ +#endif // WITH_SOCKET_LAYER_ETH default: return -1; diff --git a/lib/stats.cpp b/lib/stats.cpp index fa87ee180..e20cb9db0 100644 --- a/lib/stats.cpp +++ b/lib/stats.cpp @@ -1,9 +1,9 @@ -/** Statistic collection. +/* Statistic collection. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/lib/super_node.cpp b/lib/super_node.cpp index 471e94951..670ece9e1 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -1,9 +1,9 @@ -/** The super node object holding the state of the application. +/* The super node object holding the state of the application. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -56,12 +56,12 @@ SuperNode::SuperNode() : if (ret) throw SystemError("Failed to determine hostname"); - /* Default UUID is derived from hostname */ + // Default UUID is derived from hostname uuid::generateFromString(uuid, hname); #ifdef WITH_NETEM - kernel::nl::init(); /* Fill link cache */ -#endif /* WITH_NETEM */ + kernel::nl::init(); // Fill link cache +#endif // WITH_NETEM logger = logging.get("super_node"); } @@ -116,12 +116,12 @@ void SuperNode::parse(json_t *root) #ifdef WITH_WEB if (json_http) web.parse(json_http); -#endif /* WITH_WEB */ +#endif // WITH_WEB if (json_logging) logging.parse(json_logging); - /* Parse nodes */ + // Parse nodes if (json_nodes) { if (!json_is_object(json_nodes)) throw ConfigError(json_nodes, "node-config-nodes", "Setting 'nodes' must be a group with node name => group mappings."); @@ -167,7 +167,7 @@ void SuperNode::parse(json_t *root) } } - /* Parse paths */ + // Parse paths if (json_paths) { if (!json_is_array(json_paths)) logger->warn("Setting 'paths' must be a list of objects"); @@ -184,12 +184,12 @@ parse: auto *p = new Path(); paths.push_back(p); if (p->isReversed()) { - /* Only simple paths can be reversed */ + // Only simple paths can be reversed ret = p->isSimple(); if (!ret) throw RuntimeError("Complex paths can not be reversed!"); - /* Parse a second time with in/out reversed */ + // Parse a second time with in/out reversed json_path = json_copy(json_path); json_t *json_in = json_object_get(json_path, "in"); @@ -256,7 +256,7 @@ void SuperNode::startInterfaces() if (ret) throw RuntimeError("Failed to start network interface: {}", i->getName()); } -#endif /* WITH_NETEM */ +#endif // WITH_NETEM } void SuperNode::startNodes() @@ -408,7 +408,7 @@ void SuperNode::stopInterfaces() if (ret) throw RuntimeError("Failed to stop interface: {}", i->getName()); } -#endif /* WITH_NETEM */ +#endif // WITH_NETEM } void SuperNode::stop() @@ -467,7 +467,7 @@ int SuperNode::periodic() #ifdef WITH_HOOKS p->hooks.periodic(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS } } @@ -476,7 +476,7 @@ int SuperNode::periodic() #ifdef WITH_HOOKS n->in.hooks.periodic(); n->out.hooks.periodic(); -#endif /* WITH_HOOKS */ +#endif // WITH_HOOKS } } @@ -540,4 +540,4 @@ graph_t * SuperNode::getGraph() return g; } -#endif /* WITH_GRAPHVIZ */ +#endif // WITH_GRAPHVIZ diff --git a/lib/usb.cpp b/lib/usb.cpp index 222cdb9bb..d00fb463f 100644 --- a/lib/usb.cpp +++ b/lib/usb.cpp @@ -1,10 +1,9 @@ -/** Helpers for USB node-types +/* Helpers for USB node-types * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/lib/web.cpp b/lib/web.cpp index f96f79850..5c95d2455 100644 --- a/lib/web.cpp +++ b/lib/web.cpp @@ -1,9 +1,9 @@ -/** LWS-releated functions. +/* LWS-releated functions. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -23,10 +23,10 @@ using namespace villas; using namespace villas::node; -/* Forward declarations */ +// Forward declarations lws_callback_function villas::node::websocket_protocol_cb; -/** List of libwebsockets protocols. */ +// List of libwebsockets protocols. lws_protocols protocols[] = { { .name = "http", @@ -41,7 +41,7 @@ lws_protocols protocols[] = { .per_session_data_size = sizeof(api::Session), .rx_buffer_size = 1024 }, -#endif /* WITH_API */ +#endif // WITH_API #ifdef WITH_NODE_WEBSOCKET { .name = "live", @@ -49,7 +49,7 @@ lws_protocols protocols[] = { .per_session_data_size = sizeof(websocket_connection), .rx_buffer_size = 0 }, -#endif /* WITH_NODE_WEBSOCKET */ +#endif // WITH_NODE_WEBSOCKET #ifdef WITH_NODE_WEBRTC { .name = "webrtc-signaling", @@ -63,13 +63,14 @@ lws_protocols protocols[] = { } }; -/** List of libwebsockets mounts. */ -static lws_http_mount mounts[] = { +// List of libwebsockets mounts. +static +lws_http_mount mounts[] = { #ifdef WITH_API { - .mount_next = nullptr, /* linked-list "next" */ - .mountpoint = "/api/v2", /* mountpoint URL */ - .origin = "http-api", /* protocol */ + .mount_next = nullptr, // linked-list "next" + .mountpoint = "/api/v2", // mountpoint URL + .origin = "http-api", // protocol .def = nullptr, .protocol = "http-api", .cgienv = nullptr, @@ -81,14 +82,15 @@ static lws_http_mount mounts[] = { .cache_reusable = 0, .cache_revalidate = 0, .cache_intermediaries = 0, - .origin_protocol = LWSMPRO_CALLBACK, /* dynamic */ - .mountpoint_len = 7 /* char count */ + .origin_protocol = LWSMPRO_CALLBACK, // dynamic + .mountpoint_len = 7 // char count } -#endif /* WITH_API */ +#endif // WITH_API }; -/** List of libwebsockets extensions. */ -static const lws_extension extensions[] = { +// List of libwebsockets extensions. +static +const lws_extension extensions[] = { #ifdef LWS_DEFLATE_FOUND { .name = "permessage-deflate", @@ -100,7 +102,7 @@ static const lws_extension extensions[] = { .callback = lws_extension_callback_pm_deflate, .client_offer = "deflate_frame" }, -#endif /* LWS_DEFLATE_FOUND */ +#endif // LWS_DEFLATE_FOUND { nullptr /* terminator */ } }; @@ -111,7 +113,7 @@ void Web::lwsLogger(int lws_lvl, const char *msg) { if (nl) *nl = 0; - /* Decrease severity for some errors. */ + // Decrease severity for some errors if (strstr(msg, "Unable to open") == msg) lws_lvl = LLL_WARN; @@ -131,7 +133,7 @@ void Web::lwsLogger(int lws_lvl, const char *msg) { logger->info("{}", msg); break; - default: /* Everything else is debug */ + default: // Everything else is debug logger->debug("{}", msg); } } @@ -223,7 +225,7 @@ int Web::parse(json_t *json) void Web::start() { - /* Start server */ + // Start server lws_context_creation_info ctx_info; memset(&ctx_info, 0, sizeof(ctx_info)); @@ -240,7 +242,7 @@ void Web::start() ctx_info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; ctx_info.user = (void *) this; #if LWS_LIBRARY_VERSION_NUMBER <= 3000000 - /* See: https://github.com/warmcat/libwebsockets/issues/1249 */ + // See: https://github.com/warmcat/libwebsockets/issues/1249 ctx_info.max_http_header_pool = 1024; #endif ctx_info.mounts = mounts; @@ -263,7 +265,7 @@ void Web::start() if (vhost == nullptr) throw RuntimeError("Failed to initialize virtual host"); - /* Start thread */ + // Start thread running = true; thread = std::thread(&Web::worker, this); diff --git a/lua/hooks/test.lua b/lua/hooks/test.lua index 51f2a6f29..3ed71af18 100644 --- a/lua/hooks/test.lua +++ b/lua/hooks/test.lua @@ -1,5 +1,8 @@ -- Install with: luarocks install lunajson luasockets +-- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +-- SPDX-License-Identifier: Apache-2.0 + json = require 'lunajson' http = require 'socket.http' diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index 06f551c05..0767f6fcd 100644 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 if (NOT DEFINED DEPLOY_USER) set(DEPLOY_USER deploy) diff --git a/packaging/archlinux/.gitignore b/packaging/archlinux/.gitignore index 892a7abe8..a36160779 100644 --- a/packaging/archlinux/.gitignore +++ b/packaging/archlinux/.gitignore @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + pkg/* src/* *.tar.bz2 diff --git a/packaging/archlinux/PKGBUILD b/packaging/archlinux/PKGBUILD index c2b71ce7a..15af49b2a 100644 --- a/packaging/archlinux/PKGBUILD +++ b/packaging/archlinux/PKGBUILD @@ -1,5 +1,7 @@ # $Id$ # Maintainer: Daniel Krebs +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 pkgname=villas-node pkgdesc="Connecting real-time power grid simulation equipment" diff --git a/packaging/deps.sh b/packaging/deps.sh index cf77f6dfd..44ddebb81 100644 --- a/packaging/deps.sh +++ b/packaging/deps.sh @@ -1,4 +1,6 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Abort the script on any failed command set -e diff --git a/packaging/docker/Dockerfile.debian b/packaging/docker/Dockerfile.debian index 7798d0ef6..c149cd608 100644 --- a/packaging/docker/Dockerfile.debian +++ b/packaging/docker/Dockerfile.debian @@ -1,9 +1,8 @@ # Debian Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # You can choose between Debian and Ubuntu here ARG DISTRO=debian diff --git a/packaging/docker/Dockerfile.debian-multiarch b/packaging/docker/Dockerfile.debian-multiarch index e16bfe55d..dd3d26850 100644 --- a/packaging/docker/Dockerfile.debian-multiarch +++ b/packaging/docker/Dockerfile.debian-multiarch @@ -1,9 +1,8 @@ # Debian Multiarch Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # You can choose between Debian and Ubuntu here ARG DISTRO=debian diff --git a/packaging/docker/Dockerfile.fedora b/packaging/docker/Dockerfile.fedora index 9753dc5f4..40bd67296 100644 --- a/packaging/docker/Dockerfile.fedora +++ b/packaging/docker/Dockerfile.fedora @@ -1,9 +1,8 @@ # Fedora Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 ARG DISTRO=fedora ARG FEDORA_VERSION=36 diff --git a/packaging/docker/Dockerfile.fedora-minimal b/packaging/docker/Dockerfile.fedora-minimal index 5124baca2..460beb6d2 100644 --- a/packaging/docker/Dockerfile.fedora-minimal +++ b/packaging/docker/Dockerfile.fedora-minimal @@ -1,9 +1,8 @@ # Minimal Fedora Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 ARG DISTRO=fedora ARG FEDORA_VERSION=36 diff --git a/packaging/docker/Dockerfile.rocky b/packaging/docker/Dockerfile.rocky index 329376923..ffc3ed194 100644 --- a/packaging/docker/Dockerfile.rocky +++ b/packaging/docker/Dockerfile.rocky @@ -1,9 +1,8 @@ # Rockylinux Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 ARG DISTRO=rockylinux ARG ROCKY_VERSION=9 diff --git a/packaging/docker/Dockerfile.ubuntu b/packaging/docker/Dockerfile.ubuntu index 07bc6b807..21fbef364 100644 --- a/packaging/docker/Dockerfile.ubuntu +++ b/packaging/docker/Dockerfile.ubuntu @@ -1,9 +1,8 @@ # Ubuntu Dockerfile # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # You can choose between Debian and Ubuntu here ARG DISTRO=ubuntu diff --git a/packaging/libvillas.pc.in b/packaging/libvillas.pc.in index 512fbcf78..f1a9a2573 100644 --- a/packaging/libvillas.pc.in +++ b/packaging/libvillas.pc.in @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@CMAKE_INSTALL_LIBDIR@ diff --git a/packaging/live-iso/.gitignore b/packaging/live-iso/.gitignore index bb2998942..074e0fe8f 100644 --- a/packaging/live-iso/.gitignore +++ b/packaging/live-iso/.gitignore @@ -1,4 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + villas.iso build/ *.log - diff --git a/packaging/live-iso/.gitlab-ci.yml b/packaging/live-iso/.gitlab-ci.yml index c89a63d55..73c7c936a 100644 --- a/packaging/live-iso/.gitlab-ci.yml +++ b/packaging/live-iso/.gitlab-ci.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 +--- variables: GIT_STRATEGY: fetch GIT_SUBMODULE_STRATEGY: recursive @@ -12,7 +15,6 @@ stages: - build # Stage: prepare -############################################################################## # Build docker image which is used to build & test VILLASnode docker: @@ -27,7 +29,6 @@ docker: - trigger # Stage: build -############################################################################## iso: stage: build diff --git a/packaging/live-iso/Dockerfile b/packaging/live-iso/Dockerfile index 43af5f7ed..c2e87cccc 100644 --- a/packaging/live-iso/Dockerfile +++ b/packaging/live-iso/Dockerfile @@ -1,9 +1,8 @@ # Dockerfile for creating VILLAS live images # -# @author Steffen Vogel -# @copyright 2017-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2017-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 FROM fedora:36 diff --git a/packaging/live-iso/Makefile b/packaging/live-iso/Makefile index a46b3f857..6b4419ffc 100644 --- a/packaging/live-iso/Makefile +++ b/packaging/live-iso/Makefile @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + NAME ?= VILLASlive RELEASEVER ?= 35 RELEASEARCH ?= x86_64 diff --git a/packaging/live-iso/README.md b/packaging/live-iso/README.md index 231525c50..7316c1409 100644 --- a/packaging/live-iso/README.md +++ b/packaging/live-iso/README.md @@ -9,3 +9,8 @@ https://villas.fein-aachen.org/docs/liveusb/ ## Contact - Steffen Vogel + +## License + +- SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +- SPDX-License-Identifier: Apache-2.0 diff --git a/packaging/live-iso/ensure_loop.sh b/packaging/live-iso/ensure_loop.sh index 875535f99..c0ade25a4 100755 --- a/packaging/live-iso/ensure_loop.sh +++ b/packaging/live-iso/ensure_loop.sh @@ -2,6 +2,8 @@ # Ensure that we have at least two usable loop devices inside our Docker container # # Source: https://github.com/jpetazzo/dind/issues/19#issuecomment-48859883 +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 ensure_loop(){ num="$1" diff --git a/packaging/live-iso/villas.ks b/packaging/live-iso/villas.ks index 0be39e752..3d3f0913a 100644 --- a/packaging/live-iso/villas.ks +++ b/packaging/live-iso/villas.ks @@ -1,6 +1,7 @@ -################################################################################ # Kickstart file for VILLAS installation -################################################################################ +# +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Configuration lang en_US.UTF-8 @@ -27,7 +28,6 @@ repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?rep repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch -################################################################################ # Install packages %packages @core @@ -129,7 +129,6 @@ librdkafka-devel %end -################################################################################ # Custom post installer %post diff --git a/packaging/nix/README.md b/packaging/nix/README.md index f7abf407d..e4454e46e 100644 --- a/packaging/nix/README.md +++ b/packaging/nix/README.md @@ -1,6 +1,10 @@ - # `villas` as a Nix Flake + + `VILLASnode` is also packaged as a Nix Flake. ## Setup Nix @@ -348,3 +352,8 @@ docker load < $(nix build --no-link --print-out-paths .#image) [`villas.nix`]: ./villas.nix [`flake.nix`]: ./flake.nix + +## License + +- SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +- SPDX-License-Identifier: Apache-2.0 diff --git a/packaging/nix/ethercat.nix b/packaging/nix/ethercat.nix index eacaf9151..f8f099139 100644 --- a/packaging/nix/ethercat.nix +++ b/packaging/nix/ethercat.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { autoconf, automake, diff --git a/packaging/nix/flake.nix b/packaging/nix/flake.nix index b8c8dad38..f2a91270b 100644 --- a/packaging/nix/flake.nix +++ b/packaging/nix/flake.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { description = "a tool for connecting real-time power grid simulation equipment"; diff --git a/packaging/nix/lib60870.nix b/packaging/nix/lib60870.nix index b1595ab44..5aac968ec 100644 --- a/packaging/nix/lib60870.nix +++ b/packaging/nix/lib60870.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { cmake, lib, diff --git a/packaging/nix/libdatachannel.nix b/packaging/nix/libdatachannel.nix index 388c845eb..436916808 100644 --- a/packaging/nix/libdatachannel.nix +++ b/packaging/nix/libdatachannel.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { cmake, lib, diff --git a/packaging/nix/libiec61850.nix b/packaging/nix/libiec61850.nix index df8426ed1..81ffdc86a 100644 --- a/packaging/nix/libiec61850.nix +++ b/packaging/nix/libiec61850.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { cmake, lib, diff --git a/packaging/nix/villas.nix b/packaging/nix/villas.nix index 0973436df..fb88cdecb 100644 --- a/packaging/nix/villas.nix +++ b/packaging/nix/villas.nix @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +# SPDX-License-Identifier: Apache-2.0 { # general configuration src, diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 11134a99e..b1226a668 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Plugins link_libraries(villas) diff --git a/plugins/example_hook.cpp b/plugins/example_hook.cpp index fc96abdeb..0ab18dfca 100644 --- a/plugins/example_hook.cpp +++ b/plugins/example_hook.cpp @@ -1,9 +1,9 @@ -/** A simple example hook function which can be loaded as a plugin. +/* A simple example hook function which can be loaded as a plugin. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -16,13 +16,14 @@ class ExampleHook : public Hook { public: using Hook::Hook; - virtual void restart() + virtual + void restart() { logger->info("The path {} restarted!", path->toString()); } }; -/* Register hook */ +// Register hook static char n[] = "example"; static char d[] = "This is just a simple example hook"; static HookPlugin p; diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index e13cf6187..07d184453 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,9 +1,8 @@ # Makefile. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 if(DEFINED PROTOBUF_COMPILER AND PROTOBUF_FOUND) add_custom_command( diff --git a/python/README.md b/python/README.md index 113ad2b1f..9ac65417e 100644 --- a/python/README.md +++ b/python/README.md @@ -10,13 +10,9 @@ villas-file-merge testfile.dat testfile2.dat | villas-file-filter 3 5 > output.d User documentation is available here: -## Copyright - -2014-2022, Institute for Automation of Complex Power Systems, EONERC - ## License -This project is released under the terms of the [Apache 2.0 license](COPYING.md). +This project is released under the terms of the [Apache 2.0 license](../LICENSE). We kindly ask all academic publications employing components of VILLASframework to cite one of the following papers: @@ -25,6 +21,10 @@ We kindly ask all academic publications employing components of VILLASframework For other licensing options please consult [Prof. Antonello Monti](mailto:amonti@eonerc.rwth-aachen.de). +- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +- SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH +- SPDX-License-Identifier: Apache-2.0 + ## Contact [![EONERC ACS Logo](doc/pictures/eonerc_logo.png)](http://www.acs.eonerc.rwth-aachen.de) diff --git a/python/examples/Shmem_CIGRE_MV.py b/python/examples/Shmem_CIGRE_MV.py index c5cb8d713..8d1cf1b0b 100644 --- a/python/examples/Shmem_CIGRE_MV.py +++ b/python/examples/Shmem_CIGRE_MV.py @@ -1,6 +1,9 @@ import time from villas.node.node import Node as VILLASnode +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + # This could be moved to the DPsim Python code later diff --git a/python/setup.py b/python/setup.py index 689ec167c..d8092dbe6 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + from setuptools import setup, find_namespace_packages from glob import glob import sys diff --git a/python/villas/node/communicate.py b/python/villas/node/communicate.py index 91996e098..d78ed5741 100644 --- a/python/villas/node/communicate.py +++ b/python/villas/node/communicate.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + import time import logging import sys diff --git a/python/villas/node/node.py b/python/villas/node/node.py index 82a8ac1b2..f88fef939 100644 --- a/python/villas/node/node.py +++ b/python/villas/node/node.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + import json import os import tempfile diff --git a/python/villas/node/sample.py b/python/villas/node/sample.py index 2f8e5914b..2bbb2f910 100644 --- a/python/villas/node/sample.py +++ b/python/villas/node/sample.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + import re from datetime import datetime from functools import total_ordering diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4993367ff..fab2f82ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(SRCS villas-convert diff --git a/src/villas-compare.cpp b/src/villas-compare.cpp index 7006f946b..6305ede22 100644 --- a/src/villas-compare.cpp +++ b/src/villas-compare.cpp @@ -1,9 +1,9 @@ -/** Compare two data files. +/* Compare two data files. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -49,7 +49,7 @@ public: json_t *json_format; json_error_t err; - /* Try parsing format config as JSON */ + // Try parsing format config as JSON json_format = json_loads(format.c_str(), 0, &err); formatter = json_format ? FormatFactory::make(json_format) @@ -135,7 +135,7 @@ protected: void parse() { - /* Parse Arguments */ + // Parse Arguments int c; char *endptr; while ((c = getopt (argc, argv, "he:vTsf:t:Vd:")) != -1) { @@ -189,7 +189,7 @@ check: if (optarg == endptr) exit(EXIT_FAILURE); } - /* Open files */ + // Open files for (int i = 0; i < argc - optind; i++) filenames.push_back(argv[optind + i]); } @@ -203,7 +203,7 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to initialize pool"); - /* Open files */ + // Open files std::vector sides; for (auto filename : filenames) { auto *s = new CompareSide(filename, format, dtypes, &pool); @@ -215,7 +215,7 @@ check: if (optarg == endptr) line = 0; while (true) { - /* Read next sample from all files */ + // Read next sample from all files retry: eofs = 0; for (auto side : sides) { ret = feof(side->stream); @@ -243,7 +243,7 @@ retry: eofs = 0; if (failed) goto retry; - /* We compare all files against the first one */ + // We compare all files against the first one for (auto side : sides) { ret = sample_cmp(sides[0]->sample, side->sample, epsilon, flags); if (ret) { diff --git a/src/villas-conf2json.cpp b/src/villas-conf2json.cpp index a0e3d4cac..aea969fc2 100644 --- a/src/villas-conf2json.cpp +++ b/src/villas-conf2json.cpp @@ -1,9 +1,9 @@ -/** Convert old style config to new JSON format. +/* Convert old style config to new JSON format. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/src/villas-convert.cpp b/src/villas-convert.cpp index aa9969895..b1005cacf 100644 --- a/src/villas-convert.cpp +++ b/src/villas-convert.cpp @@ -1,10 +1,9 @@ -/** Convert between samples IO formats +/* Convert between samples IO formats * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -71,7 +70,7 @@ protected: void parse() { - /* Parse optional command line arguments */ + // Parse optional command line arguments int c; while ((c = getopt(argc, argv, "Vhd:i:o:t:")) != -1) { switch (c) { @@ -117,7 +116,7 @@ protected: json_error_t err; std::string format = dirs[i].format; - /* Try parsing format config as JSON */ + // Try parsing format config as JSON json_format = json_loads(format.c_str(), 0, &err); dirs[i].formatter = json_format ? FormatFactory::make(json_format) @@ -133,7 +132,7 @@ protected: auto isLine = dynamic_cast(dirs[0].formatter) != nullptr; auto cnt = isLine ? 1 : 128; - /* Initialize memory */ + // Initialize memory struct Pool pool; ret = pool_init(&pool, cnt, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), &memory::heap); if (ret) diff --git a/src/villas-graph.cpp b/src/villas-graph.cpp index ffd4a29fe..15f6cce4a 100644 --- a/src/villas-graph.cpp +++ b/src/villas-graph.cpp @@ -1,10 +1,9 @@ -/** Create a graph representation of the VILLASnode configuration file +/* Create a graph representation of the VILLASnode configuration file * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -23,8 +22,7 @@ struct GVC_s { char *config_path; bool config_found; - /* gvParseArgs */ - char **input_filenames; + char **input_filenames; // gvParseArgs }; namespace villas { @@ -45,7 +43,7 @@ public: if (ret) throw RuntimeError("Failed to initialize memory"); - this->argv[0] = (char *) "neato"; /* Default layout engine */ + this->argv[0] = (char *) "neato"; // Default layout engine gvc = gvContext(); } @@ -84,26 +82,26 @@ protected: configFilename = filenames.front(); } - virtual void handler(int signal, siginfo_t *siginfp, void *) + virtual + void handler(int signal, siginfo_t *siginfp, void *) { #ifndef _WIN32 switch (signal) { case SIGINT: - /* If interrupted we try to produce a partial rendering before exiting */ + // If interrupted we try to produce a partial rendering before exiting if (graph) gvRenderJobs(gvc, graph); break; - case SIGUSR1: - /* Note that we don't call gvFinalize() so that we don't start event-driven - * devices like -Tgtk or -Txlib */ + // Note that we don't call gvFinalize() so that we don't start event-driven + // devices like -Tgtk or -Txlib */ exit(gvFreeContext(gvc)); break; default: { } } -#endif /* _WIN32 */ +#endif // _WIN32 } int main() @@ -118,7 +116,7 @@ protected: graph = sn.getGraph(); - ret = gvLayoutJobs(gvc, graph); /* take layout engine from command line */ + ret = gvLayoutJobs(gvc, graph); // Take layout engine from command line if (ret) return ret; diff --git a/src/villas-hook.cpp b/src/villas-hook.cpp index 30c1797dd..240ff0a32 100644 --- a/src/villas-hook.cpp +++ b/src/villas-hook.cpp @@ -1,10 +1,9 @@ -/** Receive messages from server snd print them on stdout. +/* Receive messages from server snd print them on stdout. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -122,7 +121,7 @@ protected: int ret; std::string file; - /* Parse optional command line arguments */ + // Parse optional command line arguments int c; char *endptr; while ((c = getopt(argc, argv, "Vhv:d:f:F:t:o:c:")) != -1) { @@ -206,7 +205,7 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to initilize memory pool"); - /* Initialize IO */ + // Initialize IO struct desc { std::string dir; std::string format; @@ -221,7 +220,7 @@ check: if (optarg == endptr) json_t *json_format; json_error_t err; - /* Try parsing format config as JSON */ + // Try parsing format config as JSON json_format = json_loads(d.format.c_str(), 0, &err); (*d.formatter) = json_format ? FormatFactory::make(json_format) @@ -232,7 +231,7 @@ check: if (optarg == endptr) (*d.formatter)->start(dtypes, (int) SampleFlags::HAS_ALL); } - /* Initialize hook */ + // Initialize hook auto hf = plugin::registry->lookup(hook); if (!hf) throw RuntimeError("Unknown hook function '{}'", hook); diff --git a/src/villas-node.cpp b/src/villas-node.cpp index 232e470cd..ca2212075 100644 --- a/src/villas-node.cpp +++ b/src/villas-node.cpp @@ -1,9 +1,9 @@ -/** Main routine. +/* Main routine. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -88,7 +88,7 @@ protected: << "Usage: villas-node OPAL_ASYNC_SHMEM_NAME OPAL_ASYNC_SHMEM_SIZE OPAL_PRINT_SHMEM_NAME" << std::endl << " This type of invocation is used by OPAL-RT Asynchronous processes." << std::endl << " See in the RT-LAB User Guide for more information." << std::endl << std::endl -#endif /* WITH_NODE_OPAL */ +#endif // WITH_NODE_OPAL << "Supported node-types:" << std::endl; for (auto p : registry->lookup()) { @@ -127,7 +127,7 @@ protected: void parse() { - /* Check arguments */ + // Check arguments #ifdef WITH_NODE_OPAL if (argc != 4) { usage(); @@ -139,7 +139,7 @@ protected: uri = "villas-node.conf"; #else - /* Parse optional command line arguments */ + // Parse optional command line arguments int c; while ((c = getopt(argc, argv, "hCVd:")) != -1) { switch (c) { @@ -170,7 +170,7 @@ protected: usage(); exit(EXIT_FAILURE); } -#endif /* ENABLE_OPAL_ASYNC */ +#endif // ENABLE_OPAL_ASYNC } int main() @@ -214,4 +214,3 @@ int main(int argc, char *argv[]) return t.run(); } - diff --git a/src/villas-pipe.cpp b/src/villas-pipe.cpp index 9e8d6db76..d7b2baa0d 100644 --- a/src/villas-pipe.cpp +++ b/src/villas-pipe.cpp @@ -1,10 +1,9 @@ -/** Receive messages from server snd print them on stdout. +/* Receive messages from server snd print them on stdout. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -63,7 +62,7 @@ public: auto loggerName = fmt::format("pipe:{}", name); logger = logging.get(loggerName); - /* Initialize memory */ + // Initialize memory unsigned pool_size = LOG2_CEIL(MAX(node->out.vectorize, node->in.vectorize)); int ret = pool_init(&pool, pool_size, SAMPLE_LENGTH(DEFAULT_SAMPLE_LENGTH), node->getMemoryType()); @@ -133,7 +132,7 @@ public: logger->warn("Failed to read from stdin"); } - /* Fill in missing sequence numbers */ + // Fill in missing sequence numbers for (int i = 0; i < scanned; i++) { if (smps[i]->flags & (int) SampleFlags::HAS_SEQUENCE) last_sequenceno = smps[i]->sequence; @@ -254,7 +253,7 @@ public: protected: std::atomic stop; - SuperNode sn; /**< The global configuration */ + SuperNode sn; // The global configuration Format *formatter; int timeout; @@ -419,7 +418,7 @@ check: if (optarg == endptr) else logger->warn("No configuration file specified. Starting unconfigured. Use the API to configure this instance."); - /* Try parsing format config as JSON */ + // Try parsing format config as JSON json_format = json_loads(format.c_str(), 0, &err); formatter = json_format ? FormatFactory::make(json_format) @@ -440,12 +439,12 @@ check: if (optarg == endptr) throw RuntimeError("Node {} can not send data. Consider using receive-only mode by using '-r' option", nodestr); #if defined(WITH_NODE_WEBSOCKET) && defined(WITH_WEB) - /* Only start web subsystem if villas-pipe is used with a websocket node */ + // Only start web subsystem if villas-pipe is used with a websocket node if (node->getFactory()->getFlags() & (int) NodeFactory::Flags::REQUIRES_WEB) { Web *w = sn.getWeb(); w->start(); } -#endif /* WITH_NODE_WEBSOCKET */ +#endif // WITH_NODE_WEBSOCKET if (reverse) node->reverse(); @@ -474,7 +473,7 @@ check: if (optarg == endptr) recv.dir->startThread(); send.dir->startThread(); - /* Arm timeout timer */ + // Arm timeout timer alarm(timeout); while (!stop) @@ -496,12 +495,12 @@ check: if (optarg == endptr) throw RuntimeError("Failed to stop node type {}: reason={}", node->getFactory()->getName(), ret); #if defined(WITH_NODE_WEBSOCKET) && defined(WITH_WEB) - /* Only start web subsystem if villas-pipe is used with a websocket node */ + // Only start web subsystem if villas-pipe is used with a websocket node if (node->getFactory()->getFlags() & (int) NodeFactory::Flags::REQUIRES_WEB) { Web *w = sn.getWeb(); w->stop(); } -#endif /* WITH_NODE_WEBSOCKET */ +#endif // WITH_NODE_WEBSOCKET delete formatter; @@ -509,7 +508,6 @@ check: if (optarg == endptr) } }; - } // namespace tools } // namespace node } // namespace villas diff --git a/src/villas-relay.cpp b/src/villas-relay.cpp index 6f107de1b..3dc8e108a 100644 --- a/src/villas-relay.cpp +++ b/src/villas-relay.cpp @@ -1,9 +1,9 @@ -/** Simple WebSocket relay facilitating client-to-client connections. +/* Simple WebSocket relay facilitating client-to-client connections. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -65,7 +65,7 @@ RelaySession * RelaySession::get(Relay *r, lws *wsi) * Will select the session with the name 'node_1' */ - /* Get path of incoming request */ + // Get path of incoming request lws_hdr_copy(wsi, uri, sizeof(uri), WSI_TOKEN_GET_URI); if (strlen(uri) <= 1) throw InvalidUrlException(); @@ -218,14 +218,14 @@ Relay::Relay(int argc, char *argv[]) : hostname = hname; - /* Default UUID is derived from hostname */ + // Default UUID is derived from hostname uuid::generateFromString(uuid, hname); ret = memory::init(0); if (ret) throw RuntimeError("Failed to initialize memory"); - /* Initialize logging */ + // Initialize logging lws_set_log_level(Web::lwsLogLevel(logging.getLevel()), Web::lwsLogger); protocols = { @@ -266,14 +266,14 @@ int Relay::httpProtocolCallback(lws *wsi, enum lws_callback_reasons reason, void if (lws_add_http_common_headers(wsi, HTTP_STATUS_OK, "application/json", - LWS_ILLEGAL_HTTP_CONTENT_LEN, /* no content len */ + LWS_ILLEGAL_HTTP_CONTENT_LEN, // no content len &p, end)) return 1; if (lws_finalize_write_http_header(wsi, start, &p, end)) return 1; - /* Write the body separately */ + // Write the body separately lws_callback_on_writable(wsi); return 0; @@ -441,7 +441,7 @@ check: } int Relay::main() { - /* Start server */ + // Start server lws_context_creation_info ctx_info = { 0 }; protocols[2].name = protocol.c_str(); @@ -489,14 +489,14 @@ const std::vector Relay::extensions = { lws_extension_callback_pm_deflate, "deflate_frame" }, -#endif /* LWS_DEFLATE_FOUND */ +#endif // LWS_DEFLATE_FOUND { nullptr /* terminator */ } }; const lws_http_mount Relay::mount = { - .mount_next = nullptr, /* linked-list "next" */ - .mountpoint = "/api/v1", /* mountpoint URL */ - .origin = nullptr, /* protocol */ + .mount_next = nullptr, // linked-list "next" + .mountpoint = "/api/v1", // mountpoint URL + .origin = nullptr, // protocol .def = nullptr, .protocol = "http-api", .cgienv = nullptr, @@ -508,8 +508,8 @@ const lws_http_mount Relay::mount = { .cache_reusable = 0, .cache_revalidate = 0, .cache_intermediaries = 0, - .origin_protocol = LWSMPRO_CALLBACK, /* dynamic */ - .mountpoint_len = 7, /* char count */ + .origin_protocol = LWSMPRO_CALLBACK, // dynamic + .mountpoint_len = 7, // char count .basic_auth_login_file = nullptr, }; @@ -523,5 +523,3 @@ int main(int argc, char *argv[]) return t.run(); } - - diff --git a/src/villas-relay.hpp b/src/villas-relay.hpp index 3b8fd6000..c33b35197 100644 --- a/src/villas-relay.hpp +++ b/src/villas-relay.hpp @@ -1,10 +1,9 @@ -/** Simple WebSocket relay facilitating client-to-client connections. +/* Simple WebSocket relay facilitating client-to-client connections. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +18,7 @@ namespace villas { namespace node { namespace tools { -/* Forward declarations */ +// Forward declarations class Relay; class RelaySession; class RelayConnection; @@ -32,7 +31,7 @@ class Frame : public std::vector { public: Frame() { reserve(LWS_PRE); - /* lws_write() requires LWS_PRE bytes in front of the payload */ + // lws_write() requires LWS_PRE bytes in front of the payload insert(end(), LWS_PRE, 0); } @@ -61,10 +60,12 @@ protected: int connects; - static std::map sessions; + static + std::map sessions; public: - static RelaySession * get(Relay *r, lws *wsi); + static + RelaySession * get(Relay *r, lws *wsi); RelaySession(Relay *r, Identifier sid); @@ -116,10 +117,10 @@ public: protected: std::atomic stop; - /** The libwebsockets server context. */ + // The libwebsockets server context. lws_context *context; - /** The libwebsockets vhost. */ + // The libwebsockets vhost. lws_vhost *vhost; bool loopback; @@ -129,19 +130,24 @@ protected: uuid_t uuid; - /** List of libwebsockets protocols. */ + // List of libwebsockets protocols. std::vector protocols; - /** List of libwebsockets extensions. */ - static const std::vector extensions; + // List of libwebsockets extensions. + static + const std::vector extensions; - static const lws_http_mount mount; + static + const lws_http_mount mount; - static void loggerCallback(int level, const char *msg); + static + void loggerCallback(int level, const char *msg); - static int httpProtocolCallback(lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); + static + int httpProtocolCallback(lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); - static int protocolCallback(lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); + static + int protocolCallback(lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); void usage(); diff --git a/src/villas-signal.cpp b/src/villas-signal.cpp index 2b8b24708..b50f34de5 100644 --- a/src/villas-signal.cpp +++ b/src/villas-signal.cpp @@ -1,10 +1,9 @@ -/** Generate random packages on stdout. +/* Generate random packages on stdout. * - * @file - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - **********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -86,7 +85,7 @@ protected: json_t * parse_cli(int argc, char *argv[]) { - /* Default values */ + // Default values double rate = 10; double frequency = 1; double amplitude = 1; @@ -102,7 +101,7 @@ protected: int values = 1; int limit = -1; - /* Parse optional command line arguments */ + // Parse optional command line arguments int c; char *endptr; while ((c = getopt(argc, argv, "v:r:F:f:l:a:D:no:d:hVp:")) != -1) { @@ -262,7 +261,7 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to prepare node {}: reason={}", node->getName(), ret); - /* Try parsing format config as JSON */ + // Try parsing format config as JSON json_format = json_loads(format.c_str(), 0, &err); formatter = json_format ? FormatFactory::make(json_format) diff --git a/src/villas-test-config.cpp b/src/villas-test-config.cpp index 538a5688a..e48976a00 100644 --- a/src/villas-test-config.cpp +++ b/src/villas-test-config.cpp @@ -1,9 +1,9 @@ -/** Main routine. +/* Main routine. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/src/villas-test-rtt.cpp b/src/villas-test-rtt.cpp index da66d6bb2..ffd3d09ae 100644 --- a/src/villas-test-rtt.cpp +++ b/src/villas-test-rtt.cpp @@ -1,9 +1,9 @@ -/** Measure round-trip time. +/* Measure round-trip time. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -62,17 +62,16 @@ protected: SuperNode sn; - /** File descriptor for Matlab results. + /* File descriptor for Matlab results. * This allows you to write Matlab results in a seperate log file: * * ./test etc/example.conf rtt -f 3 3>> measurement_results.m */ int fd; - /**< Amount of messages which should be sent (default: -1 for unlimited) */ + // Amount of messages which should be sent (default: -1 for unlimited) int count; - Hist::cnt_t hist_warmup; int hist_buckets; @@ -99,7 +98,7 @@ protected: void parse() { - /* Parse Arguments */ + // Parse Arguments int c; char *endptr; while ((c = getopt (argc, argv, "w:hr:f:c:b:Vd:")) != -1) { @@ -185,14 +184,14 @@ check: if (optarg == endptr) if (ret) throw RuntimeError("Failed to start node {}: reason={}", node->getName(), ret); - /* Print header */ + // Print header fprintf(stdout, "%17s%5s%10s%10s%10s%10s%10s\n", "timestamp", "seq", "rtt", "min", "max", "mean", "stddev"); while (!stop && (count < 0 || count--)) { clock_gettime(CLOCK_ID, &send); - node->write(&smp_send, 1); /* Ping */ - node->read(&smp_recv, 1); /* Pong */ + node->write(&smp_send, 1); // Ping + node->read(&smp_recv, 1); // Pong clock_gettime(CLOCK_ID, &recv); diff --git a/src/villas-zmq-keygen.cpp b/src/villas-zmq-keygen.cpp index 7f7cda8a1..208b51e30 100644 --- a/src/villas-zmq-keygen.cpp +++ b/src/villas-zmq-keygen.cpp @@ -1,31 +1,9 @@ -/** - * Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file +/* Key generator for libzmq * - * This file is part of libzmq, the ZeroMQ core engine in C++. - * - * libzmq is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License (LGPL) as published - * by the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * As a special exception, the Contributors give you permission to link - * this library with independent modules to produce an executable, - * regardless of the license terms of these independent modules, and to - * copy and distribute the resulting executable under terms of your choice, - * provided that you also meet, for each linked independent module, the - * terms and conditions of the license of that module. An independent - * module is a module which is not derived from or based on this library. - * If you modify this library, you must extend this exception to your - * version of the library. - * - * libzmq is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9d568fb51..f60df66d0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,9 +1,8 @@ -# Makefile. +# CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 add_custom_target(tests) add_custom_target(run-tests) diff --git a/tests/benchmarks/configs/infiniband.conf b/tests/benchmarks/configs/infiniband.conf index 3a27065ac..f88ffeb11 100644 --- a/tests/benchmarks/configs/infiniband.conf +++ b/tests/benchmarks/configs/infiniband.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "infiniband", diff --git a/tests/benchmarks/configs/loopback.conf b/tests/benchmarks/configs/loopback.conf index 15001dd1f..200987e69 100644 --- a/tests/benchmarks/configs/loopback.conf +++ b/tests/benchmarks/configs/loopback.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "loopback", queuelen = 8192, diff --git a/tests/benchmarks/configs/nanomsg.conf b/tests/benchmarks/configs/nanomsg.conf index 5ec6d3804..3ded62f0f 100644 --- a/tests/benchmarks/configs/nanomsg.conf +++ b/tests/benchmarks/configs/nanomsg.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "nanomsg", diff --git a/tests/benchmarks/configs/shmem.conf b/tests/benchmarks/configs/shmem.conf index 76d09d27b..2a26e3b22 100644 --- a/tests/benchmarks/configs/shmem.conf +++ b/tests/benchmarks/configs/shmem.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "shmem", queuelen = 8192, diff --git a/tests/benchmarks/configs/socket.conf b/tests/benchmarks/configs/socket.conf index db02bcde8..724834f2c 100644 --- a/tests/benchmarks/configs/socket.conf +++ b/tests/benchmarks/configs/socket.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "socket", diff --git a/tests/benchmarks/configs/zeromq.conf b/tests/benchmarks/configs/zeromq.conf index 0921831df..83250e094 100644 --- a/tests/benchmarks/configs/zeromq.conf +++ b/tests/benchmarks/configs/zeromq.conf @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + source_node = { type = "zeromq", pattern = "pubsub", diff --git a/tests/benchmarks/run-benchmark.sh b/tests/benchmarks/run-benchmark.sh index 72d4f24a6..804be8337 100755 --- a/tests/benchmarks/run-benchmark.sh +++ b/tests/benchmarks/run-benchmark.sh @@ -2,16 +2,13 @@ # # Integration Infiniband test using villas-node. # -# @author Dennis Potter -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Dennis Potter +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e -###################################### -# SETTINGS ########################### -###################################### +# Settings # ${NUM_VALUES}, ${RATE_SAMPLES}, and ${IB_MODES} may be a list. @@ -20,10 +17,6 @@ RATE_SAMPLES=(10) TIME_TO_RUN=5 IB_MODES=("RC") -###################################### -###################################### -###################################### - . ${SRCDIR}/tools/villas-helper.sh # Check if user is superuser. SU is used for namespace @@ -78,9 +71,7 @@ else fi fi -###################################### -# SET PATHS ########################## -###################################### +# SET PATHS # Declare location of config files CONFIG=$(mktemp /tmp/nodetype-benchmark-config-XXXX.conf) @@ -90,10 +81,7 @@ CONFIG_SOURCE=$(mktemp /tmp/nodetype-benchmark-config-source-XXXX.conf) # Initialize counter COUNT=0 - -###################################### -# START OF LOOPS THROUGH CONFIGS ##### -###################################### +# START OF LOOPS THROUGH CONFIGS echo ${CONFIG_FILES[0]} echo ${CONFIG_FILES[1]} @@ -101,9 +89,7 @@ echo ${CONFIG_FILES[1]} for NODETYPE in "${NODETYPES[@]}" do - ###################################### - # CREATE PATH CONFIG FILES ########### - ###################################### + # CREATE PATH CONFIG FILES # Set target and source config file, which is the same for both runs cat > ${CONFIG_SOURCE} < ${CONFIG} < -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 add_custom_target(run-integration-tests COMMAND diff --git a/tests/integration/README.md b/tests/integration/README.md index 85c6cbfd7..fd6684fe0 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -18,3 +18,8 @@ Example: ``` $ BUILDDIR=/VILLASnode/build/ /VILLASnode/tools/integration-tests.sh -f pipe-loopback-socket -v ``` + + diff --git a/tests/integration/api-capabilities.sh b/tests/integration/api-capabilities.sh index 25895ebd3..9085405bb 100755 --- a/tests/integration/api-capabilities.sh +++ b/tests/integration/api-capabilities.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-config.sh b/tests/integration/api-config.sh index 99e560f85..b66272bd8 100755 --- a/tests/integration/api-config.sh +++ b/tests/integration/api-config.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-nodes.sh b/tests/integration/api-nodes.sh index e62979645..774cccb4c 100755 --- a/tests/integration/api-nodes.sh +++ b/tests/integration/api-nodes.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-paths.sh b/tests/integration/api-paths.sh index 633d54f74..8a6c136f7 100755 --- a/tests/integration/api-paths.sh +++ b/tests/integration/api-paths.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-restart.sh b/tests/integration/api-restart.sh index 46d5cff78..53ff10f6e 100755 --- a/tests/integration/api-restart.sh +++ b/tests/integration/api-restart.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-shutdown.sh b/tests/integration/api-shutdown.sh index 4d97ea870..eabc57f94 100755 --- a/tests/integration/api-shutdown.sh +++ b/tests/integration/api-shutdown.sh @@ -2,10 +2,9 @@ # # Integration test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/api-stress.sh b/tests/integration/api-stress.sh index 8ce055dc8..31a56c4d5 100755 --- a/tests/integration/api-stress.sh +++ b/tests/integration/api-stress.sh @@ -2,10 +2,9 @@ # # Stress test for remote API # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e set -x diff --git a/tests/integration/compare.sh b/tests/integration/compare.sh index 5328311de..2ecd4a42a 100755 --- a/tests/integration/compare.sh +++ b/tests/integration/compare.sh @@ -2,10 +2,9 @@ # # Integration test for villas compare. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 DIR=$(mktemp -d) pushd ${DIR} diff --git a/tests/integration/convert.sh b/tests/integration/convert.sh index 258068ed4..d2f50bfb8 100755 --- a/tests/integration/convert.sh +++ b/tests/integration/convert.sh @@ -2,10 +2,9 @@ # # Integration test for villas convert tool # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-average.sh b/tests/integration/hook-average.sh index 3a7bad72a..f66011d9f 100755 --- a/tests/integration/hook-average.sh +++ b/tests/integration/hook-average.sh @@ -2,10 +2,9 @@ # # Integration test for average hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-cast.sh b/tests/integration/hook-cast.sh index 848096555..35868089e 100755 --- a/tests/integration/hook-cast.sh +++ b/tests/integration/hook-cast.sh @@ -2,10 +2,9 @@ # # Integration test for cast hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-decimate.sh b/tests/integration/hook-decimate.sh index 545767aad..58f31decd 100755 --- a/tests/integration/hook-decimate.sh +++ b/tests/integration/hook-decimate.sh @@ -2,10 +2,9 @@ # # Integration test for decimate hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-drop.sh b/tests/integration/hook-drop.sh index f9f5eb2ad..1d4127f73 100755 --- a/tests/integration/hook-drop.sh +++ b/tests/integration/hook-drop.sh @@ -2,10 +2,9 @@ # # Integration test for drop hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-gate.sh b/tests/integration/hook-gate.sh index 3249a7447..2e32de58c 100755 --- a/tests/integration/hook-gate.sh +++ b/tests/integration/hook-gate.sh @@ -2,10 +2,9 @@ # # Integration test for gate hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-limit_rate.sh b/tests/integration/hook-limit_rate.sh index 2916949c7..f546ebc45 100755 --- a/tests/integration/hook-limit_rate.sh +++ b/tests/integration/hook-limit_rate.sh @@ -2,10 +2,9 @@ # # Integration test for limit_rate hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-lua.sh b/tests/integration/hook-lua.sh index 9e7880592..d7c204b9f 100755 --- a/tests/integration/hook-lua.sh +++ b/tests/integration/hook-lua.sh @@ -2,10 +2,9 @@ # # Integration test for scale hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-lua_script.sh b/tests/integration/hook-lua_script.sh index 8dfd700ee..6c4fd832c 100755 --- a/tests/integration/hook-lua_script.sh +++ b/tests/integration/hook-lua_script.sh @@ -2,10 +2,9 @@ # # Integration test for scale hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-print.sh b/tests/integration/hook-print.sh index bc9b1f3b8..11538f09f 100755 --- a/tests/integration/hook-print.sh +++ b/tests/integration/hook-print.sh @@ -2,10 +2,9 @@ # # Integration test for print hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-scale.sh b/tests/integration/hook-scale.sh index 0199bf847..0b72f21b3 100755 --- a/tests/integration/hook-scale.sh +++ b/tests/integration/hook-scale.sh @@ -2,10 +2,9 @@ # # Integration test for scale hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-shift_seq.sh b/tests/integration/hook-shift_seq.sh index 6b994d5c4..01264daf6 100755 --- a/tests/integration/hook-shift_seq.sh +++ b/tests/integration/hook-shift_seq.sh @@ -2,10 +2,9 @@ # # Integration test for shift_seq hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-shift_ts.sh b/tests/integration/hook-shift_ts.sh index be2a738b7..a195cc12f 100755 --- a/tests/integration/hook-shift_ts.sh +++ b/tests/integration/hook-shift_ts.sh @@ -2,10 +2,9 @@ # # Integration test for shift_ts hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-skip_first.sh b/tests/integration/hook-skip_first.sh index f3f084626..0797a8630 100755 --- a/tests/integration/hook-skip_first.sh +++ b/tests/integration/hook-skip_first.sh @@ -2,10 +2,9 @@ # # Integration test for skip_first hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/hook-skip_first2.sh b/tests/integration/hook-skip_first2.sh index 7a275036f..e36d29a8b 100755 --- a/tests/integration/hook-skip_first2.sh +++ b/tests/integration/hook-skip_first2.sh @@ -2,10 +2,9 @@ # # Integration test for skip_first hook. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/missing-example-configs.sh b/tests/integration/missing-example-configs.sh index 0190582a9..b4c62826f 100755 --- a/tests/integration/missing-example-configs.sh +++ b/tests/integration/missing-example-configs.sh @@ -3,10 +3,9 @@ # # Test example configurations # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 NODE_TYPES=$(villas node -C 2>/dev/null | jq -r '.nodes | join(" ")') HOOK_TYPES=$(villas node -C 2>/dev/null | jq -r '.hooks | join(" ")') diff --git a/tests/integration/node-can.sh b/tests/integration/node-can.sh index 8f6a21172..615dadb4f 100755 --- a/tests/integration/node-can.sh +++ b/tests/integration/node-can.sh @@ -2,10 +2,9 @@ # # Integration can test using villas node. # -# @author Niklas Eiling -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Niklas Eiling +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # To set up vcan interface use the following commands # sudo modprobe vcan # sudo ip link add dev vcan0 type vcan diff --git a/tests/integration/node-example.sh b/tests/integration/node-example.sh index 481fb5fe3..c66158ff1 100755 --- a/tests/integration/node-example.sh +++ b/tests/integration/node-example.sh @@ -2,10 +2,9 @@ # # Test for the example node-type # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-hook.sh b/tests/integration/node-hook.sh index 94e35fb04..fabefa518 100755 --- a/tests/integration/node-hook.sh +++ b/tests/integration/node-hook.sh @@ -2,10 +2,9 @@ # # Test hooks in villas node # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-infiniband.sh b/tests/integration/node-infiniband.sh index 631a1743f..8e868db32 100755 --- a/tests/integration/node-infiniband.sh +++ b/tests/integration/node-infiniband.sh @@ -2,10 +2,9 @@ # # Integration Infiniband test using villas node. # -# @author Dennis Potter -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Dennis Potter +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e @@ -110,11 +109,7 @@ MODES=("RC" "UC" "UD") # Run through modes for MODE in "${MODES[@]}"; do - echo "#############################" - echo "#############################" - echo "## START ${MODE} ##" - echo "#############################" - echo "#############################" + echo "## Start ${MODE}" sed -i -e 's/MODE/'${MODE}'/g' config.json diff --git a/tests/integration/node-loopback-socket.sh b/tests/integration/node-loopback-socket.sh index 73534cd4e..488f74903 100755 --- a/tests/integration/node-loopback-socket.sh +++ b/tests/integration/node-loopback-socket.sh @@ -2,10 +2,9 @@ # # Integration loopback test using villas node. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-mapping.sh b/tests/integration/node-mapping.sh index 1864fd072..f73261087 100755 --- a/tests/integration/node-mapping.sh +++ b/tests/integration/node-mapping.sh @@ -4,10 +4,9 @@ # # Test test checks if source mapping features for a path. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-multiple-destinations.sh b/tests/integration/node-multiple-destinations.sh index 8bd63430e..e53716b41 100755 --- a/tests/integration/node-multiple-destinations.sh +++ b/tests/integration/node-multiple-destinations.sh @@ -5,10 +5,9 @@ # This test checks if a single node can be used as an input # in multiple paths. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e set -x diff --git a/tests/integration/node-multiple-sources.sh b/tests/integration/node-multiple-sources.sh index f2847a646..d25f7cf32 100755 --- a/tests/integration/node-multiple-sources.sh +++ b/tests/integration/node-multiple-sources.sh @@ -5,10 +5,9 @@ # This test checks if a single node can be used as an input # in multiple paths. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/node-multiplexing.sh b/tests/integration/node-multiplexing.sh index 53d7720b8..fe1f0eb33 100755 --- a/tests/integration/node-multiplexing.sh +++ b/tests/integration/node-multiplexing.sh @@ -2,10 +2,9 @@ # # Integration loopback test using villas node. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-rate.sh b/tests/integration/node-rate.sh index 9d9a23825..ced0c4700 100755 --- a/tests/integration/node-rate.sh +++ b/tests/integration/node-rate.sh @@ -2,10 +2,9 @@ # # Integration loopback test using villas node. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/node-stats.sh b/tests/integration/node-stats.sh index efd043d05..b26bb3f3a 100755 --- a/tests/integration/node-stats.sh +++ b/tests/integration/node-stats.sh @@ -2,10 +2,9 @@ # # Integration loopback test using villas node. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/node-test_rtt.sh b/tests/integration/node-test_rtt.sh index db5154e9d..8231fd59c 100755 --- a/tests/integration/node-test_rtt.sh +++ b/tests/integration/node-test_rtt.sh @@ -2,10 +2,9 @@ # # Integration loopback test using villas node. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test not yet supported" exit 99 diff --git a/tests/integration/pipe-loopback-amqp.sh b/tests/integration/pipe-loopback-amqp.sh index 4dcc134d8..3cb60ec2e 100755 --- a/tests/integration/pipe-loopback-amqp.sh +++ b/tests/integration/pipe-loopback-amqp.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-exec.sh b/tests/integration/pipe-loopback-exec.sh index e678790eb..6135a0ae5 100755 --- a/tests/integration/pipe-loopback-exec.sh +++ b/tests/integration/pipe-loopback-exec.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-file.sh b/tests/integration/pipe-loopback-file.sh index cb023b081..d157d3dd6 100755 --- a/tests/integration/pipe-loopback-file.sh +++ b/tests/integration/pipe-loopback-file.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-iec61850-9-2.sh b/tests/integration/pipe-loopback-iec61850-9-2.sh index 5b3d5bacb..9730e6722 100755 --- a/tests/integration/pipe-loopback-iec61850-9-2.sh +++ b/tests/integration/pipe-loopback-iec61850-9-2.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/pipe-loopback-loopback.sh b/tests/integration/pipe-loopback-loopback.sh index 166d06903..92c561580 100755 --- a/tests/integration/pipe-loopback-loopback.sh +++ b/tests/integration/pipe-loopback-loopback.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-mqtt.sh b/tests/integration/pipe-loopback-mqtt.sh index 9fef51818..2c523245a 100755 --- a/tests/integration/pipe-loopback-mqtt.sh +++ b/tests/integration/pipe-loopback-mqtt.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-nanomsg.sh b/tests/integration/pipe-loopback-nanomsg.sh index 1d248dc9e..2e7a9f991 100755 --- a/tests/integration/pipe-loopback-nanomsg.sh +++ b/tests/integration/pipe-loopback-nanomsg.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-redis.sh b/tests/integration/pipe-loopback-redis.sh index 036ab8911..ecd33f30e 100755 --- a/tests/integration/pipe-loopback-redis.sh +++ b/tests/integration/pipe-loopback-redis.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test not ready" exit 99 diff --git a/tests/integration/pipe-loopback-rtp-dual.sh b/tests/integration/pipe-loopback-rtp-dual.sh index 99783b618..32fd82cfe 100755 --- a/tests/integration/pipe-loopback-rtp-dual.sh +++ b/tests/integration/pipe-loopback-rtp-dual.sh @@ -2,11 +2,10 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @author Marvin Klimke -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# Author: Marvin Klimke +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/pipe-loopback-rtp-remote.sh b/tests/integration/pipe-loopback-rtp-remote.sh index 2991ab9a8..46df8a054 100755 --- a/tests/integration/pipe-loopback-rtp-remote.sh +++ b/tests/integration/pipe-loopback-rtp-remote.sh @@ -2,11 +2,10 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @author Marvin Klimke -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# Author: Marvin Klimke +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-rtp-tbf.sh b/tests/integration/pipe-loopback-rtp-tbf.sh index 54d8f0198..89d08b9c6 100755 --- a/tests/integration/pipe-loopback-rtp-tbf.sh +++ b/tests/integration/pipe-loopback-rtp-tbf.sh @@ -2,11 +2,10 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @author Marvin Klimke -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# Author: Marvin Klimke +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/pipe-loopback-rtp.sh b/tests/integration/pipe-loopback-rtp.sh index 922c065da..0dbe6b143 100755 --- a/tests/integration/pipe-loopback-rtp.sh +++ b/tests/integration/pipe-loopback-rtp.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/pipe-loopback-shmem.sh b/tests/integration/pipe-loopback-shmem.sh index a64f54502..5f7f01359 100755 --- a/tests/integration/pipe-loopback-shmem.sh +++ b/tests/integration/pipe-loopback-shmem.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-socket-multicast.sh b/tests/integration/pipe-loopback-socket-multicast.sh index 1a3710116..7a7178737 100755 --- a/tests/integration/pipe-loopback-socket-multicast.sh +++ b/tests/integration/pipe-loopback-socket-multicast.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-socket-netem.sh b/tests/integration/pipe-loopback-socket-netem.sh index 68809a285..460794cf6 100755 --- a/tests/integration/pipe-loopback-socket-netem.sh +++ b/tests/integration/pipe-loopback-socket-netem.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 if ! modprobe -aqn sch_prio sch_netem cls_fw; then echo "Netem / TC kernel modules are missing" diff --git a/tests/integration/pipe-loopback-socket.sh b/tests/integration/pipe-loopback-socket.sh index 00887537d..881e693a3 100755 --- a/tests/integration/pipe-loopback-socket.sh +++ b/tests/integration/pipe-loopback-socket.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-loopback-websocket.sh b/tests/integration/pipe-loopback-websocket.sh index a4de667c3..a3b0e7b81 100755 --- a/tests/integration/pipe-loopback-websocket.sh +++ b/tests/integration/pipe-loopback-websocket.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/pipe-loopback-zeromq.sh b/tests/integration/pipe-loopback-zeromq.sh index 9d840cf73..0846b2955 100755 --- a/tests/integration/pipe-loopback-zeromq.sh +++ b/tests/integration/pipe-loopback-zeromq.sh @@ -2,10 +2,9 @@ # # Integration loopback test for villas pipe. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/pipe-python-protobuf.sh b/tests/integration/pipe-python-protobuf.sh index 9b3e5ba33..129704fe0 100755 --- a/tests/integration/pipe-python-protobuf.sh +++ b/tests/integration/pipe-python-protobuf.sh @@ -2,10 +2,9 @@ # # Test protobuf serialization with Python client # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/relay.sh b/tests/integration/relay.sh index b1afde288..a02657360 100755 --- a/tests/integration/relay.sh +++ b/tests/integration/relay.sh @@ -2,10 +2,9 @@ # # Integration test for villas relay # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 echo "Test is broken" exit 99 diff --git a/tests/integration/signal.sh b/tests/integration/signal.sh index ff20b06f7..cfeb9648a 100755 --- a/tests/integration/signal.sh +++ b/tests/integration/signal.sh @@ -2,10 +2,9 @@ # # Integration test for villas signal tool # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/integration/test-config.sh b/tests/integration/test-config.sh index 74f0d9c73..761c0d03d 100755 --- a/tests/integration/test-config.sh +++ b/tests/integration/test-config.sh @@ -3,10 +3,9 @@ # # Test example configurations # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 3797af484..d8aee5f19 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists.txt. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set(TEST_SRC config_json.cpp diff --git a/tests/unit/config.cpp b/tests/unit/config.cpp index 06cd3458b..ab126d6ee 100644 --- a/tests/unit/config.cpp +++ b/tests/unit/config.cpp @@ -1,9 +1,9 @@ -/** Unit tests for config features. +/* Unit tests for config features. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/tests/unit/config_json.cpp b/tests/unit/config_json.cpp index 56fd26876..f0592f17d 100644 --- a/tests/unit/config_json.cpp +++ b/tests/unit/config_json.cpp @@ -1,9 +1,9 @@ -/** Unit tests libconfig to jansson converters. +/* Unit tests libconfig to jansson converters. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -81,7 +81,7 @@ Test(config, json_to_config) config_setting_t *cfg_root; json_t *json; - /* For config_write() */ + // For config_write() FILE *f; char str[1024]; @@ -105,4 +105,4 @@ Test(config, json_to_config) json_decref(json); } -#endif /* WITH_CONFIG */ +#endif // WITH_CONFIG diff --git a/tests/unit/format.cpp b/tests/unit/format.cpp index f3b08d0e8..04c5ecef7 100644 --- a/tests/unit/format.cpp +++ b/tests/unit/format.cpp @@ -1,9 +1,9 @@ -/** Unit tests for formatters. +/* Unit tests for formatters. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -25,7 +25,8 @@ using namespace villas; using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); #define NUM_VALUES 10 @@ -68,7 +69,7 @@ void fill_sample_data(SignalList::Ptr signals, struct Sample *smps[], unsigned c break; case SignalType::COMPLEX: { - /** @todo Port to proper C++ */ + // @todo Port to proper C++ std::complex z = { j * 0.1f, i * 100.0f }; memcpy(&data->z, &z, sizeof(data->z)); break; @@ -180,7 +181,8 @@ void cr_assert_eq_sample_raw(struct Sample *a, struct Sample *b, int flags, int ParameterizedTestParameters(format, lowlevel) { - static criterion::parameters params; + static + criterion::parameters params; params.emplace_back("{ \"type\": \"gtnet\" }", 1, 32); params.emplace_back("{ \"type\": \"gtnet\", \"fake\": true }", 1, 32); @@ -267,7 +269,8 @@ ParameterizedTest(Param *p, format, lowlevel, .init = init_memory) ParameterizedTestParameters(format, highlevel) { - static criterion::parameters params; + static + criterion::parameters params; params.emplace_back("{ \"type\": \"gtnet\" }", 1, 32); params.emplace_back("{ \"type\": \"gtnet\", \"fake\": true }", 1, 32); @@ -320,7 +323,7 @@ ParameterizedTest(Param *p, format, highlevel, .init = init_memory) fill_sample_data(signals, smps, p->cnt); - /* Open a file for testing the formatter */ + // Open a file for testing the formatter char *fn, dir[64]; strncpy(dir, "/tmp/villas.XXXXXX", sizeof(dir)); @@ -347,7 +350,7 @@ ParameterizedTest(Param *p, format, highlevel, .init = init_memory) ret = fflush(stream); cr_assert_eq(ret, 0); -#if 0 /* Show the file contents */ +#if 0 // Show the file contents char cmd[128]; if (p->fmt == "csv" || p->fmt == "json" || p->fmt == "villas.human") snprintf(cmd, sizeof(cmd), "cat %s", fn); diff --git a/tests/unit/helpers.cpp b/tests/unit/helpers.cpp index 23866e41c..8b269d036 100644 --- a/tests/unit/helpers.cpp +++ b/tests/unit/helpers.cpp @@ -1,3 +1,10 @@ +/* Unit test helpers + * + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ + #include #include diff --git a/tests/unit/helpers.hpp b/tests/unit/helpers.hpp index 61f8cc925..496cada39 100644 --- a/tests/unit/helpers.hpp +++ b/tests/unit/helpers.hpp @@ -1,3 +1,10 @@ +/* Unit test helpers + * + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ + #pragma once char * cr_strdup(const char *str); diff --git a/tests/unit/json.cpp b/tests/unit/json.cpp index ce3d1afaa..659097368 100644 --- a/tests/unit/json.cpp +++ b/tests/unit/json.cpp @@ -1,10 +1,9 @@ -/** Unit tests for libjansson helpers +/* Unit tests for libjansson helpers * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ - + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -26,7 +25,8 @@ ParameterizedTestParameters(json, json_load_cli) { const auto d = cr_strdup; - static criterion::parameters params = { + static + criterion::parameters params = { // Combined long option { .argv = { d("dummy"), d("--option=value") }, diff --git a/tests/unit/main.cpp b/tests/unit/main.cpp index 627566296..faf94c471 100644 --- a/tests/unit/main.cpp +++ b/tests/unit/main.cpp @@ -1,9 +1,9 @@ -/** Custom main() for Criterion +/* Custom main() for Criterion * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/tests/unit/mapping.cpp b/tests/unit/mapping.cpp index 79410cd4c..52417f254 100644 --- a/tests/unit/mapping.cpp +++ b/tests/unit/mapping.cpp @@ -1,9 +1,9 @@ -/** Unit tests for sample value mapping. +/* Unit tests for sample value mapping. * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include diff --git a/tests/unit/memory.cpp b/tests/unit/memory.cpp index ecb7b65cd..f6fa9dd32 100644 --- a/tests/unit/memory.cpp +++ b/tests/unit/memory.cpp @@ -1,9 +1,9 @@ -/** Unit tests for memory management +/* Unit tests for memory management * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +19,8 @@ using namespace villas; using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); #define PAGESIZE (1 << 12) #define HUGEPAGESIZE (1 << 21) diff --git a/tests/unit/pool.cpp b/tests/unit/pool.cpp index fdbaecd86..446b5eca5 100644 --- a/tests/unit/pool.cpp +++ b/tests/unit/pool.cpp @@ -1,9 +1,9 @@ -/** Unit tests for memory pool +/* Unit tests for memory pool * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -19,7 +19,8 @@ using namespace villas; using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); struct param { int thread_count; @@ -30,7 +31,8 @@ struct param { ParameterizedTestParameters(pool, basic) { - static std::vector params; + static + std::vector params; params.clear(); params.push_back({ 1, 4096, 150, &memory::heap }); @@ -59,7 +61,7 @@ ParameterizedTest(struct param *p, pool, basic, .init = init_memory) ptr = pool_get(&pool); cr_assert_neq(ptr, nullptr); - memset(ptr, 1, p->block_size); /* check that we dont get a seg fault */ + memset(ptr, 1, p->block_size); // check that we dont get a seg fault int i; for (i = 1; i < p->pool_size; i++) { diff --git a/tests/unit/queue.cpp b/tests/unit/queue.cpp index 422703b3d..1253444cc 100644 --- a/tests/unit/queue.cpp +++ b/tests/unit/queue.cpp @@ -1,9 +1,9 @@ -/** Unit tests for queue +/* Unit tests for queue * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -24,14 +24,17 @@ using namespace villas; using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); #define SIZE (1 << 10) -static struct CQueue q; +static +struct CQueue q; #if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0 -static pthread_barrier_t barrier; +static +pthread_barrier_t barrier; #endif struct param { @@ -45,7 +48,7 @@ struct param { struct CQueue queue; }; -/** Get thread id as integer +/* Get thread id as integer * In contrast to pthread_t which is an opaque type */ #ifdef __linux__ #include @@ -63,13 +66,15 @@ uint64_t thread_get_id() return -1; } -/** Sleep, do nothing */ -__attribute__((always_inline)) static inline void nop() +// Sleep, do nothing +__attribute__((always_inline)) static inline +void nop() { __asm__("rep nop;"); } -static void * producer(void *ctx) +static +void * producer(void *ctx) { int ret; struct param *p = (struct param *) ctx; @@ -77,15 +82,15 @@ static void * producer(void *ctx) srand((unsigned) time(0) + thread_get_id()); size_t nops = rand() % 1000; - /* Wait for global start signal */ + // Wait for global start signal while (p->start == 0) sched_yield(); - /* Wait for a random time */ + // Wait for a random time for (size_t i = 0; i != nops; i += 1) nop(); - /* Enqueue */ + // Enqueue for (intptr_t count = 0; count < p->iter_count; count++) { do { ret = queue_push(&p->queue, (void *) count); @@ -96,7 +101,8 @@ static void * producer(void *ctx) return nullptr; } -static void * consumer(void *ctx) +static +void * consumer(void *ctx) { int ret; struct param *p = (struct param *) ctx; @@ -104,15 +110,15 @@ static void * consumer(void *ctx) srand((unsigned) time(0) + thread_get_id()); size_t nops = rand() % 1000; - /* Wait for global start signal */ + // Wait for global start signal while (p->start == 0) sched_yield(); - /* Wait for a random time */ + // Wait for a random time for (size_t i = 0; i != nops; i += 1) nop(); - /* Dequeue */ + // Dequeue for (intptr_t count = 0; count < p->iter_count; count++) { intptr_t ptr; @@ -136,11 +142,11 @@ void * producer_consumer(void *ctx) srand((unsigned) time(0) + thread_get_id()); size_t nops = rand() % 1000; - /* Wait for global start signal */ + // Wait for global start signal while (p->start == 0) sched_yield(); - /* Wait for a random time */ + // Wait for a random time for (size_t i = 0; i != nops; i += 1) nop(); @@ -150,13 +156,13 @@ void * producer_consumer(void *ctx) for (intptr_t i = 0; i < p->batch_size; i++) { void *ptr = (void *) (iter * p->batch_size + i); while (!queue_push(&p->queue, ptr)) - sched_yield(); /* queue full, let other threads proceed */ + sched_yield(); // queue full, let other threads proceed } for (intptr_t i = 0; i < p->batch_size; i++) { void *ptr; while (!queue_pull(&p->queue, &ptr)) - sched_yield(); /* queue empty, let other threads proceed */ + sched_yield(); // queue empty, let other threads proceed } } @@ -170,11 +176,11 @@ void * producer_consumer_many(void *ctx) srand((unsigned) time(0) + thread_get_id()); size_t nops = rand() % 1000; - /* Wait for global start signal */ + // Wait for global start signal while (p->start == 0) sched_yield(); - /* Wait for a random time */ + // Wait for a random time for (size_t i = 0; i != nops; i += 1) nop(); @@ -190,20 +196,20 @@ void * producer_consumer_many(void *ctx) do { pushed += queue_push_many(&p->queue, &ptrs[pushed], p->batch_size - pushed); if (pushed != p->batch_size) - sched_yield(); /* queue full, let other threads proceed */ + sched_yield(); // queue full, let other threads proceed } while (pushed < p->batch_size); int pulled = 0; do { pulled += queue_pull_many(&p->queue, &ptrs[pulled], p->batch_size - pulled); if (pulled != p->batch_size) - sched_yield(); /* queue empty, let other threads proceed */ + sched_yield(); // queue empty, let other threads proceed } while (pulled < p->batch_size); } return 0; } -#endif /* _POSIX_BARRIERS */ +#endif // _POSIX_BARRIERS Test(queue, single_threaded, .init = init_memory) { @@ -212,7 +218,7 @@ Test(queue, single_threaded, .init = init_memory) p.iter_count = 1 << 8; p.queue_size = 1 << 10; - p.start = 1; /* we start immeadiatly */ + p.start = 1; // we start immeadiatly ret = queue_init(&p.queue, p.queue_size, &memory::heap); cr_assert_eq(ret, 0, "Failed to create queue"); @@ -229,7 +235,8 @@ Test(queue, single_threaded, .init = init_memory) #if defined(_POSIX_BARRIERS) && _POSIX_BARRIERS > 0 ParameterizedTestParameters(queue, multi_threaded) { - static struct param params[] = { + static + struct param params[] = { { .iter_count = 1 << 12, .queue_size = 1 << 9, @@ -323,7 +330,7 @@ ParameterizedTest(struct param *p, queue, multi_threaded, .timeout = 20, .init = ret = pthread_barrier_destroy(&barrier); cr_assert_eq(ret, 0, "Failed to destroy barrier"); } -#endif /* _POSIX_BARRIERS */ +#endif // _POSIX_BARRIERS Test(queue, init_destroy, .init = init_memory) { @@ -331,8 +338,8 @@ Test(queue, init_destroy, .init = init_memory) struct CQueue q; ret = queue_init(&q, 1024, &memory::heap); - cr_assert_eq(ret, 0); /* Should succeed */ + cr_assert_eq(ret, 0); // Should succeed ret = queue_destroy(&q); - cr_assert_eq(ret, 0); /* Should succeed */ + cr_assert_eq(ret, 0); // Should succeed } diff --git a/tests/unit/queue_signalled.cpp b/tests/unit/queue_signalled.cpp index d88712113..2398f1409 100644 --- a/tests/unit/queue_signalled.cpp +++ b/tests/unit/queue_signalled.cpp @@ -1,9 +1,9 @@ -/** Unit tests for queue_signalled +/* Unit tests for queue_signalled * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include #include @@ -17,7 +17,8 @@ using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); #define NUM_ELEM 1000 @@ -27,7 +28,8 @@ struct param { bool polled; }; -static void * producer(void * ctx) +static +void * producer(void * ctx) { int ret; struct CQueueSignalled *q = (struct CQueueSignalled *) ctx; @@ -35,15 +37,16 @@ static void * producer(void * ctx) for (intptr_t i = 0; i < NUM_ELEM; i++) { ret = queue_signalled_push(q, (void *) i); if (ret != 1) - return (void *) 1; /* Indicates an error to the parent thread */ + return (void *) 1; // Indicates an error to the parent thread - usleep(0.1e-3 * 1e6); /* 1 ms */ + usleep(0.1e-3 * 1e6); // 1 ms } return nullptr; } -static void * consumer(void * ctx) +static +void * consumer(void * ctx) { int ret; struct CQueueSignalled *q = (struct CQueueSignalled *) ctx; @@ -53,11 +56,11 @@ static void * consumer(void * ctx) for (intptr_t i = 0; i < NUM_ELEM;) { ret = queue_signalled_pull_many(q, data, ARRAY_LEN(data)); if (ret <= 0) - return (void *) 1; /* Indicates an error to the parent thread */ + return (void *) 1; // Indicates an error to the parent thread for (intptr_t j = 0; j < ret; j++, i++) { if ((intptr_t) data[j] != i) - return (void *) 2; /* Indicates an error to the parent thread */ + return (void *) 2; // Indicates an error to the parent thread } } @@ -84,14 +87,13 @@ again: ret = poll(&pfd, 1, -1); else if (ret == 0) goto again; - void *p; ret = queue_signalled_pull(q, &p); if (ret != 1) - return (void *) 1; /* Indicates an error to the parent thread */ + return (void *) 1; // Indicates an error to the parent thread if ((intptr_t) p != i) - return (void *) 2; /* Indicates an error to the parent thread */ + return (void *) 2; // Indicates an error to the parent thread } return nullptr; @@ -99,7 +101,8 @@ again: ret = poll(&pfd, 1, -1); ParameterizedTestParameters(queue_signalled, simple) { - static struct param params[] = { + static + struct param params[] = { { QueueSignalledMode::AUTO, 0, false }, { QueueSignalledMode::PTHREAD, 0, false }, { QueueSignalledMode::PTHREAD, 0, false }, diff --git a/tests/unit/signal.cpp b/tests/unit/signal.cpp index e8c6a90bb..d674bb2b5 100644 --- a/tests/unit/signal.cpp +++ b/tests/unit/signal.cpp @@ -1,9 +1,9 @@ -/** Unit tests for memory management +/* Unit tests for memory management * - * @author Steffen Vogel - * @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC - * @license Apache 2.0 - *********************************************************************************/ + * Author: Steffen Vogel + * SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -11,7 +11,8 @@ using namespace villas::node; -extern void init_memory(); +extern +void init_memory(); // cppcheck-suppress unknownMacro Test(signal_data, parse, .init = init_memory) { diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index bcef18645..fd638841f 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,9 +1,8 @@ # CMakeLists. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 install( TARGETS ${TOOLS} diff --git a/tools/docker-dev.sh b/tools/docker-dev.sh index c494a61d1..465379763 100755 --- a/tools/docker-dev.sh +++ b/tools/docker-dev.sh @@ -2,10 +2,9 @@ # # Start a Docker based development environment # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 SCRIPT=$(realpath ${BASH_SOURCE[0]}) SCRIPTPATH=$(dirname $SCRIPT) diff --git a/tools/integration-tests.sh b/tools/integration-tests.sh index 00131f195..2f61eda39 100755 --- a/tools/integration-tests.sh +++ b/tools/integration-tests.sh @@ -2,10 +2,9 @@ # # Run integration tests # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 SCRIPT=$(realpath ${BASH_SOURCE[0]}) SCRIPTPATH=$(dirname $SCRIPT) diff --git a/tools/start-fpga.sh b/tools/start-fpga.sh index 813325381..0693b2bd0 100755 --- a/tools/start-fpga.sh +++ b/tools/start-fpga.sh @@ -1,4 +1,6 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 ARGS="$@" diff --git a/tools/tc-dump.sh b/tools/tc-dump.sh index 27ba2bcb9..f0e7ff9e4 100755 --- a/tools/tc-dump.sh +++ b/tools/tc-dump.sh @@ -2,10 +2,9 @@ # # Dump Linux traffic control state to screen. # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 IF=$1 diff --git a/tools/tc-netem.sh b/tools/tc-netem.sh index ea5040641..e6aefaced 100755 --- a/tools/tc-netem.sh +++ b/tools/tc-netem.sh @@ -4,10 +4,9 @@ # # Dependencies: iptables, ebtables and iproute2 # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e # Abort on error die() { echo "$1"; exit -1; } diff --git a/tools/tc-netem2.sh b/tools/tc-netem2.sh index 2251dd07f..6f5ebed14 100755 --- a/tools/tc-netem2.sh +++ b/tools/tc-netem2.sh @@ -4,10 +4,9 @@ # # Dependencies: iptables, ebtables and iproute2 # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 set -e # Abort on error die() { echo "$1"; exit -1; } @@ -30,7 +29,7 @@ DST_IF=p5p1.11 # Network emulation settings (see http://stuff.onse.fi/man?program=tc-netem§ion=8) NETEM="delay 1000000 20000 distribution normal duplicate 4 loss 20" -############################################################################################## +### # Do not change something below this line! MARK=$RANDOM diff --git a/tools/tune-realtime.sh b/tools/tune-realtime.sh index e22c44947..8f1819df3 100755 --- a/tools/tune-realtime.sh +++ b/tools/tune-realtime.sh @@ -1,4 +1,6 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 dnf -y --refresh install \ tuned-utils \ diff --git a/tools/villas b/tools/villas index 1e90d581e..e3f95be10 100755 --- a/tools/villas +++ b/tools/villas @@ -7,10 +7,9 @@ # Install by: # $ make install # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################### +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Get a list of all available tools SUBTOOLS="api node compare pipe hook conf2json convert graph relay signal test-config test-rtt zmq-keygen" diff --git a/tools/villas-api.sh b/tools/villas-api.sh index fdaccdf87..e634af21a 100755 --- a/tools/villas-api.sh +++ b/tools/villas-api.sh @@ -1,4 +1,6 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 # Check if all required commands exist diff --git a/tools/villas-helper.sh b/tools/villas-helper.sh index 3653385bf..7833eb64b 100755 --- a/tools/villas-helper.sh +++ b/tools/villas-helper.sh @@ -2,10 +2,9 @@ # # Some helper functions for our integration test suite # -# @author Steffen Vogel -# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC -# @license Apache 2.0 -################################################################################## +# Author: Steffen Vogel +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 function villas_format_supports_vectorize() { local FORMAT=$1 diff --git a/web/webrtc.html b/web/webrtc.html index 9bb75254e..e1df0cce4 100644 --- a/web/webrtc.html +++ b/web/webrtc.html @@ -4,9 +4,9 @@ diff --git a/webrtc_a.conf b/webrtc_a.conf new file mode 100644 index 000000000..403d38827 --- /dev/null +++ b/webrtc_a.conf @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +nodes = { + webrtc = { + type = "webrtc", + + # A unique session identifier which must be shared between two nodes + session = "KUCHEN" + peer = "a" + + # Address to the websocket signaling server + server = "http://172.23.157.207:8080" + + # wait_seconds = 5 + } + + signal = { + type = "signal" + signal = "sine" + values = 1 + rate = 0.2 + } +} + +paths = ( + { + in = "signal" + out = "webrtc" + }, + { + in = "webrtc" + hooks = ("print") + } +) diff --git a/webrtc_b.conf b/webrtc_b.conf new file mode 100644 index 000000000..897d75582 --- /dev/null +++ b/webrtc_b.conf @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +nodes = { + webrtc = { + type = "webrtc", + + # A unique session identifier which must be shared between two nodes + session = "KUCHEN" + peer = "b" + + # Address to the websocket signaling server + server = "http://172.23.157.207:8080" + + # wait_seconds = 5 + } + + signal = { + type = "signal" + signal = "sine" + values = 1 + rate = 0.2 + } +} + +paths = ( + { + in = "signal" + out = "webrtc" + }, + { + in = "webrtc" + hooks = ("print") + } +)