summaryrefslogtreecommitdiffstats
path: root/src/config.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-02 21:52:21 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-02 21:52:21 +0200
commit6c401d89e229fe24cb35b4758f1abb3cfb1cc966 (patch)
tree35ffc937a8684de1b1634d0f41cde7824abc9a26 /src/config.y
parent77520caad8302266537e87104f6496040fc98bb4 (diff)
downloadfastd-6c401d89e229fe24cb35b4758f1abb3cfb1cc966.tar
fastd-6c401d89e229fe24cb35b4758f1abb3cfb1cc966.zip
Allow peer-to-peer forwarding
Diffstat (limited to 'src/config.y')
-rw-r--r--src/config.y14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/config.y b/src/config.y
index 37a4ea9..be30ab0 100644
--- a/src/config.y
+++ b/src/config.y
@@ -44,6 +44,7 @@
%union {
int num;
char* str;
+ bool boolean;
struct in_addr addr;
struct in6_addr addr6;
}
@@ -80,6 +81,9 @@
%token TOK_INFO
%token TOK_VERBOSE
%token TOK_DEBUG
+%token TOK_PEER_TO_PEER
+%token TOK_YES
+%token TOK_NO
%token <addr> TOK_ADDR
%token <addr6> TOK_ADDR6
@@ -103,6 +107,7 @@
%type <str> maybe_string
%type <num> port
+%type <boolean> boolean
%type <num> maybe_port
%type <str> maybe_as
@@ -124,6 +129,7 @@ statement: TOK_LOG log ';'
| TOK_SECRET secret ';'
| TOK_ON TOK_UP on_up ';'
| TOK_PEER peer '{' peer_conf '}'
+ | TOK_PEER_TO_PEER peer_to_peer ';'
| TOK_INCLUDE include ';'
;
@@ -226,6 +232,10 @@ peer_include: TOK_STRING { fastd_read_config(ctx, conf, $1, true, depth); free($
;
+peer_to_peer: boolean { conf->peer_to_peer = $1; }
+ ;
+
+
include: TOK_PEER TOK_STRING maybe_as {
fastd_peer_config_new(ctx, conf);
conf->peers->name = $3;
@@ -253,6 +263,10 @@ maybe_as: TOK_AS TOK_STRING { $$ = $2; }
| { $$ = NULL; }
;
+boolean: TOK_YES { $$ = true; }
+ | TOK_NO { $$ = false; }
+ ;
+
port: TOK_INTEGER {
if ($1 < 0 || $1 > 65635)
exit_error(ctx, "invalid port %i", $1);