/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-json.h"
+
#include "fd-util.h"
#include "fuzz.h"
#include "memory-util.h"
#include "memstream-util.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL, *copy = NULL;
#include "resolvectl.h"
#include "resolved-def.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
#include "resolved-util.h"
#include "socket-netlink.h"
#include "sort-util.h"
#include "bus-log-control-api.h"
#include "bus-message-util.h"
#include "bus-polkit.h"
+#include "bus-util.h"
#include "dns-domain.h"
#include "format-util.h"
#include "memory-util.h"
#include "path-util.h"
+#include "resolve-util.h"
#include "resolved-bus.h"
#include "resolved-def.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-dnssec.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
+#include "resolved-dns-stub.h"
#include "resolved-dns-synthesize.h"
+#include "resolved-dns-transaction.h"
+#include "resolved-dns-trust-anchor.h"
#include "resolved-dnssd-bus.h"
#include "resolved-dnssd.h"
+#include "resolved-link.h"
#include "resolved-link-bus.h"
+#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
#include "socket-netlink.h"
#include "stdio-util.h"
#pragma once
#include "bus-object.h"
-#include "resolved-manager.h"
+#include "macro.h"
+
+typedef struct DnsServer DnsServer;
+typedef struct Manager Manager;
extern const BusObjectImplementation manager_object;
#include "constants.h"
#include "creds-util.h"
#include "dns-domain.h"
+#include "dns-type.h"
#include "extract-word.h"
#include "hexdecoct.h"
#include "parse-util.h"
#include "proc-cmdline.h"
#include "resolved-conf.h"
#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-stub.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
#include "conf-parser.h"
+typedef struct Manager Manager;
+
typedef enum ResolveConfigSource {
RESOLVE_CONFIG_SOURCE_FILE,
RESOLVE_CONFIG_SOURCE_NETWORKD,
_RESOLVE_CONFIG_SOURCE_INVALID = -EINVAL,
} ResolveConfigSource;
-#include "resolved-dns-server.h"
-
int manager_parse_config_file(Manager *m);
const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
#include "random-util.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
+#include "resolved-dns-rr.h"
#include "string-util.h"
static DnsAnswerItem *dns_answer_item_free(DnsAnswerItem *item) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsAnswerItem DnsAnswerItem;
-
#include "macro.h"
#include "ordered-set.h"
-#include "resolved-dns-rr.h"
+
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
/* A simple array of resource records. We keep track of the originating ifindex for each RR where that makes
* sense, so that we can qualify A and AAAA RRs referring to a local link with the right ifindex.
DNS_ANSWER_SECTION_ADDITIONAL,
} DnsAnswerFlags;
-struct DnsAnswerItem {
+typedef struct DnsAnswerItem {
unsigned n_ref;
DnsResourceRecord *rr;
DnsResourceRecord *rrsig; /* Optionally, also store RRSIG RR that successfully validates this item */
int ifindex;
DnsAnswerFlags flags;
-};
+} DnsAnswerItem;
-struct DnsAnswer {
+typedef struct DnsAnswer {
unsigned n_ref;
OrderedSet *items;
-};
+} DnsAnswer;
DnsAnswer *dns_answer_new(size_t n);
DnsAnswer *dns_answer_ref(DnsAnswer *a);
#include "format-ifname.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-cache.h"
+#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
#include "string-util.h"
/* Never cache more than 4K entries. RFC 1536, Section 5 suggests to
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "sd-json.h"
+
#include "hashmap.h"
+#include "in-addr-util.h"
#include "list.h"
#include "prioq.h"
#include "resolve-util.h"
-#include "resolved-dns-dnssec.h"
#include "time-util.h"
+typedef enum DnsProtocol DnsProtocol;
+typedef enum DnssecResult DnssecResult;
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsPacket DnsPacket;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
+
typedef struct DnsCache {
Hashmap *by_key;
Prioq *by_expiry;
unsigned n_miss;
} DnsCache;
-#include "resolved-dns-answer.h"
-#include "resolved-dns-packet.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-rr.h"
-
void dns_cache_flush(DnsCache *c);
void dns_cache_prune(DnsCache *c);
#include "alloc-util.h"
#include "dns-domain.h"
+#include "dns-type.h"
#include "fd-util.h"
#include "fileio.h"
#include "hexdecoct.h"
#include "memory-util.h"
#include "memstream-util.h"
#include "openssl-util.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
#include "sort-util.h"
#include "string-table.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef enum DnssecResult DnssecResult;
-typedef enum DnssecVerdict DnssecVerdict;
+#include <errno.h>
+#include <stdbool.h>
+#include <stdint.h>
-#include "dns-domain.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-rr.h"
+#include "time-util.h"
-enum DnssecResult {
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
+
+typedef enum DnssecResult {
/* These six are returned by dnssec_verify_rrset() */
DNSSEC_VALIDATED,
DNSSEC_VALIDATED_WILDCARD, /* Validated via a wildcard RRSIG, further NSEC/NSEC3 checks necessary */
_DNSSEC_RESULT_MAX,
_DNSSEC_RESULT_INVALID = -EINVAL,
-};
+} DnssecResult;
-enum DnssecVerdict {
+typedef enum DnssecVerdict {
DNSSEC_SECURE,
DNSSEC_INSECURE,
DNSSEC_BOGUS,
_DNSSEC_VERDICT_MAX,
_DNSSEC_VERDICT_INVALID = -EINVAL,
-};
+} DnssecVerdict;
#define DNSSEC_CANONICAL_HOSTNAME_MAX (DNS_HOSTNAME_MAX + 2)
#include "escape.h"
#include "log.h"
#include "memory-util.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
#include "set.h"
#include "stdio-util.h"
#include "string-table.h"
#include "hashmap.h"
#include "in-addr-util.h"
#include "macro.h"
+#include "resolved-def.h"
+#include "resolved-dns-answer.h"
#include "sparse-endian.h"
-typedef struct DnsPacketHeader DnsPacketHeader;
+typedef struct DnsAnswer DnsAnswer;
typedef struct DnsPacket DnsPacket;
-
-#include "resolved-def.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-rr.h"
+typedef struct DnsQuestion DnsQuestion;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
typedef enum DnsProtocol {
DNS_PROTOCOL_DNS,
_DNS_PROTOCOL_INVALID = -EINVAL,
} DnsProtocol;
-struct DnsPacketHeader {
+typedef struct DnsPacketHeader {
uint16_t id;
be16_t flags;
be16_t qdcount;
be16_t ancount;
be16_t nscount;
be16_t arcount;
-} _packed_;
+} _packed_ DnsPacketHeader;
#define DNS_PACKET_HEADER_SIZE sizeof(DnsPacketHeader)
#define UDP4_PACKET_HEADER_SIZE (sizeof(struct iphdr) + sizeof(struct udphdr))
#include "glyph-util.h"
#include "hostname-util.h"
#include "local-addresses.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-stub.h"
#include "resolved-dns-synthesize.h"
+#include "resolved-dns-transaction.h"
#include "resolved-etc-hosts.h"
+#include "resolved-manager.h"
#include "resolved-timeouts.h"
#include "string-util.h"
return 0;
}
+
+uint64_t dns_query_reply_flags_make(DnsQuery *q) {
+ assert(q);
+
+ return SD_RESOLVED_FLAGS_MAKE(q->answer_protocol,
+ q->answer_family,
+ dns_query_fully_authenticated(q),
+ dns_query_fully_confidential(q)) |
+ (q->answer_query_flags & (SD_RESOLVED_FROM_MASK|SD_RESOLVED_SYNTHETIC));
+}
#include "sd-bus.h"
#include "sd-varlink.h"
+#include "in-addr-util.h"
+#include "list.h"
+#include "resolved-def.h"
+#include "resolved-dns-dnssec.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-transaction.h"
#include "set.h"
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsPacket DnsPacket;
typedef struct DnsQueryCandidate DnsQueryCandidate;
typedef struct DnsQuery DnsQuery;
+typedef struct DnsQuestion DnsQuestion;
+typedef struct DnsScope DnsScope;
+typedef struct DnsSearchDomain DnsSearchDomain;
+typedef struct DnsStream DnsStream;
typedef struct DnsStubListenerExtra DnsStubListenerExtra;
-
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-search-domain.h"
-#include "resolved-dns-transaction.h"
+typedef struct Manager Manager;
struct DnsQueryCandidate {
unsigned n_ref;
int validate_and_mangle_query_flags(Manager *manager, uint64_t *flags, const char *name, uint64_t ok);
-static inline uint64_t dns_query_reply_flags_make(DnsQuery *q) {
- assert(q);
-
- return SD_RESOLVED_FLAGS_MAKE(q->answer_protocol,
- q->answer_family,
- dns_query_fully_authenticated(q),
- dns_query_fully_confidential(q)) |
- (q->answer_query_flags & (SD_RESOLVED_FROM_MASK|SD_RESOLVED_SYNTHETIC));
-}
+uint64_t dns_query_reply_flags_make(DnsQuery *q);
#include "dns-type.h"
#include "log.h"
#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
#include "socket-util.h"
DnsQuestion *dns_question_new(size_t n) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct DnsQuestion DnsQuestion;
-typedef struct DnsQuestionItem DnsQuestionItem;
+#include <stdio.h>
-#include "macro.h"
-#include "resolved-dns-rr.h"
+#include "in-addr-util.h"
+#include "memory-util.h"
+
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
/* A simple array of resource keys */
DNS_QUESTION_WANTS_UNICAST_REPLY = 1 << 0, /* For mDNS: sender is willing to accept unicast replies */
} DnsQuestionFlags;
-struct DnsQuestionItem {
+typedef struct DnsQuestionItem {
DnsResourceKey *key;
DnsQuestionFlags flags;
-};
+} DnsQuestionItem;
-struct DnsQuestion {
+typedef struct DnsQuestion {
unsigned n_ref;
size_t n_keys, n_allocated;
DnsQuestionItem items[];
-};
+} DnsQuestion;
DnsQuestion *dns_question_new(size_t n);
DnsQuestion *dns_question_ref(DnsQuestion *q);
#include "af-list.h"
#include "alloc-util.h"
#include "dns-domain.h"
+#include "dns-type.h"
#include "errno-util.h"
#include "fd-util.h"
#include "hostname-util.h"
#include "missing_network.h"
#include "random-util.h"
#include "resolved-dnssd.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-synthesize.h"
+#include "resolved-dns-transaction.h"
#include "resolved-dns-zone.h"
+#include "resolved-link.h"
#include "resolved-llmnr.h"
+#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-timeouts.h"
#include "socket-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "sd-event.h"
+
+#include "dns-def.h"
#include "list.h"
#include "ratelimit.h"
-
-typedef struct DnsQueryCandidate DnsQueryCandidate;
-typedef struct DnsScope DnsScope;
-
+#include "resolve-util.h"
#include "resolved-dns-cache.h"
-#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
-#include "resolved-dns-query.h"
-#include "resolved-dns-search-domain.h"
-#include "resolved-dns-server.h"
-#include "resolved-dns-stream.h"
#include "resolved-dns-zone.h"
+#include "socket-util.h"
+
+typedef struct DnsQuery DnsQuery;
+typedef struct DnsQueryCandidate DnsQueryCandidate;
+typedef struct DnsQuestion DnsQuestion;
+typedef struct DnsSearchDomain DnsSearchDomain;
+typedef struct DnsServer DnsServer;
+typedef struct DnsStream DnsStream;
+typedef struct Link Link;
+typedef struct Manager Manager;
typedef enum DnsScopeMatch {
DNS_SCOPE_NO,
#include "sd-messages.h"
#include "alloc-util.h"
+#include "dns-domain.h"
#include "errno-util.h"
#include "fd-util.h"
#include "json-util.h"
#include "resolved-bus.h"
+#include "resolved-dns-cache.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stub.h"
+#include "resolved-link.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
#include "siphash24.h"
#include "in-addr-util.h"
#include "list.h"
#include "resolve-util.h"
+#include "resolved-conf.h"
+#include "resolved-dnstls.h"
#include "time-util.h"
typedef struct DnsScope DnsScope;
typedef struct Link Link;
typedef struct Manager Manager;
-#include "resolved-dnstls.h"
-
typedef enum DnsServerType {
DNS_SERVER_SYSTEM,
DNS_SERVER_FALLBACK,
_DNS_SERVER_TYPE_INVALID = -EINVAL,
} DnsServerType;
-#include "resolved-conf.h"
-
const char* dns_server_type_to_string(DnsServerType i) _const_;
DnsServerType dns_server_type_from_string(const char *s) _pure_;
#include "iovec-util.h"
#include "macro.h"
#include "missing_network.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-manager.h"
#include "sd-event.h"
+#include "list.h"
#include "ordered-set.h"
+#include "resolved-dnstls.h"
+#include "resolved-dns-packet.h"
#include "socket-util.h"
+typedef struct DnsPacket DnsPacket;
typedef struct DnsServer DnsServer;
typedef struct DnsStream DnsStream;
typedef struct DnsTransaction DnsTransaction;
typedef struct Manager Manager;
typedef struct DnsStubListenerExtra DnsStubListenerExtra;
-#include "resolved-dns-packet.h"
-#include "resolved-dnstls.h"
-
/* Various timeouts for establishing TCP connections. First the default timeout for that. */
#define DNS_STREAM_DEFAULT_TIMEOUT_USEC (10 * USEC_PER_SEC)
#include <netinet/tcp.h>
#include "capability-util.h"
+#include "dns-type.h"
#include "errno-util.h"
#include "fd-util.h"
+#include "log.h"
#include "missing_network.h"
#include "missing_socket.h"
+#include "resolve-util.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-stream.h"
#include "resolved-dns-stub.h"
+#include "resolved-dns-transaction.h"
+#include "resolved-manager.h"
#include "socket-netlink.h"
#include "socket-util.h"
#include "stdio-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "hash-funcs.h"
+#include "sd-event.h"
+
+#include "hashmap.h"
+#include "in-addr-util.h"
typedef struct DnsStubListenerExtra DnsStubListenerExtra;
+typedef struct Manager Manager;
typedef enum DnsStubListenerMode {
DNS_STUB_LISTENER_NO,
_DNS_STUB_LISTENER_MODE_INVALID = -EINVAL,
} DnsStubListenerMode;
-#include "resolved-manager.h"
-
struct DnsStubListenerExtra {
Manager *manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "dns-domain.h"
+#include "dns-type.h"
#include "env-util.h"
#include "hostname-util.h"
#include "local-addresses.h"
#include "missing_network.h"
+#include "resolved-def.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
#include "resolved-dns-synthesize.h"
+#include "resolved-manager.h"
+#include "socket-util.h"
int dns_synthesize_family(uint64_t flags) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-manager.h"
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum DnsProtocol DnsProtocol;
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsQuestion DnsQuestion;
+typedef struct Manager Manager;
int dns_synthesize_family(uint64_t flags);
DnsProtocol dns_synthesize_protocol(uint64_t flags);
#include "fd-util.h"
#include "glyph-util.h"
#include "random-util.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-cache.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-transaction.h"
#include "resolved-dnstls.h"
+#include "resolved-link.h"
#include "resolved-llmnr.h"
+#include "resolved-socket-graveyard.h"
#include "resolved-timeouts.h"
#include "string-table.h"
return dns_transaction_dnssec_is_live(t);
}
+DnsResourceKey* dns_transaction_key(DnsTransaction *t) {
+ assert(t);
+
+ /* Return the lookup key of this transaction. Either takes the lookup key from the bypass packet if
+ * we are a bypass transaction. Or take the configured key for regular transactions. */
+
+ if (t->key)
+ return t->key;
+
+ assert(t->bypass);
+
+ return dns_question_first_key(t->bypass->question);
+}
+
void dns_transaction_notify(DnsTransaction *t, DnsTransaction *source) {
assert(t);
assert(source);
#pragma once
#include "sd-event.h"
-#include "in-addr-util.h"
-
-typedef struct DnsTransaction DnsTransaction;
-typedef struct DnsTransactionFinder DnsTransactionFinder;
-typedef enum DnsTransactionState DnsTransactionState;
-typedef enum DnsTransactionSource DnsTransactionSource;
-#include "resolved-dns-answer.h"
+#include "in-addr-util.h"
+#include "list.h"
+#include "resolved-def.h"
#include "resolved-dns-dnssec.h"
-#include "resolved-dns-packet.h"
-#include "resolved-dns-question.h"
#include "resolved-dns-server.h"
+#include "set.h"
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsPacket DnsPacket;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsScope DnsScope;
+typedef struct DnsServer DnsServer;
+typedef struct DnsStream DnsStream;
+typedef struct DnsTransaction DnsTransaction;
-enum DnsTransactionState {
+typedef enum DnsTransactionState {
DNS_TRANSACTION_NULL,
DNS_TRANSACTION_PENDING,
DNS_TRANSACTION_VALIDATING,
DNS_TRANSACTION_STUB_LOOP,
_DNS_TRANSACTION_STATE_MAX,
_DNS_TRANSACTION_STATE_INVALID = -EINVAL,
-};
+} DnsTransactionState;
#define DNS_TRANSACTION_IS_LIVE(state) IN_SET((state), DNS_TRANSACTION_NULL, DNS_TRANSACTION_PENDING, DNS_TRANSACTION_VALIDATING)
-enum DnsTransactionSource {
+typedef enum DnsTransactionSource {
DNS_TRANSACTION_NETWORK,
DNS_TRANSACTION_CACHE,
DNS_TRANSACTION_ZONE,
DNS_TRANSACTION_TRUST_ANCHOR,
_DNS_TRANSACTION_SOURCE_MAX,
_DNS_TRANSACTION_SOURCE_INVALID = -EINVAL,
-};
+} DnsTransactionSource;
struct DnsTransaction {
DnsScope *scope;
int dns_transaction_validate_dnssec(DnsTransaction *t);
int dns_transaction_request_dnssec_keys(DnsTransaction *t);
-static inline DnsResourceKey *dns_transaction_key(DnsTransaction *t) {
- assert(t);
-
- /* Return the lookup key of this transaction. Either takes the lookup key from the bypass packet if
- * we are a bypass transaction. Or take the configured key for regular transactions. */
-
- if (t->key)
- return t->key;
-
- assert(t->bypass);
-
- return dns_question_first_key(t->bypass->question);
-}
+DnsResourceKey* dns_transaction_key(DnsTransaction *t);
static inline uint64_t dns_transaction_source_to_query_flags(DnsTransactionSource s) {
#include "log.h"
#include "nulstr-util.h"
#include "parse-util.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
+#include "resolved-dns-rr.h"
#include "resolved-dns-trust-anchor.h"
#include "set.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct DnsTrustAnchor DnsTrustAnchor;
-
#include "hashmap.h"
-#include "resolved-dns-answer.h"
-#include "resolved-dns-rr.h"
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
/* This contains a fixed database mapping domain names to DS or DNSKEY records. */
-struct DnsTrustAnchor {
+typedef struct DnsTrustAnchor {
Hashmap *positive_by_key;
Set *negative_by_name;
Set *revoked_by_rr;
-};
+} DnsTrustAnchor;
int dns_trust_anchor_load(DnsTrustAnchor *d);
void dns_trust_anchor_flush(DnsTrustAnchor *d);
#include "alloc-util.h"
#include "dns-domain.h"
#include "list.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-transaction.h"
#include "resolved-dns-zone.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
#pragma once
#include "hashmap.h"
+#include "list.h"
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
+typedef struct DnsScope DnsScope;
+typedef struct DnsTransaction DnsTransaction;
+typedef struct DnsZoneItem DnsZoneItem;
typedef struct DnsZone {
Hashmap *by_key;
Hashmap *by_name;
} DnsZone;
-typedef struct DnsZoneItem DnsZoneItem;
-typedef enum DnsZoneItemState DnsZoneItemState;
-
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-rr.h"
-#include "resolved-dns-transaction.h"
-
/* RFC 4795 Section 2.8. suggests a TTL of 30s by default */
#define LLMNR_DEFAULT_TTL (30)
/* RFC 6762 Section 10. suggests a TTL of 120s by default */
#define MDNS_DEFAULT_TTL (120)
-enum DnsZoneItemState {
+typedef enum DnsZoneItemState {
DNS_ZONE_ITEM_PROBING,
DNS_ZONE_ITEM_ESTABLISHED,
DNS_ZONE_ITEM_VERIFYING,
DNS_ZONE_ITEM_WITHDRAWN,
-};
+} DnsZoneItemState;
struct DnsZoneItem {
DnsScope *scope;
#include "alloc-util.h"
#include "bus-polkit.h"
+#include "resolved-dns-scope.h"
#include "resolved-dnssd-bus.h"
#include "resolved-dnssd.h"
#include "resolved-link.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "constants.h"
+#include "dns-domain.h"
#include "hexdecoct.h"
#include "path-util.h"
#include "resolved-conf.h"
#include "resolved-dns-rr.h"
+#include "resolved-dns-zone.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
#include "specifier.h"
#include "io-util.h"
#include "openssl-util.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-dnstls.h"
#include "resolved-manager.h"
#include <sys/types.h>
#include <unistd.h>
+#include "dns-domain.h"
#include "fd-util.h"
#include "fileio.h"
#include "hostname-util.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
#include "resolved-dns-synthesize.h"
#include "resolved-etc-hosts.h"
+#include "resolved-manager.h"
#include "socket-netlink.h"
#include "stat-util.h"
#include "string-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-manager.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-answer.h"
+#include "in-addr-util.h"
+#include "set.h"
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsQuestion DnsQuestion;
+typedef struct EtcHosts EtcHosts;
+typedef struct Manager Manager;
+
+typedef struct EtcHosts {
+ Hashmap *by_address;
+ Hashmap *by_name;
+ Set *no_address;
+} EtcHosts;
typedef struct EtcHostsItemByAddress {
struct in_addr_data address;
#include <stddef.h>
#include "conf-parser.h"
#include "resolved-conf.h"
+#include "resolved-dns-server.h"
#include "resolved-manager.h"
%}
struct ConfigPerfItem;
#include "bus-get-properties.h"
#include "bus-message-util.h"
#include "bus-polkit.h"
+#include "dns-domain.h"
#include "log-link.h"
#include "parse-util.h"
#include "resolve-util.h"
#include "resolved-bus.h"
+#include "resolved-def.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
+#include "resolved-link.h"
#include "resolved-link-bus.h"
#include "resolved-llmnr.h"
#include "resolved-mdns.h"
#include "sd-bus.h"
-#include "bus-util.h"
-#include "resolved-link.h"
+#include "bus-object.h"
+
+typedef struct Link Link;
extern const BusObjectImplementation link_object;
#include "sd-network.h"
#include "alloc-util.h"
+#include "dns-domain.h"
#include "env-file.h"
#include "fd-util.h"
#include "fileio.h"
#include "mkdir.h"
#include "netif-util.h"
#include "parse-util.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-link.h"
#include "resolved-llmnr.h"
#include "resolved-mdns.h"
#include "sd-netlink.h"
#include "in-addr-util.h"
+#include "list.h"
#include "network-util.h"
#include "ratelimit.h"
#include "resolve-util.h"
+typedef struct DnsResourceRecord DnsResourceRecord;
+typedef struct DnsScope DnsScope;
+typedef struct DnsSearchDomain DnsSearchDomain;
+typedef struct DnsServer DnsServer;
typedef struct Link Link;
typedef struct LinkAddress LinkAddress;
-
-#include "resolved-dns-rr.h"
-#include "resolved-dns-scope.h"
-#include "resolved-dns-search-domain.h"
-#include "resolved-dns-server.h"
+typedef struct Manager Manager;
#define LINK_SEARCH_DOMAINS_MAX 256
#define LINK_DNS_SERVERS_MAX 256
#include "errno-util.h"
#include "fd-util.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-transaction.h"
+#include "resolved-link.h"
#include "resolved-llmnr.h"
#include "resolved-manager.h"
#include "random-util.h"
#include "resolved-bus.h"
#include "resolved-conf.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-stub.h"
+#include "resolved-dns-transaction.h"
#include "resolved-dnssd.h"
#include "resolved-etc-hosts.h"
+#include "resolved-link.h"
#include "resolved-llmnr.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-resolv-conf.h"
+#include "resolved-socket-graveyard.h"
#include "resolved-util.h"
#include "resolved-varlink.h"
#include "socket-util.h"
#include <sys/stat.h>
+#include "sd-bus.h"
#include "sd-event.h"
#include "sd-netlink.h"
#include "sd-network.h"
#include "list.h"
#include "ordered-set.h"
#include "resolve-util.h"
-
-typedef struct Manager Manager;
-
-#include "resolved-dns-query.h"
-#include "resolved-dns-search-domain.h"
+#include "resolved-dns-dnssec.h"
#include "resolved-dns-stream.h"
#include "resolved-dns-stub.h"
#include "resolved-dns-trust-anchor.h"
-#include "resolved-link.h"
-#include "resolved-socket-graveyard.h"
+#include "resolved-dnstls.h"
+#include "resolved-etc-hosts.h"
+
+typedef enum DnsServerType DnsServerType;
+
+typedef struct DnsQuery DnsQuery;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsSearchDomain DnsSearchDomain;
+typedef struct DnsScope DnsScope;
+typedef struct DnsServer DnsServer;
+typedef struct Link Link;
+typedef struct LinkAddress LinkAddress;
+typedef struct SocketGraveyard SocketGraveyard;
#define MANAGER_SEARCH_DOMAINS_MAX 256
#define MANAGER_DNS_SERVERS_MAX 256
-typedef struct EtcHosts {
- Hashmap *by_address;
- Hashmap *by_name;
- Set *no_address;
-} EtcHosts;
-
-struct Manager {
+typedef struct Manager {
sd_event *event;
ResolveSupport llmnr_support;
size_t n_socket_graveyard;
struct sigrtmin18_info sigrtmin18_info;
-};
+} Manager;
/* Manager */
#include <arpa/inet.h>
#include "alloc-util.h"
+#include "dns-domain.h"
#include "fd-util.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-transaction.h"
+#include "resolved-link.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "sort-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-manager.h"
+typedef struct Manager Manager;
#define MDNS_PORT 5353
#define MDNS_ANNOUNCE_DELAY (1 * USEC_PER_SEC)
#include "ordered-set.h"
#include "path-util.h"
#include "resolved-conf.h"
+#include "resolved-dns-cache.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
+#include "resolved-dns-stub.h"
+#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
#include "stat-util.h"
#include "string-table.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-manager.h"
+#include <errno.h>
+
+#include "macro.h"
+
+typedef struct Manager Manager;
int manager_check_resolv_conf(const Manager *m);
int manager_read_resolv_conf(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "resolved-manager.h"
#include "resolved-socket-graveyard.h"
#define SOCKET_GRAVEYARD_USEC (5 * USEC_PER_SEC)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct SocketGraveyard SocketGraveyard;
+#include "sd-event.h"
+
+#include "list.h"
+#include "time-util.h"
-#include "resolved-manager.h"
+typedef struct Manager Manager;
+typedef struct SocketGraveyard SocketGraveyard;
struct SocketGraveyard {
Manager *manager;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-polkit.h"
+#include "dns-domain.h"
+#include "dns-type.h"
#include "glyph-util.h"
#include "in-addr-util.h"
#include "json-util.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-dnssec.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
+#include "resolved-dns-rr.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
+#include "resolved-dns-server.h"
#include "resolved-dns-synthesize.h"
+#include "resolved-dns-transaction.h"
+#include "resolved-link.h"
+#include "resolved-manager.h"
#include "resolved-varlink.h"
#include "socket-netlink.h"
#include "varlink-io.systemd.Resolve.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-manager.h"
+typedef struct Manager Manager;
int manager_varlink_init(Manager *m);
void manager_varlink_done(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-type.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "list.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-type.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "log.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "log.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-query.h"
+#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-scope.h"
+#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
+#include "resolved-dns-transaction.h"
#include "resolved-link.h"
#include "resolved-manager.h"
#include "tests.h"
#include "log.h"
#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-synthesize.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-type.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-zone.h"
#include "alloc-util.h"
#include "hexdecoct.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-rr.h"
#include "string-util.h"
#include "sd-daemon.h"
+#include "dns-type.h"
#include "fd-util.h"
#include "iovec-util.h"
#include "log.h"
#include "main-func.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-question.h"
#include "resolved-manager.h"
#include "socket-netlink.h"
#include "socket-util.h"
#include <linux/if.h>
#include "netlink-internal.h"
+#include "resolved-dns-packet.h"
+#include "resolved-dns-scope.h"
+#include "resolved-dns-server.h"
#include "resolved-link.h"
#include "resolved-manager.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-json.h"
+
#include "hexdecoct.h"
#include "log.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
+#include "resolved-dns-rr.h"
#include "tests.h"
TEST(dns_packet_new) {