diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/grammar.y | 14 | ||||
-rw-r--r-- | src/scanner.l | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/grammar.y b/src/grammar.y index f3c07d1..8e3f324 100644 --- a/src/grammar.y +++ b/src/grammar.y @@ -1,4 +1,4 @@ -/* $Id: grammar.y,v 1.4 2001-08-26 21:08:36 rjkaes Exp $ +/* $Id: grammar.y,v 1.5 2001-09-16 20:08:24 rjkaes Exp $ * * This is the grammar for tinyproxy's configuration file. It needs to be * in sync with scanner.l. If you know more about yacc and lex than I do @@ -44,7 +44,8 @@ int yylex(void); %token KW_MAXREQUESTSPERCHILD %token KW_TIMEOUT %token KW_USER KW_GROUP -%token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY KW_TUNNEL +%token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY +%token KW_TUNNEL KW_UPSTREAM %token KW_ALLOW KW_DENY /* yes/no switches */ @@ -124,6 +125,15 @@ statement log_message(LOG_WARNING, "Tunnel support was not compiled in."); #endif } + | KW_UPSTREAM unique_address ':' NUMBER + { +#ifdef UPSTREAM_SUPPORT + config.upstream_name = $2; + config.upstream_port = $4; +#else + log_message(LOG_WARNING, "Upstream proxy support was not compiled in."); +#endif + } | KW_LISTEN NUMERIC_ADDRESS { config.ipAddr = $2; } | KW_ALLOW network_address { insert_acl($2, ACL_ALLOW); } | KW_DENY network_address { insert_acl($2, ACL_DENY); } diff --git a/src/scanner.l b/src/scanner.l index 5c4a975..ab87b39 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1,4 +1,4 @@ -/* $Id: scanner.l,v 1.4 2001-08-26 21:08:36 rjkaes Exp $ +/* $Id: scanner.l,v 1.5 2001-09-16 20:08:24 rjkaes Exp $ * * This builds the scanner for the tinyproxy configuration file. This * file needs to stay in sync with grammar.y. If someone knows lex and yacc @@ -47,6 +47,7 @@ static struct keyword keywords[] = { { "filter", KW_FILTER }, { "xtinyproxy", KW_XTINYPROXY }, { "tunnel", KW_TUNNEL }, + { "upstream", KW_UPSTREAM }, { "allow", KW_ALLOW }, { "deny", KW_DENY }, |