diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-15 15:21:08 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-15 15:21:08 +0100 |
commit | cdac77e4c351e1d3c4b04d8018ae3a9884057570 (patch) | |
tree | d7d3094d4d49fc794a25cb52bb6a654c8f491272 /contrib/librdns/rdns.h | |
parent | e869df63e92c8e1730995d5537c6bb5191eeed9b (diff) | |
download | rspamd-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.h | 14 |
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 |