summaryrefslogtreecommitdiffstats
path: root/contrib/librdns/rdns.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 15:21:08 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 15:21:08 +0100
commitcdac77e4c351e1d3c4b04d8018ae3a9884057570 (patch)
treed7d3094d4d49fc794a25cb52bb6a654c8f491272 /contrib/librdns/rdns.h
parente869df63e92c8e1730995d5537c6bb5191eeed9b (diff)
downloadrspamd-cdac77e4c351e1d3c4b04d8018ae3a9884057570.tar.gz
rspamd-cdac77e4c351e1d3c4b04d8018ae3a9884057570.zip
[Feature] Allow to use custom callback when parsing resolv.conf
Diffstat (limited to 'contrib/librdns/rdns.h')
-rw-r--r--contrib/librdns/rdns.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/librdns/rdns.h b/contrib/librdns/rdns.h
index e5fc82fe4..5c44900f1 100644
--- a/contrib/librdns/rdns.h
+++ b/contrib/librdns/rdns.h
@@ -265,6 +265,20 @@ void* rdns_resolver_add_server (struct rdns_resolver *resolver,
bool rdns_resolver_parse_resolv_conf (struct rdns_resolver *resolver,
const char *path);
+typedef bool (*rdns_resolv_conf_cb) (struct rdns_resolver *resolver,
+ const char *name, unsigned int port,
+ int priority, unsigned int io_cnt, void *ud);
+/**
+ * Parse nameservers calling the specified callback for each nameserver
+ * @param resolve resolver object
+ * @param path path to resolv.conf file (/etc/resolv.conf typically)
+ * @param cb callback to call
+ * @param ud userdata for callback
+ * @return true if resolv.conf has been parsed
+ */
+bool rdns_resolver_parse_resolv_conf_cb (struct rdns_resolver *resolver,
+ const char *path, rdns_resolv_conf_cb cb, void *ud);
+
/**
* Set an external logger function to log messages from the resolver
* @param resolver resolver object