diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-10-23 19:10:40 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-10-23 19:10:40 +0400 |
commit | e5f01249a3498ab47c7c7852f83564d466629a8b (patch) | |
tree | 03f4a6f4a1dc52ca29e8a9e3aff6f9048c3cf9a3 /cfg_file.y | |
parent | 9d6f80f8a3fbdc7d8079f6a60d936532098e27a4 (diff) | |
download | rspamd-e5f01249a3498ab47c7c7852f83564d466629a8b.tar.gz rspamd-e5f01249a3498ab47c7c7852f83564d466629a8b.zip |
* Add initial implementation of control interface
Diffstat (limited to 'cfg_file.y')
-rw-r--r-- | cfg_file.y | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/cfg_file.y b/cfg_file.y index c5badb437..1ccb928b7 100644 --- a/cfg_file.y +++ b/cfg_file.y @@ -49,7 +49,7 @@ struct metric *cur_metric = NULL; %token MEMCACHED WORKERS REQUIRE MODULE %token MODULE_OPT PARAM VARIABLE %token HEADER_FILTERS MIME_FILTERS MESSAGE_FILTERS URL_FILTERS FACTORS METRIC NAME -%token REQUIRED_SCORE FUNCTION FRACT COMPOSITES +%token REQUIRED_SCORE FUNCTION FRACT COMPOSITES CONTROL PASSWORD %type <string> STRING %type <string> VARIABLE @@ -73,6 +73,7 @@ file : /* empty */ command : bindsock + | control | tempdir | pidfile | memcached @@ -112,9 +113,39 @@ pidfile : } ; +control: + CONTROL OBRACE controlbody EBRACE + ; + +controlbody: + controlcmd SEMICOLON + | controlbody controlcmd SEMICOLON + ; + +controlcmd: + controlsock + | controlpassword + ; + +controlsock: + BINDSOCK EQSIGN bind_cred { + if (!parse_bind_line (cfg, $3, 1)) { + yyerror ("yyparse: parse_bind_line"); + YYERROR; + } + cfg->controller_enabled = 1; + free ($3); + } + ; +controlpassword: + PASSWORD EQSIGN QUOTEDSTRING { + cfg->control_password = memory_pool_strdup (cfg->cfg_pool, $3); + } + ; + bindsock: BINDSOCK EQSIGN bind_cred { - if (!parse_bind_line (cfg, $3)) { + if (!parse_bind_line (cfg, $3, 0)) { yyerror ("yyparse: parse_bind_line"); YYERROR; } |