We now perform the range check via argparse and provide a function to
add the parser argument like with other common parser arguments.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
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>
This adds the option to enable keepalive messages for AAPv2 in the
aap_receive and aap_ping tooling, so that the AAPv2 connections stay
alive until bundles are received.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We specify AAP 2.0 to be an RPC protocol whereas the direction of calls
can be switched during configuration. Each call needs to be answered.
This change adds the answer for bundle reception by a client.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
- 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>
This adds adapted versions of `aap_send.py`, `aap_receive.py`, and
`aap_ping.py` for AAP2 and implements the required client classes in
the `ud3tn_utils` module.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
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>
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>
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>
The program waits only if timeout parameter is specified otherwise it terminates right after sending all ping bundles. Also edits argument description.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
This adds a timeout argument for `aap_ping.py`. If specified the program will
wait the defined time after sending all bundles and then stop.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
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>
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>
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/D124239Fixes: #117
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This makes the testing logs prettier and may help in decoding the
responses received by aap_receive.py.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
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>
Previously we were sending the whole outer bundle binary data, however,
the AppAgent expects only the BPDU binary data.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We register an own endpoint for the ping, so can expect only ping
bundles to come back. If we receive anything else, it should be a warning.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Sometimes we may send around data that are not UTF-8 encoded. These
previously led to a crash of aap_receive. Also, we could not easily
inject such data via aap_send, even when reading from stdin.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We sometimes want to send a "request" bundle and receive a "response".
For this purpose, a combination of aap_send.py and aap_receive.py is not
always suitable, because the reception process can only be started with
a delay after the sending process.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This adds a common function to initialize a logger from the Python
`logging` module and uses it in all tools (except aap_test.py, which is
deliberately kept minimal). Each tool chooses in its initialization
routine whether WARN or INFO is the default log level, simply by either
adding 1 to the verbosity parameter or not.
Messages that were previously printed to the terminal using print() are
changed into log statements.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This changes the supported EID schemes format of uD3TN nodes
from `dtn` to `ipn' form according to the ION format. It also adds
small fixes and edits `readme_contact_plan_reader.md` file.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
This removes `parse_contact_time_span` and adds `create_contact` functions.
The last one converts time input in DTN timestamps for the ConfigMessage.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
This implements the `aap_contact_plan_reader.py` Python tool that reads
contact plans in ION format and which configures the uD3TN nodes by
scheduling contacts between them. It also adds a small documentation on
how it can be used.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
Previously we only supported uD3TN's default settings (UNIX socket with
default name). This adds the same socket options as used by the other
AAP tools to aap_test.py.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This allows us to support IPv6 properly. A slight re-structuring was
necessary as we have to attempt multiple connections with different
sockets one after another. Thus, the socket instance is created in
connect() instead of __init__ and we use abc.ABC to prevent
instantiating the AAPClient without overriding the connect() method.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
When invoking aap_ping with the defaults (`--count 0`) the calculation
added in the previous commit is faulty as the minimum will always be
zero.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Correct two typographical errors. Remove try ... except construct
to not drop all the details about the errors that may occur.
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
Like the well-known "ping" utility this gives aap_ping the capability to
stop operation after a specified number of bundles and report success or
failure (i.e., whether all sent bundles have been received) with its
exit status.
Note that the utility terminates latest after (count * (interval+1))
seconds - we cannot know until when a response is expected and, thus,
assume that the interval is chosen appropriately by the user.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
aap_ping did only handle SIGINT (KeyboardInterrupt) in case it was raised
during a receive operation. This moves the handler outside of the while
loop and moves the receiving code into a dedicated function.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This prints an appropriate error message in case the connection to uD3TN
breaks and, additionally, gracefully terminates the sending thread which
would otherwise access an invalid file descriptor.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
It implements a simple AAP application that connects to a DTN-node and sends
an "echo" of the received bundles back to the sender. This tool works well with
a companion aap_ping function "ping" receiving "ping bundles" and sending
them back(like in the ICMP echos).
Resolves: #80
See also: #79
Signed-off-by: Oleksandr Nazymko <oleksandr.nazymko@d3tn.com>
This provides aap_ping.py, a simple tool to send bundles containing just
some information about when they were sent plus a sequence number.
The contained information is printed as soon as the bundles are received
back, similar to the "ping" utility for IP networks. This can be used to
check connectivity and proper operation of an AAP-capable bundle agent
(like uD3TN) and, in combination with a "bundle echo" tool, connectivity
to some arbitrary destination node.
Closes: #79
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Former releases of uD3TN have included support for STM32/FreeRTOS.
Having this support from the first moment on was a good thing in
order to optimize for platforms with limited resources. As this
platform is not used in current uD3TN setups and as it results in quite
some maintenance work, it is removed with this commit. The removed parts
cover the implementation itself, tests, tools, documentation, parts of
the build/make scripts as well as licensing information.
Signed-off-by: Marius Feldmann <marius.feldmann@d3tn.com>
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>
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>
Previously we always used simple string concatenation. This change first
obtains the EID prefix representing the bundle node and, then, adds the
config endpoint to it.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>