diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-27 20:05:33 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-07-27 20:05:33 +0400 |
commit | 7ed8ac7bcb54df908bd4a5f8b915ec1fdc483ac7 (patch) | |
tree | 8cb06875ef55407d7961d11491346b2899971f18 /src/fuzzy_storage.h | |
parent | bc7022c5ce4186892ac4d9eee5899fdbc65e62c4 (diff) | |
download | rspamd-7ed8ac7bcb54df908bd4a5f8b915ec1fdc483ac7.tar.gz rspamd-7ed8ac7bcb54df908bd4a5f8b915ec1fdc483ac7.zip |
* Implement fuzzy hashes storage worker
TODO:
- implement client as rspamd plugin
- add support to controller and rspamc
- improve performance by avoiding usage of linked lists
Diffstat (limited to 'src/fuzzy_storage.h')
-rw-r--r-- | src/fuzzy_storage.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/fuzzy_storage.h b/src/fuzzy_storage.h new file mode 100644 index 000000000..533ecaf13 --- /dev/null +++ b/src/fuzzy_storage.h @@ -0,0 +1,30 @@ +#ifndef RSPAMD_FUZZY_STORAGE_H +#define RSPAMD_FUZZY_STORAGE_H + +#include "config.h" +#include "main.h" +#include "fuzzy.h" + +/* Commands for fuzzy storage */ +#define FUZZY_CHECK 0 +#define FUZZY_WRITE 1 +#define FUZZY_DEL 2 + +struct fuzzy_cmd { + u_char cmd; + uint32_t blocksize; + u_char hash[FUZZY_HASHLEN]; +}; + +struct fuzzy_session { + struct rspamd_worker *worker; + struct event ev; + struct fuzzy_cmd cmd; + struct timeval tv; + int fd; + u_char *pos; +}; + +void start_fuzzy_storage (struct rspamd_worker *worker); + +#endif |