]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/resolve/dns-type.h
resolved: cache stringified transaction key once per transaction
[thirdparty/systemd.git] / src / resolve / dns-type.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2014 Zbigniew Jędrzejewski-Szmek
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 #pragma once
23
24 #include "macro.h"
25
26 const char *dns_type_to_string(int type);
27 int dns_type_from_string(const char *s);
28
29 bool dns_type_is_pseudo(uint16_t type);
30 bool dns_type_is_valid_query(uint16_t type);
31 bool dns_type_is_valid_rr(uint16_t type);
32
33 /* DNS record types, taken from
34 * http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml.
35 */
36 enum {
37 /* Normal records */
38 DNS_TYPE_A = 0x01,
39 DNS_TYPE_NS,
40 DNS_TYPE_MD,
41 DNS_TYPE_MF,
42 DNS_TYPE_CNAME,
43 DNS_TYPE_SOA,
44 DNS_TYPE_MB,
45 DNS_TYPE_MG,
46 DNS_TYPE_MR,
47 DNS_TYPE_NULL,
48 DNS_TYPE_WKS,
49 DNS_TYPE_PTR,
50 DNS_TYPE_HINFO,
51 DNS_TYPE_MINFO,
52 DNS_TYPE_MX,
53 DNS_TYPE_TXT,
54 DNS_TYPE_RP,
55 DNS_TYPE_AFSDB,
56 DNS_TYPE_X25,
57 DNS_TYPE_ISDN,
58 DNS_TYPE_RT,
59 DNS_TYPE_NSAP,
60 DNS_TYPE_NSAP_PTR,
61 DNS_TYPE_SIG,
62 DNS_TYPE_KEY,
63 DNS_TYPE_PX,
64 DNS_TYPE_GPOS,
65 DNS_TYPE_AAAA,
66 DNS_TYPE_LOC,
67 DNS_TYPE_NXT,
68 DNS_TYPE_EID,
69 DNS_TYPE_NIMLOC,
70 DNS_TYPE_SRV,
71 DNS_TYPE_ATMA,
72 DNS_TYPE_NAPTR,
73 DNS_TYPE_KX,
74 DNS_TYPE_CERT,
75 DNS_TYPE_A6,
76 DNS_TYPE_DNAME,
77 DNS_TYPE_SINK,
78 DNS_TYPE_OPT, /* EDNS0 option */
79 DNS_TYPE_APL,
80 DNS_TYPE_DS,
81 DNS_TYPE_SSHFP,
82 DNS_TYPE_IPSECKEY,
83 DNS_TYPE_RRSIG,
84 DNS_TYPE_NSEC,
85 DNS_TYPE_DNSKEY,
86 DNS_TYPE_DHCID,
87 DNS_TYPE_NSEC3,
88 DNS_TYPE_NSEC3PARAM,
89 DNS_TYPE_TLSA,
90
91 DNS_TYPE_HIP = 0x37,
92 DNS_TYPE_NINFO,
93 DNS_TYPE_RKEY,
94 DNS_TYPE_TALINK,
95 DNS_TYPE_CDS,
96 DNS_TYPE_CDNSKEY,
97
98 DNS_TYPE_SPF = 0x63,
99 DNS_TYPE_NID,
100 DNS_TYPE_L32,
101 DNS_TYPE_L64,
102 DNS_TYPE_LP,
103 DNS_TYPE_EUI48,
104 DNS_TYPE_EUI64,
105
106 DNS_TYPE_TKEY = 0xF9,
107 DNS_TYPE_TSIG,
108 DNS_TYPE_IXFR,
109 DNS_TYPE_AXFR,
110 DNS_TYPE_MAILB,
111 DNS_TYPE_MAILA,
112 DNS_TYPE_ANY,
113 DNS_TYPE_URI,
114 DNS_TYPE_CAA,
115 DNS_TYPE_TA = 0x8000,
116 DNS_TYPE_DLV,
117
118 _DNS_TYPE_MAX,
119 _DNS_TYPE_INVALID = -1
120 };
121
122 assert_cc(DNS_TYPE_SSHFP == 44);
123 assert_cc(DNS_TYPE_TLSA == 52);
124 assert_cc(DNS_TYPE_ANY == 255);