| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
#include "time-util.h" |
| 6 |
|
| 7 |
/* Input + Output: The various protocols we can use */ |
| 8 |
#define SD_RESOLVED_DNS (UINT64_C(1) << 0) |
| 9 |
#define SD_RESOLVED_LLMNR_IPV4 (UINT64_C(1) << 1) |
| 10 |
#define SD_RESOLVED_LLMNR_IPV6 (UINT64_C(1) << 2) |
| 11 |
#define SD_RESOLVED_MDNS_IPV4 (UINT64_C(1) << 3) |
| 12 |
#define SD_RESOLVED_MDNS_IPV6 (UINT64_C(1) << 4) |
| 13 |
|
| 14 |
/* Input: Don't follow CNAMEs/DNAMEs */ |
| 15 |
#define SD_RESOLVED_NO_CNAME (UINT64_C(1) << 5) |
| 16 |
|
| 17 |
/* Input: When doing service (SRV) resolving, don't resolve associated mDNS-style TXT records */ |
| 18 |
#define SD_RESOLVED_NO_TXT (UINT64_C(1) << 6) |
| 19 |
|
| 20 |
/* Input: When doing service (SRV) resolving, don't resolve A/AAA RR for included hostname */ |
| 21 |
#define SD_RESOLVED_NO_ADDRESS (UINT64_C(1) << 7) |
| 22 |
|
| 23 |
/* Input: Don't apply search domain logic to request */ |
| 24 |
#define SD_RESOLVED_NO_SEARCH (UINT64_C(1) << 8) |
| 25 |
|
| 26 |
/* Output: Result is authenticated */ |
| 27 |
#define SD_RESOLVED_AUTHENTICATED (UINT64_C(1) << 9) |
| 28 |
|
| 29 |
/* Input: Don't DNSSEC validate request */ |
| 30 |
#define SD_RESOLVED_NO_VALIDATE (UINT64_C(1) << 10) |
| 31 |
|
| 32 |
/* Input: Don't answer request from locally synthesized records (which includes /etc/hosts) */ |
| 33 |
#define SD_RESOLVED_NO_SYNTHESIZE (UINT64_C(1) << 11) |
| 34 |
|
| 35 |
/* Input: Don't answer request from cache */ |
| 36 |
#define SD_RESOLVED_NO_CACHE (UINT64_C(1) << 12) |
| 37 |
|
| 38 |
/* Input: Don't answer request from locally registered public LLMNR/mDNS RRs */ |
| 39 |
#define SD_RESOLVED_NO_ZONE (UINT64_C(1) << 13) |
| 40 |
|
| 41 |
/* Input: Don't answer request from locally configured trust anchors. */ |
| 42 |
#define SD_RESOLVED_NO_TRUST_ANCHOR (UINT64_C(1) << 14) |
| 43 |
|
| 44 |
/* Input: Don't go to network for this request */ |
| 45 |
#define SD_RESOLVED_NO_NETWORK (UINT64_C(1) << 15) |
| 46 |
|
| 47 |
/* Input: Require that request is answered from a "primary" answer, i.e. not from RRs acquired as |
| 48 |
* side-effect of a previous transaction */ |
| 49 |
#define SD_RESOLVED_REQUIRE_PRIMARY (UINT64_C(1) << 16) |
| 50 |
|
| 51 |
/* Input: If reply is answered from cache, the TTLs will be adjusted by age of cache entry */ |
| 52 |
#define SD_RESOLVED_CLAMP_TTL (UINT64_C(1) << 17) |
| 53 |
|
| 54 |
/* Output: Result was only sent via encrypted channels, or never left this system */ |
| 55 |
#define SD_RESOLVED_CONFIDENTIAL (UINT64_C(1) << 18) |
| 56 |
|
| 57 |
/* Output: Result was (at least partially) synthesized locally */ |
| 58 |
#define SD_RESOLVED_SYNTHETIC (UINT64_C(1) << 19) |
| 59 |
|
| 60 |
/* Output: Result was (at least partially) answered from cache */ |
| 61 |
#define SD_RESOLVED_FROM_CACHE (UINT64_C(1) << 20) |
| 62 |
|
| 63 |
/* Output: Result was (at least partially) answered from local zone */ |
| 64 |
#define SD_RESOLVED_FROM_ZONE (UINT64_C(1) << 21) |
| 65 |
|
| 66 |
/* Output: Result was (at least partially) answered from trust anchor */ |
| 67 |
#define SD_RESOLVED_FROM_TRUST_ANCHOR (UINT64_C(1) << 22) |
| 68 |
|
| 69 |
/* Output: Result was (at least partially) answered from network */ |
| 70 |
#define SD_RESOLVED_FROM_NETWORK (UINT64_C(1) << 23) |
| 71 |
|
| 72 |
/* Input: Don't answer request with stale data */ |
| 73 |
#define SD_RESOLVED_NO_STALE (UINT64_C(1) << 24) |
| 74 |
|
| 75 |
/* Input: Allow single-label lookups to Internet DNS servers */ |
| 76 |
#define SD_RESOLVED_RELAX_SINGLE_LABEL \ |
| 77 |
(UINT64_C(1) << 25) |
| 78 |
|
| 79 |
/* Input: To differentiate between a probe and a continuous query. */ |
| 80 |
#define SD_RESOLVED_QUERY_CONTINUOUS \ |
| 81 |
(UINT64_C(1) << 26) |
| 82 |
|
| 83 |
/* Output: Result was answered by hook */ |
| 84 |
#define SD_RESOLVED_FROM_HOOK (UINT64_C(1) << 27) |
| 85 |
|
| 86 |
#define SD_RESOLVED_LLMNR (SD_RESOLVED_LLMNR_IPV4|SD_RESOLVED_LLMNR_IPV6) |
| 87 |
#define SD_RESOLVED_MDNS (SD_RESOLVED_MDNS_IPV4|SD_RESOLVED_MDNS_IPV6) |
| 88 |
#define SD_RESOLVED_PROTOCOLS_ALL (SD_RESOLVED_MDNS|SD_RESOLVED_LLMNR|SD_RESOLVED_DNS) |
| 89 |
|
| 90 |
#define SD_RESOLVED_FROM_MASK (SD_RESOLVED_FROM_CACHE|SD_RESOLVED_FROM_ZONE|SD_RESOLVED_FROM_TRUST_ANCHOR|SD_RESOLVED_FROM_NETWORK|SD_RESOLVED_FROM_HOOK) |
| 91 |
|
| 92 |
#define SD_RESOLVED_QUERY_TIMEOUT_USEC (120 * USEC_PER_SEC) |