diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-05 13:17:02 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-04-05 13:17:02 +0200 |
commit | 7b2cfb422af6a957aa90e22bd6e9b19f16b30319 (patch) | |
tree | aaa2fd85662309af45ab4fced6b332445bdf0f10 /src/config.y | |
parent | 329d15d50c54a69ce8e2be0865124744c0bf3428 (diff) | |
download | fastd-7b2cfb422af6a957aa90e22bd6e9b19f16b30319.tar fastd-7b2cfb422af6a957aa90e22bd6e9b19f16b30319.zip |
Cleanly shutdown; add on-down command
Diffstat (limited to 'src/config.y')
-rw-r--r-- | src/config.y | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/config.y b/src/config.y index 332ad77..0af0980 100644 --- a/src/config.y +++ b/src/config.y @@ -72,6 +72,7 @@ %token TOK_TUN %token TOK_ON %token TOK_UP +%token TOK_DOWN %token TOK_PEERS %token TOK_FROM %token TOK_LOG @@ -97,10 +98,10 @@ void fastd_config_error(YYLTYPE *loc, fastd_context *ctx, fastd_config *conf, const char *filename, int depth, char *s); - extern fastd_protocol fastd_protocol_null; + extern const fastd_protocol fastd_protocol_null; #ifdef WITH_PROTOCOL_ECFXP - extern fastd_protocol fastd_protocol_ec25519_fhmqvc_xsalsa20_poly1305; + extern const fastd_protocol fastd_protocol_ec25519_fhmqvc_xsalsa20_poly1305; #endif } @@ -129,6 +130,7 @@ statement: TOK_LOG log ';' | TOK_PROTOCOL protocol ';' | TOK_SECRET secret ';' | TOK_ON TOK_UP on_up ';' + | TOK_ON TOK_DOWN on_down ';' | TOK_PEER peer '{' peer_conf '}' | TOK_PEER_TO_PEER peer_to_peer ';' | TOK_INCLUDE include ';' @@ -201,6 +203,15 @@ on_up: TOK_STRING { } ; +on_down: TOK_STRING { + free(conf->on_down); + free(conf->on_down_dir); + + conf->on_down = strdup($1->str); + conf->on_down_dir = get_current_dir_name(); + } + ; + peer: maybe_string { fastd_peer_config_new(ctx, conf); conf->peers->name = strdup($1->str); |