summaryrefslogtreecommitdiff
path: root/src/grp-resolve
diff options
context:
space:
mode:
Diffstat (limited to 'src/grp-resolve')
-rw-r--r--src/grp-resolve/Makefile3
-rw-r--r--src/grp-resolve/libbasic-dns/Makefile30
-rw-r--r--src/grp-resolve/systemd-resolve/Makefile8
-rw-r--r--src/grp-resolve/systemd-resolved/Makefile28
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-scope.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-server.h20
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-stream.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-dns-transaction.h2
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-link.h1
-rw-r--r--src/grp-resolve/systemd-resolved/resolved-manager.c1
10 files changed, 57 insertions, 39 deletions
diff --git a/src/grp-resolve/Makefile b/src/grp-resolve/Makefile
index 8132573d49..5e90fec8c7 100644
--- a/src/grp-resolve/Makefile
+++ b/src/grp-resolve/Makefile
@@ -23,6 +23,9 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+dist_systempreset_DATA = \
+ 90-resolved.preset
+
nested.subdirs += libbasic-dns
nested.subdirs += nss-resolve
nested.subdirs += systemd-resolve
diff --git a/src/grp-resolve/libbasic-dns/Makefile b/src/grp-resolve/libbasic-dns/Makefile
index 40ee1e85b5..e5c32d8539 100644
--- a/src/grp-resolve/libbasic-dns/Makefile
+++ b/src/grp-resolve/libbasic-dns/Makefile
@@ -23,15 +23,30 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-$(outdir)/dns_type-list.txt: src/resolve/dns-type.h
+$(outdir)/dns_type-list.txt: $(srcdir)/dns-type.h
$(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
-$(outdir)/dns_type-to-name.h: src/resolve/dns_type-list.txt
+$(outdir)/dns_type-to-name.h: $(outdir)/dns_type-list.txt
$(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
+$(outdir)/dns_type-from-name.gperf: $(outdir)/dns_type-list.txt
$(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 }' <$< >$@
+basic_dns_sources =
+libbasic_dns_la_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
+
tests += \
test-dns-packet \
test-resolve-tables \
@@ -51,6 +66,7 @@ test_resolve_tables_CFLAGS = \
$(GCRYPT_CFLAGS)
test_resolve_tables_LDADD = \
+ libbasic-dns.la \
libsystemd-shared.la \
$(GCRYPT_LIBS) \
-lm
@@ -66,7 +82,7 @@ test_dns_packet_CFLAGS = \
$(GCRYPT_CFLAGS)
test_dns_packet_LDADD = \
- libsystemd-shared.la \
+ libbasic-dns.la \
$(GCRYPT_LIBS) \
-lm
@@ -91,6 +107,7 @@ test_dnssec_CFLAGS = \
$(GCRYPT_CFLAGS)
test_dnssec_LDADD = \
+ libbasic-dns.la \
libsystemd-shared.la \
$(GCRYPT_LIBS) \
-lm
@@ -103,7 +120,8 @@ test_dnssec_complex_SOURCES = \
test_dnssec_complex_LDADD = \
libsystemd-shared.la
-gperf_txt_sources += \
- src/resolve/dns_type-list.txt
+noinst_LTLIBRARIES = libbasic-dns.la
+libbasic_dns_la_LIBADD = libshared.la
+$(outdir)/dns-type.lo: $(outdir)/dns_type-from-name.h $(outdir)/dns_type-to-name.h
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolve/Makefile b/src/grp-resolve/systemd-resolve/Makefile
index 9d9b46d58d..48c2ec1e26 100644
--- a/src/grp-resolve/systemd-resolve/Makefile
+++ b/src/grp-resolve/systemd-resolve/Makefile
@@ -23,11 +23,11 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
+basic_dns_sources =
+
systemd_resolve_SOURCES = \
src/resolve/resolve-tool.c \
- $(basic_dns_sources) \
- src/shared/gcrypt-util.c \
- src/shared/gcrypt-util.h
+ $(basic_dns_sources)
nodist_systemd_resolve_SOURCES = \
src/resolve/dns_type-from-name.h \
@@ -50,4 +50,6 @@ dist_bashcompletion_data += \
dist_zshcompletion_data += \
shell-completion/zsh/_systemd-resolve
+systemd_resolve_LDADD += libbasic-dns.la
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/Makefile b/src/grp-resolve/systemd-resolved/Makefile
index 78b352b76f..be55959cb2 100644
--- a/src/grp-resolve/systemd-resolved/Makefile
+++ b/src/grp-resolve/systemd-resolved/Makefile
@@ -23,21 +23,7 @@
include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk
-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
+basic_dns_sources =
systemd_resolved_SOURCES = \
src/resolve/resolved.c \
@@ -82,9 +68,7 @@ systemd_resolved_SOURCES = \
src/resolve/resolved-dns-stub.h \
src/resolve/resolved-dns-stub.c \
src/resolve/resolved-etc-hosts.h \
- src/resolve/resolved-etc-hosts.c \
- src/shared/gcrypt-util.c \
- src/shared/gcrypt-util.h
+ src/resolve/resolved-etc-hosts.c
nodist_systemd_resolved_SOURCES = \
src/resolve/dns_type-from-name.h \
@@ -127,7 +111,9 @@ GENERAL_ALIASES += \
nodist_pkgsysconf_DATA += \
src/resolve/resolved.conf
-endif # ENABLE_RESOLVED
+gperf_txt_sources += \
+ src/resolve/dns_type-list.txt
+
gperf_gperf_sources += \
src/resolve/resolved-gperf.gperf
@@ -138,4 +124,8 @@ EXTRA_DIST += \
dist_rootlibexec_DATA += \
src/resolve/resolv.conf
+systemd_resolved_LDADD += libbasic-dns.la
+
+sd.CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
index 4a6842013a..c4bc95da45 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-scope.h
@@ -27,8 +27,10 @@ typedef struct DnsScope DnsScope;
#include "resolved-dns-cache.h"
#include "resolved-dns-server.h"
+#include "resolved-dns-stream.h"
#include "resolved-dns-zone.h"
#include "resolved-link.h"
+#include "resolved-manager.h"
typedef enum DnsScopeMatch {
DNS_SCOPE_NO,
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-server.h b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
index 9e216fb991..e1f0ac5fd9 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-server.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-server.h
@@ -23,16 +23,6 @@
typedef struct DnsServer DnsServer;
-typedef enum DnsServerType {
- DNS_SERVER_SYSTEM,
- DNS_SERVER_FALLBACK,
- DNS_SERVER_LINK,
-} DnsServerType;
-#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1)
-
-const char* dns_server_type_to_string(DnsServerType i) _const_;
-DnsServerType dns_server_type_from_string(const char *s) _pure_;
-
typedef enum DnsServerFeatureLevel {
DNS_SERVER_FEATURE_LEVEL_TCP,
DNS_SERVER_FEATURE_LEVEL_UDP,
@@ -52,6 +42,16 @@ int dns_server_feature_level_from_string(const char *s) _pure_;
#include "resolved-link.h"
#include "resolved-manager.h"
+typedef enum DnsServerType {
+ DNS_SERVER_SYSTEM,
+ DNS_SERVER_FALLBACK,
+ DNS_SERVER_LINK,
+} DnsServerType;
+#define _DNS_SERVER_TYPE_MAX (DNS_SERVER_LINK + 1)
+
+const char* dns_server_type_to_string(DnsServerType i) _const_;
+DnsServerType dns_server_type_from_string(const char *s) _pure_;
+
struct DnsServer {
Manager *manager;
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
index 92b2579fc6..6538da457a 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-stream.h
@@ -25,6 +25,7 @@
typedef struct DnsStream DnsStream;
#include "resolved-dns-transaction.h"
+#include "resolved-manager.h"
/* Streams are used by three subsystems:
*
diff --git a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
index 26307f84ac..5837e982d4 100644
--- a/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
+++ b/src/grp-resolve/systemd-resolved/resolved-dns-transaction.h
@@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <systemd/sd-event.h>
+
typedef struct DnsTransaction DnsTransaction;
typedef enum DnsTransactionState DnsTransactionState;
typedef enum DnsTransactionSource DnsTransactionSource;
diff --git a/src/grp-resolve/systemd-resolved/resolved-link.h b/src/grp-resolve/systemd-resolved/resolved-link.h
index 0d7ce15f65..def8b097e4 100644
--- a/src/grp-resolve/systemd-resolved/resolved-link.h
+++ b/src/grp-resolve/systemd-resolved/resolved-link.h
@@ -29,6 +29,7 @@
typedef struct Link Link;
typedef struct LinkAddress LinkAddress;
+#include "resolved-dns-scope.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-manager.c b/src/grp-resolve/systemd-resolved/resolved-manager.c
index 800f06db13..0fff82bd98 100644
--- a/src/grp-resolve/systemd-resolved/resolved-manager.c
+++ b/src/grp-resolve/systemd-resolved/resolved-manager.c
@@ -35,7 +35,6 @@
#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"