]>
Commit | Line | Data |
---|---|---|
faa133f3 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 | typedef struct DnsQuestion DnsQuestion; | |
25 | ||
26 | #include "resolved-dns-rr.h" | |
27 | ||
28 | /* A simple array of resources keys */ | |
29 | ||
30 | struct DnsQuestion { | |
31 | unsigned n_ref; | |
32 | unsigned n_keys, n_allocated; | |
33 | DnsResourceKey* keys[0]; | |
34 | }; | |
35 | ||
36 | DnsQuestion *dns_question_new(unsigned n); | |
37 | DnsQuestion *dns_question_ref(DnsQuestion *q); | |
38 | DnsQuestion *dns_question_unref(DnsQuestion *q); | |
39 | ||
40 | int dns_question_add(DnsQuestion *q, DnsResourceKey *key); | |
41 | ||
42 | int dns_question_matches_rr(DnsQuestion *q, DnsResourceRecord *rr); | |
43 | int dns_question_matches_cname(DnsQuestion *q, DnsResourceRecord *rr); | |
44 | int dns_question_is_valid(DnsQuestion *q); | |
45 | int dns_question_is_superset(DnsQuestion *q, DnsQuestion *other); | |
46 | ||
47 | int dns_question_cname_redirect(DnsQuestion *q, const char *name, DnsQuestion **ret); | |
48 | ||
b914e211 LP |
49 | int dns_question_endswith(DnsQuestion *q, const char *suffix); |
50 | int dns_question_extract_reverse_address(DnsQuestion *q, int *family, union in_addr_union *address); | |
51 | ||
faa133f3 | 52 | DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuestion*, dns_question_unref); |