Commit graph

23 commits

Author SHA1 Message Date
Maximilian Nitsch
ada5f57efa nix: Add SPDX-License-Identifier
Adds a SPDX-License-Identifier to all nix files and adjust
`license-check.sh` to consider Nix files and the corresponding
directories.

Filtering directories that should not be checked is now performed in the
find command instead of in the iteration. In addition, the iteration
function is changed, as the for loop splits by spaces, which leads to an
error for file names with spaces — linebreaks are used instead.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-07-01 11:04:04 +02:00
Felix Walter
2dcc1387eb bundle6/serializer: Replace flow control in macro with condition var
The previous version may lead to hard-to-spot issues later on.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-24 14:30:26 +02:00
Felix Walter
e8a319a277 TX: Allow the bundle serializers to indicate failure if CLA fails
If the write method of the CLA fails, the serailizers will now return
early and this failure is handled properly by the TX task.

In the case of the BPv6 serializer, we add the necessary flow control to
the `write_bytes` macro, to prevent needing a conditional for every
write* or serialize* statement.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-21 12:38:15 +02:00
Felix Walter
271ff4aa4f agent_manager: Extend by FIB and BDM mgmt., simplify, make testable
- Implement management of FIB and BDM agents:
  * add administrative secret which is required for registering FIB and
    BDM agents
  * allow registering reverse-direction agents for TX/RX of ADUs when
    passing the admin secret
  * add cmdline option to pass the admin secret via an env variable
  * make administrative secret optional in debug builds
- Register agents by number, as FIB and BDM agents may not have a sink
  ID. Numbers are allocated by the agent_register function.
- Remove global state, add function to de-allocate everything.
- Add comprehensive unit tests.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-17 13:33:31 +02:00
Maximilian Nitsch
b7ce5ef89b SQLiteCLA+Agent: Extend StorageCall Protobuf definition
- Introduces a CompoundBundleId to filter exactly one bundle
- Filter bundles either by their ID or selected metadata
- Transfer the entire StorageCall object to the CLA via the agent queue

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-06-03 13:41:58 +02:00
Felix Walter
f816360cb5 Update whole-package license to AGPLv3 and add contribution info
For protecting µD3TN from proprietary forks that do not give back to the
open-source project, we decided to re-license the µD3TN project under
the GNU Affero General Public License v3.0 (AGPLv3).

To still enable proprietary projects to use µD3TN, D3TN will start to
offer proprietary licenses. To ensure that all future contributions are
compatible with this dual licensing scheme, all external contributions
will still be accepted under the terms of the Apache 2.0 license.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-03 13:10:58 +02:00
Maximilian Nitsch
5c8cfedf33 python: Update pinned dependencies
- pyd3tn: Fix pinned cbor version
- python-ud3tn-utils: Update protobuf to version 2.24.4
- tools: Update flake8 to version 6.1.0

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2023-12-22 11:22:31 +01:00
Oleksandr Nazymko
0ef3836015 Adjust clang-check script
This adds an adjustment to `clang-check.sh` script so that it checks subdirectories too.

Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
2023-12-19 13:51:05 +01:00
Felix Walter
dfbec5d175 tools/analysis: Pin Python package versions
See also: #145

This ensures that the analysis jobs will not break in the future.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-11-09 14:33:48 +01:00
Felix Walter
aef2b668c6 style: Fix style of typedef usage in aap2_client.c
This adds the AAP 2.0 typedefs to the checkpatch list, so it will not
complain about style when declaring a variable or function argument as
`<typedef> *const <name>`.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-11-08 15:11:53 +01:00
Felix Walter
346387eb7e tools/analysis: Adapt checks to new files and directories
- We have files generated from Protobuf in the codebase, which do not
  contain the license header.
- We have a new component directory (`aap2`).
- The license header check is extended to the `proto` and `options`
  files.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-11-08 15:11:52 +01:00
