resolved: Break include cycles

This commit is contained in:
Daan De Meyer
2020-05-07 09:00:48 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 96249bf8d6
commit be28f72d6a
18 changed files with 53 additions and 31 deletions
+3
View File
@@ -9,6 +9,9 @@
#include "resolved-conf.h"
#include "resolved-dnssd.h"
#include "resolved-util.h"
#include "resolved-manager.h"
#include "resolved-dns-search-domain.h"
#include "dns-domain.h"
#include "specifier.h"
#include "string-table.h"
#include "string-util.h"
-1
View File
@@ -14,7 +14,6 @@ enum DnsStubListenerMode {
_DNS_STUB_LISTENER_MODE_INVALID = -1
};
#include "resolved-manager.h"
#include "resolved-dns-server.h"
int manager_parse_config_file(Manager *m);
+1 -1
View File
@@ -10,8 +10,8 @@ typedef struct DnsQuery DnsQuery;
#include "resolved-dns-answer.h"
#include "resolved-dns-question.h"
#include "resolved-dns-stream.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-transaction.h"
struct DnsQueryCandidate {
DnsQuery *query;
+3 -2
View File
@@ -2,18 +2,19 @@
#pragma once
#include "list.h"
#include "ratelimit.h"
typedef struct DnsQueryCandidate DnsQueryCandidate;
typedef struct DnsScope DnsScope;
#include "resolved-dns-cache.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-query.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-dns-zone.h"
#include "resolved-link.h"
typedef enum DnsScopeMatch {
DNS_SCOPE_NO,
+2
View File
@@ -3,6 +3,8 @@
#include "alloc-util.h"
#include "dns-domain.h"
#include "resolved-dns-search-domain.h"
#include "resolved-link.h"
#include "resolved-manager.h"
int dns_search_domain_new(
Manager *m,
+3 -3
View File
@@ -1,18 +1,18 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "list.h"
#include "macro.h"
typedef struct DnsSearchDomain DnsSearchDomain;
typedef struct Link Link;
typedef struct Manager Manager;
typedef enum DnsSearchDomainType {
DNS_SEARCH_DOMAIN_SYSTEM,
DNS_SEARCH_DOMAIN_LINK,
} DnsSearchDomainType;
#include "resolved-link.h"
#include "resolved-manager.h"
struct DnsSearchDomain {
Manager *manager;
+1
View File
@@ -6,6 +6,7 @@
#include "resolved-bus.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stub.h"
#include "resolved-manager.h"
#include "resolved-resolv-conf.h"
#include "siphash24.h"
#include "string-table.h"
+10 -4
View File
@@ -2,8 +2,18 @@
#pragma once
#include "in-addr-util.h"
#include "list.h"
#include "resolve-util.h"
#include "time-util.h"
typedef struct DnsScope DnsScope;
typedef struct DnsServer DnsServer;
typedef struct DnsStream DnsStream;
typedef struct DnsPacket DnsPacket;
typedef struct Link Link;
typedef struct Manager Manager;
#include "resolved-dnstls.h"
typedef enum DnsServerType {
DNS_SERVER_SYSTEM,
@@ -35,10 +45,6 @@ typedef enum DnsServerFeatureLevel {
const char* dns_server_feature_level_to_string(int i) _const_;
int dns_server_feature_level_from_string(const char *s) _pure_;
#include "resolved-dnstls.h"
#include "resolved-link.h"
#include "resolved-manager.h"
struct DnsServer {
Manager *manager;
+1
View File
@@ -8,6 +8,7 @@
#include "io-util.h"
#include "missing_network.h"
#include "resolved-dns-stream.h"
#include "resolved-manager.h"
#define DNS_STREAM_TIMEOUT_USEC (10 * USEC_PER_SEC)
#define DNS_STREAMS_MAX 128
+9 -5
View File
@@ -1,9 +1,18 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "sd-event.h"
#include "ordered-set.h"
#include "socket-util.h"
typedef struct DnsServer DnsServer;
typedef struct DnsStream DnsStream;
typedef struct DnsTransaction DnsTransaction;
typedef struct Manager Manager;
#include "resolved-dns-packet.h"
#include "resolved-dnstls.h"
typedef enum DnsStreamType {
DNS_STREAM_LOOKUP, /* Outgoing connection to a classic DNS server */
@@ -14,11 +23,6 @@ typedef enum DnsStreamType {
_DNS_STREAM_TYPE_INVALID = -1,
} DnsStreamType;
#include "resolved-dns-packet.h"
#include "resolved-dns-transaction.h"
#include "resolved-dnstls.h"
#include "resolved-manager.h"
#define DNS_STREAM_WRITE_TLS_DATA 1
/* Streams are used by three subsystems:
+8 -7
View File
@@ -1,10 +1,18 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "sd-event.h"
typedef struct DnsTransaction DnsTransaction;
typedef enum DnsTransactionState DnsTransactionState;
typedef enum DnsTransactionSource DnsTransactionSource;
#include "resolved-dns-answer.h"
#include "resolved-dns-dnssec.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-server.h"
enum DnsTransactionState {
DNS_TRANSACTION_NULL,
DNS_TRANSACTION_PENDING,
@@ -37,13 +45,6 @@ enum DnsTransactionSource {
_DNS_TRANSACTION_SOURCE_INVALID = -1
};
#include "resolved-dns-answer.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
struct DnsTransaction {
DnsScope *scope;
+1
View File
@@ -6,6 +6,7 @@
#include "resolved-dns-packet.h"
#include "resolved-dns-zone.h"
#include "resolved-dnssd.h"
#include "resolved-manager.h"
#include "string-util.h"
/* Never allow more than 1K entries */
+1
View File
@@ -6,6 +6,7 @@
#include "resolved-dnssd-bus.h"
#include "resolved-dnssd.h"
#include "resolved-link.h"
#include "resolved-manager.h"
#include "strv.h"
#include "user-util.h"
+1
View File
@@ -8,6 +8,7 @@
#include "resolved-dns-stream.h"
#include "resolved-dnstls.h"
#include "resolved-manager.h"
#define TLS_PROTOCOL_PRIORITY "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2"
DEFINE_TRIVIAL_CLEANUP_FUNC(gnutls_session_t, gnutls_deinit);
+5 -4
View File
@@ -3,9 +3,14 @@
#if ENABLE_DNS_OVER_TLS
#include <stdint.h>
typedef struct DnsServer DnsServer;
typedef struct DnsStream DnsStream;
typedef struct DnsTlsManagerData DnsTlsManagerData;
typedef struct DnsTlsServerData DnsTlsServerData;
typedef struct DnsTlsStreamData DnsTlsStreamData;
typedef struct Manager Manager;
#if DNS_OVER_TLS_USE_GNUTLS
#include "resolved-dnstls-gnutls.h"
@@ -15,10 +20,6 @@ typedef struct DnsTlsStreamData DnsTlsStreamData;
#error Unknown dependency for supporting DNS-over-TLS
#endif
#include "resolved-dns-stream.h"
#include "resolved-dns-transaction.h"
#include "resolved-manager.h"
#define DNSTLS_STREAM_CLOSED 1
int dnstls_stream_connect_tls(DnsStream *stream, DnsServer *server);
+2 -1
View File
@@ -5,6 +5,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
#include <stddef.h>
#include "conf-parser.h"
#include "resolved-conf.h"
#include "resolved-manager.h"
%}
struct ConfigPerfItem;
%null_strings
@@ -26,4 +27,4 @@ Resolve.DNSSEC, config_parse_dnssec_mode, 0,
Resolve.DNSOverTLS, config_parse_dns_over_tls_mode, 0, offsetof(Manager, dns_over_tls_mode)
Resolve.Cache, config_parse_dns_cache_mode, DNS_CACHE_MODE_YES, offsetof(Manager, enable_cache)
Resolve.DNSStubListener, config_parse_dns_stub_listener_mode, 0, offsetof(Manager, dns_stub_listener_mode)
Resolve.ReadEtcHosts, config_parse_bool, 0, offsetof(Manager, read_etc_hosts)
Resolve.ReadEtcHosts, config_parse_bool, 0, offsetof(Manager, read_etc_hosts)
+2 -1
View File
@@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "sd-netlink.h"
#include "in-addr-util.h"
#include "ratelimit.h"
#include "resolve-util.h"
@@ -12,7 +14,6 @@ typedef struct LinkAddress LinkAddress;
#include "resolved-dns-scope.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-manager.h"
#define LINK_SEARCH_DOMAINS_MAX 256
#define LINK_DNS_SERVERS_MAX 256
-2
View File
@@ -15,10 +15,8 @@ typedef struct Manager Manager;
#include "resolved-conf.h"
#include "resolved-dns-query.h"
#include "resolved-dns-search-domain.h"
#include "resolved-dns-server.h"
#include "resolved-dns-stream.h"
#include "resolved-dns-trust-anchor.h"
#include "resolved-dnstls.h"
#include "resolved-link.h"
#define MANAGER_SEARCH_DOMAINS_MAX 256