diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-06-24 17:50:29 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-06-24 17:50:29 +0400 |
commit | bcf147f18f4370d061aff7890873aeed10542663 (patch) | |
tree | c869bbbb8a227ab1956d9436a7d93a9bce1a4bc9 /cfg_file.h | |
parent | daca72b007e666fb9abebcfa7c27ed6ddcadfd58 (diff) | |
download | rspamd-bcf147f18f4370d061aff7890873aeed10542663.tar.gz rspamd-bcf147f18f4370d061aff7890873aeed10542663.zip |
* Add initial support of perl filters
Diffstat (limited to 'cfg_file.h')
-rw-r--r-- | cfg_file.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cfg_file.h b/cfg_file.h index 37e0cd4d5..bc61cf8b7 100644 --- a/cfg_file.h +++ b/cfg_file.h @@ -46,6 +46,14 @@ enum { VAL_UNDEF=0, VAL_TRUE, VAL_FALSE }; +enum script_type { + SCRIPT_HEADER, + SCRIPT_MIME, + SCRIPT_URL, + SCRIPT_MESSAGE, + SCRIPT_CHAIN, +}; + struct memcached_server { struct upstream up; struct in_addr addr; @@ -54,6 +62,24 @@ struct memcached_server { short int num; }; +struct perl_module { + const char *path; + LIST_ENTRY (perl_module) next; +}; + +struct script_param { + const char *symbol; + const char *function; + enum script_type type; + LIST_ENTRY (script_param) next; +}; + +struct filter_chain { + unsigned int metric; + LIST_HEAD (scriptq, script_param) *scripts; + LIST_ENTRY (filter_chain) next; +}; + struct config_file { char *cfg_name; char *pid_file; @@ -74,12 +100,16 @@ struct config_file { unsigned int memcached_dead_time; unsigned int memcached_maxerrors; unsigned int memcached_connect_timeout; + + LIST_HEAD (perlq, filter_chain) filters; + LIST_HEAD (modulesq, perl_module) modules; }; int add_memcached_server (struct config_file *cf, char *str); int parse_bind_line (struct config_file *cf, char *str); void init_defaults (struct config_file *cfg); void free_config (struct config_file *cfg); +int parse_script (char *str, struct script_param *param, enum script_type type); int yylex (void); int yyparse (void); |