diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-15 13:45:53 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-15 13:45:53 +0000 |
commit | 612bbd0102d0090b753de4ccc10147461e4a3932 (patch) | |
tree | 5b11fee5bbbbc8fff680dddb2960df11f94a0a8f /src/libutil/upstream.h | |
parent | e7d1c7c1a609761ce46f0a6f7cdc7709a4ba2df8 (diff) | |
download | rspamd-612bbd0102d0090b753de4ccc10147461e4a3932.tar.gz rspamd-612bbd0102d0090b753de4ccc10147461e4a3932.zip |
[Feature] Allow iterating over upstreams
Diffstat (limited to 'src/libutil/upstream.h')
-rw-r--r-- | src/libutil/upstream.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libutil/upstream.h b/src/libutil/upstream.h index 79d88802d..c3cbf685a 100644 --- a/src/libutil/upstream.h +++ b/src/libutil/upstream.h @@ -130,6 +130,19 @@ gboolean rspamd_upstreams_parse_line (struct upstream_list *ups, gboolean rspamd_upstreams_from_ucl (struct upstream_list *ups, const ucl_object_t *in, guint16 def_port, void *data); + +typedef void (*rspamd_upstream_traverse_func) (struct upstream *up, + void *ud); + +/** + * Traverse upstreams list calling the function specified + * @param ups + * @param cb + * @param ud + */ +void rspamd_upstreams_foreach (struct upstream_list *ups, + rspamd_upstream_traverse_func cb, void *ud); + /** * Returns the current IP address of the upstream * @param up |