Browse Source

Add versions to rspamd modules and workers

tags/1.2.0
Vsevolod Stakhov 8 years ago
parent
commit
d54124d738

+ 5
- 0
CMakeLists.txt View File

SET(RSPAMD_VERSION_MINOR 2) SET(RSPAMD_VERSION_MINOR 2)
SET(RSPAMD_VERSION_PATCH 0) SET(RSPAMD_VERSION_PATCH 0)


# Keep two digits all the time
SET(RSPAMD_VERSION_MAJOR_NUM ${RSPAMD_VERSION_MAJOR}0)
SET(RSPAMD_VERSION_MINOR_NUM ${RSPAMD_VERSION_MINOR}0)
SET(RSPAMD_VERSION_PATCH_NUM ${RSPAMD_VERSION_PATCH}0)

IF(GIT_ID) IF(GIT_ID)
SET(GIT_VERSION 1) SET(GIT_VERSION 1)
SET(RSPAMD_ID "${GIT_ID}") SET(RSPAMD_ID "${GIT_ID}")

+ 3
- 1
config.h.in View File

#define RSPAMD_PREFIX "${CMAKE_INSTALL_PREFIX}" #define RSPAMD_PREFIX "${CMAKE_INSTALL_PREFIX}"




#ifdef GIT_VERSION
#if defined(GIT_VERSION) && GIT_VERSION == 1
# define RVERSION "${RSPAMD_VERSION}" # define RVERSION "${RSPAMD_VERSION}"
# define RID "${RSPAMD_ID}" # define RID "${RSPAMD_ID}"
# define RSPAMD_VERSION_NUM 0x${RSPAMD_VERSION_MAJOR_NUM}${RSPAMD_VERSION_MINOR_NUM}${RSPAMD_VERSION_PATCH_NUM}${RSPAMD_ID}ULL
#else #else
# define RVERSION "${RSPAMD_VERSION}" # define RVERSION "${RSPAMD_VERSION}"
# define RSPAMD_VERSION_NUM 0x${RSPAMD_VERSION_MAJOR_NUM}${RSPAMD_VERSION_MINOR_NUM}${RSPAMD_VERSION_PATCH_NUM}0000000ULL
# define RID "release" # define RID "release"
#endif #endif



+ 2
- 1
src/controller.c View File

TRUE, /* Non unique */ TRUE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };
/* /*
* Worker's context * Worker's context

+ 2
- 1
src/fuzzy_storage.c View File

FALSE, /* Unique */ FALSE, /* Unique */
FALSE, /* Threaded */ FALSE, /* Threaded */
FALSE, /* Non killable */ FALSE, /* Non killable */
SOCK_DGRAM /* UDP socket */
SOCK_DGRAM, /* UDP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


/* For evtimer */ /* For evtimer */

+ 2
- 1
src/hs_helper.c View File

TRUE, /* Unique */ TRUE, /* Unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


static const gdouble default_max_time = 1.0; static const gdouble default_max_time = 1.0;

+ 2
- 1
src/http_proxy.c View File

FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER
}; };


struct rspamd_http_upstream { struct rspamd_http_upstream {

+ 2
- 1
src/lmtp.c View File

TRUE, /* Has socket */ TRUE, /* Has socket */
FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE /* Killable */
TRUE, /* Killable */
RSPAMD_WORKER_VER /* Version info */
}; };


#ifndef HAVE_SA_SIGINFO #ifndef HAVE_SA_SIGINFO

+ 2
- 1
src/lua_worker.c View File

FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


