summaryrefslogtreecommitdiff
path: root/src/grp-resolve
diff options
context:
space:
mode:
Diffstat (limited to 'src/grp-resolve')
-rw-r--r--src/grp-resolve/Makefile28
-rw-r--r--src/grp-resolve/libbasic-dns/dns-type.c5
-rw-r--r--src/grp-resolve/libbasic-dns/dns-type.h2
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-answer.c7
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-answer.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-packet.c15
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-packet.h10
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-question.c5
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-question.h3
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-rr.c17
-rw-r--r--src/grp-resolve/libbasic-dns/resolved-dns-rr.h11
-rw-r--r--src/grp-resolve/libbasic-dns/test-dns-packet.c17
-rw-r--r--src/grp-resolve/libbasic-dns/test-dnssec-complex.c13
-rw-r--r--src/grp-resolve/libbasic-dns/test-dnssec.c7
-rw-r--r--src/grp-resolve/libbasic-dns/test-resolve-tables.c3
-rw-r--r--src/grp-resolve/nss-resolve/Makefile46
-rw-r--r--src/grp-resolve/nss-resolve/nss-resolve.c14
-rw-r--r--src/grp-resolve/systemd-resolve/resolve-tool.c18
-rw-r--r--src/grp-resolve/systemd-resolved/Makefile227
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-bus.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-conf.c13
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-cache.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-cache.h8
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-query.h10
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.c19
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.h6
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c5
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.h4
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c7
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-transaction.c15
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c25
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h6
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-zone.c9
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-zone.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-etc-hosts.c15
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-etc-hosts.h5
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link-bus.c11
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.c12
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.h8
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-llmnr.c3
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.c33
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.h12
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-mdns.c7
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-resolv-conf.c17
-rw-r--r--src/grp-resolve/systemd-resolved/resolved.c11
52 files changed, 554 insertions, 219 deletions
diff --git a/src/grp-resolve/Makefile b/src/grp-resolve/Makefile
new file mode 100644
index 0000000000..ae0c5a2466
--- /dev/null
+++ b/src/grp-resolve/Makefile
@@ -0,0 +1,28 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+at.subdirs += systemd-resolved nss-resolve
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/libbasic-dns/dns-type.c b/src/grp-resolve/libbasic-dns/dns-type.c
index 78d9d5733f..6d5b9d616f 100644
--- a/src/grp-resolve/libbasic-dns/dns-type.c
+++ b/src/grp-resolve/libbasic-dns/dns-type.c
@@ -19,9 +19,10 @@
#include <sys/socket.h>
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+
#include "dns-type.h"
-#include "parse-util.h"
-#include "string-util.h"
typedef const struct {
uint16_t type;
diff --git a/src/grp-resolve/libbasic-dns/dns-type.h b/src/grp-resolve/libbasic-dns/dns-type.h
index 7b79d29d7e..a8ee105e16 100644
--- a/src/grp-resolve/libbasic-dns/dns-type.h
+++ b/src/grp-resolve/libbasic-dns/dns-type.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
/* DNS record types, taken from
* http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-answer.c b/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
index 0dadf8b1dd..1ade0507db 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-answer.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
-#include "string-util.h"
DnsAnswer *dns_answer_new(unsigned n) {
DnsAnswer *a;
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-answer.h b/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
index 0679c610f5..92557a410a 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-answer.h
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/macro.h"
+
typedef struct DnsAnswer DnsAnswer;
typedef struct DnsAnswerItem DnsAnswerItem;
-#include "macro.h"
#include "resolved-dns-rr.h"
/* A simple array of resource records. We keep track of the
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
index 77bd4d71bf..b73cc24100 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-dnssec.h
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "shared/dns-domain.h"
+
typedef enum DnssecResult DnssecResult;
typedef enum DnssecVerdict DnssecVerdict;
-#include "dns-domain.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-packet.c b/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
index b7907bb511..37c0244b7e 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-packet.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/string-table.h"
+#include "basic/strv.h"
+#include "basic/unaligned.h"
+#include "basic/utf8.h"
+#include "basic/util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-packet.h"
-#include "string-table.h"
-#include "strv.h"
-#include "unaligned.h"
-#include "utf8.h"
-#include "util.h"
#define EDNS0_OPT_DO (1<<15)
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-packet.h b/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
index 416335d0a2..2e0eba83b6 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-packet.h
@@ -22,13 +22,13 @@
#include <netinet/ip.h>
#include <netinet/udp.h>
-#include "hashmap.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "sparse-endian.h"
+#include "basic/hashmap.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/sparse-endian.h"
-typedef struct DnsPacketHeader DnsPacketHeader;
typedef struct DnsPacket DnsPacket;
+typedef struct DnsPacketHeader DnsPacketHeader;
#include "resolved-def.h"
#include "resolved-dns-answer.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-question.c b/src/grp-resolve/libbasic-dns/resolved-dns-question.c
index c8b502d1cd..ee53dbff9d 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-question.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-question.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+
#include "dns-type.h"
#include "resolved-dns-question.h"
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-question.h b/src/grp-resolve/libbasic-dns/resolved-dns-question.h
index ea41478975..320bf53488 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-question.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-question.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/macro.h"
+
typedef struct DnsQuestion DnsQuestion;
-#include "macro.h"
#include "resolved-dns-rr.h"
/* A simple array of resource keys */
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-rr.c b/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
index 6a29a93a26..c6a60b65b7 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-rr.c
@@ -19,18 +19,19 @@
#include <math.h>
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/terminal-util.h"
+#include "shared/dns-domain.h"
+
#include "dns-type.h"
-#include "escape.h"
-#include "hexdecoct.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "strv.h"
-#include "terminal-util.h"
DnsResourceKey* dns_resource_key_new(uint16_t class, uint16_t type, const char *name) {
DnsResourceKey *k;
diff --git a/src/grp-resolve/libbasic-dns/resolved-dns-rr.h b/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
index 020a2abd77..daf9c8c210 100644
--- a/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
+++ b/src/grp-resolve/libbasic-dns/resolved-dns-rr.h
@@ -21,12 +21,13 @@
#include <netinet/in.h>
-#include "bitmap.h"
+#include "basic/bitmap.h"
+#include "basic/hashmap.h"
+#include "basic/in-addr-util.h"
+#include "basic/list.h"
+#include "basic/string-util.h"
+
#include "dns-type.h"
-#include "hashmap.h"
-#include "in-addr-util.h"
-#include "list.h"
-#include "string-util.h"
typedef struct DnsResourceKey DnsResourceKey;
typedef struct DnsResourceRecord DnsResourceRecord;
diff --git a/src/grp-resolve/libbasic-dns/test-dns-packet.c b/src/grp-resolve/libbasic-dns/test-dns-packet.c
index c232a69ce1..18d04b930d 100644
--- a/src/grp-resolve/libbasic-dns/test-dns-packet.c
+++ b/src/grp-resolve/libbasic-dns/test-dns-packet.c
@@ -17,18 +17,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/if.h>
#include <glob.h>
+#include <net/if.h>
+
+#include "basic/alloc-util.h"
+#include "basic/fileio.h"
+#include "basic/glob-util.h"
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
-#include "alloc-util.h"
-#include "fileio.h"
-#include "glob-util.h"
-#include "log.h"
-#include "macro.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-rr.h"
-#include "string-util.h"
-#include "strv.h"
#define HASH_KEY SD_ID128_MAKE(d3,1e,48,90,4b,fa,4c,fe,af,9d,d5,a1,d7,2e,8a,b1)
diff --git a/src/grp-resolve/libbasic-dns/test-dnssec-complex.c b/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
index 568400ac77..ef78cd1ea5 100644
--- a/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
+++ b/src/grp-resolve/libbasic-dns/test-dnssec-complex.c
@@ -21,13 +21,14 @@
#include <systemd/sd-bus.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-common-errors.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/random-util.h"
+#include "basic/string-util.h"
+#include "basic/time-util.h"
+#include "sd-bus/bus-common-errors.h"
+
#include "dns-type.h"
-#include "random-util.h"
-#include "string-util.h"
-#include "time-util.h"
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
diff --git a/src/grp-resolve/libbasic-dns/test-dnssec.c b/src/grp-resolve/libbasic-dns/test-dnssec.c
index b3018e8239..1f05196d8e 100644
--- a/src/grp-resolve/libbasic-dns/test-dnssec.c
+++ b/src/grp-resolve/libbasic-dns/test-dnssec.c
@@ -21,11 +21,12 @@
#include <netinet/in.h>
#include <sys/socket.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/hexdecoct.h"
+#include "basic/string-util.h"
+
#include "resolved-dns-dnssec.h"
#include "resolved-dns-rr.h"
-#include "string-util.h"
-#include "hexdecoct.h"
static void test_dnssec_canonicalize_one(const char *original, const char *canonical, int r) {
char canonicalized[DNSSEC_CANONICAL_HOSTNAME_MAX];
diff --git a/src/grp-resolve/libbasic-dns/test-resolve-tables.c b/src/grp-resolve/libbasic-dns/test-resolve-tables.c
index 2d615130e1..0eaab70687 100644
--- a/src/grp-resolve/libbasic-dns/test-resolve-tables.c
+++ b/src/grp-resolve/libbasic-dns/test-resolve-tables.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "shared/test-tables.h"
+
#include "dns-type.h"
-#include "test-tables.h"
int main(int argc, char **argv) {
uint16_t i;
diff --git a/src/grp-resolve/nss-resolve/Makefile b/src/grp-resolve/nss-resolve/Makefile
new file mode 100644
index 0000000000..acfbe831ae
--- /dev/null
+++ b/src/grp-resolve/nss-resolve/Makefile
@@ -0,0 +1,46 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+libnss_resolve_la_SOURCES = \
+ src/nss-resolve/nss-resolve.sym \
+ src/nss-resolve/nss-resolve.c
+
+libnss_resolve_la_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ -module \
+ -export-dynamic \
+ -avoid-version \
+ -shared \
+ -shrext .so.2 \
+ -Wl,--version-script=$(srcdir)/nss-resolve.sym
+
+libnss_resolve_la_LIBADD = \
+ libsystemd-internal.la \
+ -ldl
+
+lib_LTLIBRARIES += \
+ libnss_resolve.la
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/nss-resolve/nss-resolve.c b/src/grp-resolve/nss-resolve/nss-resolve.c
index 4c2101d856..e316803a58 100644
--- a/src/grp-resolve/nss-resolve/nss-resolve.c
+++ b/src/grp-resolve/nss-resolve/nss-resolve.c
@@ -26,13 +26,13 @@
#include <systemd/sd-bus.h>
-#include "bus-common-errors.h"
-#include "in-addr-util.h"
-#include "macro.h"
-#include "nss-util.h"
-#include "string-util.h"
-#include "util.h"
-#include "signal-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/macro.h"
+#include "basic/nss-util.h"
+#include "basic/signal-util.h"
+#include "basic/string-util.h"
+#include "basic/util.h"
+#include "sd-bus/bus-common-errors.h"
NSS_GETHOSTBYNAME_PROTOTYPES(resolve);
NSS_GETHOSTBYADDR_PROTOTYPES(resolve);
diff --git a/src/grp-resolve/systemd-resolve/resolve-tool.c b/src/grp-resolve/systemd-resolve/resolve-tool.c
index fbf7b0e4f6..dee23289b3 100644
--- a/src/grp-resolve/systemd-resolve/resolve-tool.c
+++ b/src/grp-resolve/systemd-resolve/resolve-tool.c
@@ -22,17 +22,17 @@
#include <systemd/sd-bus.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "bus-error.h"
-#include "bus-util.h"
-#include "escape.h"
-#include "in-addr-util.h"
-#include "gcrypt-util.h"
-#include "parse-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/escape.h"
+#include "basic/in-addr-util.h"
+#include "basic/parse-util.h"
+#include "basic/terminal-util.h"
#include "resolved-def.h"
#include "resolved-dns-packet.h"
-#include "terminal-util.h"
+#include "sd-bus/bus-error.h"
+#include "shared/bus-util.h"
+#include "shared/gcrypt-util.h"
#define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile
new file mode 100644
index 0000000000..e18b1b3d90
--- /dev/null
+++ b/src/grp-resolve/systemd-resolved/Makefile
@@ -0,0 +1,227 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
+include $(topsrcdir)/build-aux/Makefile.head.mk
+
+
+$(outdir)/dns_type-list.txt: src/resolve/dns-type.h
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
+
+$(outdir)/dns_type-to-name.h: src/resolve/dns_type-list.txt
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
+
+$(outdir)/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
+ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
+
+ifneq ($(ENABLE_RESOLVED),)
+
+basic_dns_sources = \
+ 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-rr.c \
+ src/resolve/resolved-dns-rr.h \
+ src/resolve/resolved-dns-answer.c \
+ src/resolve/resolved-dns-answer.h \
+ src/resolve/resolved-dns-question.c \
+ src/resolve/resolved-dns-question.h \
+ src/resolve/dns-type.c \
+ src/resolve/dns-type.h
+
+systemd_resolved_SOURCES = \
+ src/resolve/resolved.c \
+ src/resolve/resolved-manager.c \
+ src/resolve/resolved-manager.h \
+ src/resolve/resolved-conf.c \
+ src/resolve/resolved-conf.h \
+ src/resolve/resolved-resolv-conf.c \
+ src/resolve/resolved-resolv-conf.h \
+ src/resolve/resolved-bus.c \
+ src/resolve/resolved-bus.h \
+ src/resolve/resolved-link.h \
+ src/resolve/resolved-link.c \
+ src/resolve/resolved-link-bus.c \
+ src/resolve/resolved-link-bus.h \
+ src/resolve/resolved-llmnr.h \
+ src/resolve/resolved-llmnr.c \
+ src/resolve/resolved-mdns.h \
+ src/resolve/resolved-mdns.c \
+ src/resolve/resolved-def.h \
+ $(basic_dns_sources) \
+ src/resolve/resolved-dns-query.h \
+ src/resolve/resolved-dns-query.c \
+ src/resolve/resolved-dns-synthesize.h \
+ src/resolve/resolved-dns-synthesize.c \
+ src/resolve/resolved-dns-transaction.h \
+ src/resolve/resolved-dns-transaction.c \
+ src/resolve/resolved-dns-scope.h \
+ src/resolve/resolved-dns-scope.c \
+ src/resolve/resolved-dns-server.h \
+ src/resolve/resolved-dns-server.c \
+ src/resolve/resolved-dns-search-domain.h \
+ src/resolve/resolved-dns-search-domain.c \
+ src/resolve/resolved-dns-cache.h \
+ src/resolve/resolved-dns-cache.c \
+ src/resolve/resolved-dns-zone.h \
+ src/resolve/resolved-dns-zone.c \
+ src/resolve/resolved-dns-stream.h \
+ src/resolve/resolved-dns-stream.c \
+ src/resolve/resolved-dns-trust-anchor.h \
+ src/resolve/resolved-dns-trust-anchor.c \
+ src/resolve/resolved-etc-hosts.h \
+ src/resolve/resolved-etc-hosts.c \
+ src/shared/gcrypt-util.c \
+ src/shared/gcrypt-util.h
+
+nodist_systemd_resolved_SOURCES = \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h \
+ src/resolve/resolved-gperf.c
+
+systemd_resolved_LDADD = \
+ libsystemd-network.la \
+ libshared.la
+
+rootlibexec_PROGRAMS += \
+ systemd-resolved
+
+nodist_systemunit_DATA += \
+ units/systemd-resolved.service
+
+dist_systemunit_DATA_busnames += \
+ units/org.freedesktop.resolve1.busname
+
+dist_dbuspolicy_DATA += \
+ src/resolve/org.freedesktop.resolve1.conf
+
+dist_dbussystemservice_DATA += \
+ src/resolve/org.freedesktop.resolve1.service
+
+SYSTEM_UNIT_ALIASES += \
+ systemd-resolved.service dbus-org.freedesktop.resolve1.service
+
+BUSNAMES_TARGET_WANTS += \
+ org.freedesktop.resolve1.busname
+
+GENERAL_ALIASES += \
+ $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
+
+nodist_pkgsysconf_DATA += \
+ src/resolve/resolved.conf
+
+systemd_resolve_SOURCES = \
+ src/resolve/resolve-tool.c \
+ $(basic_dns_sources) \
+ src/shared/gcrypt-util.c \
+ src/shared/gcrypt-util.h
+
+nodist_systemd_resolve_SOURCES = \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h
+
+systemd_resolve_LDADD = \
+ libshared.la
+
+bin_PROGRAMS += \
+ systemd-resolve
+
+dist_bashcompletion_data += \
+ shell-completion/bash/systemd-resolve
+
+dist_zshcompletion_data += \
+ shell-completion/zsh/_systemd-resolve
+
+tests += \
+ test-dns-packet \
+ test-resolve-tables \
+ test-dnssec
+
+manual_tests += \
+ test-dnssec-complex
+
+test_resolve_tables_SOURCES = \
+ src/resolve/test-resolve-tables.c \
+ src/resolve/dns_type-from-name.h \
+ src/resolve/dns_type-to-name.h \
+ $(basic_dns_sources) \
+ src/shared/test-tables.h
+
+test_resolve_tables_LDADD = \
+ libshared.la
+
+test_dns_packet_SOURCES = \
+ src/resolve/test-dns-packet.c \
+ $(basic_dns_sources)
+
+test_dns_packet_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DRESOLVE_TEST_DIR=\"$(abs_top_srcdir)/src/resolve/test-data\"
+
+test_dns_packet_LDADD = \
+ libshared.la
+
+EXTRA_DIST += \
+ src/resolve/test-data/_openpgpkey.fedoraproject.org.pkts \
+ src/resolve/test-data/fedoraproject.org.pkts \
+ src/resolve/test-data/gandi.net.pkts \
+ src/resolve/test-data/google.com.pkts \
+ src/resolve/test-data/root.pkts \
+ src/resolve/test-data/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
+ src/resolve/test-data/teamits.com.pkts \
+ src/resolve/test-data/zbyszek@fedoraproject.org.pkts \
+ src/resolve/test-data/_443._tcp.fedoraproject.org.pkts \
+ src/resolve/test-data/kyhwana.org.pkts \
+ src/resolve/test-data/fake-caa.pkts
+
+test_dnssec_SOURCES = \
+ src/resolve/test-dnssec.c \
+ $(basic_dns_sources)
+
+test_dnssec_LDADD = \
+ libshared.la
+
+test_dnssec_complex_SOURCES = \
+ src/resolve/test-dnssec-complex.c \
+ src/resolve/dns-type.c \
+ src/resolve/dns-type.h
+
+test_dnssec_complex_LDADD = \
+ libshared.la
+
+endif # ENABLE_RESOLVED
+
+gperf_txt_sources += \
+ src/resolve/dns_type-list.txt
+
+gperf_gperf_sources += \
+ src/resolve/resolved-gperf.gperf
+
+EXTRA_DIST += \
+ units/systemd-resolved.service.m4.in \
+ src/resolve/resolved.conf.in
+
+include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/resolved-bus.c b/src/grp-resolve/systemd-resolved/resolved-bus.c
index 33f7c61557..1454e1f5f4 100644
--- a/src/grp-resolve/systemd-resolved/resolved-bus.c
+++ b/src/grp-resolve/systemd-resolved/resolved-bus.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-common-errors.h"
-#include "bus-util.h"
-#include "dns-domain.h"
-#include "resolved-bus.h"
+#include "basic/alloc-util.h"
#include "resolved-def.h"
+#include "sd-bus/bus-common-errors.h"
+#include "shared/bus-util.h"
+#include "shared/dns-domain.h"
+
+#include "resolved-bus.h"
#include "resolved-dns-synthesize.h"
#include "resolved-link-bus.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-conf.c b/src/grp-resolve/systemd-resolved/resolved-conf.c
index 990dc03b60..4dc169094b 100644
--- a/src/grp-resolve/systemd-resolved/resolved-conf.c
+++ b/src/grp-resolve/systemd-resolved/resolved-conf.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "conf-parser.h"
-#include "def.h"
-#include "extract-word.h"
-#include "parse-util.h"
+#include "basic/alloc-util.h"
+#include "basic/def.h"
+#include "basic/extract-word.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "shared/conf-parser.h"
+
#include "resolved-conf.h"
-#include "string-util.h"
int manager_add_dns_server_by_string(Manager *m, DnsServerType type, const char *word) {
union in_addr_union address;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
index 77c42d7aad..33e0582d98 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-cache.c
@@ -19,13 +19,14 @@
#include <net/if.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/string-util.h"
#include "resolved-dns-answer.h"
-#include "resolved-dns-cache.h"
#include "resolved-dns-packet.h"
-#include "string-util.h"
+#include "shared/dns-domain.h"
+
+#include "resolved-dns-cache.h"
/* Never cache more than 4K entries. RFC 1536, Section 5 suggests to
* leave DNS caches unbounded, but that's crazy. */
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-cache.h b/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
index 2293718e86..e7cdd2e27a 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-cache.h
@@ -19,10 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
-#include "list.h"
-#include "prioq.h"
-#include "time-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/prioq.h"
+#include "basic/time-util.h"
typedef struct DnsCache {
Hashmap *by_key;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.c b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
index ea04e58d61..7b9282a69d 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.c
@@ -17,15 +17,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "basic/string-util.h"
#include "dns-type.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "sd-netlink/local-addresses.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-query.h"
#include "resolved-dns-synthesize.h"
#include "resolved-etc-hosts.h"
-#include "string-util.h"
/* How long to wait for the query in total */
#define QUERY_TIMEOUT_USEC (30 * USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-query.h b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
index 7f7c76ff20..4a127930bd 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-query.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-query.h
@@ -22,15 +22,15 @@
#include <systemd/sd-bus.h>
-#include "set.h"
+#include "basic/set.h"
+#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
-typedef struct DnsQueryCandidate DnsQueryCandidate;
typedef struct DnsQuery DnsQuery;
+typedef struct DnsQueryCandidate DnsQueryCandidate;
-#include "resolved-dns-answer.h"
-#include "resolved-dns-question.h"
-#include "resolved-dns-stream.h"
#include "resolved-dns-search-domain.h"
+#include "resolved-dns-stream.h"
struct DnsQueryCandidate {
DnsQuery *query;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.c b/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
index 66e4585c18..cf878cc783 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.c
@@ -19,18 +19,19 @@
#include <netinet/tcp.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "hostname-util.h"
-#include "missing.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/hostname-util.h"
+#include "basic/missing.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#include "basic/strv.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-scope.h"
#include "resolved-llmnr.h"
#include "resolved-mdns.h"
-#include "socket-util.h"
-#include "strv.h"
#define MULTICAST_RATELIMIT_INTERVAL_USEC (1*USEC_PER_SEC)
#define MULTICAST_RATELIMIT_BURST 1000
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
index 291e5817d0..af1d01f694 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
@@ -19,13 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "list.h"
+#include "basic/list.h"
+#include "resolved-dns-dnssec.h"
+#include "resolved-dns-packet.h"
typedef struct DnsScope DnsScope;
#include "resolved-dns-cache.h"
-#include "resolved-dns-dnssec.h"
-#include "resolved-dns-packet.h"
#include "resolved-dns-server.h"
#include "resolved-dns-zone.h"
#include "resolved-link.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
index 732471027b..7798c498a0 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.c
@@ -17,8 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
+#include "basic/alloc-util.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-search-domain.h"
int dns_search_domain_new(
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
index eaacef4edc..f047941db2 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-search-domain.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
+#include "basic/macro.h"
typedef struct DnsSearchDomain DnsSearchDomain;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.c b/src/grp-resolve/systemd-resolved/resolved-dns-server.c
index dedc9beb19..be11cfa743 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.c
@@ -19,12 +19,13 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
+#include "basic/alloc-util.h"
+#include "basic/siphash24.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+
#include "resolved-dns-server.h"
#include "resolved-resolv-conf.h"
-#include "siphash24.h"
-#include "string-table.h"
-#include "string-util.h"
/* After how much time to repeat classic DNS requests */
#define DNS_TIMEOUT_MIN_USEC (500 * USEC_PER_MSEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.h b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
index 9f4a69c37a..2855c97faa 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "in-addr-util.h"
+#include "basic/in-addr-util.h"
typedef struct DnsServer DnsServer;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.c b/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
index a1040aeff4..0c55f6d6c7 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.c
@@ -19,10 +19,11 @@
#include <netinet/tcp.h>
-#include "alloc-util.h"
-#include "fd-util.h"
-#include "io-util.h"
-#include "missing.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/io-util.h"
+#include "basic/missing.h"
+
#include "resolved-dns-stream.h"
#define DNS_STREAM_TIMEOUT_USEC (10 * USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
index 5ccc842249..e610986833 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
@@ -19,11 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "socket-util.h"
+#include "basic/socket-util.h"
+#include "resolved-dns-packet.h"
typedef struct DnsStream DnsStream;
-#include "resolved-dns-packet.h"
#include "resolved-dns-transaction.h"
struct DnsStream {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
index e3003411f7..16e0410f98 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "hostname-util.h"
-#include "local-addresses.h"
+#include "basic/alloc-util.h"
+#include "basic/hostname-util.h"
+#include "sd-netlink/local-addresses.h"
+
#include "resolved-dns-synthesize.h"
int dns_synthesize_ifindex(int ifindex) {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
index 5d829bb2e7..2309105068 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-synthesize.h
@@ -21,6 +21,7 @@
#include "resolved-dns-answer.h"
#include "resolved-dns-question.h"
+
#include "resolved-manager.h"
int dns_synthesize_ifindex(int ifindex);
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
index 1b4b2b804b..3a19b12b47 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.c
@@ -19,16 +19,17 @@
#include <systemd/sd-messages.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "errno-list.h"
-#include "fd-util.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/errno-list.h"
+#include "basic/fd-util.h"
+#include "basic/random-util.h"
+#include "basic/string-table.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-cache.h"
#include "resolved-dns-transaction.h"
#include "resolved-llmnr.h"
-#include "string-table.h"
#define TRANSACTIONS_MAX 4096
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
index 0972792341..c9f221d425 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.c
@@ -19,19 +19,20 @@
#include <systemd/sd-messages.h>
-#include "alloc-util.h"
-#include "conf-files.h"
-#include "def.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio.h"
-#include "hexdecoct.h"
-#include "parse-util.h"
-#include "resolved-dns-trust-anchor.h"
+#include "basic/alloc-util.h"
+#include "basic/conf-files.h"
+#include "basic/def.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hexdecoct.h"
+#include "basic/parse-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
#include "resolved-dns-dnssec.h"
-#include "set.h"
-#include "string-util.h"
-#include "strv.h"
+#include "shared/dns-domain.h"
+
+#include "resolved-dns-trust-anchor.h"
static const char trust_anchor_dirs[] = CONF_PATHS_NULSTR("dnssec-trust-anchors.d");
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
index 635c75fde5..ee5cda0748 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-trust-anchor.h
@@ -19,12 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-typedef struct DnsTrustAnchor DnsTrustAnchor;
-
-#include "hashmap.h"
+#include "basic/hashmap.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-rr.h"
+typedef struct DnsTrustAnchor DnsTrustAnchor;
+
/* This contains a fixed database mapping domain names to DS or DNSKEY records. */
struct DnsTrustAnchor {
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-zone.c b/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
index 850eed8cb8..3d5bc9ea82 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-zone.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "list.h"
+#include "basic/alloc-util.h"
+#include "basic/list.h"
+#include "basic/string-util.h"
#include "resolved-dns-packet.h"
+#include "shared/dns-domain.h"
+
#include "resolved-dns-zone.h"
-#include "string-util.h"
/* Never allow more than 1K entries */
#define ZONE_MAX 1024
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-zone.h b/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
index 408833c359..baddbc78ec 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-zone.h
@@ -19,7 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "hashmap.h"
+#include "basic/hashmap.h"
typedef struct DnsZone {
Hashmap *by_key;
diff --git a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
index 40d650949d..2bab6fdc35 100644
--- a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
+++ b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.c
@@ -17,14 +17,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "fd-util.h"
-#include "fileio.h"
-#include "hostname-util.h"
-#include "resolved-etc-hosts.h"
+#include "basic/fd-util.h"
+#include "basic/fileio.h"
+#include "basic/hostname-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "basic/time-util.h"
+
#include "resolved-dns-synthesize.h"
-#include "string-util.h"
-#include "strv.h"
-#include "time-util.h"
+#include "resolved-etc-hosts.h"
/* Recheck /etc/hosts at most once every 2s */
#define ETC_HOSTS_RECHECK_USEC (2*USEC_PER_SEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
index 9d5a175f18..e68d87417e 100644
--- a/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
+++ b/src/grp-resolve/systemd-resolved/resolved-etc-hosts.h
@@ -19,9 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "resolved-manager.h"
-#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
+#include "resolved-dns-question.h"
+
+#include "resolved-manager.h"
void manager_etc_hosts_flush(Manager *m);
int manager_etc_hosts_read(Manager *m);
diff --git a/src/grp-resolve/systemd-resolved/resolved-link-bus.c b/src/grp-resolve/systemd-resolved/resolved-link-bus.c
index 7f21891819..122c4dd45d 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link-bus.c
+++ b/src/grp-resolve/systemd-resolved/resolved-link-bus.c
@@ -17,13 +17,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "alloc-util.h"
-#include "bus-util.h"
-#include "parse-util.h"
-#include "resolve-util.h"
+#include "basic/alloc-util.h"
+#include "basic/parse-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+#include "shared/resolve-util.h"
+
#include "resolved-bus.h"
#include "resolved-link-bus.h"
-#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_resolve_support, resolve_support, ResolveSupport);
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_dnssec_mode, dnssec_mode, DnssecMode);
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.c b/src/grp-resolve/systemd-resolved/resolved-link.c
index 4eef20599a..1d23e49172 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.c
+++ b/src/grp-resolve/systemd-resolved/resolved-link.c
@@ -19,14 +19,14 @@
#include <net/if.h>
-#include <systemd/sd-network.h>
+#include "basic/alloc-util.h"
+#include "basic/missing.h"
+#include "basic/parse-util.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "sd-network/sd-network.h"
-#include "alloc-util.h"
-#include "missing.h"
-#include "parse-util.h"
#include "resolved-link.h"
-#include "string-util.h"
-#include "strv.h"
int link_new(Manager *m, Link **ret, int ifindex) {
_cleanup_(link_freep) Link *l = NULL;
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.h b/src/grp-resolve/systemd-resolved/resolved-link.h
index f534c12824..53a5f597ef 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.h
+++ b/src/grp-resolve/systemd-resolved/resolved-link.h
@@ -21,14 +21,14 @@
#include <net/if.h>
-#include "in-addr-util.h"
-#include "ratelimit.h"
-#include "resolve-util.h"
+#include "basic/in-addr-util.h"
+#include "basic/ratelimit.h"
+#include "resolved-dns-rr.h"
+#include "shared/resolve-util.h"
typedef struct Link Link;
typedef struct LinkAddress LinkAddress;
-#include "resolved-dns-rr.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-manager.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-llmnr.c b/src/grp-resolve/systemd-resolved/resolved-llmnr.c
index 8b1d71a3eb..24b7a4784f 100644
--- a/src/grp-resolve/systemd-resolved/resolved-llmnr.c
+++ b/src/grp-resolve/systemd-resolved/resolved-llmnr.c
@@ -20,7 +20,8 @@
#include <netinet/in.h>
#include <resolv.h>
-#include "fd-util.h"
+#include "basic/fd-util.h"
+
#include "resolved-llmnr.h"
#include "resolved-manager.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.c b/src/grp-resolve/systemd-resolved/resolved-manager.c
index 7166b94d71..b82c2569bf 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.c
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.c
@@ -21,18 +21,23 @@
#include <poll.h>
#include <sys/ioctl.h>
-#include "af-list.h"
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "hostname-util.h"
-#include "io-util.h"
-#include "netlink-util.h"
-#include "network-internal.h"
-#include "ordered-set.h"
-#include "parse-util.h"
-#include "random-util.h"
+#include "basic/af-list.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/hostname-util.h"
+#include "basic/io-util.h"
+#include "basic/ordered-set.h"
+#include "basic/parse-util.h"
+#include "basic/random-util.h"
+#include "basic/socket-util.h"
+#include "basic/string-table.h"
+#include "basic/string-util.h"
+#include "basic/utf8.h"
+#include "sd-netlink/netlink-util.h"
+#include "shared/dns-domain.h"
+#include "systemd-network/network-internal.h"
+
#include "resolved-bus.h"
#include "resolved-conf.h"
#include "resolved-etc-hosts.h"
@@ -40,10 +45,6 @@
#include "resolved-manager.h"
#include "resolved-mdns.h"
#include "resolved-resolv-conf.h"
-#include "socket-util.h"
-#include "string-table.h"
-#include "string-util.h"
-#include "utf8.h"
#define SEND_TIMEOUT_USEC (200 * USEC_PER_MSEC)
diff --git a/src/grp-resolve/systemd-resolved/resolved-manager.h b/src/grp-resolve/systemd-resolved/resolved-manager.h
index 8bef2d2b28..dd2a534213 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.h
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.h
@@ -20,13 +20,13 @@
***/
#include <systemd/sd-event.h>
-#include <systemd/sd-netlink.h>
-#include <systemd/sd-network.h>
-#include "hashmap.h"
-#include "list.h"
-#include "ordered-set.h"
-#include "resolve-util.h"
+#include "basic/hashmap.h"
+#include "basic/list.h"
+#include "basic/ordered-set.h"
+#include "sd-netlink/sd-netlink.h"
+#include "sd-network/sd-network.h"
+#include "shared/resolve-util.h"
typedef struct Manager Manager;
diff --git a/src/grp-resolve/systemd-resolved/resolved-mdns.c b/src/grp-resolve/systemd-resolved/resolved-mdns.c
index b13b1d0144..0c78f7bda5 100644
--- a/src/grp-resolve/systemd-resolved/resolved-mdns.c
+++ b/src/grp-resolve/systemd-resolved/resolved-mdns.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <resolv.h>
-#include <netinet/in.h>
#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <resolv.h>
+
+#include "basic/fd-util.h"
-#include "fd-util.h"
#include "resolved-manager.h"
#include "resolved-mdns.h"
diff --git a/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c b/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
index ff03acc772..c50796de2e 100644
--- a/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
+++ b/src/grp-resolve/systemd-resolved/resolved-resolv-conf.c
@@ -19,16 +19,17 @@
#include <resolv.h>
-#include "alloc-util.h"
-#include "dns-domain.h"
-#include "fd-util.h"
-#include "fileio-label.h"
-#include "fileio.h"
-#include "ordered-set.h"
+#include "basic/alloc-util.h"
+#include "basic/fd-util.h"
+#include "basic/fileio-label.h"
+#include "basic/fileio.h"
+#include "basic/ordered-set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/dns-domain.h"
+
#include "resolved-conf.h"
#include "resolved-resolv-conf.h"
-#include "string-util.h"
-#include "strv.h"
int manager_read_resolv_conf(Manager *m) {
_cleanup_fclose_ FILE *f = NULL;
diff --git a/src/grp-resolve/systemd-resolved/resolved.c b/src/grp-resolve/systemd-resolved/resolved.c
index 086a2fcac7..07952227ce 100644
--- a/src/grp-resolve/systemd-resolved/resolved.c
+++ b/src/grp-resolve/systemd-resolved/resolved.c
@@ -20,14 +20,15 @@
#include <systemd/sd-daemon.h>
#include <systemd/sd-event.h>
-#include "capability-util.h"
-#include "mkdir.h"
+#include "basic/capability-util.h"
+#include "basic/mkdir.h"
+#include "basic/selinux-util.h"
+#include "basic/signal-util.h"
+#include "basic/user-util.h"
+
#include "resolved-conf.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
-#include "selinux-util.h"
-#include "signal-util.h"
-#include "user-util.h"
int main(int argc, char *argv[]) {
_cleanup_(manager_freep) Manager *m = NULL;