diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-16 16:13:30 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-16 16:13:30 +0000 |
commit | e175d9762f84e52c1fae2fca59a12dbbc142034f (patch) | |
tree | 6c7cdb3d6110b733e4973bc97afbfaaca0b6fbae /src/cfg_xml.c | |
parent | 29ea337d8d38af6babd3ad012b91b022a61bbb0f (diff) | |
download | rspamd-e175d9762f84e52c1fae2fca59a12dbbc142034f.tar.gz rspamd-e175d9762f84e52c1fae2fca59a12dbbc142034f.zip |
Remove unused xml code.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r-- | src/cfg_xml.c | 624 |
1 files changed, 0 insertions, 624 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c index 1e20f0456..e8f0207cb 100644 --- a/src/cfg_xml.c +++ b/src/cfg_xml.c @@ -67,603 +67,6 @@ enum xml_read_state { #define EOL "\n" -#if 0 -#define NULL_ATTR \ -{ \ - NULL, \ - NULL, \ - 0, \ - NULL \ -} \ - -#define NULL_DEF_ATTR \ -{ \ - NULL, \ - 0, \ - NULL \ -} \ - -enum xml_config_section { - XML_SECTION_MAIN, - XML_SECTION_OPTIONS, - XML_SECTION_LOGGING, - XML_SECTION_WORKER, - XML_SECTION_METRIC, - XML_SECTION_CLASSIFIER, - XML_SECTION_STATFILE, - XML_SECTION_MODULE, - XML_SECTION_MODULE_META, - XML_SECTION_MODULES, - XML_SECTION_VIEW -}; - -struct xml_config_param { - const gchar *name; - element_handler_func handler; - gint offset; - gpointer user_data; -}; - -struct xml_default_config_param { - element_default_handler_func handler; - gint offset; - gpointer user_data; -}; - -struct xml_parser_rule { - enum xml_config_section section; - struct xml_config_param params[MAX_PARAM]; - struct xml_default_config_param default_param; -}; - -struct xml_subparser { - enum xml_read_state state; - const GMarkupParser *parser; - gpointer user_data; - void (*fin_func)(gpointer ud); -}; - -/* Here we describes our basic grammar */ -static struct xml_parser_rule grammar[] = { - { XML_SECTION_MAIN, { - { - "pidfile", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, pid_file), - NULL - }, - { - "lua", - handle_lua, - 0, - NULL - }, - { - "raw_mode", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, raw_mode), - NULL - }, - { - "check_attachements", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, check_text_attachements), - NULL - }, - { - "tempdir", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, temp_dir), - NULL - }, - { - "checksum", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, dump_checksum), - NULL - }, - { - "statfile_pool_size", - xml_handle_size, - G_STRUCT_OFFSET (struct config_file, max_statfile_size), - NULL - }, - { - "filters", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, filters_str), - NULL - }, - { - "variable", - handle_variable, - 0, - NULL - }, - { - "composite", - handle_composite, - 0, - NULL - }, - { - "user_settings", - handle_user_settings, - 0, - NULL - }, - { - "domain_settings", - handle_domain_settings, - 0, - NULL - }, - { - "cache_file", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, cache_filename), - NULL - }, - { - "dns_timeout", - xml_handle_seconds, - G_STRUCT_OFFSET (struct config_file, dns_timeout), - NULL - }, - { - "dns_retransmits", - xml_handle_uint32, - G_STRUCT_OFFSET (struct config_file, dns_retransmits), - NULL - }, - { - "dns_throttling_errors", - xml_handle_uint32, - G_STRUCT_OFFSET (struct config_file, dns_throttling_errors), - NULL - }, - { - "dns_throttling_time", - xml_handle_seconds, - G_STRUCT_OFFSET (struct config_file, dns_throttling_time), - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, - { XML_SECTION_OPTIONS, { - { - "statfile_pool_size", - xml_handle_size, - G_STRUCT_OFFSET (struct config_file, max_statfile_size), - NULL - }, - { - "user_settings", - handle_user_settings, - 0, - NULL - }, - { - "domain_settings", - handle_domain_settings, - 0, - NULL - }, - { - "cache_file", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, cache_filename), - NULL - }, - { - "dns_timeout", - xml_handle_seconds, - G_STRUCT_OFFSET (struct config_file, dns_timeout), - NULL - }, - { - "dns_retransmits", - xml_handle_uint32, - G_STRUCT_OFFSET (struct config_file, dns_retransmits), - NULL - }, - { - "dns_nameserver", - options_handle_nameserver, - 0, - NULL - }, - { - "raw_mode", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, raw_mode), - NULL - }, - { - "one_shot", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, one_shot_mode), - NULL - }, - { - "check_attachements", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, check_text_attachements), - NULL - }, - { - "tempdir", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, temp_dir), - NULL - }, - { - "pidfile", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, pid_file), - NULL - }, - { - "filters", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, filters_str), - NULL - }, - { - "sync_interval", - xml_handle_seconds, - G_STRUCT_OFFSET (struct config_file, statfile_sync_interval), - NULL - }, - { - "sync_timeout", - xml_handle_seconds, - G_STRUCT_OFFSET (struct config_file, statfile_sync_timeout), - NULL - }, - { - "max_diff", - xml_handle_size, - G_STRUCT_OFFSET (struct config_file, max_diff), - NULL - }, - { - "map_watch_interval", - xml_handle_seconds_double, - G_STRUCT_OFFSET (struct config_file, map_timeout), - NULL - }, - { - "dynamic_conf", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, dynamic_conf), - NULL - }, - { - "use_mlock", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, mlock_statfile_pool), - NULL - }, - { - "rrd", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, rrd_file), - NULL - }, - { - "history_file", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, history_file), - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, - { XML_SECTION_LOGGING, { - { - "type", - handle_log_type, - 0, - NULL - }, - { - "level", - handle_log_level, - 0, - NULL - }, - { - "log_urls", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, log_urls), - NULL - }, - { - "log_buffer", - xml_handle_uint32, - G_STRUCT_OFFSET (struct config_file, log_buf_size), - NULL - }, - { - "debug_ip", - xml_handle_string, - G_STRUCT_OFFSET (struct config_file, debug_ip_map), - NULL - }, - { - "debug_symbols", - xml_handle_string_list, - G_STRUCT_OFFSET (struct config_file, debug_symbols), - NULL - }, - { - "log_color", - xml_handle_boolean, - G_STRUCT_OFFSET (struct config_file, log_color), - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, - { XML_SECTION_WORKER, { - { - "type", - worker_handle_type, - 0, - NULL - }, - { - "bind_socket", - worker_handle_bind, - 0, - NULL - }, - { - "count", - xml_handle_uint16, - G_STRUCT_OFFSET (struct worker_conf, count), - NULL - }, - { - "maxfiles", - xml_handle_uint32, - G_STRUCT_OFFSET (struct worker_conf, rlimit_nofile), - NULL - }, - { - "maxcore", - xml_handle_uint32, - G_STRUCT_OFFSET (struct worker_conf, rlimit_maxcore), - NULL - }, - NULL_ATTR - }, - { - worker_handle_param, - 0, - NULL - } - }, - { XML_SECTION_METRIC, { - { - "name", - xml_handle_string, - G_STRUCT_OFFSET (struct metric, name), - NULL - }, - { - "grow_factor", - xml_handle_double, - G_STRUCT_OFFSET (struct metric, grow_factor), - NULL - }, - { - "required_score", - xml_handle_deprecated, - 0, - NULL - }, - { - "reject_score", - xml_handle_deprecated, - 0, - NULL - }, - { - "subject", - xml_handle_string, - G_STRUCT_OFFSET (struct metric, subject), - NULL - }, - { - "symbol", - handle_metric_symbol, - 0, - NULL - }, - { - "action", - handle_metric_action, - 0, - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, - { XML_SECTION_CLASSIFIER, { - { - "metric", - xml_handle_string, - G_STRUCT_OFFSET (struct classifier_config, metric), - NULL - }, - { - "tokenizer", - handle_classifier_tokenizer, - 0, - NULL - }, - NULL_ATTR - }, - { - handle_classifier_opt, - 0, - NULL - } - }, - { XML_SECTION_STATFILE, { - { - "symbol", - xml_handle_string, - G_STRUCT_OFFSET (struct statfile, symbol), - NULL - }, - { - "path", - xml_handle_string, - G_STRUCT_OFFSET (struct statfile, path), - NULL - }, - { - "label", - xml_handle_string, - G_STRUCT_OFFSET (struct statfile, label), - NULL - }, - { - "size", - xml_handle_size, - G_STRUCT_OFFSET (struct statfile, size), - NULL - }, - { - "spam", - xml_handle_boolean, - G_STRUCT_OFFSET (struct statfile, is_spam), - NULL - }, - { - "normalizer", - handle_statfile_normalizer, - 0, - NULL - }, - { - "binlog", - handle_statfile_binlog, - 0, - NULL - }, - { - "binlog_rotate", - handle_statfile_binlog_rotate, - 0, - NULL - }, - { - "binlog_master", - handle_statfile_binlog_master, - 0, - NULL - }, - NULL_ATTR - }, - { - handle_statfile_opt, - 0, - NULL - } - }, - { XML_SECTION_MODULE_META, { - { - "name", - xml_handle_string, - G_STRUCT_OFFSET (struct module_meta_opt, name), - NULL - }, - NULL_ATTR - }, - { - handle_module_meta, - 0, - NULL - } - }, - { XML_SECTION_MODULE, { - NULL_ATTR - }, - { - handle_module_opt, - 0, - NULL - } - }, - { XML_SECTION_MODULES, { - { - "path", - handle_module_path, - 0, - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, - { XML_SECTION_VIEW, { - { - "skip_check", - xml_handle_boolean, - G_STRUCT_OFFSET (struct rspamd_view, skip_check), - NULL - }, - { - "ip", - handle_view_ip, - 0, - NULL - }, - { - "client_ip", - handle_view_client_ip, - 0, - NULL - }, - { - "from", - handle_view_from, - 0, - NULL - }, - { - "rcpt", - handle_view_rcpt, - 0, - NULL - }, - { - "symbols", - handle_view_symbols, - 0, - NULL - }, - NULL_ATTR - }, - NULL_DEF_ATTR - }, -}; - -GHashTable *module_options = NULL, - *worker_options = NULL, - *classifier_options = NULL, - *subparsers = NULL; -#endif - GQuark xml_error_quark (void) { @@ -924,30 +327,3 @@ rspamd_xml_error (GMarkupParseContext *context, GError *error, gpointer user_dat msg_err ("xml parser error: %s, at state \"%s\"", error->message, xml_state_to_string (ud)); } - -/* Register new module option */ -void -register_module_opt (const gchar *mname, const gchar *optname, enum module_opt_type type) -{ - msg_err ("this function is depreciated and must not be used"); -} - -/* Register new worker's options */ -void -register_worker_opt (gint wtype, const gchar *optname, element_handler_func func, gpointer dest_struct, gint offset) -{ - msg_err ("this function is depreciated and must not be used"); -} - -/* Register new classifier option */ -void -register_classifier_opt (const gchar *ctype, const gchar *optname) -{ - msg_err ("this function is depreciated and must not be used"); -} - -void -register_subparser (const gchar *tag, int state, const GMarkupParser *parser, void (*fin_func)(gpointer ud), gpointer user_data) -{ - msg_err ("this function is depreciated and must not be used"); -} |