aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-27 12:58:23 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-27 13:10:40 +0000
commit19f28d85479e4d0e97d15f8ad05890c01fd033f3 (patch)
tree872e6e6ae0ee02bd76a2e36107e5f0b1893c582b /src
parent424ac722959351c8332e185e36fb7daddff24faf (diff)
downloadrspamd-19f28d85479e4d0e97d15f8ad05890c01fd033f3.tar.gz
rspamd-19f28d85479e4d0e97d15f8ad05890c01fd033f3.zip
Add ability to insert documentation strings
Issue: #461
Diffstat (limited to 'src')
-rw-r--r--src/controller.c136
-rw-r--r--src/fuzzy_storage.c111
-rw-r--r--src/hs_helper.c21
-rw-r--r--src/http_proxy.c51
-rw-r--r--src/libserver/cfg_rcl.c243
-rw-r--r--src/libserver/cfg_rcl.h8
-rw-r--r--src/libserver/protocol.c23
-rw-r--r--src/lua_worker.c12
-rw-r--r--src/smtp_proxy.c110
-rw-r--r--src/worker.c104
10 files changed, 569 insertions, 250 deletions
diff --git a/src/controller.c b/src/controller.c
index f16bf42a0..68ce74a3a 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -34,6 +34,8 @@
#include "libutil/rrd.h"
#include "unix-std.h"
#include <math.h>
+#include <tclDecls.h>
+#include <curses.h>
/* 60 seconds for worker's IO */
#define DEFAULT_WORKER_IO_TIMEOUT 60000
@@ -2263,47 +2265,99 @@ init_controller_worker (struct rspamd_config *cfg)
ctx->timeout = DEFAULT_WORKER_IO_TIMEOUT;
- rspamd_rcl_register_worker_option (cfg, type, "password",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, password), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "enable_password",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, enable_password), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "ssl",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, use_ssl), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "ssl_cert",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, ssl_cert), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "ssl_key",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, ssl_key), 0);
- rspamd_rcl_register_worker_option (cfg, type, "timeout",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
- timeout), RSPAMD_CL_FLAG_TIME_INTEGER);
-
- rspamd_rcl_register_worker_option (cfg, type, "secure_ip",
- rspamd_rcl_parse_struct_string_list, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, secure_ip), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "static_dir",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
- static_files_dir), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "keypair",
- rspamd_rcl_parse_struct_keypair, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
- key), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "stats_path",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, saved_stats_path), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "password",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, password),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "enable_password",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ enable_password),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "ssl",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, use_ssl),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "ssl_cert",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, ssl_cert),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "ssl_key",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, ssl_key),
+ 0,
+ NULL);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "timeout",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ timeout),
+ RSPAMD_CL_FLAG_TIME_INTEGER,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "secure_ip",
+ rspamd_rcl_parse_struct_string_list,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx, secure_ip),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "static_dir",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ static_files_dir),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "keypair",
+ rspamd_rcl_parse_struct_keypair,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ key),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "stats_path",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_controller_worker_ctx,
+ saved_stats_path),
+ 0,
+ NULL);
return ctx;
}
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index c70f5a148..8e84ddea7 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1136,49 +1136,98 @@ init_fuzzy (struct rspamd_config *cfg)
(GDestroyNotify) rspamd_inet_address_destroy, g_free,
rspamd_inet_address_hash, rspamd_inet_address_equal);
- rspamd_rcl_register_worker_option (cfg, type, "hashfile",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "hashfile",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile),
+ 0,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "hash_file",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "hash_file",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile),
+ 0,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "file",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "file",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile),
+ 0,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "database",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "database",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, hashfile),
+ 0,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "sync",
- rspamd_rcl_parse_struct_time, ctx,
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "sync",
+ rspamd_rcl_parse_struct_time,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx,
- sync_timeout), RSPAMD_CL_FLAG_TIME_FLOAT);
+ sync_timeout),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "expire",
- rspamd_rcl_parse_struct_time, ctx,
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "expire",
+ rspamd_rcl_parse_struct_time,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx,
- expire), RSPAMD_CL_FLAG_TIME_FLOAT);
+ expire),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "allow_update",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, update_map), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "allow_update",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, update_map),
+ 0,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "keypair",
- fuzzy_parse_keypair, ctx,
- 0, RSPAMD_CL_FLAG_MULTIPLE);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "keypair",
+ fuzzy_parse_keypair,
+ ctx,
+ 0,
+ RSPAMD_CL_FLAG_MULTIPLE,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "keypair_cache_size",
- rspamd_rcl_parse_struct_integer, ctx,
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "keypair_cache_size",
+ rspamd_rcl_parse_struct_integer,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx,
- keypair_cache_size),
- RSPAMD_CL_FLAG_UINT);
+ keypair_cache_size),
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
- rspamd_rcl_register_worker_option (cfg, type, "encrypted_only",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, encrypted_only), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "encrypted_only",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_fuzzy_storage_ctx, encrypted_only),
+ 0,
+ NULL);
return ctx;
diff --git a/src/hs_helper.c b/src/hs_helper.c
index 1d49537c0..7ca14e672 100644
--- a/src/hs_helper.c
+++ b/src/hs_helper.c
@@ -75,13 +75,22 @@ init_hs_helper (struct rspamd_config *cfg)
ctx->hs_dir = RSPAMD_DBDIR "/";
ctx->max_time = default_max_time;
- rspamd_rcl_register_worker_option (cfg, type, "cache_dir",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct hs_helper_ctx, hs_dir), 0);
- rspamd_rcl_register_worker_option (cfg, type, "max_time",
- rspamd_rcl_parse_struct_time, ctx,
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "cache_dir",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct hs_helper_ctx, hs_dir),
+ 0,
+ NULL);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "max_time",
+ rspamd_rcl_parse_struct_time,
+ ctx,
G_STRUCT_OFFSET (struct hs_helper_ctx, max_time),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
return ctx;
}
diff --git a/src/http_proxy.c b/src/http_proxy.c
index 43cacae9c..eebd5c91e 100644
--- a/src/http_proxy.c
+++ b/src/http_proxy.c
@@ -22,6 +22,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <tclDecls.h>
+#include <curses.h>
#include "config.h"
#include "libutil/util.h"
#include "libutil/map.h"
@@ -203,20 +205,41 @@ init_http_proxy (struct rspamd_config *cfg)
ctx->rotate_tm = DEFAULT_ROTATION_TIME;
ctx->cfg = cfg;
- rspamd_rcl_register_worker_option (cfg, type, "timeout",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct http_proxy_ctx,
- timeout), RSPAMD_CL_FLAG_TIME_FLOAT);
- rspamd_rcl_register_worker_option (cfg, type, "rotate",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct http_proxy_ctx,
- rotate_tm), RSPAMD_CL_FLAG_TIME_FLOAT);
- rspamd_rcl_register_worker_option (cfg, type, "keypair",
- rspamd_rcl_parse_struct_keypair, ctx,
- G_STRUCT_OFFSET (struct http_proxy_ctx,
- key), 0);
- rspamd_rcl_register_worker_option (cfg, type, "upstream",
- http_proxy_parse_upstream, ctx, 0, 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "timeout",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct http_proxy_ctx,
+ timeout),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "rotate",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct http_proxy_ctx,
+ rotate_tm),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "keypair",
+ rspamd_rcl_parse_struct_keypair,
+ ctx,
+ G_STRUCT_OFFSET (struct http_proxy_ctx,
+ key),
+ 0,
+ NULL);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "upstream",
+ http_proxy_parse_upstream,
+ ctx,
+ 0,
+ 0,
+ NULL);
return ctx;
}
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 7ddc14f93..41c6d3f17 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -39,6 +39,10 @@
#ifdef HAVE_GLOB_H
#include <glob.h>
+#include <cursesp.h>
+#include <itclInt.h>
+#include <cursesf.h>
+
#endif
struct rspamd_rcl_default_handler_data {
@@ -1231,7 +1235,8 @@ rspamd_rcl_add_default_handler (struct rspamd_rcl_section *section,
const gchar *name,
rspamd_rcl_default_handler_t handler,
goffset offset,
- gint flags)
+ gint flags,
+ const gchar *doc_string)
{
struct rspamd_rcl_default_handler_data *new;
@@ -1271,57 +1276,68 @@ rspamd_rcl_config_init (void)
"log_buffer",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, log_buf_size),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"log_urls",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_urls),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"log_re_cache",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_re_cache),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"debug_ip",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, debug_ip_map),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"debug_symbols",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, debug_symbols),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"log_color",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_color),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"color",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_color),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"log_systemd",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_systemd),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"systemd",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, log_systemd),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"debug_modules",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, debug_modules),
- RSPAMD_CL_FLAG_STRING_LIST_HASH);
+ RSPAMD_CL_FLAG_STRING_LIST_HASH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"log_format",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, log_format_str),
- 0);
+ 0,
+ NULL);
/**
* Options section
*/
@@ -1335,176 +1351,214 @@ rspamd_rcl_config_init (void)
"cache_file",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, cache_filename),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
/* Old DNS configuration */
rspamd_rcl_add_default_handler (sub,
"dns_nameserver",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, nameservers),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"dns_timeout",
rspamd_rcl_parse_struct_time,
G_STRUCT_OFFSET (struct rspamd_config, dns_timeout),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"dns_retransmits",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_retransmits),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"dns_sockets",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"dns_max_requests",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_max_requests),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"classify_headers",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, classify_headers),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"control_socket",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, control_socket_path),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"explicit_modules",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, explicit_modules),
- RSPAMD_CL_FLAG_STRING_LIST_HASH);
+ RSPAMD_CL_FLAG_STRING_LIST_HASH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"allow_raw_input",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, allow_raw_input),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"raw_mode",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, raw_mode),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"one_shot",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, one_shot_mode),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"check_attachements",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, check_text_attachements),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"tempdir",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, temp_dir),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"pidfile",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, pid_file),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"filters",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, filters),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_diff",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, max_diff),
- RSPAMD_CL_FLAG_INT_SIZE);
+ RSPAMD_CL_FLAG_INT_SIZE,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"map_watch_interval",
rspamd_rcl_parse_struct_time,
G_STRUCT_OFFSET (struct rspamd_config, map_timeout),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"dynamic_conf",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, dynamic_conf),
- 0);
- rspamd_rcl_add_default_handler (sub, "rrd", rspamd_rcl_parse_struct_string,
+ 0,
+ NULL);
+ rspamd_rcl_add_default_handler (sub,
+ "rrd",
+ rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config,
- rrd_file), RSPAMD_CL_FLAG_STRING_PATH);
+ rrd_file),
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"history_file",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, history_file),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"use_mlock",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, mlock_statfile_pool),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"strict_protocol_headers",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, strict_protocol_headers),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"check_all_filters",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, check_all_filters),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"all_filters",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, check_all_filters),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"min_word_len",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, min_word_len),
- RSPAMD_CL_FLAG_UINT);
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_word_len",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, max_word_len),
- RSPAMD_CL_FLAG_UINT);
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"words_decay",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, words_decay),
- RSPAMD_CL_FLAG_UINT);
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"url_tld",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, tld_file),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"tld",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, tld_file),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"history_rows",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, history_rows),
- RSPAMD_CL_FLAG_UINT);
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"disable_hyperscan",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_config, disable_hyperscan),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"cores_dir",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_config, cores_dir),
- RSPAMD_CL_FLAG_STRING_PATH);
+ RSPAMD_CL_FLAG_STRING_PATH,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_cores_size",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, max_cores_size),
- RSPAMD_CL_FLAG_INT_SIZE);
+ RSPAMD_CL_FLAG_INT_SIZE,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_cores_count",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, max_cores_count),
- RSPAMD_CL_FLAG_INT_SIZE);
+ RSPAMD_CL_FLAG_INT_SIZE,
+ NULL);
/* New DNS configuration */
ssub = rspamd_rcl_add_section (&sub->subsections, "dns", NULL, NULL,
@@ -1513,32 +1567,38 @@ rspamd_rcl_config_init (void)
"nameserver",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, nameservers),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"server",
rspamd_rcl_parse_struct_string_list,
G_STRUCT_OFFSET (struct rspamd_config, nameservers),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"timeout",
rspamd_rcl_parse_struct_time,
G_STRUCT_OFFSET (struct rspamd_config, dns_timeout),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"retransmits",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_retransmits),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"sockets",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"connections",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
/* New upstreams configuration */
@@ -1548,17 +1608,20 @@ rspamd_rcl_config_init (void)
"max_errors",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, upstream_max_errors),
- RSPAMD_CL_FLAG_UINT);
+ RSPAMD_CL_FLAG_UINT,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"error_time",
rspamd_rcl_parse_struct_time,
G_STRUCT_OFFSET (struct rspamd_config, upstream_error_time),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"revive_time",
rspamd_rcl_parse_struct_time,
G_STRUCT_OFFSET (struct rspamd_config, upstream_revive_time),
- RSPAMD_CL_FLAG_TIME_FLOAT);
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
/**
* Metric section
@@ -1574,17 +1637,20 @@ rspamd_rcl_config_init (void)
"unknown_weight",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct metric, unknown_weight),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"grow_factor",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct metric, grow_factor),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"subject",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct metric, subject),
- 0);
+ 0,
+ NULL);
/* Ungrouped symbols */
ssub = rspamd_rcl_add_section (&sub->subsections,
@@ -1597,17 +1663,20 @@ rspamd_rcl_config_init (void)
"description",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_symbol_def, description),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"score",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"weight",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
- 0);
+ 0,
+ NULL);
/* Actions part */
ssub = rspamd_rcl_add_section (&sub->subsections,
@@ -1628,17 +1697,20 @@ rspamd_rcl_config_init (void)
"disabled",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_symbols_group, disabled),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"enabled",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_symbols_group, disabled),
- RSPAMD_CL_FLAG_BOOLEAN_INVERSE);
+ RSPAMD_CL_FLAG_BOOLEAN_INVERSE,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"max_score",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct rspamd_symbols_group, max_score),
- 0);
+ 0,
+ NULL);
/* Grouped symbols */
sssub = rspamd_rcl_add_section (&ssub->subsections,
@@ -1651,17 +1723,20 @@ rspamd_rcl_config_init (void)
"description",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_symbol_def, description),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sssub,
"score",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sssub,
"weight",
rspamd_rcl_parse_struct_double,
G_STRUCT_OFFSET (struct rspamd_symbol_def, score),
- 0);
+ 0,
+ NULL);
/**
* Worker section
@@ -1676,17 +1751,20 @@ rspamd_rcl_config_init (void)
"count",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_worker_conf, count),
- RSPAMD_CL_FLAG_INT_16);
+ RSPAMD_CL_FLAG_INT_16,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_files",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_worker_conf, rlimit_nofile),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_core",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_worker_conf, rlimit_maxcore),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
/**
* Modules handler
@@ -1714,22 +1792,26 @@ rspamd_rcl_config_init (void)
"min_tokens",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_classifier_config, min_tokens),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"max_tokens",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_classifier_config, max_tokens),
- RSPAMD_CL_FLAG_INT_32);
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"backend",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_classifier_config, backend),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"name",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_classifier_config, name),
- 0);
+ 0,
+ NULL);
/*
* Statfile defaults
@@ -1744,12 +1826,14 @@ rspamd_rcl_config_init (void)
"label",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_statfile_config, label),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (ssub,
"spam",
rspamd_rcl_parse_struct_boolean,
G_STRUCT_OFFSET (struct rspamd_statfile_config, is_spam),
- 0);
+ 0,
+ NULL);
/**
* Composites handler
@@ -2584,7 +2668,8 @@ rspamd_rcl_register_worker_option (struct rspamd_config *cfg,
rspamd_rcl_default_handler_t handler,
gpointer target,
glong offset,
- gint flags)
+ gint flags,
+ const gchar *doc_string)
{
struct rspamd_worker_param_parser *nhandler;
struct rspamd_worker_cfg_parser *nparser;
diff --git a/src/libserver/cfg_rcl.h b/src/libserver/cfg_rcl.h
index 81a61e2a2..d7b1c0de2 100644
--- a/src/libserver/cfg_rcl.h
+++ b/src/libserver/cfg_rcl.h
@@ -99,12 +99,13 @@ typedef void (*rspamd_rcl_section_fin_t)(rspamd_mempool_t *pool, gpointer ud);
* @param flags flags for the parser
* @return newly created structure
*/
-struct rspamd_rcl_default_handler_data * rspamd_rcl_add_default_handler (
+struct rspamd_rcl_default_handler_data *rspamd_rcl_add_default_handler (
struct rspamd_rcl_section *section,
const gchar *name,
rspamd_rcl_default_handler_t handler,
goffset offset,
- gint flags);
+ gint flags,
+ const gchar *doc_string);
/**
* Add new section to the configuration
@@ -324,7 +325,8 @@ void rspamd_rcl_register_worker_option (struct rspamd_config *cfg,
rspamd_rcl_default_handler_t handler,
gpointer target,
glong offset,
- gint flags);
+ gint flags,
+ const gchar *doc_string);
/**
* Register a default parser for a worker
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 58850209e..93ed5a546 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -22,6 +22,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <glib-unix.h>
+#include <itcl2TclOO.h>
#include "config.h"
#include "rspamd.h"
#include "util.h"
@@ -527,37 +529,44 @@ rspamd_protocol_control_parser_init (void)
"ip",
rspamd_rcl_parse_struct_addr,
G_STRUCT_OFFSET (struct rspamd_task, from_addr),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"from",
rspamd_rcl_parse_struct_mime_addr,
G_STRUCT_OFFSET (struct rspamd_task, from_envelope),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"rcpt",
rspamd_rcl_parse_struct_mime_addr,
G_STRUCT_OFFSET (struct rspamd_task, rcpt_envelope),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"helo",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_task, helo),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"user",
rspamd_rcl_parse_struct_string,
G_STRUCT_OFFSET (struct rspamd_task, user),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"pass_all",
rspamd_protocol_parse_task_flags,
G_STRUCT_OFFSET (struct rspamd_task, flags),
- 0);
+ 0,
+ NULL);
rspamd_rcl_add_default_handler (sub,
"json",
rspamd_protocol_parse_task_flags,
G_STRUCT_OFFSET (struct rspamd_task, flags),
- 0);
+ 0,
+ NULL);
}
}
diff --git a/src/lua_worker.c b/src/lua_worker.c
index 1e37419a2..7188cb6b8 100644
--- a/src/lua_worker.c
+++ b/src/lua_worker.c
@@ -22,6 +22,7 @@
*/
+#include <tclDecls.h>
#include "config.h"
#include "util.h"
#include "rspamd.h"
@@ -325,9 +326,14 @@ init_lua_worker (struct rspamd_config *cfg)
(GDestroyNotify)g_list_free);
- rspamd_rcl_register_worker_option (cfg, type, "file",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct rspamd_lua_worker_ctx, file), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "file",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_lua_worker_ctx, file),
+ 0,
+ NULL);
rspamd_rcl_register_worker_parser (cfg, type, rspamd_lua_worker_parser,
ctx);
diff --git a/src/smtp_proxy.c b/src/smtp_proxy.c
index 9c5364f1e..ff4a9f553 100644
--- a/src/smtp_proxy.c
+++ b/src/smtp_proxy.c
@@ -984,41 +984,81 @@ init_smtp_proxy (struct rspamd_config *cfg)
ctx->smtp_delay = 0;
ctx->instant_reject = TRUE;
- rspamd_rcl_register_worker_option (cfg, type, "upstreams",
- rspamd_rcl_parse_struct_string, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx, upstreams_str), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "timeout",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx,
- smtp_timeout_raw), RSPAMD_CL_FLAG_TIME_UINT_32);
-
- rspamd_rcl_register_worker_option (cfg, type, "delay",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx,
- smtp_delay), RSPAMD_CL_FLAG_TIME_UINT_32);
-
- rspamd_rcl_register_worker_option (cfg, type, "jitter",
- rspamd_rcl_parse_struct_time, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx,
- delay_jitter), RSPAMD_CL_FLAG_TIME_UINT_32);
-
- rspamd_rcl_register_worker_option (cfg, type, "xclient",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx, use_xclient), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "instant_reject",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx, instant_reject), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "proxy_buffer",
- rspamd_rcl_parse_struct_integer, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx,
- proxy_buf_len), RSPAMD_CL_FLAG_INT_32);
-
- rspamd_rcl_register_worker_option (cfg, type, "dnsbl",
- rspamd_rcl_parse_struct_string_list, ctx,
- G_STRUCT_OFFSET (struct smtp_proxy_ctx, rbls), 0);
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "upstreams",
+ rspamd_rcl_parse_struct_string,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx, upstreams_str),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "timeout",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx,
+ smtp_timeout_raw),
+ RSPAMD_CL_FLAG_TIME_UINT_32,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "delay",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx,
+ smtp_delay),
+ RSPAMD_CL_FLAG_TIME_UINT_32,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "jitter",
+ rspamd_rcl_parse_struct_time,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx,
+ delay_jitter),
+ RSPAMD_CL_FLAG_TIME_UINT_32,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "xclient",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx, use_xclient),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "instant_reject",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx, instant_reject),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "proxy_buffer",
+ rspamd_rcl_parse_struct_integer,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx,
+ proxy_buf_len),
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "dnsbl",
+ rspamd_rcl_parse_struct_string_list,
+ ctx,
+ G_STRUCT_OFFSET (struct smtp_proxy_ctx, rbls),
+ 0,
+ NULL);
return ctx;
}
diff --git a/src/worker.c b/src/worker.c
index 63cb778f4..cce45c405 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -27,6 +27,8 @@
*/
#include <libserver/rspamd_control.h>
+#include <tclDecls.h>
+#include <curses.h>
#include "config.h"
#include "libutil/util.h"
#include "libutil/map.h"
@@ -324,41 +326,81 @@ init_worker (struct rspamd_config *cfg)
ctx->cfg = cfg;
ctx->task_timeout = DEFAULT_TASK_TIMEOUT;
- rspamd_rcl_register_worker_option (cfg, type, "mime",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_mime), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "http",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_http), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "json",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_json), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "allow_learn",
- rspamd_rcl_parse_struct_boolean, ctx,
- G_STRUCT_OFFSET (struct rspamd_worker_ctx, allow_learn), 0);
-
- rspamd_rcl_register_worker_option (cfg, type, "timeout",
- rspamd_rcl_parse_struct_time, ctx,
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "mime",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_mime),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "http",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_http),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "json",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_worker_ctx, is_json),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "allow_learn",
+ rspamd_rcl_parse_struct_boolean,
+ ctx,
+ G_STRUCT_OFFSET (struct rspamd_worker_ctx, allow_learn),
+ 0,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "timeout",
+ rspamd_rcl_parse_struct_time,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_worker_ctx,
- timeout), RSPAMD_CL_FLAG_TIME_INTEGER);
-
- rspamd_rcl_register_worker_option (cfg, type, "task_timeout",
- rspamd_rcl_parse_struct_time, ctx,
+ timeout),
+ RSPAMD_CL_FLAG_TIME_INTEGER,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "task_timeout",
+ rspamd_rcl_parse_struct_time,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_worker_ctx,
- task_timeout), RSPAMD_CL_FLAG_TIME_FLOAT);
-
- rspamd_rcl_register_worker_option (cfg, type, "max_tasks",
- rspamd_rcl_parse_struct_integer, ctx,
+ task_timeout),
+ RSPAMD_CL_FLAG_TIME_FLOAT,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "max_tasks",
+ rspamd_rcl_parse_struct_integer,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_worker_ctx,
- max_tasks), RSPAMD_CL_FLAG_INT_32);
-
- rspamd_rcl_register_worker_option (cfg, type, "keypair",
- rspamd_rcl_parse_struct_keypair, ctx,
+ max_tasks),
+ RSPAMD_CL_FLAG_INT_32,
+ NULL);
+
+ rspamd_rcl_register_worker_option (cfg,
+ type,
+ "keypair",
+ rspamd_rcl_parse_struct_keypair,
+ ctx,
G_STRUCT_OFFSET (struct rspamd_worker_ctx,
- key), 0);
+ key),
+ 0,
+ NULL);
return ctx;
}