ud3tn/include/agents/sqlite_agent.h
Felix Walter 271ff4aa4f agent_manager: Extend by FIB and BDM mgmt., simplify, make testable
- 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>
2024-06-17 13:33:31 +02:00

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