]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/resolve/resolved-dns-scope.h
ldconfig: add configure option to disable
[thirdparty/systemd.git] / src / resolve / resolved-dns-scope.h
CommitLineData
74b2466e
LP
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3#pragma once
4
5/***
6 This file is part of systemd.
7
8 Copyright 2014 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include "list.h"
25
26typedef struct DnsScope DnsScope;
27
74b2466e
LP
28#include "resolved-dns-server.h"
29#include "resolved-dns-packet.h"
30#include "resolved-dns-query.h"
322345fd 31#include "resolved-dns-cache.h"
623a4c97
LP
32#include "resolved-dns-zone.h"
33#include "resolved-dns-stream.h"
39d8db04
LP
34#include "resolved-manager.h"
35#include "resolved-link.h"
74b2466e 36
74b2466e
LP
37typedef enum DnsScopeMatch {
38 DNS_SCOPE_NO,
39 DNS_SCOPE_MAYBE,
40 DNS_SCOPE_YES,
41 _DNS_SCOPE_MATCH_MAX,
42 _DNS_SCOPE_INVALID = -1
43} DnsScopeMatch;
44
45struct DnsScope {
46 Manager *manager;
47
1716f6dc 48 DnsProtocol protocol;
0dd25fb9 49 int family;
74b2466e
LP
50
51 Link *link;
52
53 char **domains;
54
322345fd 55 DnsCache cache;
623a4c97 56 DnsZone zone;
322345fd 57
a4076574
LP
58 Hashmap *conflict_queue;
59 sd_event_source *conflict_event_source;
60
aea2429d
LP
61 RateLimit ratelimit;
62
ec2c5e43 63 LIST_HEAD(DnsTransaction, transactions);
74b2466e
LP
64
65 LIST_FIELDS(DnsScope, scopes);
66};
67
0dd25fb9 68int dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol p, int family);
74b2466e
LP
69DnsScope* dns_scope_free(DnsScope *s);
70
a4076574 71int dns_scope_emit(DnsScope *s, DnsPacket *p);
623a4c97 72int dns_scope_tcp_socket(DnsScope *s, int family, const union in_addr_union *address, uint16_t port);
ad867662 73
1716f6dc
LP
74DnsScopeMatch dns_scope_good_domain(DnsScope *s, const char *domain);
75int dns_scope_good_key(DnsScope *s, DnsResourceKey *key);
623a4c97 76int dns_scope_good_dns_server(DnsScope *s, int family, const union in_addr_union *address);
74b2466e 77
2c27fbca 78DnsServer *dns_scope_get_dns_server(DnsScope *s);
74b2466e 79void dns_scope_next_dns_server(DnsScope *s);
1716f6dc
LP
80
81int dns_scope_llmnr_membership(DnsScope *s, bool b);
623a4c97
LP
82
83void dns_scope_process_query(DnsScope *s, DnsStream *stream, DnsPacket *p);
ec2c5e43 84
dc4d47e2 85DnsTransaction *dns_scope_find_transaction(DnsScope *scope, DnsQuestion *question, bool cache_ok);
a4076574
LP
86
87int dns_scope_notify_conflict(DnsScope *scope, DnsResourceRecord *rr);
88void dns_scope_check_conflicts(DnsScope *scope, DnsPacket *p);