diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-16 20:43:26 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-06-16 20:43:26 +0400 |
commit | a639bf512e3df778fa33c49d83c3996c9fe60d77 (patch) | |
tree | 072c4167dae82382b1c8eef93e0270339635e389 /src/cfg_file.h | |
parent | c4aab3053d2839e6d3b99f8a542b0a4f54f2b856 (diff) | |
download | rspamd-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/cfg_file.h')
-rw-r--r-- | src/cfg_file.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/cfg_file.h b/src/cfg_file.h index dec843359..e788be2e6 100644 --- a/src/cfg_file.h +++ b/src/cfg_file.h @@ -10,6 +10,7 @@ #include "mem_pool.h" #include "upstream.h" #include "memcached.h" +#include "symbols_cache.h" #define DEFAULT_BIND_PORT 768 #define DEFAULT_CONTROL_PORT 7608 @@ -278,33 +279,29 @@ struct config_file { GHashTable* variables; /**< hash of $variables defined in config, indexed by variable name */ GHashTable* metrics; /**< hash of metrics indexed by metric name */ GList* metrics_list; /**< linked list of metrics */ - GHashTable* factors; /**< hash of factors indexed by symbol name */ + GHashTable* metrics_symbols; /**< hash table of metrics indexed by symbol */ GHashTable* c_modules; /**< hash of c modules indexed by module name */ GHashTable* composite_symbols; /**< hash of composite symbols indexed by its name */ GList *classifiers; /**< list of all classifiers defined */ GList *statfiles; /**< list of all statfiles in config file order */ GHashTable *classifiers_symbols; /**< hashtable indexed by symbol name of classifiers */ GHashTable* cfg_params; /**< all cfg params indexed by its name in this structure */ - int clock_res; /**< resolution of clock used */ - double grow_factor; /**< grow factor for consolidation callback */ GList *views; /**< views */ GHashTable* domain_settings; /**< settings per-domains */ GHashTable* user_settings; /**< settings per-user */ gchar* domain_settings_str; /**< string representation of settings */ gchar* user_settings_str; + int clock_res; /**< resolution of clock used */ + + struct symbols_cache *cache; /**< symbols cache object */ + char *cache_filename; /**< filename of cache file */ + struct metric *default_metric; /**< default metric */ gchar* checksum; /**< real checksum of config file */ gchar* dump_checksum; /**< dump checksum of config file */ gpointer lua_state; /**< pointer to lua state */ }; -/** - * Add memcached server to config - * @param cf config file to use - * @param str line that describes server's credits - * @return 1 if line was successfully parsed and 0 in case of error - */ -int add_memcached_server (struct config_file *cf, gchar *str); /** * Parse host:port line @@ -397,15 +394,10 @@ void unescape_quotes (gchar *line); GList* parse_comma_list (memory_pool_t *pool, gchar *line); struct classifier_config* check_classifier_cfg (struct config_file *cfg, struct classifier_config *c); struct worker_conf* check_worker_conf (struct config_file *cfg, struct worker_conf *c); +struct metric* check_metric_conf (struct config_file *cfg, struct metric *c); gboolean parse_normalizer (struct config_file *cfg, struct statfile *st, const gchar *line); gboolean read_xml_config (struct config_file *cfg, const gchar *filename); -int yylex (void); -int yyparse (void); -void yyrestart (FILE *); -void parse_err (const gchar *fmt, ...); -void parse_warn (const gchar *fmt, ...); - #endif /* ifdef CFG_FILE_H */ /* * vi:ts=4 |