diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-15 19:42:28 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-15 19:42:28 +0400 |
commit | c76bd2e9ab2506ef06cc291c3e4b6b57ae08ea65 (patch) | |
tree | deb00c3ceb9659a1d8b80845a7218b93cea4cbab /src/protocol.h | |
parent | c9d11a65b5c801a27f154091aebe86cbd08fd319 (diff) | |
download | rspamd-c76bd2e9ab2506ef06cc291c3e4b6b57ae08ea65.tar.gz rspamd-c76bd2e9ab2506ef06cc291c3e4b6b57ae08ea65.zip |
* Add module for blacklisting emails (self documented in sample config)
* Add command 'emails' for extracting emails from a message
* Rework protocol layout to allow expanding rspamd protocol by custom commands that can be added from anywhere in code
* Allow rspamc to work without strictly parameter 'command'. Command by default is 'symbols'.
* Update version to 0.1.8
Diffstat (limited to 'src/protocol.h')
-rw-r--r-- | src/protocol.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/protocol.h b/src/protocol.h index ed00edc26..bd2ac5343 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -13,6 +13,15 @@ #define RSPAMD_PROTOCOL_ERROR 3 #define RSPAMD_LENGTH_ERROR 4 +/* + * Reply messages + */ +#define RSPAMD_REPLY_BANNER "RSPAMD/1.0" +#define SPAMD_REPLY_BANNER "SPAMD/1.1" +#define SPAMD_OK "EX_OK" +/* XXX: try to convert rspamd errors to spamd errors */ +#define SPAMD_ERROR "EX_ERROR" + struct worker_task; enum rspamd_protocol { @@ -29,6 +38,15 @@ enum rspamd_command { CMD_PING, CMD_PROCESS, CMD_URLS, + CMD_OTHER, +}; + + +typedef int (*protocol_reply_func)(struct worker_task *task); + +struct custom_command { + const char *name; + protocol_reply_func func; }; /** @@ -46,4 +64,12 @@ int read_rspamd_input_line (struct worker_task *task, f_str_t *line); */ int write_reply (struct worker_task *task); + +/** + * Register custom fucntion to extend protocol + * @param name symbolic name of custom function + * @param func callback function for writing reply + */ +void register_protocol_command (const char *name, protocol_reply_func func); + #endif |