Felix Walter
1dd5961bc4 Add AAP 2.0 component stub with Protobuf support via Nanopb
This adds the Nanopb library as submodule under `external/` and adds
corresponding build configuration to the Makefiles. Additionally, a
Protobuf stub for AAP 2.0 is included along with a `make` target to
build the corresponding C language files (`aap2-proto-headers`).

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-11-08 15:11:52 +01:00
Felix Walter
2a10d81b37 stylecheck: Enable strict mode partially
This enables a set of "strict" diagnostics from `checkpatch.pl` but
disables some that would cause excessive refactoring or do only apply to
the Kernel.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-07-25 13:15:05 +02:00
Felix Walter
92a5e7f680 stylecheck: Update line length and ignored checks
This...
- sets the line length limit to 100 chars in accordance with the new
  Linux kernel line length limit
- ignores things we have no control or which do not apply to us: camel
  case (used via TinyCBOR, simplequeue, and FreeRTOS), and macros and types
  we have not implemented (things only part of the Linux kernel)

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-07-25 13:15:05 +02:00
Felix Walter
e16ec4c579 Enable building a BPv7 decoder binary
This adds a target `data-decoder` which builds a binary to decode a
specified binary file using uD3TN's parsing logic (based on the CLA RX
subsystem) and print details about it. In this first version only the
decoding of BPv7 bundles is implemented.

This binary can be used, e.g., for fuzz testing.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-16 11:34:14 +02:00
Oleksandr Nazymko
06b937452c Add code coverage report
This integrates code coverage report into gitlab CI. Also adds an option for generating code coverage
report after running unit tests to the Makefile.

Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
2023-05-12 11:30:27 +02:00
Felix Walter
afb91e562c tools/analysis: Exclude clang-analyzer-valist checks in clang-tidy
There is a false positive in clang-tidy that keeps happening in various
places. I checked all usages of valist and they are properly allocated,
used, and freed anytime. This disables the broken checks.

Note the removed single quotes around the extra arguments to clang-tidy:
bash somehow double-quoted the arguments when adding these and
clang-tidy did not process the filter consequently (checked via set -x).

See: https://github.com/llvm/llvm-project/issues/40656
See: https://github.com/llvm/llvm-project/issues/55009
See: https://reviews.llvm.org/D124239

Fixes: #117

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-11 17:08:39 +02:00
Felix Walter
71fb7e2b24 Make Clang check script more flexible and fix clang-tidy job
This allows the user to specify the checker binary and fixes the
"clang-tidy" CI job by using a newer version and directly invoking the
script.

Fixes: #43

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-10 11:22:51 +02:00
Felix Walter
3d619b126a Add sane behavior in release build where debug triggers assertion
This will gracefully handle cases where a debug build would abort the
program.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-10 11:22:51 +02:00
Georg Alexander Murzik
e114bfcf84 Add license-check script and CI job
The script checks that the SPDX expression in LICENSE is present in
most of our source code files.

Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
2022-02-20 16:24:38 +01:00
Georg Alexander Murzik
298431c68f Insert SPDX license expression comments into our .c, .h, .py, and .sh code
ud3tn is available under multiple licenses and we want to reflect this in
our source code. But which license information should appear first and how
can we manage this efficiently in the future? The Linux Kernel uses SPDX
expressions instead of boilerplate sections. This seems to be a great
approach, so we do the same here.

Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
2022-02-20 16:24:38 +01:00
Felix Walter
bc271aa444 Rename binary, main component, and config defaults "ud3tn"
This changes the core component name as well as the output binary names
(including the library and test binaries) from "upcn" to "ud3tn".
Additionally, the default configuration for the created socket and the
used EID is adapted.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2020-11-17 15:51:10 +01:00
Felix Walter
0ce4bee910
Initial import of uPCN v0.8.0 source code
This is the initial commit for uD3TN. uD3TN is a fork of uPCN v0.8.0,
which will be developed and maintained in a public Git repository.

For questions concerning the history of and code provided with uPCN,
please get in touch with us via: contact <at> d3tn <dot> com

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2020-11-14 11:56:40 +01:00