aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-07-29 20:17:29 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-07-29 20:17:29 +0400
commitc4621d35aebaf9c6d466bf7a15a9de340b20b0ce (patch)
tree75553d38928ccbb2b029bb7646b67ab8b0afac8f /src/main.h
parenteb9facb84cad4017db7ac877b5a0446472756308 (diff)
downloadrspamd-c4621d35aebaf9c6d466bf7a15a9de340b20b0ce.tar.gz
rspamd-c4621d35aebaf9c6d466bf7a15a9de340b20b0ce.zip
* Add support for extending controller protocol by modules
* Add write support via controller to fuzzy storage TODO: Add delete and check commands support to controller interface
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h
index e87b4efde..ee34a2cae 100644
--- a/src/main.h
+++ b/src/main.h
@@ -117,6 +117,8 @@ struct save_point {
unsigned int saved; /**< how much time we have delayed processing */
};
+
+
/**
* Control session object
*/
@@ -127,6 +129,8 @@ struct controller_session {
STATE_LEARN,
STATE_REPLY,
STATE_QUIT,
+ STATE_OTHER,
+ STATE_WAIT,
} state; /**< current session state */
int sock; /**< socket descriptor */
/* Access to authorized commands */
@@ -142,8 +146,13 @@ struct controller_session {
f_str_t *learn_buf; /**< learn input */
GList *parts; /**< extracted mime parts */
int in_class; /**< positive or negative learn */
+ void (*other_handler)(struct controller_session *session,
+ f_str_t *in); /**< other command handler to execute at the end of processing */
+ void *other_data; /**< and its data */
};
+typedef void (*controller_func_t)(char **args, struct controller_session *session);
+
/**
* Worker task structure
*/
@@ -214,6 +223,20 @@ void start_worker (struct rspamd_worker *worker);
void start_controller (struct rspamd_worker *worker);
/**
+ * Register custom controller function
+ */
+void register_custom_controller_command (const char *name, controller_func_t handler, gboolean privilleged, gboolean require_message);
+
+/**
+ * Construct new task for worker
+ */
+struct worker_task* construct_task (struct rspamd_worker *worker);
+/**
+ * Destroy task object and remove its IO dispatcher if it exists
+ */
+void free_task (struct worker_task *task, gboolean is_soft);
+
+/**
* If set, reopen log file on next write
*/
extern sig_atomic_t do_reopen_log;