aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/upstream.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-29 13:58:33 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-29 13:58:33 +0000
commitdb0e114862cdac564756485f9d5c9102e73d81ab (patch)
tree010416fac5f370c5b63b37aa1a4799c9bf1e60c6 /src/libutil/upstream.h
parent8c9cf87f25a81677b52ed1a309fea505d1c2174f (diff)
downloadrspamd-db0e114862cdac564756485f9d5c9102e73d81ab.tar.gz
rspamd-db0e114862cdac564756485f9d5c9102e73d81ab.zip
Add parsing of multiple upstreams string.
Diffstat (limited to 'src/libutil/upstream.h')
-rw-r--r--src/libutil/upstream.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h
index cc4462878..a5e3715f9 100644
--- a/src/libutil/upstream.h
+++ b/src/libutil/upstream.h
@@ -51,10 +51,11 @@ struct upstream_list* rspamd_upstreams_create (void);
* @param ups
*/
void rspamd_upstreams_destroy (struct upstream_list *ups);
+
/**
* Add upstream from the string
* @param ups upstream list
- * @param str string in format "name[:port[:priority]]
+ * @param str string in format "name[:port[:priority]]"
* @param def_port default port number
* @param data optional userdata
* @return TRUE if upstream has been added
@@ -63,6 +64,17 @@ gboolean rspamd_upstreams_add_upstream (struct upstream_list *ups,
const gchar *str, guint16 def_port, void *data);
/**
+ * Add multiple upstreams from comma, semicolon or space separated line
+ * @param ups upstream list
+ * @param str string in format "(<ups>([<sep>+]<ups>)*)+"
+ * @param def_port default port number
+ * @param data optional userdata
+ * @return TRUE if **any** of upstreams has been added
+ */
+gboolean rspamd_upstreams_parse_line (struct upstream_list *ups,
+ const gchar *str, guint16 def_port, void *data);
+
+/**
* Returns the current IP address of the upstream
* @param up
* @return