aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-15 13:26:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-15 13:26:52 +0000
commite7d1c7c1a609761ce46f0a6f7cdc7709a4ba2df8 (patch)
tree12d80438ed46eb3b95e8d269ca8d994fa4b2c840 /src/libutil/upstream.h
parent844e34179a661f0c372ea726adff5776be55bbaa (diff)
downloadrspamd-e7d1c7c1a609761ce46f0a6f7cdc7709a4ba2df8.tar.gz
rspamd-e7d1c7c1a609761ce46f0a6f7cdc7709a4ba2df8.zip
[Feature] Add flags and opaque data to upstreams
Diffstat (limited to 'src/libutil/upstream.h')
-rw-r--r--src/libutil/upstream.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h
index 16561a6ac..79d88802d 100644
--- a/src/libutil/upstream.h
+++ b/src/libutil/upstream.h
@@ -15,6 +15,9 @@ enum rspamd_upstream_rotation {
RSPAMD_UPSTREAM_UNDEF
};
+enum rspamd_upstream_flag {
+ RSPAMD_UPSTREAM_FLAG_NORESOLVE = (1 << 0),
+};
struct rspamd_config;
/* Opaque upstream structures */
@@ -64,6 +67,15 @@ void rspamd_upstream_ok (struct upstream *up);
* @return
*/
struct upstream_list* rspamd_upstreams_create (struct upstream_ctx *ctx);
+
+/**
+ * Sets specific flag to the upstream list
+ * @param ups
+ * @param flags
+ */
+void rspamd_upstreams_set_flags (struct upstream_list *ups,
+ enum rspamd_upstream_flag flags);
+
/**
* Destroy list of upstreams
* @param ups
@@ -141,6 +153,21 @@ gboolean rspamd_upstream_add_addr (struct upstream *up,
const gchar* rspamd_upstream_name (struct upstream *up);
/**
+ * Sets opaque user data associated with this upstream
+ * @param up
+ * @param data
+ * @return old data
+ */
+gpointer rspamd_upstream_set_data (struct upstream *up, gpointer data);
+
+/**
+ * Gets opaque user data associated with this upstream
+ * @param up
+ * @return
+ */
+gpointer rspamd_upstream_get_data (struct upstream *up);
+
+/**
* Get new upstream from the list
* @param ups upstream list
* @param type type of rotation algorithm, for `RSPAMD_UPSTREAM_HASHED` it is required to specify `key` and `keylen` as arguments