From 6c401d89e229fe24cb35b4758f1abb3cfb1cc966 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Apr 2012 21:52:21 +0200 Subject: Allow peer-to-peer forwarding --- src/config.y | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/config.y') 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 TOK_ADDR %token TOK_ADDR6 @@ -103,6 +107,7 @@ %type maybe_string %type port +%type boolean %type maybe_port %type 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); -- cgit v1.2.3