/** * @file cfg_file.h * Config file parser and config routines API */ #ifndef CFG_FILE_H #define CFG_FILE_H #include "config.h" #include "mem_pool.h" #include "upstream.h" #include "memcached.h" #define DEFAULT_BIND_PORT 768 #define DEFAULT_CONTROL_PORT 7608 #define DEFAULT_LMTP_PORT 7609 #define MAX_MEMCACHED_SERVERS 48 #define DEFAULT_MEMCACHED_PORT 11211 /* Memcached timeouts */ #define DEFAULT_MEMCACHED_CONNECT_TIMEOUT 1000 /* Upstream timeouts */ #define DEFAULT_UPSTREAM_ERROR_TIME 10 #define DEFAULT_UPSTREAM_ERROR_TIME 10 #define DEFAULT_UPSTREAM_DEAD_TIME 300 #define DEFAULT_UPSTREAM_MAXERRORS 10 /* Statfile pool size, 50Mb */ #define DEFAULT_STATFILE_SIZE 52428800L /* 1 worker by default */ #define DEFAULT_WORKERS_NUM 1 #define DEFAULT_SCORE 10.0 #define DEFAULT_REJECT_SCORE 999.0 #define yyerror parse_err #define yywarn parse_warn struct expression; struct tokenizer; struct classifier; enum { VAL_UNDEF=0, VAL_TRUE, VAL_FALSE }; /** * Types of rspamd bind lines */ enum rspamd_cred_type { CRED_NORMAL, CRED_CONTROL, CRED_LMTP, CRED_DELIVERY, }; /** * Regexp type: /H - header, /M - mime, /U - url /X - raw header */ enum rspamd_regexp_type { REGEXP_NONE = 0, REGEXP_HEADER, REGEXP_MIME, REGEXP_MESSAGE, REGEXP_URL, REGEXP_RAW_HEADER, }; /** * Logging type */ enum rspamd_log_type { RSPAMD_LOG_CONSOLE, RSPAMD_LOG_SYSLOG, RSPAMD_LOG_FILE, }; /** * Regexp structure */ struct rspamd_regexp { enum rspamd_regexp_type type; /**< regexp type */ gchar *regexp_text; /**< regexp text representation */ GRegex *regexp; /**< glib regexp structure */ GRegex *raw_regexp; /**< glib regexp structure for raw matching */ gchar *header; /**< header name for header regexps */ }; /** * Memcached server object */ struct memcached_server { struct upstream up; /**< common upstream base */ struct in_addr addr; /**< address of server */ uint16_t port; /**< port to connect */ short alive; /**< is this server alive */ short int num; /**< number of servers in case of mirror */ }; /** * script module list item */ struct script_module { gchar *name; /**< name of module */ gchar *path; /**< path to module */ }; /** * Type of lua variable */ enum lua_var_type { LUA_VAR_NUM, LUA_VAR_BOOLEAN, LUA_VAR_STRING, LUA_VAR_FUNCTION, LUA_VAR_UNKNOWN }; /** * Module option */ struct module_opt { gchar *param; /**< parameter name */ gchar *value; /**< paramater value */ gpointer actual_data; /**< parsed data */ gboolean is_lua; /**< actually this is lua variable */ enum lua_var_type lua_type; /**< type of lua variable */ }; /** * Statfile section definition */ struct statfile_section { uint32_t code; /**< section's code */ uint64_t size; /**< size of section */ double weight; /**< weight coefficient for section */ }; /** * Statfile autolearn parameters */ struct statfile_autolearn_params { const gchar *metric; /**< metric name for autolearn triggering */ double threshold_min; /**< threshold mark */ double threshold_max; /**< threshold mark */ GList *symbols; /**< list of symbols */ }; /** * Sync affinity */ enum sync_affinity { AFFINITY_NONE = 0, AFFINITY_MASTER, AFFINITY_SLAVE }; /** * Binlog params */ struct statfile_binlog_params { enum sync_affinity affinity; time_
<script>
<!--
ok( true, "script within html comments executed" );
-->
</script>
<script>
<![CDATA[
ok( true, "script within CDATA executed" );
]]>
</script>