summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config.y b/src/config.y
index 0af0980..ac5f808 100644
--- a/src/config.y
+++ b/src/config.y
@@ -73,6 +73,8 @@
%token TOK_ON
%token TOK_UP
%token TOK_DOWN
+%token TOK_ESTABLISH
+%token TOK_DISESTABLISH
%token TOK_PEERS
%token TOK_FROM
%token TOK_LOG
@@ -131,6 +133,8 @@ statement: TOK_LOG log ';'
| TOK_SECRET secret ';'
| TOK_ON TOK_UP on_up ';'
| TOK_ON TOK_DOWN on_down ';'
+ | TOK_ON TOK_ESTABLISH on_establish ';'
+ | TOK_ON TOK_DISESTABLISH on_disestablish ';'
| TOK_PEER peer '{' peer_conf '}'
| TOK_PEER_TO_PEER peer_to_peer ';'
| TOK_INCLUDE include ';'
@@ -212,6 +216,24 @@ on_down: TOK_STRING {
}
;
+on_establish: TOK_STRING {
+ free(conf->on_establish);
+ free(conf->on_establish_dir);
+
+ conf->on_establish = strdup($1->str);
+ conf->on_establish_dir = get_current_dir_name();
+ }
+ ;
+
+on_disestablish: TOK_STRING {
+ free(conf->on_disestablish);
+ free(conf->on_disestablish_dir);
+
+ conf->on_disestablish = strdup($1->str);
+ conf->on_disestablish_dir = get_current_dir_name();
+ }
+ ;
+
peer: maybe_string {
fastd_peer_config_new(ctx, conf);
conf->peers->name = strdup($1->str);