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>
This determines the config endpoint according to uD3TN default settings
properly even if uD3TN uses the ipn EID scheme.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
-> https://datatracker.ietf.org/doc/html/draft-ietf-dtn-bpbis-31#section-4.2.5
The previous validation methods were not sufficient to check validity of
dtn as well as ipn EIDs. This adds further functions to easily detect
the EID scheme and validate dtn plus ipn EIDs. Tests for the most common
cases where validity checks should be successful and where they might
fail are added as well.
Due to this change the default EID of uD3TN gets a slash appended, as
dtn EIDs always have to contain the name delimiter '/'.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This commit fixes typos and indentation issues and simplifies parts
of the bundle7.py, aap_message.py and aap_receive.py files.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
This commit remedies the issue of having to modifiy the bundle7.py before
being able to run the automated ION interoperability test by introducing
the --compatibility switch to bibe_over_mtcp_test.py. This command line
argument forces the generated BIBE bundle to use the administrative
record type code 7 instead of 3, ensuring compatibility to ION'S BIBE
implementation.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
Changed default value of --outer from dtn://ud3tn.dtn to
dtn://lower.dtn, to match the description in the BIBE documentation.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
This commit remedies code smells introduced to pyd3tn and the python
tools while implementing the BIBE CLA.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
This commit renames the --outer_destination and --inner_destination
commandline parameters to --outer and --inner respectively. It also
adds short forms (-o and -i).
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
The default port the script connected to was 4222 instead
of the mtcp port (4224). Also the destinations of the inner and outer
bundles were hardcoded and not changeable via commandline parameters.
This commit fixes those issues by changing the default port and adding
the outer_destination and inner_destination commandline arguments.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
By changing the the way BIBE bundles are handled in the bundle processor
(discarding the administrative record and just forwarding the BPDU)
aap_receive.py had to be modified to work with the new payload format.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
This commit modifies aap_send.py, aap_receive.py and aap_client.py to
allow for sending SENDBIBE messages using the Python uD3TN utils.
The clear distinction between regular SENDBUNDLE messages and SENDBIBE
messages allows for a rework of the crude check of the message type
performed in aap_receive.py, which is also implemented by this commit.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
The aap_receive.py file has been modified to support the new parser for
administrative records. This will facilitate testing of sending ARs over
AAP.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
To allow for receiving and parsing BIBE bundles, the parser implemented
in a previous commit is used. Also in order to differentiate BIBE bundles
from AAP messages, a simple check has been added. This check might need
some refinement if other administrative record types are to be supported
in the future, but it works reliably for BIBE bundles.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
When using the command line parameter --bibe, aap_send.py will now
encapsulate the bundle containing the chosen payload in a BIBE PDU
before sending.
Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>