and recommended. However, the following flags are defined to alter the look-up:</para>
<programlisting>/* Input+Output: Protocol/scope */
-#define SD_RESOLVED_DNS (UINT64_C(1) << 0)
-#define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) << 1)
-#define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) << 2)
-#define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) << 3)
-#define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) << 4)
+#define SD_RESOLVED_DNS (UINT64_C(1) << 0)
+#define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) << 1)
+#define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) << 2)
+#define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) << 3)
+#define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) << 4)
/* Input: Restrictions */
-#define SD_RESOLVED_NO_CNAME (UINT64_C(1) << 5)
-#define SD_RESOLVED_NO_TXT (UINT64_C(1) << 6)
-#define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) << 7)
-#define SD_RESOLVED_NO_SEARCH (UINT64_C(1) << 8)
-#define SD_RESOLVED_NO_VALIDATE (UINT64_C(1) << 10)
-#define SD_RESOLVED_NO_SYNTHESIZE (UINT64_C(1) << 11)
-#define SD_RESOLVED_NO_CACHE (UINT64_C(1) << 12)
-#define SD_RESOLVED_NO_ZONE (UINT64_C(1) << 13)
-#define SD_RESOLVED_NO_TRUST_ANCHOR (UINT64_C(1) << 14)
-#define SD_RESOLVED_NO_NETWORK (UINT64_C(1) << 15)
-#define SD_RESOLVED_NO_STALE (UINT64_C(1) << 24)
+#define SD_RESOLVED_NO_CNAME (UINT64_C(1) << 5)
+#define SD_RESOLVED_NO_TXT (UINT64_C(1) << 6)
+#define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) << 7)
+#define SD_RESOLVED_NO_SEARCH (UINT64_C(1) << 8)
+#define SD_RESOLVED_NO_VALIDATE (UINT64_C(1) << 10)
+#define SD_RESOLVED_NO_SYNTHESIZE (UINT64_C(1) << 11)
+#define SD_RESOLVED_NO_CACHE (UINT64_C(1) << 12)
+#define SD_RESOLVED_NO_ZONE (UINT64_C(1) << 13)
+#define SD_RESOLVED_NO_TRUST_ANCHOR (UINT64_C(1) << 14)
+#define SD_RESOLVED_NO_NETWORK (UINT64_C(1) << 15)
+#define SD_RESOLVED_NO_STALE (UINT64_C(1) << 24)
+#define SD_RESOLVED_RELAX_SINGLE_LABEL (UINT64_C(1) << 25)
/* Output: Security */
-#define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) << 9)
-#define SD_RESOLVED_CONFIDENTIAL (UINT64_C(1) << 18)
+#define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) << 9)
+#define SD_RESOLVED_CONFIDENTIAL (UINT64_C(1) << 18)
/* Output: Origin */
-#define SD_RESOLVED_SYNTHETIC (UINT64_C(1) << 19)
-#define SD_RESOLVED_FROM_CACHE (UINT64_C(1) << 20)
-#define SD_RESOLVED_FROM_ZONE (UINT64_C(1) << 21)
-#define SD_RESOLVED_FROM_TRUST_ANCHOR (UINT64_C(1) << 22)
-#define SD_RESOLVED_FROM_NETWORK (UINT64_C(1) << 23)
+#define SD_RESOLVED_SYNTHETIC (UINT64_C(1) << 19)
+#define SD_RESOLVED_FROM_CACHE (UINT64_C(1) << 20)
+#define SD_RESOLVED_FROM_ZONE (UINT64_C(1) << 21)
+#define SD_RESOLVED_FROM_TRUST_ANCHOR (UINT64_C(1) << 22)
+#define SD_RESOLVED_FROM_NETWORK (UINT64_C(1) << 23)
</programlisting>
<para>On input, the first five flags control the protocols to use for the look-up. They refer to
LIST_FOREACH(scopes, s, q->manager->dns_scopes) {
DnsScopeMatch match;
- match = dns_scope_good_domain(s, q);
+ match = dns_scope_good_domain(s, q, q->flags);
assert(match >= 0);
if (match > found) { /* Does this match better? If so, remember how well it matched, and the first one
* that matches this well */
LIST_FOREACH(scopes, s, first->scopes_next) {
DnsScopeMatch match;
- match = dns_scope_good_domain(s, q);
+ match = dns_scope_good_domain(s, q, q->flags);
assert(match >= 0);
if (match < found)
continue;
int dns_scope_socket_tcp(DnsScope *s, int family, const union in_addr_union *address, DnsServer *server, uint16_t port, union sockaddr_union *ret_socket_address);
int dns_scope_socket_udp(DnsScope *s, DnsServer *server);
-DnsScopeMatch dns_scope_good_domain(DnsScope *s, DnsQuery *q);
+DnsScopeMatch dns_scope_good_domain(DnsScope *s, DnsQuery *q, uint64_t query_flags);
bool dns_scope_good_key(DnsScope *s, const DnsResourceKey *key);
DnsServer *dns_scope_get_dns_server(DnsScope *s);