Previously it was not possible to disable SQLite because of a linker
error. Also, `sqlite3.h` was always required to be present. This adds
an example to `config.mk.example` and fixes both issues.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This adds functionality to dispatch bundles and control the FIB to AAP
2.0 and the bundle processor, replacing the old "router" completely.
AAP 2.0 is extended slightly to enable fragmentation.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
- 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>
The SQLiteAgent enables SQLiteCLA to read packages from the database and
return them to μD3TN. For this purpose, the SQLiteAgent writes commands
to the queue that SQLiteCLA is waiting for.
The SQLiteAgent itself can be controlled by protobuf messages that
describe which action is to be applied to which set of bundles.
Currently the operations "Push" and "Delete" are implemented and a
filter based on a destination EID pattern.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
The SQLiteCLA makes it possible to write bundles, that are to be sent
via this CLA, to an SQLite database in order to persist them over a
longer period of time and also a restart of μD3TN.
The bundles are saved together with selected metadata (source EID,
destination EID, creation timestamp) in the "bundles" table. A
combination of source EID and creation timestamp is used as the primary
key.
To return bundles to μD3TN, they are read from the database and injected
via the cla_read() function, just like other CLAs that receive bundles.
To trigger this, commands are read from a queue that specify which
bundles are to be read from the database.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
For two settings previously defined in `hal_config.h` it makes sense to
make them changeable via `config.mk`. The AAP setting is moved to the
appropriate header and the Linux-specific APU define gets a guard so it
can be changed at compile time.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This moves all definitions from config.h to individual header files and
makes them configurable (i.e., does not define when already defined).
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This may cause a deadlock which we observed sometimes in the routing
integration test in CI as one slot in the BP queue is always needed to
finish processing the Bundle in the BP (that causes `agent_forward` in
this case).
This makes the config agent directly invoke the BP function.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This refactors the Router Task into synchronous functions called by the
BP, preventing the need of circular notifications between them.
The router queue is replaced by new signals in the BP queue.
This additionally removes the global state in the bundle processor.
Closes: #11
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This implements what we have as aap_echo.py tool in an agent that runs
within uD3TN itself. This makes it easier to check availability of uD3TN
also if the runtime environment does not provide a Python implementation.
Signed-off-by: Felix Walter <felix.walter@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 had a build-time flag for enabling configuration via
bundles received from other nodes. Thus, changing the flag required a
re-build. As we are depending on it also for our integration tests and
it is often handy in further setups, this change makes it a command
line argument "--allow-remote-config".
As the STM32 platform does not support command line arguments, remote
configuration is enabled by default there via config.h.
See also: !13, #32
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This moves handling the CONFIG_AGENT_REMOTE_CONFIGURATION flag from the
header to the respective source file as we do not want the variable to
be present in any file including the config_agent header.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We already have a CONFIG_AGENT_REMOTE_CONFIGURATION build option to
enable remote configuration via the config_agent. However, setting the
time via management_agent is allowed in any case. This change applies
the same restrictions to setting the system time.
Note: Setting the time is important for STM32 as this device does not
manage the time by itself like a POSIX-based system.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This avoids unsynchronized shared state access between the application agent
and the bundle processor tasks, which could lead to use after free errors.
This commit also removes some unreachable code in the `process_aap_message`
function of `application_agent.c`:
```
// already handled by the previous `aap_message_is_valid` call w/ early return
if (msg.eid == NULL || msg.eid_length == 0) {
// zero-length EID, only de-registering
response.type = AAP_MESSAGE_ACK;
}
```
Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
To be protected against unauthorized remote configuration, by default
only configuration bundles with a local source EID are processed by the
config agent. This feature can be disabled by setting
CONFIG_AGENT_REMOTE_CONFIGURATION to true at compile time.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
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>