summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-05 22:43:11 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-05 22:43:11 +0200
commit2561266c156a1f63ed85fe2865ac607507ae4cef (patch)
tree9fbc7cf5fb9a045e7bbf70ab07f9b5b4e518a782 /src/config.y
parent5f898aa52f81671cbc54beea19211c8a75e0962f (diff)
downloadfastd-2561266c156a1f63ed85fe2865ac607507ae4cef.tar
fastd-2561266c156a1f63ed85fe2865ac607507ae4cef.zip
Add status socket to get the current status as JSON
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/config.y b/src/config.y
index 389cf31..35b8901 100644
--- a/src/config.y
+++ b/src/config.y
@@ -116,6 +116,8 @@
%token TOK_REMOTE
%token TOK_SECRET
%token TOK_SECURE
+%token TOK_SOCKET
+%token TOK_STATUS
%token TOK_STDERR
%token TOK_SYNC
%token TOK_SYSLOG
@@ -199,6 +201,7 @@ statement: peer_group_statement
| TOK_ON TOK_ESTABLISH on_establish ';'
| TOK_ON TOK_DISESTABLISH on_disestablish ';'
| TOK_ON TOK_VERIFY on_verify ';'
+ | TOK_STATUS TOK_SOCKET status_socket ';'
| TOK_FORWARD forward ';'
;
@@ -415,8 +418,18 @@ on_verify: sync_def_async TOK_STRING {
#ifdef WITH_DYNAMIC_PEERS
fastd_shell_command_set(&conf.on_verify, $2->str, $1);
#else
- fastd_config_error(&@$, state, "`on verify' is not supported by this version of fastd");
- YYERROR;
+ fastd_config_error(&@$, state, "`on verify' is not supported by this version of fastd");
+ YYERROR;
+#endif
+ }
+ ;
+
+status_socket: TOK_STRING {
+#ifdef WITH_STATUS_SOCKET
+ free(conf.status_socket); conf.status_socket = fastd_strdup($1->str);
+#else
+ fastd_config_error(&@$, state, "status sockets aren't supported by this version of fastd");
+ YYERROR;
#endif
}
;