diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-12 14:44:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-12 14:44:35 +0000 |
commit | 85b3f42f215e5736d90a803835f506673538bbd0 (patch) | |
tree | 30ac8621fee86ad9dcb5f7950af157016e0bc3cf /src/rspamd.h | |
parent | d54124d738a0e30d2b3b9adb1966374935ff3f46 (diff) | |
download | rspamd-85b3f42f215e5736d90a803835f506673538bbd0.tar.gz rspamd-85b3f42f215e5736d90a803835f506673538bbd0.zip |
Initial support for dynamic modules and workers
Diffstat (limited to 'src/rspamd.h')
-rw-r--r-- | src/rspamd.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/rspamd.h b/src/rspamd.h index e5c7bb4db..0c7668bfa 100644 --- a/src/rspamd.h +++ b/src/rspamd.h @@ -117,17 +117,20 @@ struct module_ctx { #define RSPAMD_FEATURE_SNOWBALL "1" #endif +#define RSPAMD_CUR_MODULE_VERSION 0x1 +#define RSPAMD_CUR_WORKER_VERSION 0x1 + #define RSPAMD_FEATURES \ RSPAMD_FEATURE_HYPERSCAN RSPAMD_FEATURE_PCRE2 \ RSPAMD_FEATURE_FANN RSPAMD_FEATURE_SNOWBALL #define RSPAMD_MODULE_VER \ - 0x1, /* Module version */ \ + RSPAMD_CUR_MODULE_VERSION, /* Module version */ \ RSPAMD_VERSION_NUM, /* Rspamd version */ \ RSPAMD_FEATURES /* Compilation features */ \ #define RSPAMD_WORKER_VER \ - 0x1, /* Worker version */ \ + RSPAMD_CUR_WORKER_VERSION, /* Worker version */ \ RSPAMD_VERSION_NUM, /* Rspamd version */ \ RSPAMD_FEATURES /* Compilation features */ \ /** @@ -154,11 +157,27 @@ typedef struct worker_s { gboolean threaded; gboolean killable; gint listen_type; - guint module_version; + guint worker_version; guint64 rspamd_version; const gchar *rspamd_features; } worker_t; +/** + * Check if loaded worker is compatible with rspamd + * @param cfg + * @param wrk + * @return + */ +gboolean rspamd_check_worker (struct rspamd_config *cfg, worker_t *wrk); + +/** + * Check if loaded module is compatible with rspamd + * @param cfg + * @param wrk + * @return + */ +gboolean rspamd_check_module (struct rspamd_config *cfg, module_t *wrk); + struct pidfh; struct rspamd_config; struct tokenizer; |