summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-05-17 22:24:31 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-05-17 22:24:31 +0200
commita2b9f2c732232200fd4822e34d60d4c7f5ad37d2 (patch)
tree590e83f11ea568349e523256606b7fbf0148dd14 /src/config.c
parentd8a3a034a13aaabe5877c6b3cdf73e0582e6425f (diff)
downloadfastd-a2b9f2c732232200fd4822e34d60d4c7f5ad37d2.tar
fastd-a2b9f2c732232200fd4822e34d60d4c7f5ad37d2.zip
Add daemon mode
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index f407239..d9397cc 100644
--- a/src/config.c
+++ b/src/config.c
@@ -88,6 +88,7 @@ static void default_config(fastd_config *conf) {
conf->on_disestablish = NULL;
conf->on_disestablish_dir = NULL;
+ conf->daemon = false;
conf->machine_readable = false;
conf->generate_key = false;
conf->show_key = false;
@@ -332,6 +333,7 @@ static void count_peers(fastd_context *ctx, fastd_config *conf) {
#define OPTIONS \
OPTION(usage, "--help" OR "-h", "Shows this help text") \
OPTION(version, "--version" OR "-v", "Shows the fastd version") \
+ OPTION(option_daemon, "--daemon" OR "-d", "Runs fastd in the background") \
OPTION_ARG(option_log_level, "--log-level", "error|warn|info|verbose|debug", "Sets the log level; default is info") \
OPTION_ARG(option_config, "--config" OR "-c", "<filename>", "Loads a config file") \
OPTION_ARG(option_config_peer, "--config-peer", "<filename>", "Loads a config file for a single peer") \
@@ -553,6 +555,9 @@ static void option_on_disestablish(fastd_context *ctx, fastd_config *conf, const
conf->on_disestablish_dir = get_current_dir_name();
}
+static void option_daemon(fastd_context *ctx, fastd_config *conf) {
+ conf->daemon = true;
+}
static void option_generate_key(fastd_context *ctx, fastd_config *conf) {
conf->generate_key = true;
conf->show_key = false;