aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/rspamd_control.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-25 14:14:09 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-25 14:14:09 +0000
commit840f144b9d399d69f06c921f23e36c13d0b498ff (patch)
treef8f3fda3f8a2178247b07b6f40afe91ea8fe3f2f /src/libserver/rspamd_control.h
parent64839a3bfb364431c1e5640d9e51f84607055d2a (diff)
downloadrspamd-840f144b9d399d69f06c921f23e36c13d0b498ff.tar.gz
rspamd-840f144b9d399d69f06c921f23e36c13d0b498ff.zip
Start work on worker->main pipe interface
Diffstat (limited to 'src/libserver/rspamd_control.h')
-rw-r--r--src/libserver/rspamd_control.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/libserver/rspamd_control.h b/src/libserver/rspamd_control.h
index ddca143cc..24874e785 100644
--- a/src/libserver/rspamd_control.h
+++ b/src/libserver/rspamd_control.h
@@ -38,6 +38,10 @@ enum rspamd_control_type {
RSPAMD_CONTROL_MAX
};
+enum rspamd_srv_type {
+ RSPAMD_SRV_SOCKETPAIR = 0,
+};
+
struct rspamd_control_command {
enum rspamd_control_type type;
union {
@@ -72,6 +76,29 @@ struct rspamd_control_reply {
} reply;
};
+#define PAIR_ID_LEN 16
+struct rspamd_srv_command {
+ enum rspamd_srv_type type;
+ guint64 id;
+ union {
+ struct {
+ gint af;
+ gchar pair_id[PAIR_ID_LEN];
+ guint pair_num;
+ } spair;
+ } cmd;
+};
+
+struct rspamd_srv_reply {
+ enum rspamd_srv_type type;
+ guint64 id;
+ union {
+ struct {
+ gint code;
+ } spair;
+ } reply;
+};
+
typedef gboolean (*rspamd_worker_control_handler) (struct rspamd_main *rspamd_main,
struct rspamd_worker *worker, gint fd,
struct rspamd_control_command *cmd,
@@ -97,4 +124,10 @@ void rspamd_control_worker_add_cmd_handler (struct rspamd_worker *worker,
rspamd_worker_control_handler handler,
gpointer ud);
+/**
+ * Start watching on srv pipe
+ */
+void rspamd_main_start_watching (struct rspamd_worker *worker,
+ struct event_base *ev_base);
+
#endif