aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/fuzzy_wire.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-25 14:48:42 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-11-25 14:48:42 +0000
commit4854a5a4053a50743ce976392b458496a1e3fd60 (patch)
tree345e19e33bd4372d47d49da3b789d2b555ec4d83 /src/libserver/fuzzy_wire.h
parentd2e806d902f1469e87070b340291d21fa04fc26a (diff)
downloadrspamd-4854a5a4053a50743ce976392b458496a1e3fd60.tar.gz
rspamd-4854a5a4053a50743ce976392b458496a1e3fd60.zip
[Rework] Implement new version of fuzzy replies
Diffstat (limited to 'src/libserver/fuzzy_wire.h')
-rw-r--r--src/libserver/fuzzy_wire.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libserver/fuzzy_wire.h b/src/libserver/fuzzy_wire.h
index da809f405..ef9a7e4e3 100644
--- a/src/libserver/fuzzy_wire.h
+++ b/src/libserver/fuzzy_wire.h
@@ -6,7 +6,7 @@
#include "shingles.h"
#include "cryptobox.h"
-#define RSPAMD_FUZZY_VERSION 3
+#define RSPAMD_FUZZY_VERSION 4
#define RSPAMD_FUZZY_KEYLEN 8
/* Commands for fuzzy storage */
@@ -24,6 +24,7 @@ enum rspamd_fuzzy_epoch {
RSPAMD_FUZZY_EPOCH8, /**< 0.8 till 0.9 */
RSPAMD_FUZZY_EPOCH9, /**< 0.9 + */
RSPAMD_FUZZY_EPOCH10, /**< 1.0+ encryption */
+ RSPAMD_FUZZY_EPOCH11, /**< 1.7+ extended reply */
RSPAMD_FUZZY_EPOCH_MAX
};
@@ -42,13 +43,20 @@ RSPAMD_PACKED(rspamd_fuzzy_shingle_cmd) {
struct rspamd_shingle sgl;
};
-RSPAMD_PACKED(rspamd_fuzzy_reply) {
+RSPAMD_PACKED(rspamd_fuzzy_reply_v1) {
gint32 value;
guint32 flag;
guint32 tag;
float prob;
};
+RSPAMD_PACKED(rspamd_fuzzy_reply) {
+ struct rspamd_fuzzy_reply_v1 v1;
+ gchar digest[rspamd_cryptobox_HASHBYTES];
+ guint32 ts;
+ guchar reserved[12];
+};
+
RSPAMD_PACKED(rspamd_fuzzy_encrypted_req_hdr) {
guchar magic[4];
guchar key_id[RSPAMD_FUZZY_KEYLEN];