Commit graph

18 commits

Author SHA1 Message Date
Felix Walter
22e0ede032 ud3tn_utils: Set log level in AAP client to DEBUG
The AAP client class prints some log messages, but we do not want them
to be printed by default if we turn on INFO logging. This uses
`logger.debug` instead.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-11-11 10:12:47 +01:00
Felix Walter
4002eed29f
Merge branch 'hotfix/93-ipn-eid-printing'
See !66
2022-10-11 18:05:16 +02:00
Felix Walter
d9f67e83fc python_ud3tn_utils: Drop leading zero from ipn service number
Do not simply concatenate the node EID and agent ID in case of `ipn`
EIDs.

Fixes: #93
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-09-19 08:07:42 +02:00
Felix Walter
092e7a7b2f python_ud3tn_utils: Limit auto-generated ipn service nbr to INT32_MAX
See #92 - ION only supports 32 bit service numbers.

Fixes: #92
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-09-19 07:52:21 +02:00
Felix Walter
d41bab7f77 tools: Use getaddrinfo() for establishing TCP connections
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>
2022-05-02 10:19:31 +02:00
Felix Walter
83b1b07186 python: Bump version to 0.11.0 2022-03-04 21:10:44 +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
37e39104aa Fix EID validation for dtn and ipn according to BPv7 draft 31
-> 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>
2022-01-26 21:05:41 +01:00
Felix Walter
449d0bc17c Add proper support for the ipn EID scheme
Previously uD3TN implicitly assumed string EID in many places such as
the agent manager. This adds proper handling for ipn-scheme EIDs,
using numerical service numbers as agent IDs in case uD3TN is started
with an ipn-scheme EID. If the ipn scheme is used, uD3TN always has to
be configured with the service number 0. The config and management agent
IDs can be configured in config.h and are 9000 and 9001, respectively,
to keep the lower range of service numbers free. It is intentional that
agents can register with a service number of zero - uD3TN does not
provide specific functionality under this service number.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-01-26 21:05:41 +01:00
Tobias Nöthlich
10028924d6 Refactor Python components
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>
2022-01-26 21:04:02 +01:00
Tobias Nöthlich
60813aa49e Fix python-stylecheck warnings and errors
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>
2021-11-29 13:29:31 +01:00
Tobias Nöthlich
fe5d08f2b0 Add sending/receiving BIBE AAP messages using Python
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>
2021-11-02 10:02:35 +01:00
Tobias Nöthlich
fc8e3bdaff Add SEND/RECVBIBE to aap_client and aap_message.py
To facilitate testing of AAP BIBE reception in uD3TN, this commit adds
the functionality for sending SENDBIBE messages using aap_client.py.

Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
2021-11-02 08:31:53 +01:00
Felix Walter
f1024de0ea
python: Bump version to 0.10.0
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2021-09-24 12:45:09 +02:00
Maximilian Nitsch
24db3a530f tools+utils: Adapt default UNIX socket path
By changing the default UNIX socket path to PWD in !11, the default
parameters for the AAP tools are adapted accordingly.

Closes: #51

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2021-06-02 13:47:25 +02:00
Felix Walter
baa58a7d4b
python: Bump version to 0.9.0
The first release will be v0.9.0 to continue with the µPCN history.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2020-11-19 18:52:42 +01:00
Maximilian Nitsch
fb18337198 Apply PEP8 style guide
All additional spaces for aligning assignments to equals signs are
removed because they are not PEP8 compliant.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2020-11-19 12:38:40 +01:00
Maximilian Nitsch
45bbccebb6 Prepare PyPi packages
To distribute the pyD3TN DTN protocol implementations as well as the
uD3TN python utilities on PyPi, the Python code is organized in separate
directories and the PyPi packaging guideline is applied. The
restructuring also requires an adjustment of the imports in the scripts
in tools/ and test/.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2020-11-19 12:38:39 +01:00