Split out of #37344.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <errno.h>
#include <sys/socket.h>
#include "dns-type.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-
-#include "macro.h"
+#include "forward.h"
/* DNS record types, taken from
* http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "fuzz.h"
-#include "memory-util.h"
#include "resolved-dns-packet.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
#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"
+#include "string-util.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL, *copy = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
-#include <net/if.h>
+#include <stdlib.h>
#include "alloc-util.h"
#include "build.h"
-#include "constants.h"
-#include "dns-domain.h"
#include "extract-word.h"
#include "fileio.h"
#include "log.h"
-#include "parse-util.h"
#include "pretty-print.h"
#include "resolvconf-compat.h"
#include "resolvectl.h"
-#include "resolved-def.h"
#include "string-util.h"
#include "strv.h"
-#include "terminal-util.h"
static int resolvconf_help(void) {
_cleanup_free_ char *link = NULL;
#include "sd-bus.h"
#include "sd-daemon.h"
+#include "sd-event.h"
#include "sd-json.h"
#include "sd-netlink.h"
#include "sd-varlink.h"
#include "bus-util.h"
#include "dns-domain.h"
#include "errno-list.h"
+#include "errno-util.h"
#include "escape.h"
#include "format-ifname.h"
#include "format-table.h"
#include "parse-util.h"
#include "polkit-agent.h"
#include "pretty-print.h"
-#include "process-util.h"
#include "resolvconf-compat.h"
#include "resolve-util.h"
#include "resolvectl.h"
#include "sort-util.h"
#include "stdio-util.h"
#include "string-table.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
+#include "time-util.h"
#include "utf8.h"
#include "varlink-util.h"
#include "verb-log-control.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <in-addr-util.h>
-#include <stdbool.h>
-#include <sys/types.h>
+#include "forward.h"
typedef enum ExecutionMode {
MODE_RESOLVE_HOST,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-locator.h"
#include "bus-log-control-api.h"
#include "bus-message-util.h"
+#include "bus-object.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-dns-stub.h"
#include "resolved-dns-synthesize.h"
#include "resolved-dns-transaction.h"
-#include "resolved-dns-trust-anchor.h"
#include "resolved-dnssd.h"
#include "resolved-dnssd-bus.h"
#include "resolved-link.h"
#include "resolved-link-bus.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
+#include "set.h"
#include "socket-netlink.h"
-#include "stdio-util.h"
-#include "strv.h"
-#include "syslog-util.h"
-#include "user-util.h"
+#include "string-util.h"
#include "utf8.h"
BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_resolve_support, resolve_support, ResolveSupport);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "bus-object.h"
-#include "macro.h"
-
-typedef struct DnsServer DnsServer;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
extern const BusObjectImplementation manager_object;
#include "alloc-util.h"
#include "conf-parser.h"
-#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 "ordered-set.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 "set.h"
#include "socket-netlink.h"
-#include "specifier.h"
-#include "string-table.h"
#include "string-util.h"
-#include "strv.h"
-#include "utf8.h"
DEFINE_CONFIG_PARSE_ENUM(config_parse_dns_stub_listener_mode, dns_stub_listener_mode, DnsStubListenerMode);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef enum ResolveConfigSource {
RESOLVE_CONFIG_SOURCE_FILE,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <inttypes.h>
-
+#include "resolved-forward.h"
#include "time-util.h"
/* Input + Output: The various protocols we can use */
#include "log.h"
#include "random-util.h"
#include "resolved-dns-answer.h"
-#include "resolved-dns-dnssec.h"
#include "resolved-dns-rr.h"
+#include "siphash24.h"
#include "string-util.h"
static DnsAnswerItem *dns_answer_item_free(DnsAnswerItem *item) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "macro.h"
#include "ordered-set.h"
-
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
+#include "resolved-forward.h"
/* 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.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
+#include "sd-json.h"
#include "af-list.h"
#include "alloc-util.h"
+#include "bitmap.h"
#include "dns-domain.h"
#include "format-ifname.h"
+#include "log.h"
+#include "prioq.h"
+#include "resolve-util.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"
+#include "time-util.h"
/* Never cache more than 4K entries. RFC 1536, Section 5 suggests to
* leave DNS caches unbounded, but that's crazy. */
/* 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 "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;
+#include "resolved-forward.h"
typedef struct DnsCache {
Hashmap *by_key;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
+#include "alloc-util.h"
#include "bus-get-properties.h"
+#include "bus-object.h"
+#include "hashmap.h"
#include "resolved-bus.h"
#include "resolved-dns-delegate.h"
#include "resolved-dns-delegate-bus.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct BusObjectImplementation BusObjectImplementation;
-typedef struct DnsDelegate DnsDelegate;
+#include "resolved-forward.h"
extern const BusObjectImplementation dns_delegate_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "alloc-util.h"
#include "conf-files.h"
+#include "conf-parser.h"
#include "constants.h"
#include "dns-domain.h"
+#include "extract-word.h"
+#include "hashmap.h"
#include "in-addr-util.h"
+#include "log.h"
#include "path-util.h"
#include "resolved-dns-delegate.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-server.h"
#include "resolved-manager.h"
#include "socket-netlink.h"
+#include "string-util.h"
#include "strv.h"
#define DNS_DELEGATES_MAX 4096U
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
#include "list.h"
-
-typedef struct DnsDelegate DnsDelegate;
-typedef struct DnsScope DnsScope;
-typedef struct DnsSearchDomain DnsSearchDomain;
-typedef struct DnsServer DnsServer;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
#define DELEGATE_SEARCH_DOMAINS_MAX 256
#define DELEGATE_DNS_SERVERS_MAX 256
/* A DnsDelegate object is used to manage additional, explicitly configured unicast DNS lookup scopes,
* independent from any network link and from the global scope. */
-struct DnsDelegate {
+typedef struct DnsDelegate {
Manager *manager;
char *id;
DnsScope *scope;
LIST_FIELDS(DnsDelegate, delegates);
-};
+} DnsDelegate;
int dns_delegate_new(Manager *m, const char *id, DnsDelegate **ret);
DnsDelegate *dns_delegate_free(DnsDelegate *d);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "bitmap.h"
#include "dns-domain.h"
#include "dns-type.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "hexdecoct.h"
#include "log.h"
#include "memory-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"
+#include "string-util.h"
+#include "time-util.h"
#if HAVE_OPENSSL && OPENSSL_VERSION_MAJOR >= 3
DISABLE_WARNING_DEPRECATED_DECLARATIONS;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-#include <stdbool.h>
-#include <stdint.h>
-
-#include "time-util.h"
-
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
+#include "resolved-forward.h"
typedef enum DnssecResult {
/* These six are returned by dnssec_verify_rrset() */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
+#include "bitmap.h"
#include "dns-domain.h"
#include "escape.h"
#include "log.h"
#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "set.h"
+#include "siphash24.h"
#include "stdio-util.h"
#include "string-table.h"
-#include "strv.h"
+#include "string-util.h"
+#include "time-util.h"
#include "unaligned.h"
#include "utf8.h"
#include <netinet/ip6.h>
#include <netinet/udp.h>
-#include "hashmap.h"
#include "in-addr-util.h"
-#include "macro.h"
+#include "memory-util.h"
#include "resolved-def.h"
-#include "resolved-dns-answer.h"
+#include "resolved-forward.h"
#include "sparse-endian.h"
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsPacket DnsPacket;
-typedef struct DnsQuestion DnsQuestion;
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
-
typedef enum DnsProtocol {
DNS_PROTOCOL_DNS,
DNS_PROTOCOL_MDNS,
/* With EDNS0 we can use larger packets, default to 1232, which is what is commonly used */
#define DNS_PACKET_UNICAST_SIZE_LARGE_MAX 1232u
-struct DnsPacket {
+typedef struct DnsPacket {
unsigned n_ref;
DnsProtocol protocol;
size_t size, allocated, rindex, max_size, fragsize;
bool canonical_form;
/* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
-};
+} DnsPacket;
static inline uint8_t* DNS_PACKET_DATA(const DnsPacket *p) {
if (_unlikely_(!p))
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+#include "sd-varlink.h"
+
#include "alloc-util.h"
#include "dns-domain.h"
#include "dns-type.h"
#include "event-util.h"
#include "glyph-util.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "log.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-query.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 "set.h"
#include "string-util.h"
#define QUERIES_MAX 2048
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#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;
-typedef struct Manager Manager;
-
-struct DnsQueryCandidate {
+#include "resolved-forward.h"
+
+typedef struct DnsQueryCandidate {
unsigned n_ref;
int error_code;
LIST_FIELDS(DnsQueryCandidate, candidates_by_query);
LIST_FIELDS(DnsQueryCandidate, candidates_by_scope);
-};
+} DnsQueryCandidate;
-struct DnsQuery {
+typedef struct DnsQuery {
Manager *manager;
/* The question, formatted in IDNA for use on classic DNS, and as UTF8 for use in LLMNR or mDNS. Note
LIST_FIELDS(DnsQuery, auxiliary_queries);
/* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
-};
+} DnsQuery;
enum {
DNS_QUERY_MATCH,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdio.h>
+
#include "alloc-util.h"
#include "dns-domain.h"
#include "dns-type.h"
-#include "log.h"
#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "socket-util.h"
+#include "string-util.h"
DnsQuestion *dns_question_new(size_t n) {
DnsQuestion *q;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdio.h>
-
-#include "in-addr-util.h"
-#include "memory-util.h"
-
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
+#include "resolved-forward.h"
/* A simple array of resource keys */
#include <math.h>
#include "alloc-util.h"
+#include "bitmap.h"
#include "dns-domain.h"
#include "dns-type.h"
#include "escape.h"
+#include "hash-funcs.h"
#include "hexdecoct.h"
#include "json-util.h"
-#include "log.h"
#include "memory-util.h"
+#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
+#include "siphash24.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
+#include "time-util.h"
#include "unaligned.h"
DnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
#include <netinet/in.h>
-#include "sd-json.h"
-
-#include "bitmap.h"
#include "dns-def.h"
#include "dns-type.h"
-#include "hashmap.h"
-#include "in-addr-util.h"
#include "list.h"
-#include "string-util.h"
-#include "time-util.h"
-
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
-typedef struct DnsTxtItem DnsTxtItem;
-typedef struct DnsSvcParam DnsSvcParam;
+#include "resolved-forward.h"
/* DNSKEY RR flags */
#define DNSKEY_FLAG_SEP (UINT16_C(1) << 0)
_NSEC3_ALGORITHM_MAX_DEFINED
};
-struct DnsResourceKey {
+typedef struct DnsResourceKey {
unsigned n_ref; /* (unsigned -1) for const keys, see below */
uint16_t class, type;
char *_name; /* don't access directly, use dns_resource_key_name()! */
-};
+} DnsResourceKey;
/* Creates a temporary resource key. This is only useful to quickly
* look up something, without allocating a full DnsResourceKey object
._name = (char*) n, \
})
-struct DnsTxtItem {
+typedef struct DnsTxtItem {
size_t length;
LIST_FIELDS(DnsTxtItem, items);
uint8_t data[];
-};
+} DnsTxtItem;
-struct DnsSvcParam {
+typedef struct DnsSvcParam {
uint16_t key;
size_t length;
LIST_FIELDS(DnsSvcParam, params);
DECLARE_FLEX_ARRAY(struct in_addr, value_in_addr);
DECLARE_FLEX_ARRAY(struct in6_addr, value_in6_addr);
};
-};
+} DnsSvcParam;
-struct DnsResourceRecord {
+typedef struct DnsResourceRecord {
unsigned n_ref;
uint32_t ttl;
usec_t expiry; /* RRSIG signature expiry */
};
/* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
-};
+} DnsResourceRecord;
/* We use uint8_t for label counts above, and UINT8_MAX/-1 has special meaning. */
assert_cc(DNS_N_LABELS_MAX < UINT8_MAX);
#include <netinet/tcp.h>
+#include "sd-event.h"
+#include "sd-json.h"
+
#include "af-list.h"
#include "alloc-util.h"
#include "dns-domain.h"
#include "errno-util.h"
#include "fd-util.h"
#include "hostname-util.h"
-#include "missing_network.h"
+#include "log.h"
#include "random-util.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-delegate.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-timeouts.h"
+#include "set.h"
#include "socket-util.h"
#include "string-table.h"
-#include "strv.h"
#define MULTICAST_RATELIMIT_INTERVAL_USEC (1*USEC_PER_SEC)
#define MULTICAST_RATELIMIT_BURST 1000
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
#include "dns-def.h"
+#include "forward.h"
#include "list.h"
#include "ratelimit.h"
#include "resolve-util.h"
#include "resolved-dns-cache.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-zone.h"
-#include "socket-util.h"
-
-typedef struct DnsDelegate DnsDelegate;
-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;
+#include "resolved-forward.h"
typedef enum DnsScopeMatch {
DNS_SCOPE_NO,
_DNS_SCOPE_ORIGIN_INVALID = -EINVAL,
} DnsScopeOrigin;
-struct DnsScope {
+typedef struct DnsScope {
Manager *manager;
DnsScopeOrigin origin;
LIST_FIELDS(DnsScope, scopes);
bool announced;
-};
+} DnsScope;
int dns_scope_new(Manager *m, DnsScope **ret, DnsScopeOrigin origin, Link *link, DnsDelegate *delegate, DnsProtocol protocol, int family);
DnsScope* dns_scope_free(DnsScope *s);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
-
#include "list.h"
-#include "macro.h"
-#include "memory-util.h"
-
-typedef struct DnsDelegate DnsDelegate;
-typedef struct DnsSearchDomain DnsSearchDomain;
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef enum DnsSearchDomainType {
DNS_SEARCH_DOMAIN_SYSTEM,
DNS_SEARCH_DOMAIN_DELEGATE,
} DnsSearchDomainType;
-struct DnsSearchDomain {
+typedef struct DnsSearchDomain {
Manager *manager;
unsigned n_ref;
bool linked:1;
LIST_FIELDS(DnsSearchDomain, domains);
-};
+} DnsSearchDomain;
int dns_search_domain_new(
Manager *m,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if_arp.h>
-
+#include "sd-event.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "dns-domain.h"
#include "errno-util.h"
+#include "extract-word.h"
#include "fd-util.h"
+#include "hash-funcs.h"
#include "json-util.h"
#include "resolved-bus.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-link.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
#include "socket-util.h"
#include "string-table.h"
#include "string-util.h"
+#include "time-util.h"
/* The amount of time to wait before retrying with a full feature set */
#define DNS_SERVER_FEATURE_GRACE_PERIOD_MAX_USEC (6 * USEC_PER_HOUR)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
-
+#include "forward.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 DnsDelegate DnsDelegate;
-typedef struct DnsPacket DnsPacket;
-typedef struct DnsScope DnsScope;
-typedef struct DnsServer DnsServer;
-typedef struct DnsStream DnsStream;
-typedef struct Link Link;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef enum DnsServerType {
DNS_SERVER_SYSTEM,
const char* dns_server_feature_level_to_string(DnsServerFeatureLevel i) _const_;
DnsServerFeatureLevel dns_server_feature_level_from_string(const char *s) _pure_;
-struct DnsServer {
+typedef struct DnsServer {
Manager *manager;
unsigned n_ref;
/* Tri-state to indicate if the DNS server is accessible. */
int accessible;
-};
+} DnsServer;
int dns_server_new(
Manager *m,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/if_arp.h>
-#include <netinet/tcp.h>
#include <unistd.h>
+#include "sd-event.h"
+
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "iovec-util.h"
-#include "macro.h"
+#include "log.h"
#include "missing_network.h"
+#include "ordered-set.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-manager.h"
+#include "set.h"
+#include "time-util.h"
#define DNS_STREAMS_MAX 128
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
+#include "forward.h"
#include "list.h"
-#include "ordered-set.h"
#include "resolved-dns-packet.h"
#include "resolved-dnstls.h"
+#include "resolved-forward.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 "sparse-endian.h"
+#include "time-util.h"
/* Various timeouts for establishing TCP connections. First the default timeout for that. */
#define DNS_STREAM_DEFAULT_TIMEOUT_USEC (10 * USEC_PER_SEC)
* 3. The DNS stub logic when accepting a TCP-based lookup
*/
-struct DnsStream {
+typedef struct DnsStream {
Manager *manager;
unsigned n_ref;
DnsStubListenerExtra *stub_listener_extra;
LIST_FIELDS(DnsStream, streams);
-};
+} DnsStream;
int dns_stream_new(
Manager *m,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if_arp.h>
#include <netinet/tcp.h>
+#include "sd-event.h"
+#include "sd-id128.h"
+
#include "alloc-util.h"
#include "capability-util.h"
#include "dns-type.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-stub.h"
#include "resolved-dns-transaction.h"
#include "resolved-manager.h"
-#include "socket-netlink.h"
+#include "set.h"
+#include "siphash24.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "string-table.h"
+#include "string-util.h"
+#include "time-util.h"
/* The MTU of the loopback device is 64K on Linux, advertise that as maximum datagram size, but subtract the Ethernet,
* IP and UDP header sizes */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
-#include "hashmap.h"
#include "in-addr-util.h"
-
-typedef struct DnsStubListenerExtra DnsStubListenerExtra;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef enum DnsStubListenerMode {
DNS_STUB_LISTENER_NO,
_DNS_STUB_LISTENER_MODE_INVALID = -EINVAL,
} DnsStubListenerMode;
-struct DnsStubListenerExtra {
+typedef struct DnsStubListenerExtra {
Manager *manager;
DnsStubListenerMode mode;
sd_event_source *tcp_event_source;
Hashmap *queries_by_packet;
-};
+} DnsStubListenerExtra;
extern const struct hash_ops dns_stub_listener_extra_hash_ops;
#include "env-util.h"
#include "hostname-util.h"
#include "local-addresses.h"
+#include "log.h"
#include "missing_network.h"
#include "resolved-def.h"
#include "resolved-dns-answer.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-
-typedef enum DnsProtocol DnsProtocol;
-
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsQuestion DnsQuestion;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
int dns_synthesize_family(uint64_t flags);
DnsProtocol dns_synthesize_protocol(uint64_t flags);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-event.h"
#include "sd-messages.h"
#include "af-list.h"
#include "errno-util.h"
#include "fd-util.h"
#include "glyph-util.h"
+#include "log.h"
#include "random-util.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-cache.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-server.h"
+#include "resolved-dns-stream.h"
#include "resolved-dns-transaction.h"
#include "resolved-dnstls.h"
#include "resolved-link.h"
#include "resolved-llmnr.h"
+#include "resolved-manager.h"
#include "resolved-socket-graveyard.h"
#include "resolved-timeouts.h"
+#include "set.h"
#include "string-table.h"
+#include "string-util.h"
#define TRANSACTIONS_MAX 4096
assert(t);
assert(error != 0);
- t->answer_errno = abs(error);
+ t->answer_errno = ABS(error);
dns_transaction_complete(t, DNS_TRANSACTION_ERRNO);
}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
-#include "in-addr-util.h"
#include "list.h"
#include "resolved-def.h"
#include "resolved-dns-dnssec.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;
+#include "resolved-forward.h"
typedef enum DnsTransactionState {
DNS_TRANSACTION_NULL,
_DNS_TRANSACTION_SOURCE_INVALID = -EINVAL,
} DnsTransactionSource;
-struct DnsTransaction {
+typedef struct DnsTransaction {
DnsScope *scope;
DnsResourceKey *key; /* For regular lookups the RR key to look for */
LIST_FIELDS(DnsTransaction, transactions_by_key);
/* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
-};
+} DnsTransaction;
int dns_transaction_new(DnsTransaction **ret, DnsScope *s, DnsResourceKey *key, DnsPacket *bypass, uint64_t flags);
DnsTransaction* dns_transaction_free(DnsTransaction *t);
#include "conf-files.h"
#include "constants.h"
#include "dns-domain.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "hexdecoct.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "hashmap.h"
-
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsResourceKey DnsResourceKey;
-typedef struct DnsResourceRecord DnsResourceRecord;
+#include "resolved-forward.h"
/* This contains a fixed database mapping domain names to DS or DNSKEY records. */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdio.h>
+
#include "alloc-util.h"
#include "dns-domain.h"
#include "list.h"
+#include "log.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
#include "resolved-dns-zone.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
+#include "set.h"
#include "string-util.h"
/* Never allow more than 1K entries */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#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;
+#include "resolved-forward.h"
typedef struct DnsZone {
Hashmap *by_key;
DNS_ZONE_ITEM_WITHDRAWN,
} DnsZoneItemState;
-struct DnsZoneItem {
+typedef struct DnsZoneItem {
DnsScope *scope;
DnsResourceRecord *rr;
LIST_FIELDS(DnsZoneItem, by_name);
DnsTransaction *probe_transaction;
-};
+} DnsZoneItem;
void dns_zone_flush(DnsZone *z);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
+#include "bus-object.h"
#include "bus-polkit.h"
+#include "hashmap.h"
+#include "log.h"
#include "resolved-dns-scope.h"
#include "resolved-dnssd.h"
#include "resolved-dnssd-bus.h"
#include "resolved-link.h"
#include "resolved-manager.h"
#include "strv.h"
-#include "user-util.h"
int bus_dnssd_method_unregister(sd_bus_message *message, void *userdata, sd_bus_error *error) {
DnssdService *s = ASSERT_PTR(userdata);
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
+#include "forward.h"
extern const BusObjectImplementation dnssd_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "constants.h"
#include "dns-domain.h"
+#include "extract-word.h"
+#include "hashmap.h"
#include "hexdecoct.h"
#include "path-util.h"
#include "resolved-conf.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
#include "specifier.h"
+#include "string-util.h"
#include "strv.h"
#include "utf8.h"
#include "list.h"
#include "resolved-conf.h"
-
-typedef struct DnssdService DnssdService;
-typedef struct DnssdTxtData DnssdTxtData;
-
-typedef struct Manager Manager;
-typedef struct DnsResourceRecord DnsResourceRecord;
-typedef struct DnsTxtItem DnsTxtItem;
+#include "resolved-forward.h"
enum {
DNS_TXT_ITEM_TEXT,
DNS_TXT_ITEM_DATA,
};
-struct DnssdTxtData {
+typedef struct DnssdTxtData {
DnsResourceRecord *rr;
LIST_HEAD(DnsTxtItem, txts);
LIST_FIELDS(DnssdTxtData, items);
-};
+} DnssdTxtData;
-struct DnssdService {
+typedef struct DnssdService {
char *path;
char *id;
char *name_template;
bool withdrawn:1;
uid_t originator;
-};
+} DnssdService;
DnssdService *dnssd_service_free(DnssdService *service);
DnssdTxtData *dnssd_txtdata_free(DnssdTxtData *txt_data);
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/x509v3.h>
+#include <sys/epoll.h>
#include "alloc-util.h"
-#include "io-util.h"
#include "openssl-util.h"
+#include "log.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-dnstls.h"
#endif
#include <openssl/ssl.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <sys/uio.h>
-typedef struct DnsServer DnsServer;
-typedef struct DnsStream DnsStream;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef struct DnsTlsManagerData {
SSL_CTX *ctx;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
+#include "sd-event.h"
#include "alloc-util.h"
#include "dns-domain.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "hostname-util.h"
+#include "log.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 "set.h"
#include "socket-netlink.h"
#include "stat-util.h"
#include "string-util.h"
-#include "strv.h"
#include "time-util.h"
/* Recheck /etc/hosts at most once every 2s */
#pragma once
#include "in-addr-util.h"
-#include "set.h"
-
-typedef struct DnsAnswer DnsAnswer;
-typedef struct DnsQuestion DnsQuestion;
-typedef struct EtcHosts EtcHosts;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
typedef struct EtcHosts {
Hashmap *by_address;
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "conf-parser-forward.h" /* IWYU pragma: export */
+#include "forward.h" /* IWYU pragma: export */
+
+typedef enum DnsAnswerFlags DnsAnswerFlags;
+typedef enum DnsCacheMode DnsCacheMode;
+typedef enum DnsProtocol DnsProtocol;
+typedef enum DnssecResult DnssecResult;
+typedef enum DnssecVerdict DnssecVerdict;
+typedef enum DnsScopeOrigin DnsScopeOrigin;
+typedef enum DnsTransactionState DnsTransactionState;
+typedef enum ResolveConfigSource ResolveConfigSource;
+
+typedef struct DnsAnswer DnsAnswer;
+typedef struct DnsDelegate DnsDelegate;
+typedef struct DnsPacket DnsPacket;
+typedef struct DnsQuery DnsQuery;
+typedef struct DnsQueryCandidate DnsQueryCandidate;
+typedef struct DnsQuestion DnsQuestion;
+typedef struct DnsResourceKey DnsResourceKey;
+typedef struct DnsResourceRecord DnsResourceRecord;
+typedef struct DnsScope DnsScope;
+typedef struct DnssdService DnssdService;
+typedef struct DnssdTxtData DnssdTxtData;
+typedef struct DnsSearchDomain DnsSearchDomain;
+typedef struct DnsServer DnsServer;
+typedef struct DnsStream DnsStream;
+typedef struct DnsStubListenerExtra DnsStubListenerExtra;
+typedef struct DnsSvcParam DnsSvcParam;
+typedef struct DnsTransaction DnsTransaction;
+typedef struct DnsTxtItem DnsTxtItem;
+typedef struct DnsZoneItem DnsZoneItem;
+typedef struct Link Link;
+typedef struct LinkAddress LinkAddress;
+typedef struct Manager Manager;
+typedef struct SocketGraveyard SocketGraveyard;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/capability.h>
+
+#include "sd-bus.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-message-util.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "dns-domain.h"
#include "log-link.h"
#include "resolved-link.h"
#include "resolved-link-bus.h"
#include "resolved-llmnr.h"
+#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-resolv-conf.h"
+#include "set.h"
#include "socket-netlink.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
-#include "user-util.h"
static BUS_DEFINE_PROPERTY_GET(property_get_dnssec_supported, "b", Link, link_dnssec_supported);
static BUS_DEFINE_PROPERTY_GET2(property_get_dnssec_mode, "s", Link, link_get_dnssec_mode, dnssec_mode_to_string);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-
-typedef struct Link Link;
+#include "resolved-forward.h"
extern const BusObjectImplementation link_object;
#include <linux/if.h>
#include <unistd.h>
+#include "sd-netlink.h"
#include "sd-network.h"
#include "alloc-util.h"
#include "dns-domain.h"
#include "env-file.h"
+#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "resolved-dns-server.h"
#include "resolved-link.h"
#include "resolved-llmnr.h"
+#include "resolved-manager.h"
#include "resolved-mdns.h"
+#include "set.h"
#include "socket-netlink.h"
#include "stat-util.h"
#include "string-util.h"
#include <sys/stat.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;
-typedef struct Manager Manager;
+#include "resolved-forward.h"
#define LINK_SEARCH_DOMAINS_MAX 256
#define LINK_DNS_SERVERS_MAX 256
-struct LinkAddress {
+typedef struct LinkAddress {
Link *link;
int family;
DnsResourceRecord *mdns_ptr_rr;
LIST_FIELDS(LinkAddress, addresses);
-};
+} LinkAddress;
-struct Link {
+typedef struct Link {
Manager *manager;
int ifindex;
char *state_file;
bool unicast_relevant;
-};
+} Link;
int link_new(Manager *m, Link **ret, int ifindex);
Link *link_free(Link *l);
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include <resolv.h>
+
+#include "sd-event.h"
#include "errno-util.h"
#include "fd-util.h"
+#include "hashmap.h"
+#include "log.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-transaction.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "resolved-manager.h"
+#include "resolved-forward.h"
#define LLMNR_PORT 5355
#include <linux/ipv6.h>
#include <netinet/in.h>
#include <poll.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
+#include "sd-bus.h"
+#include "sd-netlink.h"
+#include "sd-network.h"
+
#include "af-list.h"
#include "alloc-util.h"
-#include "bus-polkit.h"
#include "daemon-util.h"
#include "dirent-util.h"
#include "dns-domain.h"
+#include "errno-util.h"
#include "event-util.h"
#include "fd-util.h"
-#include "fileio.h"
#include "hostname-setup.h"
#include "hostname-util.h"
-#include "idn-util.h"
#include "io-util.h"
#include "iovec-util.h"
#include "json-util.h"
#include "memstream-util.h"
#include "missing_network.h"
#include "missing_socket.h"
-#include "netlink-util.h"
#include "ordered-set.h"
#include "parse-util.h"
#include "random-util.h"
#include "resolved-socket-graveyard.h"
#include "resolved-util.h"
#include "resolved-varlink.h"
-#include "socket-netlink.h"
+#include "set.h"
#include "socket-util.h"
-#include "string-table.h"
#include "string-util.h"
-#include "utf8.h"
+#include "time-util.h"
#include "varlink-util.h"
#define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC)
#include <sys/stat.h>
-#include "sd-bus.h"
-#include "sd-event.h"
-#include "sd-netlink.h"
-#include "sd-network.h"
-#include "sd-varlink.h"
-
#include "common-signal.h"
-#include "hashmap.h"
+#include "forward.h"
#include "list.h"
-#include "ordered-set.h"
#include "resolve-util.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-stream.h"
#include "resolved-dns-stub.h"
#include "resolved-dns-trust-anchor.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;
+#include "resolved-forward.h"
#define MANAGER_SEARCH_DOMAINS_MAX 256
#define MANAGER_DNS_SERVERS_MAX 256
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <arpa/inet.h>
#include <netinet/in.h>
-#include <resolv.h>
+
+#include "sd-event.h"
#include "alloc-util.h"
#include "dns-domain.h"
#include "fd-util.h"
+#include "log.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "sort-util.h"
+#include "time-util.h"
#define CLEAR_CACHE_FLUSH(x) (~MDNS_RR_CACHE_FLUSH_OR_QU & (x))
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
+#include "resolved-forward.h"
#define MDNS_PORT 5353
#define MDNS_ANNOUNCE_DELAY (1 * USEC_PER_SEC)
#include <resolv.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
#include "alloc-util.h"
-#include "dns-domain.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "label-util.h"
+#include "log.h"
#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"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <errno.h>
-
-#include "macro.h"
-
-typedef struct Manager Manager;
+#include "resolved-forward.h"
int manager_check_resolv_conf(const Manager *m);
int manager_read_resolv_conf(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-event.h"
#include "alloc-util.h"
+#include "assert-fundamental.h"
+#include "log.h"
#include "resolved-manager.h"
#include "resolved-socket-graveyard.h"
+#include "time-util.h"
#define SOCKET_GRAVEYARD_USEC (5 * USEC_PER_SEC)
#define SOCKET_GRAVEYARD_MAX 100
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-event.h"
-
#include "list.h"
-#include "time-util.h"
-
-typedef struct Manager Manager;
-typedef struct SocketGraveyard SocketGraveyard;
+#include "resolved-forward.h"
-struct SocketGraveyard {
+typedef struct SocketGraveyard {
Manager *manager;
usec_t deadline;
sd_event_source *io_event_source;
LIST_FIELDS(SocketGraveyard, graveyard);
-};
+} SocketGraveyard;
void manager_socket_graveyard_process(Manager *m);
void manager_socket_graveyard_clear(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-event.h"
+
#include "alloc-util.h"
#include "bus-polkit.h"
#include "dns-domain.h"
#include "dns-type.h"
+#include "errno-util.h"
#include "glyph-util.h"
#include "in-addr-util.h"
#include "json-util.h"
#include "resolved-link.h"
#include "resolved-manager.h"
#include "resolved-varlink.h"
+#include "set.h"
#include "socket-netlink.h"
+#include "string-util.h"
#include "varlink-io.systemd.Resolve.h"
#include "varlink-io.systemd.Resolve.Monitor.h"
#include "varlink-io.systemd.service.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-typedef struct Manager Manager;
+#include "resolved-forward.h"
int manager_varlink_init(Manager *m);
void manager_varlink_done(Manager *m);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
-#include "sd-daemon.h"
#include "sd-event.h"
#include "bus-log-control-api.h"
+#include "bus-object.h"
#include "capability-util.h"
#include "daemon-util.h"
+#include "label-util.h"
+#include "log.h"
#include "main-func.h"
#include "mkdir-label.h"
#include "resolved-bus.h"
-#include "resolved-conf.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
-#include "selinux-util.h"
#include "service-util.h"
-#include "signal-util.h"
#include "user-util.h"
static int run(int argc, char *argv[]) {
#include "dns-type.h"
#include "fd-util.h"
#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
#include "tests.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <stdlib.h>
#include <sys/socket.h>
+#include <unistd.h>
+
+#include "sd-json.h"
#include "dns-type.h"
#include "fd-util.h"
#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
#include "resolve-util.h"
#include "resolved-def.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
#include "tests.h"
+#include "time-util.h"
#include "tmpfile-util.h"
static DnsCache new_cache(void) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-type.h"
-#include "log.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <net/if.h>
-
#include "sd-id128.h"
#include "alloc-util.h"
#include "fileio.h"
#include "glob-util.h"
#include "log.h"
-#include "macro.h"
-#include "path-util.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
-#include "string-util.h"
-#include "strv.h"
+#include "siphash24.h"
#include "tests.h"
#include "unaligned.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "log.h"
+#include "sd-event.h"
+
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-query.h"
#include "dns-type.h"
#include "fd-util.h"
#include "fileio.h"
-#include "fs-util.h"
-#include "log.h"
+#include "in-addr-util.h"
#include "resolved-dns-question.h"
#include "resolved-dns-rr.h"
#include "tests.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-json.h"
+
#include "dns-type.h"
-#include "log.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
#include "tests.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "log.h"
#include "resolved-dns-search-domain.h"
#include "resolved-link.h"
#include "resolved-manager.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-question.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dns-type.h"
-#include "log.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 "resolved-link.h"
#include "resolved-manager.h"
#include "tests.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <netinet/ip.h>
+#include <sys/socket.h>
#include "sd-bus.h"
#include "resolved-def.h"
#include "string-util.h"
#include "tests.h"
-#include "time-util.h"
static void prefix_random(const char *name, char **ret) {
uint64_t i, u;
#include <arpa/inet.h>
#include <netinet/in.h>
-#include <sys/socket.h>
#include "alloc-util.h"
+#include "bitmap.h"
#include "hexdecoct.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-rr.h"
#include "string-util.h"
#include "tests.h"
+#include "time-util.h"
TEST(dnssec_verify_dns_key) {
static const uint8_t ds1_fprint[] = {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-daemon.h"
+#include "sd-event.h"
#include "dns-type.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "iovec-util.h"
#include "log.h"
#include "resolved-manager.h"
#include "socket-netlink.h"
#include "socket-util.h"
+#include "string-util.h"
+#include "time-util.h"
/* Taken from resolved-dns-stub.c */
#define ADVERTISE_DATAGRAM_SIZE_MAX (65536U-14U-20U-8U)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <arpa/inet.h>
-#include <malloc.h>
#include <netinet/in.h>
#include <sys/socket.h>
+#include "argv-util.h"
#include "fd-util.h"
#include "fileio.h"
-#include "fs-util.h"
+#include "hashmap.h"
#include "log.h"
#include "resolved-etc-hosts.h"
+#include "set.h"
#include "strv.h"
#include "tests.h"
#include "tmpfile-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/if.h>
-#include <net/if.h>
-#include "log.h"
+#include "sd-event.h"
+#include "sd-netlink.h"
+
#include "netlink-internal.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-scope.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <arpa/inet.h>
#include <fcntl.h>
#include <net/if.h>
-#include <net/if_arp.h>
#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
-#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include "fd-util.h"
#include "log.h"
-#include "macro.h"
#include "path-util.h"
#include "process-util.h"
#include "random-util.h"
#include "resolved-manager.h"
#include "sparse-endian.h"
#include "tests.h"
+#include "time-util.h"
static union sockaddr_union server_address;