summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/config.y b/src/config.y
index ec2aabe..07774d1 100644
--- a/src/config.y
+++ b/src/config.y
@@ -94,6 +94,7 @@
%token TOK_YES
%token TOK_NO
%token TOK_PORT
+%token TOK_FLOAT
%token <addr> TOK_ADDR
%token <addr6> TOK_ADDR6
@@ -117,6 +118,7 @@
%type <num> maybe_port
%type <str> maybe_as
%type <num> maybe_af
+%type <boolean> maybe_float
%%
start: START_CONFIG config
@@ -294,12 +296,13 @@ peer_remote: TOK_ADDR port {
conf->peers->address.in6.sin6_addr = $1;
conf->peers->address.in6.sin6_port = htons($2);
}
- | maybe_af TOK_STRING port {
+ | maybe_af TOK_STRING port maybe_float {
free(conf->peers->hostname);
conf->peers->hostname = strdup($2->str);
conf->peers->address.sa.sa_family = $1;
conf->peers->address.in.sin_port = htons($3);
+ conf->peers->dynamic_float = $4;
}
;
@@ -351,6 +354,10 @@ maybe_af: TOK_IPV4 { $$ = AF_INET; }
| { $$ = AF_UNSPEC; }
;
+maybe_float: TOK_FLOAT { $$ = true; }
+ | { $$ = false; }
+ ;
+
boolean: TOK_YES { $$ = true; }
| TOK_NO { $$ = false; }
;