From e628a01fffba231a1f0f729bdb509abcba6e6f0b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 13 Apr 2014 18:21:17 +0200 Subject: Add on-connect hook --- src/config.y | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/config.y') 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); } -- cgit v1.2.3