summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-13 18:21:17 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-13 18:21:17 +0200
commite628a01fffba231a1f0f729bdb509abcba6e6f0b (patch)
tree56e71649d6036116ea3d78a28af4f6876625ec72 /src/config.y
parent7cac6770e0b380d6e5f37b9fad71c9f7f15952ba (diff)
downloadfastd-e628a01fffba231a1f0f729bdb509abcba6e6f0b.tar
fastd-e628a01fffba231a1f0f729bdb509abcba6e6f0b.zip
Add on-connect hook
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/config.y b/src/config.y
index 2bdd5d3..b4bd68b 100644
--- a/src/config.y
+++ b/src/config.y
@@ -74,6 +74,7 @@
%token TOK_BIND
%token TOK_CAPABILITIES
%token TOK_CIPHER
+%token TOK_CONNECT
%token TOK_DEBUG
%token TOK_DEBUG2
%token TOK_DEFAULT
@@ -198,6 +199,7 @@ statement: peer_group_statement
| TOK_ON TOK_UP on_up ';'
| TOK_ON TOK_DOWN on_down ';'
| TOK_ON TOK_POST_DOWN on_post_down ';'
+ | TOK_ON TOK_CONNECT on_connect ';'
| TOK_ON TOK_ESTABLISH on_establish ';'
| TOK_ON TOK_DISESTABLISH on_disestablish ';'
| TOK_ON TOK_VERIFY on_verify ';'
@@ -398,6 +400,11 @@ on_post_down: sync_def_sync TOK_STRING {
}
;
+on_connect: sync_def_async TOK_STRING {
+ fastd_shell_command_set(&conf->on_connect, $2->str, $1);
+ }
+ ;
+
on_establish: sync_def_async TOK_STRING {
fastd_shell_command_set(&conf->on_establish, $2->str, $1);
}