]> git.ipfire.org Git - thirdparty/strongswan.git/blob - src/libstrongswan/resolver/rr.h
Update copyright headers after acquisition by secunet
[thirdparty/strongswan.git] / src / libstrongswan / resolver / rr.h
1 /*
2 * Copyright (C) 2012 Reto Guadagnini
3 *
4 * Copyright (C) secunet Security Networks AG
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 */
16
17 /**
18 * @defgroup rr rr
19 * @{ @ingroup resolver
20 */
21
22 #ifndef RR_H_
23 #define RR_H_
24
25 typedef struct rr_t rr_t;
26 typedef enum rr_type_t rr_type_t;
27 typedef enum rr_class_t rr_class_t;
28
29 #include <library.h>
30
31 /**
32 * Resource Record types.
33 *
34 * According to www.iana.org/assignments/dns-parameters (version 2012-03-13).
35 */
36 enum rr_type_t {
37 /** a host address */
38 RR_TYPE_A = 1,
39 /** an authoritative name server */
40 RR_TYPE_NS = 2,
41 //** a mail destination (OBSOLETE - use MX */
42 RR_TYPE_MD = 3,
43 /** a mail forwarder (OBSOLETE - use MX) */
44 RR_TYPE_MF = 4,
45 /** the canonical name for an alias */
46 RR_TYPE_CNAME = 5,
47 /** marks the start of a zone of authority */
48 RR_TYPE_SOA = 6,
49 /** a mailbox domain name (EXPERIMENTAL) */
50 RR_TYPE_MB = 7,
51 /** a mail group member (EXPERIMENTAL) */
52 RR_TYPE_MG = 8,
53 /** a mail rename domain name (EXPERIMENTAL) */
54 RR_TYPE_MR = 9,
55 /** a null RR (EXPERIMENTAL) */
56 RR_TYPE_NULL = 10,
57 /** a well known service description */
58 RR_TYPE_WKS = 11,
59 /** a domain name pointer */
60 RR_TYPE_PTR = 12,
61 /** host information */
62 RR_TYPE_HINFO = 13,
63 /** mailbox or mail list information */
64 RR_TYPE_MINFO = 14,
65 /** mail exchange */
66 RR_TYPE_MX = 15,
67 /** text strings */
68 RR_TYPE_TXT = 16,
69 /** for Responsible Person */
70 RR_TYPE_RP = 17,
71 /** for AFS Data Base location */
72 RR_TYPE_AFSDB = 18,
73 /** for X.25 PSDN address */
74 RR_TYPE_X25 = 19,
75 /** for ISDN address */
76 RR_TYPE_ISDN = 20,
77 /** for Route Through */
78 RR_TYPE_RT = 21,
79 /** for NSAP address, NSAP style A record */
80 RR_TYPE_NSAP = 22,
81 /** for domain name pointer, NSAP style */
82 RR_TYPE_NSAP_PTR = 23,
83 /** for security signature */
84 RR_TYPE_SIG = 24,
85 /** for security key */
86 RR_TYPE_KEY = 25,
87 /** X.400 mail mapping information */
88 RR_TYPE_PX = 26,
89 /** Geographical Position */
90 RR_TYPE_GPOS = 27,
91 /** ipv6 address */
92 RR_TYPE_AAAA = 28,
93 /** Location Information */
94 RR_TYPE_LOC = 29,
95 /** Next Domain (OBSOLETE) */
96 RR_TYPE_NXT = 30,
97 /** Endpoint Identifier */
98 RR_TYPE_EID = 31,
99 /** Nimrod Locator */
100 RR_TYPE_NIMLOC = 32,
101 /** Server Selection */
102 RR_TYPE_SRV = 33,
103 /** ATM Address */
104 RR_TYPE_ATMA = 34,
105 /** Naming Authority Pointer */
106 RR_TYPE_NAPTR = 35,
107 /** Key Exchanger */
108 RR_TYPE_KX = 36,
109 /** CERT */
110 RR_TYPE_CERT = 37,
111 /** A6 (OBSOLETE - use AAAA) */
112 RR_TYPE_A6 = 38,
113 /** DNAME */
114 RR_TYPE_DNAME = 39,
115 /** SINK */
116 RR_TYPE_SINK = 40,
117 /** OPT */
118 RR_TYPE_OPT = 41,
119 /** APL */
120 RR_TYPE_APL = 42,
121 /** Delegation Signer */
122 RR_TYPE_DS = 43,
123 /** SSH Key Fingerprint */
124 RR_TYPE_SSHFP = 44,
125 /** IPSECKEY */
126 RR_TYPE_IPSECKEY = 45,
127 /** RRSIG */
128 RR_TYPE_RRSIG = 46,
129 /** NSEC */
130 RR_TYPE_NSEC = 47,
131 /** DNSKEY */
132 RR_TYPE_DNSKEY = 48,
133 /** DHCID */
134 RR_TYPE_DHCID = 49,
135 /** NSEC3 */
136 RR_TYPE_NSEC3 = 50,
137 /** NSEC3PARAM */
138 RR_TYPE_NSEC3PARAM = 51,
139
140 /** Unassigned 52-54 */
141
142 /** Host Identity Protocol */
143 RR_TYPE_HIP = 55,
144 /** NINFO */
145 RR_TYPE_NINFO = 56,
146 /** RKEY */
147 RR_TYPE_RKEY = 57,
148 /** Trust Anchor LINK */
149 RR_TYPE_TALINK = 58,
150 /** Child DS */
151 RR_TYPE_CDS = 59,
152
153 /** Unassigned 60-98 */
154
155 /** SPF */
156 RR_TYPE_SPF = 99,
157 /** UINFO */
158 RR_TYPE_UINFO = 100,
159 /** UID */
160 RR_TYPE_UID = 101,
161 /** GID */
162 RR_TYPE_GID = 102,
163 /** UNSPEC */
164 RR_TYPE_UNSPEC = 103,
165
166 /** Unassigned 104-248 */
167
168 /** Transaction Key */
169 RR_TYPE_TKEY = 249,
170 /** Transaction Signature */
171 RR_TYPE_TSIG = 250,
172 /** incremental transfer */
173 RR_TYPE_IXFR = 251,
174 /** transfer of an entire zone */
175 RR_TYPE_AXFR = 252,
176 /** mailbox-related RRs (MB, MG or MR) */
177 RR_TYPE_MAILB = 253,
178 /** mail agent RRs (OBSOLETE - see MX) */
179 RR_TYPE_MAILA = 254,
180 /** A request for all records */
181 RR_TYPE_ANY = 255,
182 /** URI */
183 RR_TYPE_URI = 256,
184 /** Certification Authority Authorization */
185 RR_TYPE_CAA = 257,
186
187 /** Unassigned 258-32767 */
188
189 /** DNSSEC Trust Authorities */
190 RR_TYPE_TA = 32768,
191 /** DNSSEC Lookaside Validation */
192 RR_TYPE_DLV = 32769,
193
194 /** Unassigned 32770-65279 */
195
196 /** Private use 65280-65534 */
197
198 /** Reserved 65535 */
199 };
200
201
202 /**
203 * Resource Record CLASSes
204 */
205 enum rr_class_t {
206 /** Internet */
207 RR_CLASS_IN = 1,
208 /** Chaos */
209 RR_CLASS_CH = 3,
210 /** Hesiod */
211 RR_CLASS_HS = 4,
212 /** further CLASSes: http://wwwiana.org/assignments/dns-parameters */
213 };
214
215
216 /**
217 * A DNS Resource Record.
218 *
219 * Represents a Resource Record of the Domain Name System
220 * as defined in RFC 1035.
221 *
222 */
223 struct rr_t {
224
225 /**
226 * Get the NAME of the owner of this RR.
227 *
228 * @return owner name as string
229 */
230 char *(*get_name)(rr_t *this);
231
232 /**
233 * Get the type of this RR.
234 *
235 * @return RR type
236 */
237 rr_type_t (*get_type)(rr_t *this);
238
239 /**
240 * Get the class of this RR.
241 *
242 * @return RR class
243 */
244 rr_class_t (*get_class)(rr_t *this);
245
246 /**
247 * Get the Time to Live (TTL) of this RR.
248 *
249 * @return Time to Live
250 */
251 uint32_t (*get_ttl)(rr_t *this);
252
253 /**
254 * Get the content of the RDATA field as chunk.
255 *
256 * The data pointed by the chunk is still owned by the RR.
257 * Clone it if needed.
258 *
259 * @return RDATA field as chunk
260 */
261 chunk_t (*get_rdata)(rr_t *this);
262
263 /**
264 * Destroy the Resource Record.
265 */
266 void (*destroy) (rr_t *this);
267 };
268
269 #endif /** RR_H_ @}*/