]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: Clean up includes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 11:56:22 +0000 (13:56 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 May 2025 14:50:31 +0000 (23:50 +0900)
Split out of #37344.

89 files changed:
src/resolve/dns-type.c
src/resolve/dns-type.h
src/resolve/fuzz-dns-packet.c
src/resolve/fuzz-resource-record.c
src/resolve/resolvconf-compat.c
src/resolve/resolvectl.c
src/resolve/resolvectl.h
src/resolve/resolved-bus.c
src/resolve/resolved-bus.h
src/resolve/resolved-conf.c
src/resolve/resolved-conf.h
src/resolve/resolved-def.h
src/resolve/resolved-dns-answer.c
src/resolve/resolved-dns-answer.h
src/resolve/resolved-dns-cache.c
src/resolve/resolved-dns-cache.h
src/resolve/resolved-dns-delegate-bus.c
src/resolve/resolved-dns-delegate-bus.h
src/resolve/resolved-dns-delegate.c
src/resolve/resolved-dns-delegate.h
src/resolve/resolved-dns-dnssec.c
src/resolve/resolved-dns-dnssec.h
src/resolve/resolved-dns-packet.c
src/resolve/resolved-dns-packet.h
src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-question.c
src/resolve/resolved-dns-question.h
src/resolve/resolved-dns-rr.c
src/resolve/resolved-dns-rr.h
src/resolve/resolved-dns-scope.c
src/resolve/resolved-dns-scope.h
src/resolve/resolved-dns-search-domain.h
src/resolve/resolved-dns-server.c
src/resolve/resolved-dns-server.h
src/resolve/resolved-dns-stream.c
src/resolve/resolved-dns-stream.h
src/resolve/resolved-dns-stub.c
src/resolve/resolved-dns-stub.h
src/resolve/resolved-dns-synthesize.c
src/resolve/resolved-dns-synthesize.h
src/resolve/resolved-dns-transaction.c
src/resolve/resolved-dns-transaction.h
src/resolve/resolved-dns-trust-anchor.c
src/resolve/resolved-dns-trust-anchor.h
src/resolve/resolved-dns-zone.c
src/resolve/resolved-dns-zone.h
src/resolve/resolved-dnssd-bus.c
src/resolve/resolved-dnssd-bus.h
src/resolve/resolved-dnssd.c
src/resolve/resolved-dnssd.h
src/resolve/resolved-dnstls.c
src/resolve/resolved-dnstls.h
src/resolve/resolved-etc-hosts.c
src/resolve/resolved-etc-hosts.h
src/resolve/resolved-forward.h [new file with mode: 0644]
src/resolve/resolved-link-bus.c
src/resolve/resolved-link-bus.h
src/resolve/resolved-link.c
src/resolve/resolved-link.h
src/resolve/resolved-llmnr.c
src/resolve/resolved-llmnr.h
src/resolve/resolved-manager.c
src/resolve/resolved-manager.h
src/resolve/resolved-mdns.c
src/resolve/resolved-mdns.h
src/resolve/resolved-resolv-conf.c
src/resolve/resolved-resolv-conf.h
src/resolve/resolved-socket-graveyard.c
src/resolve/resolved-socket-graveyard.h
src/resolve/resolved-varlink.c
src/resolve/resolved-varlink.h
src/resolve/resolved.c
src/resolve/test-dns-answer.c
src/resolve/test-dns-cache.c
src/resolve/test-dns-packet-extract.c
src/resolve/test-dns-packet.c
src/resolve/test-dns-query.c
src/resolve/test-dns-question.c
src/resolve/test-dns-rr.c
src/resolve/test-dns-search-domain.c
src/resolve/test-dns-synthesize.c
src/resolve/test-dns-zone.c
src/resolve/test-dnssec-complex.c
src/resolve/test-dnssec.c
src/resolve/test-resolved-dummy-server.c
src/resolve/test-resolved-etc-hosts.c
src/resolve/test-resolved-link.c
src/resolve/test-resolved-stream.c

index 4cce7130c0792aa9c50c1767d1430a8b340a22a1..57fd915c691f0b1c11282ac74c37a3899a824e73 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <sys/socket.h>
 
 #include "dns-type.h"
index 590e8f4008e576bf105f046e995f98e223cfff4a..683c7ee6efc688e6fe2b11702ef1ea530ac083b3 100644 (file)
@@ -1,9 +1,7 @@
 /* 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.
index a5b1fd64f763cbca75ab4195919b74aadb9e5338..27a196cb8f904d6756a6b1ee8d6343da1223e6f2 100644 (file)
@@ -1,7 +1,6 @@
 /* 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) {
index 378308cee8dd2122aa43f0a0d155d7c2584e01c6..8d0817493db7515d66837856ac9897af29fe859d 100644 (file)
@@ -2,12 +2,11 @@
 
 #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;
index 97749d80c2b511e0ec7dfc3e2cac6a08e9b7412e..47abdc900f886c48cf3d108878d2975b24bdf8bb 100644 (file)
@@ -1,23 +1,18 @@
 /* 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;
index 7dac8d741fc5e58547fa626277466880b5874bfc..bb967f8ce53e70754c3152c5a44c4eaff98105bd 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "sd-bus.h"
 #include "sd-daemon.h"
+#include "sd-event.h"
 #include "sd-json.h"
 #include "sd-netlink.h"
 #include "sd-varlink.h"
@@ -22,6 +23,7 @@
 #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"
@@ -36,7 +38,6 @@
 #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"
index 16e11fcd08e851642c917d9476d6d5fcc5f7c4bc..c6ec00816997cf11da12015e8c8dc6fe1a68792e 100644 (file)
@@ -1,9 +1,7 @@
 /* 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,
index be927e07060fb7bd56175001a6a88ae05b985047..bbb6580bb0be49d0302d987a7e450f7d428f2b0e 100644 (file)
@@ -1,16 +1,18 @@
 /* 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);
index fb8de0ddb49eb61b9a88f840553bdc6c93393d68..4bcd41caf9b533cc61c0177c97710f3eb18703f9 100644 (file)
@@ -1,11 +1,7 @@
 /* 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;
 
index 415c46d856744a53954c8d38f596a33590b2b289..117bf7ccc32419f78231e7a918d3b978d9077cc5 100644 (file)
@@ -2,26 +2,19 @@
 
 #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);
 
index 4499f3b956f3d4008cdf6771b45cf31be2167ac3..70c7b03aa71538c5e2b1cddf33273de7b5523455 100644 (file)
@@ -1,9 +1,7 @@
 /* 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,
index f702a0a0ea4558a627a25dc7e14d11591bee4182..de06c8ad28e0b51ae16ae62ca2617f164b1a5be8 100644 (file)
@@ -1,8 +1,7 @@
 /* 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 */
index 2b9e750010c4e0bf54b6e8a230a762c181cd74e6..144b8c3b6771056471136b993702609c35c3a2c5 100644 (file)
@@ -7,8 +7,8 @@
 #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) {
index 0707a9a6c0cad1d8e0c93406de78be7951214934..e4c1d2cb2a4aa0cae0a1d5ca3f52f1b722d1d7d8 100644 (file)
@@ -1,11 +1,8 @@
 /* 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.
index f14ddd19ab5284a8281ff73e5327e932fda6fe63..7f39e05c59bd6747265538889bd2fc0e65f64096 100644 (file)
@@ -1,17 +1,22 @@
 /* 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. */
index c764971373630d7b156ab20b08d9930d9d2647a7..be98a8a56766531f8036e9a91736f3b637f21bb5 100644 (file)
@@ -1,22 +1,7 @@
 /* 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;
index 60134b504ce98e3d92fd789abb97d7e23efd22a3..c1ea2d1ebb43d26e3fa42080eb0870fb9c8faeef 100644 (file)
@@ -1,6 +1,11 @@
 /* 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"
index 7acdd5a983e5b539d527295d75bdcef333fa125c..e647c5321fe616b4bc877235bf481cc02e73545c 100644 (file)
@@ -1,8 +1,7 @@
 /* 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;
 
index 969836c30479dfb6b22271b1f2c7d47c95905cb7..287f9ad1318c60084a70b1b8a72da0ea82f2abd0 100644 (file)
@@ -1,9 +1,14 @@
 /* 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"
@@ -11,6 +16,7 @@
 #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
index 3ce3c1e172b8c56fa4460f71787ba7d2141713e6..509cc06335e26780b54a0c807f4db4f663934f21 100644 (file)
@@ -1,14 +1,8 @@
 /* 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
@@ -16,7 +10,7 @@ typedef struct Manager Manager;
 /* 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;
 
@@ -32,7 +26,7 @@ struct DnsDelegate {
         DnsScope *scope;
 
         LIST_FIELDS(DnsDelegate, delegates);
-};
+} DnsDelegate;
 
 int dns_delegate_new(Manager *m, const char *id, DnsDelegate **ret);
 DnsDelegate *dns_delegate_free(DnsDelegate *d);
index 221cd8548d6a58e5240ff9b70d2cb3f76fa4ad38..321aa0816e4e0bab4bdbe4bf3825b889ceeb5623 100644 (file)
@@ -1,10 +1,9 @@
 /* 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;
index 21a9bd54af79f3744cebbe8ca96376cf3c0e6674..cd2e92f20e5c2787e9d52e3cf715b283fda0219a 100644 (file)
@@ -1,15 +1,7 @@
 /* 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() */
index 0bf692c06ad901b3d0643e3bdcad4138f9e6af88..e091d4273b6f8f5578b6b22203e756345801757b 100644 (file)
@@ -1,6 +1,7 @@
 /* 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"
 
index 6e93980d366005bf358e2d9b5198af1e4ab0bd2e..8095807805bcd2035b8b827c8799f4b87702ced9 100644 (file)
@@ -5,19 +5,12 @@
 #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,
@@ -58,7 +51,7 @@ assert_cc(sizeof(DnsPacketHeader) == 12);
 /* 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;
@@ -88,7 +81,7 @@ struct DnsPacket {
         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))
index 2da402c92f624ec4159fdf896a3540474ef5ecb7..da35656bcf686575c07d569af02f55b19549c5dc 100644 (file)
@@ -1,12 +1,14 @@
 /* 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
index 9433ed91268065419c4ba0502e152e673f6ecf9d..9eec6d87d16d71c8ee964c7ea19c77526950c635 100644 (file)
@@ -1,29 +1,13 @@
 /* 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;
 
@@ -37,9 +21,9 @@ struct DnsQueryCandidate {
 
         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
@@ -129,7 +113,7 @@ struct DnsQuery {
         LIST_FIELDS(DnsQuery, auxiliary_queries);
 
         /* Note: fields should be ordered to minimize alignment gaps. Use pahole! */
-};
+} DnsQuery;
 
 enum {
         DNS_QUERY_MATCH,
index 7d8f4832931fcc225f498ae5693026e995e4b66a..9288aa0af8c87ef6de500c2058fea715b1ea7720 100644 (file)
@@ -1,12 +1,14 @@
 /* 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;
index 33997963c16135d29601fd7c9e16a5f4c7dbc5c3..15ea3024eca4c3b025556f6ee39f31677f94c15a 100644 (file)
@@ -1,13 +1,7 @@
 /* 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 */
 
index e7d797c506a2af6c846db7cd946fd4aed143ab04..4be6dd0f23cf18e063da4af07aa2e5dbf7a8b8a9 100644 (file)
@@ -3,20 +3,24 @@
 #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) {
index 3ad98ee571abc342db71c4fff5990b8244339ba1..d183d0b80fe017bd3e69b96d06e3f06c101a84b7 100644 (file)
@@ -3,21 +3,10 @@
 
 #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)
@@ -68,11 +57,11 @@ enum {
         _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
@@ -86,13 +75,13 @@ struct DnsResourceKey {
                 ._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);
@@ -101,9 +90,9 @@ struct DnsSvcParam {
                 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 */
@@ -284,7 +273,7 @@ struct DnsResourceRecord {
         };
 
         /* 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);
index 4525f253de79745aa6609a1b14fe77b9349fa213..72b918b3cfce52da9372ab7fb285edc0a38f29e9 100644 (file)
@@ -2,6 +2,9 @@
 
 #include <netinet/tcp.h>
 
+#include "sd-event.h"
+#include "sd-json.h"
+
 #include "af-list.h"
 #include "alloc-util.h"
 #include "dns-domain.h"
@@ -9,7 +12,7 @@
 #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"
@@ -29,9 +32,9 @@
 #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
index 872457ffc209072dafa347553870487f7bd10496..4e930499ec88f33ecd836d376742a603983d08f5 100644 (file)
@@ -1,26 +1,15 @@
 /* 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,
@@ -40,7 +29,7 @@ typedef enum DnsScopeOrigin {
         _DNS_SCOPE_ORIGIN_INVALID = -EINVAL,
 } DnsScopeOrigin;
 
-struct DnsScope {
+typedef struct DnsScope {
         Manager *manager;
 
         DnsScopeOrigin origin;
@@ -84,7 +73,7 @@ struct DnsScope {
         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);
index 63bd357b8312345ebfe5c14ce0835f4f9d0c6e56..503f6bf3e6c2f101971afcfe58956bba068d113c 100644 (file)
@@ -1,16 +1,8 @@
 /* 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,
@@ -18,7 +10,7 @@ typedef enum DnsSearchDomainType {
         DNS_SEARCH_DOMAIN_DELEGATE,
 } DnsSearchDomainType;
 
-struct DnsSearchDomain {
+typedef struct DnsSearchDomain {
         Manager *manager;
 
         unsigned n_ref;
@@ -34,7 +26,7 @@ struct DnsSearchDomain {
 
         bool linked:1;
         LIST_FIELDS(DnsSearchDomain, domains);
-};
+} DnsSearchDomain;
 
 int dns_search_domain_new(
                 Manager *m,
index 7845dcfd217e1d25854a84add6c45a8bd82bfcdc..a177c323e2bff58072f78e53a2e38d5a75059cab 100644 (file)
@@ -1,13 +1,14 @@
 /* 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"
@@ -16,7 +17,6 @@
 #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"
@@ -25,6 +25,7 @@
 #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)
index bef352aa421ba321341ea491381361d914ec254c..efc8de2f0a3213bdfaf3c87d82e4524acfb7dde7 100644 (file)
@@ -1,22 +1,12 @@
 /* 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,
@@ -51,7 +41,7 @@ typedef enum DnsServerFeatureLevel {
 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;
@@ -110,7 +100,7 @@ struct DnsServer {
 
         /* Tri-state to indicate if the DNS server is accessible. */
         int accessible;
-};
+} DnsServer;
 
 int dns_server_new(
                 Manager *m,
index 03c6cd7cf4d7d38b72489cf1c3a93656065c4e26..728c3f762045052a6d71c15f34bdf1c2230f7530 100644 (file)
@@ -1,18 +1,22 @@
 /* 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
 
index fe661d5cee2ad52483be6ddb456b344971cfae06..91f65e446a4ae261c15f9d4e2d0df10792b269fc 100644 (file)
@@ -1,20 +1,14 @@
 /* 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)
@@ -46,7 +40,7 @@ typedef enum DnsStreamType {
  *   3. The DNS stub logic when accepting a TCP-based lookup
  */
 
-struct DnsStream {
+typedef struct DnsStream {
         Manager *manager;
         unsigned n_ref;
 
@@ -94,7 +88,7 @@ struct DnsStream {
         DnsStubListenerExtra *stub_listener_extra;
 
         LIST_FIELDS(DnsStream, streams);
-};
+} DnsStream;
 
 int dns_stream_new(
                 Manager *m,
index e70902a60b348ae7f515d67eafac95b6910a6f55..82f852a93688fb866c2b78443caebef15931fea7 100644 (file)
@@ -1,8 +1,10 @@
 /* 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"
@@ -10,7 +12,6 @@
 #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 */
index bfde108026c3de1d61ec438bdb8498667ee5d302..a7b0e41722085fee317c094e0ecd9ef56aa0b6e7 100644 (file)
@@ -1,13 +1,8 @@
 /* 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,
@@ -18,7 +13,7 @@ typedef enum DnsStubListenerMode {
         _DNS_STUB_LISTENER_MODE_INVALID = -EINVAL,
 } DnsStubListenerMode;
 
-struct DnsStubListenerExtra {
+typedef struct DnsStubListenerExtra {
         Manager *manager;
 
         DnsStubListenerMode mode;
@@ -31,7 +26,7 @@ struct DnsStubListenerExtra {
         sd_event_source *tcp_event_source;
 
         Hashmap *queries_by_packet;
-};
+} DnsStubListenerExtra;
 
 extern const struct hash_ops dns_stub_listener_extra_hash_ops;
 
index 0f19fa51c39be7d081c55b91f65576b5aaee68b1..c549856b93e465922ffa14bccb2d4e6f03a109b1 100644 (file)
@@ -6,6 +6,7 @@
 #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"
index f121eb442af6b55789f12e29e8a645913126bec0..43a9c0623a5f8686fbf752f44f91b37ed04ee000 100644 (file)
@@ -1,14 +1,7 @@
 /* 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);
index 12abd8b0e833e37d4c8c6617b7c8aba44c2180ee..d6dbba546c637fbb9f0245ebf2af7540e8285009 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-event.h"
 #include "sd-messages.h"
 
 #include "af-list.h"
@@ -9,6 +10,7 @@
 #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
 
@@ -473,7 +479,7 @@ static void dns_transaction_complete_errno(DnsTransaction *t, int error) {
         assert(t);
         assert(error != 0);
 
-        t->answer_errno = abs(error);
+        t->answer_errno = ABS(error);
         dns_transaction_complete(t, DNS_TRANSACTION_ERRNO);
 }
 
index 85feffb0d07fbe774792e04e4bdc82b10a11a5ce..e7f9ca7fbf6d3353059653a85a43a0ec5631a81d 100644 (file)
@@ -1,22 +1,11 @@
 /* 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,
@@ -52,7 +41,7 @@ typedef enum DnsTransactionSource {
         _DNS_TRANSACTION_SOURCE_INVALID = -EINVAL,
 } DnsTransactionSource;
 
-struct DnsTransaction {
+typedef struct DnsTransaction {
         DnsScope *scope;
 
         DnsResourceKey *key;         /* For regular lookups the RR key to look for */
@@ -149,7 +138,7 @@ struct DnsTransaction {
         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);
index 8cc495c898ad2d24514f6f1bf8af8bd6ac537343..3c4d7efdc594f2ba1f678deb38c7f647c6377c62 100644 (file)
@@ -6,6 +6,7 @@
 #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"
index 969e648957dfc9e87f8760a269d29447009517b1..640aa4cb8b091a7ad6f1c7c046609387d84956ed 100644 (file)
@@ -1,11 +1,7 @@
 /* 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. */
 
index a471de76969bc037e113f91270f02233883ba9dd..bb30c5a6f700abe9c6cee1e96362efc96ef8ed8e 100644 (file)
@@ -1,8 +1,11 @@
 /* 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"
@@ -11,6 +14,7 @@
 #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 */
index a4c0da5a7bc40d118da3bfabecace98ee8545fe1..63bee685ba9e31377b15f470fde8fef3f5732e5f 100644 (file)
@@ -1,15 +1,8 @@
 /* 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;
@@ -29,7 +22,7 @@ typedef enum DnsZoneItemState {
         DNS_ZONE_ITEM_WITHDRAWN,
 } DnsZoneItemState;
 
-struct DnsZoneItem {
+typedef struct DnsZoneItem {
         DnsScope *scope;
         DnsResourceRecord *rr;
 
@@ -43,7 +36,7 @@ struct DnsZoneItem {
         LIST_FIELDS(DnsZoneItem, by_name);
 
         DnsTransaction *probe_transaction;
-};
+} DnsZoneItem;
 
 void dns_zone_flush(DnsZone *z);
 
index 0f97eae05ac433d77d6d7776ef185f8f8a15ec0e..6b344427d760431f963be99e0a6e4cc14d8216ea 100644 (file)
@@ -1,14 +1,18 @@
 /* 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);
index f396e23cd76acd0f66ca3396110d569aab328dd5..04fd506cf451d873512e11814999c86a06c54b55 100644 (file)
@@ -2,9 +2,7 @@
 
 #pragma once
 
-#include "sd-bus.h"
-
-#include "bus-object.h"
+#include "forward.h"
 
 extern const BusObjectImplementation dnssd_object;
 
index 6523737ccec554302775ff122ddc5759df78d236..725f82380260098cb948f001e7cd9293c9e645d5 100644 (file)
@@ -1,10 +1,14 @@
 /* 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"
@@ -13,6 +17,7 @@
 #include "resolved-dnssd.h"
 #include "resolved-manager.h"
 #include "specifier.h"
+#include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
 
index 8aaa9da748dbdc8e7481ea037a354854807229de..98d6a54a6cd129abb62f7aa9d18237600f67ecd3 100644 (file)
@@ -4,28 +4,22 @@
 
 #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;
@@ -50,7 +44,7 @@ struct DnssdService {
 
         bool withdrawn:1;
         uid_t originator;
-};
+} DnssdService;
 
 DnssdService *dnssd_service_free(DnssdService *service);
 DnssdTxtData *dnssd_txtdata_free(DnssdTxtData *txt_data);
index a03919cfedd0400024be4e9fcec4c11a697a17cd..b4b53921a138b40123ac074835a2f779d9f92b7a 100644 (file)
@@ -7,10 +7,11 @@
 #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"
index 3d06a82196b2c990c912569dd2d920d3692fd25b..35a8d785defa1d61fe62552267775b8abed14467 100644 (file)
@@ -8,13 +8,8 @@
 #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;
index bb655d055d0e65f2b093f2e37dd1a834fd14cee7..1b5d061e4cade8b9db27f14ec67ba9ff6ae3edb8 100644 (file)
@@ -1,24 +1,24 @@
 /* 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 */
index 032654fcad00ba192dd0898a56748447b03743c7..0d790bbd47b9763f79d434d631707db280125e8b 100644 (file)
@@ -2,12 +2,7 @@
 #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;
diff --git a/src/resolve/resolved-forward.h b/src/resolve/resolved-forward.h
new file mode 100644 (file)
index 0000000..e5be2fe
--- /dev/null
@@ -0,0 +1,38 @@
+/* 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;
index 9e5371684aa092c3dd3dd9148b397576552107f5..ed4485671c8ad3321b5d125af663efd96bea0c46 100644 (file)
@@ -1,13 +1,14 @@
 /* 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);
index e798aae74a3a007893d53bf22e43d127ba7437a4..539f9cd69d69337fffcb654ac1e1c8f517f1c14d 100644 (file)
@@ -1,11 +1,7 @@
 /* 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;
 
index 55c8aa36cf6aa522a21d8e0b5e00a0fcf4fcdef7..6d79d1709c5b5dca31fc711868ef7bb176d02cca 100644 (file)
@@ -3,11 +3,13 @@
 #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"
@@ -22,7 +24,9 @@
 #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"
index 3ae0c209259451bdccc3270b582af63c261e3776..3f9002fa1072bbed90d5640738f2a3df19f76a2f 100644 (file)
@@ -3,26 +3,16 @@
 
 #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;
@@ -39,9 +29,9 @@ struct LinkAddress {
         DnsResourceRecord *mdns_ptr_rr;
 
         LIST_FIELDS(LinkAddress, addresses);
-};
+} LinkAddress;
 
-struct Link {
+typedef struct Link {
         Manager *manager;
 
         int ifindex;
@@ -83,7 +73,7 @@ struct Link {
         char *state_file;
 
         bool unicast_relevant;
-};
+} Link;
 
 int link_new(Manager *m, Link **ret, int ifindex);
 Link *link_free(Link *l);
index 5fdecc97eb7c307c22eedb39855144b7a2171489..812ef947f6b38651ff59f581b74d3dc273a8b38e 100644 (file)
@@ -2,10 +2,13 @@
 
 #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"
index 358201b5df8677db49318019dcd88afa159d4af8..3da0f3a5c1c60e2f6e7d36dd78296cf7068a85bd 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "resolved-manager.h"
+#include "resolved-forward.h"
 
 #define LLMNR_PORT 5355
 
index f5c2fafd901ae51a49b3e87920c2adb691acba86..f52adaf22d6ebc4b93e393b7066c8ed7ddae6ccb 100644 (file)
@@ -4,30 +4,28 @@
 #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)
index bb398e83b7fa994529efb4b8d4715d0fcd6a7167..cbe635ff9479605e80faf985ef9507da1cc8f902 100644 (file)
@@ -3,34 +3,16 @@
 
 #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
index d9a993a001491e9fc607388da5919c57c34bf67e..e6bd844aadcb5a7e4f200f3e9139805c6c301315 100644 (file)
@@ -1,12 +1,13 @@
 /* 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"
@@ -17,6 +18,7 @@
 #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))
 
index 319fa53703ce4c2d95f1341c595a395c71b7ae43..fd9ecc944f44aa400a1c4d6f9ef44b80652e0796 100644 (file)
@@ -1,7 +1,7 @@
 /* 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)
index 3f4c67ecbc37fbbbf3dd50d96e160bc5dc151d63..c85d68c984053065338a9ad8542d5f3237e5b906 100644 (file)
@@ -2,18 +2,15 @@
 
 #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"
index 6738af61999d9735ddea365c2e92678030611fff..6b3c91ed2880dc164c939aae27f631eec2f89d86 100644 (file)
@@ -1,11 +1,7 @@
 /* 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);
index a55ebd304e54619fb1e4356aec0ff370193e3f89..bfa3055dedee4a16f867d65c84840c8b7a33860b 100644 (file)
@@ -1,8 +1,12 @@
 /* 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
index 90417313fbd777e6d31056558f1b25d94056a4d1..07b895ad3e534f4a1691eca48b39e1e439ccdbd5 100644 (file)
@@ -1,20 +1,15 @@
 /* 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);
index 5b534b1d937ce1fe02a9e9f0bb2292d0232bd1d3..43bd0b6c6f60c1b5822527fe4560730984ac3794 100644 (file)
@@ -1,9 +1,12 @@
 /* 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"
@@ -21,7 +24,9 @@
 #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"
index b96700719bf4721580235820b282d457277b4eaa..ad55182adbf9264ff36d03b75a9050585a8c5b6f 100644 (file)
@@ -1,7 +1,7 @@
 /* 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);
index a0c801802390fdb39dc730385b83452681cfbedc..0676c4529f2fc887f6acccc230295dff93c81d8f 100644 (file)
@@ -1,24 +1,22 @@
 /* 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[]) {
index 7f59e666bca76c1f82334e01710ab0b85f6028a4..77775bffc9e782faa48df978a2353e55ee502e0b 100644 (file)
@@ -3,8 +3,6 @@
 #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"
index 2413ad795f0c560835246415a15e6038230de344..a60daab5c631445b79384cd48eafbd6e144ead2c 100644 (file)
@@ -1,12 +1,14 @@
 /* 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"
@@ -15,6 +17,7 @@
 #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) {
index 64bbd6241db249b58766bceed86bccea16e93870..9b67a6a93fc85941b38368800539e967963790c0 100644 (file)
@@ -1,7 +1,6 @@
 /* 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"
index fca52bcf61e5463e39df898e6927d19f80e92447..88c6cb127b8b0244d24bf1100647c48046885ed6 100644 (file)
@@ -1,19 +1,14 @@
 /* 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"
 
index 83460e1c2d4a3da65d377cc1f38cb6d74819b3cf..083cc6d7005e9ca0781d8ab3b9f0ca5290761aab 100644 (file)
@@ -1,6 +1,7 @@
 /* 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"
index 27e907463ae4070ea2227affd37748d255764c29..62cc81d47e8e1c7f97fced44efe8de28d6b8eaa1 100644 (file)
@@ -3,8 +3,7 @@
 #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"
index 8b8f95661350bfd4d60245a0cfeca7230850184c..a69c2120d13912178dd138392e4774b4bbe76509 100644 (file)
@@ -1,7 +1,8 @@
 /* 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"
index 8c1f8415cc7ca2a5dabbea72787897b9f2ea39ec..e8fc7a482346a8416c3934c2b9662e29a3173d01 100644 (file)
@@ -1,6 +1,5 @@
 /* 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"
index eb25a7fbe76fc187b7b4fe6467a46f087d81305c..14f7a5156ab228ae3cc708ff9a0aba096911d41a 100644 (file)
@@ -1,6 +1,5 @@
 /* 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"
index 2c461e9d88dcee2b1ea93ae498f0b8f6b0f41b22..3f449cbfcf8eb698bad99a0e5657bb25429b9def 100644 (file)
@@ -1,13 +1,11 @@
 /* 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"
 
index 30f49a780be03a466d74e5ccfe69ab3025b465ff..7dab5b8fe005b62696b37cb901d4e65bd8bb8a1e 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <netinet/ip.h>
+#include <sys/socket.h>
 
 #include "sd-bus.h"
 
@@ -13,7 +13,6 @@
 #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;
index dc2e3f076caf395cb0c28fe767c3cb66f9a32f72..32aaa4c0db280dc4ed1a5ff0c213ec56e320e40f 100644 (file)
@@ -2,15 +2,16 @@
 
 #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[] = {
index 705965f30e18cd23b869cd428f3de0d8b0b789e5..21556d57fa894eba5aa052f70acd2053af1d5233 100644 (file)
@@ -1,8 +1,10 @@
 /* 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"
@@ -12,6 +14,8 @@
 #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)
index 75f7db34828db360f1dc0d8c506008a2652fd846..0528a411dc347a01ba8c2a77d2d462b1032a5316 100644 (file)
@@ -1,15 +1,16 @@
 /* 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"
index 96f62a362fb15d886ae9bd20b2a683737d11cf9b..e0cb6006adca25670d7e00fcf50e00bdbe170819 100644 (file)
@@ -1,9 +1,10 @@
 /* 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"
index b5e8ce9f95532a8f21ac0155fcdadbaa783e2946..82d8f2925323383a9a3a78d13c23dcd0f86cdd22 100644 (file)
@@ -1,15 +1,12 @@
 /* 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>
@@ -18,7 +15,6 @@
 
 #include "fd-util.h"
 #include "log.h"
-#include "macro.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "random-util.h"
@@ -31,6 +27,7 @@
 #include "resolved-manager.h"
 #include "sparse-endian.h"
 #include "tests.h"
+#include "time-util.h"
 
 static union sockaddr_union server_address;