summaryrefslogtreecommitdiffstats
path: root/contrib/librdns
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-27 09:21:10 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-27 09:21:10 +0000
commit1d5c1d7b7f12803e12230260cd517d980bf30ca1 (patch)
treefd83fff8bbd6e2c5525c03acf1ce48f70d9ae715 /contrib/librdns
parent04101f59f5cd8c08d86bbf2e5d7563f3c1a43887 (diff)
downloadrspamd-1d5c1d7b7f12803e12230260cd517d980bf30ca1.tar.gz
rspamd-1d5c1d7b7f12803e12230260cd517d980bf30ca1.zip
[Minor] Core: Pass server name when doing DNS request
Diffstat (limited to 'contrib/librdns')
-rw-r--r--contrib/librdns/rdns.h8
-rw-r--r--contrib/librdns/util.c10
2 files changed, 18 insertions, 0 deletions
diff --git a/contrib/librdns/rdns.h b/contrib/librdns/rdns.h
index 016903ba6..647f0f1b1 100644
--- a/contrib/librdns/rdns.h
+++ b/contrib/librdns/rdns.h
@@ -436,6 +436,14 @@ const struct rdns_request_name* rdns_request_get_name (struct rdns_request *req,
unsigned int *count);
/**
+ * Return a DNS server name associated with the request
+ * @param req request object
+ * @return name of a DNS server
+ */
+const char* rdns_request_get_server (struct rdns_request *req);
+
+
+/**
* Return PTR string for a request (ipv4 or ipv6) addresses
* @param str string representation of IP address
* @return name to resolve or NULL if `str` is not an IP address; caller must free result when it is unused
diff --git a/contrib/librdns/util.c b/contrib/librdns/util.c
index c9480beb6..b793b9077 100644
--- a/contrib/librdns/util.c
+++ b/contrib/librdns/util.c
@@ -663,6 +663,16 @@ rdns_request_get_name (struct rdns_request *req, unsigned int *count)
return req->requested_names;
}
+const char*
+rdns_request_get_server (struct rdns_request *req)
+{
+ if (req && req->io) {
+ return req->io->srv->name;
+ }
+
+ return NULL;
+}
+
char *
rdns_generate_ptr_from_str (const char *str)
{