summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-question.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-dns-question.c')
-rw-r--r--src/resolve/resolved-dns-question.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c
index 056bd6eb64..66017e82cd 100644
--- a/src/resolve/resolved-dns-question.c
+++ b/src/resolve/resolved-dns-question.c
@@ -235,3 +235,38 @@ int dns_question_cname_redirect(DnsQuestion *q, const char *name, DnsQuestion **
return 1;
}
+
+int dns_question_endswith(DnsQuestion *q, const char *suffix) {
+ unsigned i;
+
+ assert(q);
+ assert(suffix);
+
+ for (i = 0; i < q->n_keys; i++) {
+ int k;
+
+ k = dns_name_endswith(DNS_RESOURCE_KEY_NAME(q->keys[i]), suffix);
+ if (k <= 0)
+ return k;
+ }
+
+ return 1;
+}
+
+int dns_question_extract_reverse_address(DnsQuestion *q, int *family, union in_addr_union *address) {
+ unsigned i;
+
+ assert(q);
+ assert(family);
+ assert(address);
+
+ for (i = 0; i < q->n_keys; i++) {
+ int k;
+
+ k = dns_name_address(DNS_RESOURCE_KEY_NAME(q->keys[i]), family, address);
+ if (k != 0)
+ return k;
+ }
+
+ return 0;
+}