]>
Commit | Line | Data |
---|---|---|
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 | ||
26 | typedef struct DnsScope DnsScope; | |
27 | ||
28 | #include "resolved.h" | |
29 | #include "resolved-link.h" | |
30 | #include "resolved-dns-server.h" | |
31 | #include "resolved-dns-packet.h" | |
32 | #include "resolved-dns-query.h" | |
322345fd | 33 | #include "resolved-dns-cache.h" |
74b2466e LP |
34 | |
35 | typedef enum DnsScopeType { | |
36 | DNS_SCOPE_DNS, | |
37 | DNS_SCOPE_MDNS, | |
38 | } DnsScopeType; | |
39 | ||
40 | typedef enum DnsScopeMatch { | |
41 | DNS_SCOPE_NO, | |
42 | DNS_SCOPE_MAYBE, | |
43 | DNS_SCOPE_YES, | |
44 | _DNS_SCOPE_MATCH_MAX, | |
45 | _DNS_SCOPE_INVALID = -1 | |
46 | } DnsScopeMatch; | |
47 | ||
48 | struct DnsScope { | |
49 | Manager *manager; | |
50 | ||
51 | DnsScopeType type; | |
52 | unsigned char family; | |
53 | ||
54 | Link *link; | |
55 | ||
56 | char **domains; | |
57 | ||
322345fd LP |
58 | DnsCache cache; |
59 | ||
74b2466e LP |
60 | LIST_HEAD(DnsQueryTransaction, transactions); |
61 | ||
62 | LIST_FIELDS(DnsScope, scopes); | |
63 | }; | |
64 | ||
65 | int dns_scope_new(Manager *m, DnsScope **ret, DnsScopeType t); | |
66 | DnsScope* dns_scope_free(DnsScope *s); | |
67 | ||
68 | int dns_scope_send(DnsScope *s, DnsPacket *p); | |
ad867662 LP |
69 | int dns_scope_tcp_socket(DnsScope *s); |
70 | ||
74b2466e LP |
71 | DnsScopeMatch dns_scope_test(DnsScope *s, const char *domain); |
72 | ||
73 | DnsServer *dns_scope_get_server(DnsScope *s); | |
74 | void dns_scope_next_dns_server(DnsScope *s); |