mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-16 13:01:06 +02:00
- 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>
33 lines
718 B
C
33 lines
718 B
C
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
#ifndef SQLITE_AGENT_H_INCLUDED
|
|
#define SQLITE_AGENT_H_INCLUDED
|
|
|
|
#include "platform/posix/hal_types.h"
|
|
|
|
#include "ud3tn/bundle_processor.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sqlite3.h>
|
|
|
|
// Default Agent IDs.
|
|
#ifndef AGENT_ID_SQLITE_DTN
|
|
#define AGENT_ID_SQLITE_DTN "sqlite"
|
|
#endif // AGENT_ID_SQLITE_DTN
|
|
#ifndef AGENT_ID_SQLITE_IPN
|
|
#define AGENT_ID_SQLITE_IPN "9003"
|
|
#endif // AGENT_ID_SQLITE_IPN
|
|
|
|
struct sqlite_agent_params {
|
|
char *sink_identifier;
|
|
agent_no_t registered_agent_no;
|
|
sqlite3 *db;
|
|
QueueIdentifier_t cla_queue;
|
|
};
|
|
|
|
int sqlite_agent_setup(
|
|
const struct bundle_agent_interface *const,
|
|
struct sqlite_agent_params *params
|
|
);
|
|
|
|
#endif // SQLITE_AGENT_H_INCLUDED
|