summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-packet.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-14 01:00:15 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-14 01:01:43 +0200
commit51323288fc628a5cac50914df915545d685b793e (patch)
tree013681d930ff79f768b5499bb295cc618942a056 /src/resolve/resolved-dns-packet.h
parent12e34d9d58ed4d97e7bdf8c23494c51ee5ec388e (diff)
resolved: allow passing on which protocol, family and interface to look something up
Also, return on which protocol/family/interface we found something.
Diffstat (limited to 'src/resolve/resolved-dns-packet.h')
-rw-r--r--src/resolve/resolved-dns-packet.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index 6a865a2d5b..561dd3adfa 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -34,6 +34,7 @@ typedef struct DnsPacket DnsPacket;
#include "resolved-dns-rr.h"
#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
+#include "resolved-def.h"
typedef enum DnsProtocol {
DNS_PROTOCOL_DNS,
@@ -220,3 +221,16 @@ enum {
const char* dnssec_algorithm_to_string(int i) _const_;
int dnssec_algorithm_from_string(const char *s) _pure_;
+
+static inline uint64_t SD_RESOLVED_FLAGS_MAKE(DnsProtocol protocol, int family) {
+
+ /* Converts a protocol + family into a flags field as used in queries */
+
+ if (protocol == DNS_PROTOCOL_DNS)
+ return SD_RESOLVED_DNS;
+
+ if (protocol == DNS_PROTOCOL_LLMNR)
+ return family == AF_INET6 ? SD_RESOLVED_LLMNR_IPV6 : SD_RESOLVED_LLMNR_IPV4;
+
+ return 0;
+}