summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-answer.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-20 21:28:53 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-21 13:20:48 +0200
commit501e8eb0549bb6c3f5d08b6f6c6ad7c6a34575ba (patch)
tree221e628bf3252fd2dfb85b429530fe28a82befe7 /src/resolve/resolved-dns-answer.h
parent17c8de633faad3ac97012e066c6c6b2f71b83a67 (diff)
resolved: add dns_answer_is_empty() and dns_question_is_empty() helpers
And make use of them at a few places.
Diffstat (limited to 'src/resolve/resolved-dns-answer.h')
-rw-r--r--src/resolve/resolved-dns-answer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-answer.h b/src/resolve/resolved-dns-answer.h
index b2b86d1772..4a92bd1150 100644
--- a/src/resolve/resolved-dns-answer.h
+++ b/src/resolve/resolved-dns-answer.h
@@ -87,6 +87,10 @@ static inline unsigned dns_answer_size(DnsAnswer *a) {
return a ? a->n_rrs : 0;
}
+static inline bool dns_answer_isempty(DnsAnswer *a) {
+ return dns_answer_size(a) <= 0;
+}
+
void dns_answer_dump(DnsAnswer *answer, FILE *f);
DEFINE_TRIVIAL_CLEANUP_FUNC(DnsAnswer*, dns_answer_unref);