/* /*

+ 2
- 1
src/plugins/chartable.c View File

chartable_module_init, chartable_module_init,
chartable_module_config, chartable_module_config,
chartable_module_reconfig, chartable_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
}; };


struct chartable_ctx { struct chartable_ctx {

+ 2
- 1
src/plugins/dkim_check.c View File

dkim_module_init, dkim_module_init,
dkim_module_config, dkim_module_config,
dkim_module_reconfig, dkim_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
}; };


static void static void

+ 2
- 1
src/plugins/fuzzy_check.c View File

fuzzy_check_module_init, fuzzy_check_module_init,
fuzzy_check_module_config, fuzzy_check_module_config,
fuzzy_check_module_reconfig, fuzzy_check_module_reconfig,
fuzzy_attach_controller
fuzzy_attach_controller,
RSPAMD_MODULE_VER
}; };


static void static void

+ 2
- 1
src/plugins/surbl.c View File

surbl_module_init, surbl_module_init,
surbl_module_config, surbl_module_config,
surbl_module_reconfig, surbl_module_reconfig,
NULL
NULL,
RSPAMD_MODULE_VER
}; };


static void static void

+ 40
- 0
src/rspamd.h View File

gboolean enabled; /**< true if module is enabled in configuration */ gboolean enabled; /**< true if module is enabled in configuration */
}; };


#ifndef WITH_HYPERSCAN
#define RSPAMD_FEATURE_HYPERSCAN "0"
#else
#define RSPAMD_FEATURE_HYPERSCAN "1"
#endif
#ifndef WITH_PCRE2
#define RSPAMD_FEATURE_PCRE2 "0"
#else
#define RSPAMD_FEATURE_PCRE2 "1"
#endif
#ifndef WITH_FANN
#define RSPAMD_FEATURE_FANN "0"
#else
#define RSPAMD_FEATURE_FANN "1"
#endif
#ifndef WITH_SNOWBALL
#define RSPAMD_FEATURE_SNOWBALL "0"
#else
#define RSPAMD_FEATURE_SNOWBALL "1"
#endif

#define RSPAMD_FEATURES \
RSPAMD_FEATURE_HYPERSCAN RSPAMD_FEATURE_PCRE2 \
RSPAMD_FEATURE_FANN RSPAMD_FEATURE_SNOWBALL

#define RSPAMD_MODULE_VER \
0x1, /* Module version */ \
RSPAMD_VERSION_NUM, /* Rspamd version */ \
RSPAMD_FEATURES /* Compilation features */ \

#define RSPAMD_WORKER_VER \
0x1, /* Worker version */ \
RSPAMD_VERSION_NUM, /* Rspamd version */ \
RSPAMD_FEATURES /* Compilation features */ \
/** /**
* Module * Module
*/ */
int (*module_reconfig_func)(struct rspamd_config *cfg); int (*module_reconfig_func)(struct rspamd_config *cfg);
int (*module_attach_controller_func)(struct module_ctx *ctx, int (*module_attach_controller_func)(struct module_ctx *ctx,
GHashTable *custom_commands); GHashTable *custom_commands);
guint module_version;
guint64 rspamd_version;
const gchar *rspamd_features;
} module_t; } module_t;


typedef struct worker_s { typedef struct worker_s {
gboolean threaded; gboolean threaded;
gboolean killable; gboolean killable;
gint listen_type; gint listen_type;
guint module_version;
guint64 rspamd_version;
const gchar *rspamd_features;
} worker_t; } worker_t;


struct pidfh; struct pidfh;

+ 2
- 1
src/smtp.c View File

FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


static gboolean static gboolean

+ 2
- 1
src/smtp_proxy.c View File

FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


struct smtp_proxy_ctx { struct smtp_proxy_ctx {

+ 2
- 1
src/worker.c View File

FALSE, /* Non unique */ FALSE, /* Non unique */
FALSE, /* Non threaded */ FALSE, /* Non threaded */
TRUE, /* Killable */ TRUE, /* Killable */
SOCK_STREAM /* TCP socket */
SOCK_STREAM, /* TCP socket */
RSPAMD_WORKER_VER /* Version info */
}; };


#define msg_err_ctx(...) rspamd_default_log_function(G_LOG_LEVEL_CRITICAL, \ #define msg_err_ctx(...) rspamd_default_log_function(G_LOG_LEVEL_CRITICAL, \

Loading…
Cancel
Save