Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
#include <systemd/sd-event.h>
#include "bus.h"
+#include "config.h"
#include "daemon.h"
#include "logging.h"
struct nw_daemon {
int nrefs;
+ struct nw_config* config;
+
// Event Loop
sd_event* loop;
static int nw_daemon_setup(struct nw_daemon* daemon) {
int r;
+ // Read configuration file
+ r = nw_config_read(&daemon->config, "/etc/network/settings");
+ if (r)
+ return r;
+
// Setup the event loop
r = nw_daemon_setup_loop(daemon);
if (r)
}
static void nw_daemon_free(struct nw_daemon* daemon) {
+ if (daemon->config)
+ nw_config_unref(daemon->config);
if (daemon->bus)
sd_bus_unref(daemon->bus);
if (daemon->loop)