diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-06 08:56:02 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-06 08:56:02 +0100 |
commit | fd20fa9f63e72df66b2b702cde982f729f704480 (patch) | |
tree | bb7dc05025ff92cf09911bea0280ae761b1c8097 /src/libserver/monitored.h | |
parent | 07b8d8cb2d14a357f196afcb42aa8469b43a6167 (diff) | |
download | rspamd-fd20fa9f63e72df66b2b702cde982f729f704480.tar.gz rspamd-fd20fa9f63e72df66b2b702cde982f729f704480.zip |
[Rework] Further steps towards one process monitoring
Diffstat (limited to 'src/libserver/monitored.h')
-rw-r--r-- | src/libserver/monitored.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/libserver/monitored.h b/src/libserver/monitored.h index e342a5886..261227d35 100644 --- a/src/libserver/monitored.h +++ b/src/libserver/monitored.h @@ -23,6 +23,8 @@ struct rspamd_monitored; struct rspamd_monitored_ctx; struct rspamd_config; +#define RSPAMD_MONITORED_TAG_LEN 32 + enum rspamd_monitored_type { RSPAMD_MONITORED_DNS = 0, }; @@ -63,12 +65,32 @@ void rspamd_monitored_ctx_config (struct rspamd_monitored_ctx *ctx, * @param flags specific flags for monitoring * @return new monitored object */ -struct rspamd_monitored *rspamd_monitored_create ( +struct rspamd_monitored *rspamd_monitored_create_ ( struct rspamd_monitored_ctx *ctx, const gchar *line, enum rspamd_monitored_type type, enum rspamd_monitored_flags flags, - const ucl_object_t *opts); + const ucl_object_t *opts, + const gchar *loc); +#define rspamd_monitored_create(ctx, line, type, flags, opts) \ + rspamd_monitored_create_(ctx, line, type, flags, opts, G_STRFUNC) + +/** + * Return monitored by its tag + * @param ctx + * @param tag + * @return + */ +struct rspamd_monitored * rspamd_monitored_by_tag (struct rspamd_monitored_ctx *ctx, + guchar tag[RSPAMD_MONITORED_TAG_LEN]); + +/** + * Sets `tag_out` to the monitored tag + * @param m + * @param tag_out + */ +void rspamd_monitored_get_tag (struct rspamd_monitored *m, + guchar tag_out[RSPAMD_MONITORED_TAG_LEN]); /** * Return TRUE if monitored object is alive |