summaryrefslogtreecommitdiffstats
path: root/src/options.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-12 18:54:16 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-12 18:54:16 +0200
commitd468ffff4564ac0d6fb1b13d886ee72785d329ef (patch)
tree52b54fc5f1e020b928c01228d1be413dd3aa8e74 /src/options.c
parent78de22fd21b348fc00dde6fa0bfec73abb8fd651 (diff)
downloadfastd-d468ffff4564ac0d6fb1b13d886ee72785d329ef.tar
fastd-d468ffff4564ac0d6fb1b13d886ee72785d329ef.zip
Add pre-up and post-down handlers
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 7bab8bc..92ac46e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -231,6 +231,14 @@ static void option_forward(fastd_context_t *ctx, fastd_config_t *conf) {
conf->forward = true;
}
+static void option_on_pre_up(fastd_context_t *ctx, fastd_config_t *conf, const char *arg) {
+ free(conf->on_pre_up);
+ free(conf->on_pre_up_dir);
+
+ conf->on_pre_up = strdup(arg);
+ conf->on_pre_up_dir = get_current_dir_name();
+}
+
static void option_on_up(fastd_context_t *ctx, fastd_config_t *conf, const char *arg) {
free(conf->on_up);
free(conf->on_up_dir);
@@ -247,6 +255,14 @@ static void option_on_down(fastd_context_t *ctx, fastd_config_t *conf, const cha
conf->on_down_dir = get_current_dir_name();
}
+static void option_on_post_down(fastd_context_t *ctx, fastd_config_t *conf, const char *arg) {
+ free(conf->on_post_down);
+ free(conf->on_post_down_dir);
+
+ conf->on_post_down = strdup(arg);
+ conf->on_post_down_dir = get_current_dir_name();
+}
+
static void option_on_establish(fastd_context_t *ctx, fastd_config_t *conf, const char *arg) {
free(conf->on_establish);
free(conf->on_establish_dir);