summaryrefslogtreecommitdiffstats
path: root/src/filter.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-16 20:43:26 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-06-16 20:43:26 +0400
commita639bf512e3df778fa33c49d83c3996c9fe60d77 (patch)
tree072c4167dae82382b1c8eef93e0270339635e389 /src/filter.h
parentc4aab3053d2839e6d3b99f8a542b0a4f54f2b856 (diff)
downloadrspamd-a639bf512e3df778fa33c49d83c3996c9fe60d77.tar.gz
rspamd-a639bf512e3df778fa33c49d83c3996c9fe60d77.zip
* Change metric logic
* Completely remove lex/yacc readers for config * Make common sense of metric/action and symbols * Sync changes with all plugins TODO: add this to documentation
Diffstat (limited to 'src/filter.h')
-rw-r--r--src/filter.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/filter.h b/src/filter.h
index edc9523c6..24feaae9e 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -40,11 +40,17 @@ struct metric {
char *name; /**< name of metric */
char *func_name; /**< name of consolidation function */
metric_cons_func func; /**< c consolidation function */
+ double grow_factor; /**< grow factor for metric */
double required_score; /**< required score for this metric */
double reject_score; /**< reject score for this metric */
- struct classifier *classifier; /**< classifier that is used for metric */
- struct symbols_cache *cache; /**< symbols cache for metric */
- char *cache_filename; /**< filename of cache file */
+ GHashTable *symbols; /**< weights of symbols in metric */
+ enum {
+ METRIC_ACTION_REJECT = 0,
+ METRIC_ACTION_SOFT_REJECT,
+ METRIC_ACTION_REWRITE_SUBJECT,
+ METRIC_ACTION_ADD_HEADER,
+ METRIC_ACTION_GREYLIST
+ } action; /**< action to do by this metric */
};
/**
@@ -55,6 +61,7 @@ struct metric_result {
double score; /**< total score */
GHashTable *symbols; /**< symbols of metric */
gboolean checked; /**< whether metric result is consolidated */
+ double grow_factor; /**< current grow factor */
};
/**
@@ -78,7 +85,7 @@ void process_statfiles (struct worker_task *task);
* @param flag numeric weight for symbol
* @param opts list of symbol's options
*/
-void insert_result (struct worker_task *task, const char *metric_name, const char *symbol, double flag, GList *opts);
+void insert_result (struct worker_task *task, const char *symbol, double flag, GList *opts);
/**
* Process all results and form composite metrics from existent metrics as it is defined in config