]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/resolve/resolved-dns-zone.h
Merge pull request #7388 from keszybz/doc-tweak
[thirdparty/systemd.git] / src / resolve / resolved-dns-zone.h
CommitLineData
623a4c97
LP
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2014 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include "hashmap.h"
23
24typedef struct DnsZone {
25 Hashmap *by_key;
26 Hashmap *by_name;
27} DnsZone;
28
ec2c5e43
LP
29typedef struct DnsZoneItem DnsZoneItem;
30typedef enum DnsZoneItemState DnsZoneItemState;
31
623a4c97 32#include "resolved-dns-answer.h"
71d35b6b
TA
33#include "resolved-dns-question.h"
34#include "resolved-dns-rr.h"
ec2c5e43
LP
35#include "resolved-dns-transaction.h"
36
37/* RFC 4795 Section 2.8. suggests a TTL of 30s by default */
38#define LLMNR_DEFAULT_TTL (30)
39
400cb36e
DR
40/* RFC 6762 Section 10. suggests a TTL of 120s by default */
41#define MDNS_DEFAULT_TTL (120)
42
ec2c5e43
LP
43enum DnsZoneItemState {
44 DNS_ZONE_ITEM_PROBING,
45 DNS_ZONE_ITEM_ESTABLISHED,
46 DNS_ZONE_ITEM_VERIFYING,
47 DNS_ZONE_ITEM_WITHDRAWN,
48};
49
50struct DnsZoneItem {
51 DnsScope *scope;
52 DnsResourceRecord *rr;
53
54 DnsZoneItemState state;
55
56 unsigned block_ready;
57
58 bool probing_enabled;
59
60 LIST_FIELDS(DnsZoneItem, by_key);
61 LIST_FIELDS(DnsZoneItem, by_name);
62
63 DnsTransaction *probe_transaction;
64};
623a4c97
LP
65
66void dns_zone_flush(DnsZone *z);
67
ec2c5e43 68int dns_zone_put(DnsZone *z, DnsScope *s, DnsResourceRecord *rr, bool probe);
623a4c97
LP
69void dns_zone_remove_rr(DnsZone *z, DnsResourceRecord *rr);
70
97ebebbc 71int dns_zone_lookup(DnsZone *z, DnsResourceKey *key, int ifindex, DnsAnswer **answer, DnsAnswer **soa, bool *tentative);
57f5ad31 72
ec2c5e43 73void dns_zone_item_conflict(DnsZoneItem *i);
547973de 74void dns_zone_item_notify(DnsZoneItem *i);
a4076574
LP
75
76int dns_zone_check_conflicts(DnsZone *zone, DnsResourceRecord *rr);
77int dns_zone_verify_conflicts(DnsZone *zone, DnsResourceKey *key);
902bb5d8
LP
78
79void dns_zone_verify_all(DnsZone *zone);
3ef64445
LP
80
81void dns_zone_item_probe_stop(DnsZoneItem *i);
4d506d6b
LP
82
83void dns_zone_dump(DnsZone *zone, FILE *f);
84bool dns_zone_is_empty(DnsZone *zone);