Added the support code to process a ConnectPort configuration directive.

This commit is contained in:
Robert James Kaes 2002-04-12 16:59:37 +00:00
parent eb1230e841
commit 660e4d5687
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $Id: grammar.y,v 1.7 2002-04-02 17:17:30 rjkaes Exp $ /* $Id: grammar.y,v 1.8 2002-04-12 16:59:37 rjkaes Exp $
* *
* This is the grammar for tinyproxy's configuration file. It needs to be * 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 * in sync with scanner.l. If you know more about yacc and lex than I do
@ -24,6 +24,7 @@
#include "acl.h" #include "acl.h"
#include "anonymous.h" #include "anonymous.h"
#include "log.h" #include "log.h"
#include "reqs.h"
#include "thread.h" #include "thread.h"
void yyerror(char *s); void yyerror(char *s);
@ -46,6 +47,7 @@ int yylex(void);
%token KW_USER KW_GROUP %token KW_USER KW_GROUP
%token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY %token KW_ANONYMOUS KW_FILTER KW_XTINYPROXY
%token KW_TUNNEL KW_UPSTREAM %token KW_TUNNEL KW_UPSTREAM
%token KW_CONNECTPORT
%token KW_ALLOW KW_DENY %token KW_ALLOW KW_DENY
/* yes/no switches */ /* yes/no switches */
@ -145,6 +147,7 @@ statement
| KW_ALLOW network_address { insert_acl($2, ACL_ALLOW); } | KW_ALLOW network_address { insert_acl($2, ACL_ALLOW); }
| KW_DENY network_address { insert_acl($2, ACL_DENY); } | KW_DENY network_address { insert_acl($2, ACL_DENY); }
| KW_LOGLEVEL loglevels { set_log_level($2); } | KW_LOGLEVEL loglevels { set_log_level($2); }
| KW_CONNECTPORT NUMBER { add_connect_port_allowed($2); }
; ;
loglevels loglevels

View File

@ -1,4 +1,4 @@
/* $Id: scanner.l,v 1.8 2002-04-10 17:29:18 rjkaes Exp $ /* $Id: scanner.l,v 1.9 2002-04-12 16:59:37 rjkaes Exp $
* *
* This builds the scanner for the tinyproxy configuration file. This * 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 * file needs to stay in sync with grammar.y. If someone knows lex and yacc
@ -49,6 +49,7 @@ static struct keyword keywords[] = {
{ "upstream", KW_UPSTREAM }, { "upstream", KW_UPSTREAM },
{ "allow", KW_ALLOW }, { "allow", KW_ALLOW },
{ "deny", KW_DENY }, { "deny", KW_DENY },
{ "connectport", KW_CONNECTPORT },
/* loglevel and the settings */ /* loglevel and the settings */
{ "loglevel", KW_LOGLEVEL }, { "loglevel", KW_LOGLEVEL },