summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-02-26 01:02:35 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-02-26 01:02:35 +0100
commit4ab4858d5473c816cc526b296ae9da6c6956219d (patch)
tree67ac9253e6aa74a68699aa2a9e8e43d89e14c088 /src/config.c
parent87b9b80a55d3567e76fc86d3abc7f3cfd6d92e6f (diff)
downloadfastd-4ab4858d5473c816cc526b296ae9da6c6956219d.tar
fastd-4ab4858d5473c816cc526b296ae9da6c6956219d.zip
Experimental support for accepting connections from unknown peers
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index c866b14..001cc2e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -549,6 +549,7 @@ static void count_peers(fastd_context_t *ctx, fastd_config_t *conf) {
OPTION_ARG(option_on_down, "--on-down", "<command>", "Sets a shell command to execute before interface destruction") \
OPTION_ARG(option_on_establish, "--on-establish", "<command>", "Sets a shell command to execute when a new connection is established") \
OPTION_ARG(option_on_disestablish, "--on-disestablish", "<command>", "Sets a shell command to execute when a connection is lost") \
+ OPTION_ARG(option_on_verify, "--on-verify", "<command>", "Sets a shell command to execute to check an connection attempt by an unknown peer") \
OPTION(option_generate_key, "--generate-key", "Generates a new keypair") \
OPTION(option_show_key, "--show-key", "Shows the public key corresponding to the configured secret") \
OPTION(option_machine_readable, "--machine-readable", "Suppresses output of explaining text in the --show-key and --generate-key commands")
@@ -781,6 +782,14 @@ static void option_on_disestablish(fastd_context_t *ctx, fastd_config_t *conf, c
conf->on_disestablish_dir = get_current_dir_name();
}
+static void option_on_verify(fastd_context_t *ctx, fastd_config_t *conf, const char *arg) {
+ free(conf->on_verify);
+ free(conf->on_verify_dir);
+
+ conf->on_verify = strdup(arg);
+ conf->on_verify_dir = get_current_dir_name();
+}
+
static void option_daemon(fastd_context_t *ctx, fastd_config_t *conf) {
conf->daemon = true;
}
@@ -1062,6 +1071,8 @@ void fastd_config_release(fastd_context_t *ctx, fastd_config_t *conf) {
free(conf->on_establish_dir);
free(conf->on_disestablish);
free(conf->on_disestablish_dir);
+ free(conf->on_verify);
+ free(conf->on_verify_dir);
free(conf->protocol_config);
free(conf->log_syslog_ident);
}