code.h revision 1.1 1 1.1 christos /*
2 1.1 christos * Copyright (C) 1998-2018 Internet Systems Consortium, Inc. ("ISC")
3 1.1 christos *
4 1.1 christos * This Source Code Form is subject to the terms of the Mozilla Public
5 1.1 christos * License, v. 2.0. If a copy of the MPL was not distributed with this
6 1.1 christos * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 1.1 christos */
8 1.1 christos
9 1.1 christos /***************
10 1.1 christos ***************
11 1.1 christos *************** THIS FILE IS AUTOMATICALLY GENERATED BY gen.c.
12 1.1 christos *************** DO NOT EDIT!
13 1.1 christos ***************
14 1.1 christos ***************/
15 1.1 christos
16 1.1 christos /*! \file */
17 1.1 christos
18 1.1 christos #ifndef DNS_CODE_H
19 1.1 christos #define DNS_CODE_H 1
20 1.1 christos
21 1.1 christos #include <isc/boolean.h>
22 1.1 christos #include <isc/result.h>
23 1.1 christos
24 1.1 christos #include <dns/name.h>
25 1.1 christos
26 1.1 christos #include "rdata/in_1/a_1.c"
27 1.1 christos #include "rdata/ch_3/a_1.c"
28 1.1 christos #include "rdata/hs_4/a_1.c"
29 1.1 christos #include "rdata/generic/ns_2.c"
30 1.1 christos #include "rdata/generic/md_3.c"
31 1.1 christos #include "rdata/generic/mf_4.c"
32 1.1 christos #include "rdata/generic/cname_5.c"
33 1.1 christos #include "rdata/generic/soa_6.c"
34 1.1 christos #include "rdata/generic/mb_7.c"
35 1.1 christos #include "rdata/generic/mg_8.c"
36 1.1 christos #include "rdata/generic/mr_9.c"
37 1.1 christos #include "rdata/generic/null_10.c"
38 1.1 christos #include "rdata/in_1/wks_11.c"
39 1.1 christos #include "rdata/generic/ptr_12.c"
40 1.1 christos #include "rdata/generic/hinfo_13.c"
41 1.1 christos #include "rdata/generic/minfo_14.c"
42 1.1 christos #include "rdata/generic/mx_15.c"
43 1.1 christos #include "rdata/generic/txt_16.c"
44 1.1 christos #include "rdata/generic/rp_17.c"
45 1.1 christos #include "rdata/generic/afsdb_18.c"
46 1.1 christos #include "rdata/generic/x25_19.c"
47 1.1 christos #include "rdata/generic/isdn_20.c"
48 1.1 christos #include "rdata/generic/rt_21.c"
49 1.1 christos #include "rdata/in_1/nsap_22.c"
50 1.1 christos #include "rdata/in_1/nsap-ptr_23.c"
51 1.1 christos #include "rdata/generic/sig_24.c"
52 1.1 christos #include "rdata/generic/key_25.c"
53 1.1 christos #include "rdata/in_1/px_26.c"
54 1.1 christos #include "rdata/generic/gpos_27.c"
55 1.1 christos #include "rdata/in_1/aaaa_28.c"
56 1.1 christos #include "rdata/generic/loc_29.c"
57 1.1 christos #include "rdata/generic/nxt_30.c"
58 1.1 christos #include "rdata/in_1/srv_33.c"
59 1.1 christos #include "rdata/generic/naptr_35.c"
60 1.1 christos #include "rdata/in_1/kx_36.c"
61 1.1 christos #include "rdata/generic/cert_37.c"
62 1.1 christos #include "rdata/in_1/a6_38.c"
63 1.1 christos #include "rdata/generic/dname_39.c"
64 1.1 christos #include "rdata/generic/sink_40.c"
65 1.1 christos #include "rdata/generic/opt_41.c"
66 1.1 christos #include "rdata/in_1/apl_42.c"
67 1.1 christos #include "rdata/generic/ds_43.c"
68 1.1 christos #include "rdata/generic/sshfp_44.c"
69 1.1 christos #include "rdata/generic/ipseckey_45.c"
70 1.1 christos #include "rdata/generic/rrsig_46.c"
71 1.1 christos #include "rdata/generic/nsec_47.c"
72 1.1 christos #include "rdata/generic/dnskey_48.c"
73 1.1 christos #include "rdata/in_1/dhcid_49.c"
74 1.1 christos #include "rdata/generic/nsec3_50.c"
75 1.1 christos #include "rdata/generic/nsec3param_51.c"
76 1.1 christos #include "rdata/generic/tlsa_52.c"
77 1.1 christos #include "rdata/generic/smimea_53.c"
78 1.1 christos #include "rdata/generic/hip_55.c"
79 1.1 christos #include "rdata/generic/ninfo_56.c"
80 1.1 christos #include "rdata/generic/rkey_57.c"
81 1.1 christos #include "rdata/generic/talink_58.c"
82 1.1 christos #include "rdata/generic/cds_59.c"
83 1.1 christos #include "rdata/generic/cdnskey_60.c"
84 1.1 christos #include "rdata/generic/openpgpkey_61.c"
85 1.1 christos #include "rdata/generic/csync_62.c"
86 1.1 christos #include "rdata/generic/spf_99.c"
87 1.1 christos #include "rdata/generic/unspec_103.c"
88 1.1 christos #include "rdata/generic/nid_104.c"
89 1.1 christos #include "rdata/generic/l32_105.c"
90 1.1 christos #include "rdata/generic/l64_106.c"
91 1.1 christos #include "rdata/generic/lp_107.c"
92 1.1 christos #include "rdata/generic/eui48_108.c"
93 1.1 christos #include "rdata/generic/eui64_109.c"
94 1.1 christos #include "rdata/generic/tkey_249.c"
95 1.1 christos #include "rdata/any_255/tsig_250.c"
96 1.1 christos #include "rdata/generic/uri_256.c"
97 1.1 christos #include "rdata/generic/caa_257.c"
98 1.1 christos #include "rdata/generic/avc_258.c"
99 1.1 christos #include "rdata/generic/doa_259.c"
100 1.1 christos #include "rdata/generic/ta_32768.c"
101 1.1 christos #include "rdata/generic/dlv_32769.c"
102 1.1 christos #include "rdata/generic/keydata_65533.c"
103 1.1 christos
104 1.1 christos
105 1.1 christos
106 1.1 christos #define FROMTEXTSWITCH \
107 1.1 christos switch (type) { \
108 1.1 christos case 1: switch (rdclass) { \
109 1.1 christos case 1: result = fromtext_in_a(rdclass, type, lexer, origin, options, target, callbacks); break; \
110 1.1 christos case 3: result = fromtext_ch_a(rdclass, type, lexer, origin, options, target, callbacks); break; \
111 1.1 christos case 4: result = fromtext_hs_a(rdclass, type, lexer, origin, options, target, callbacks); break; \
112 1.1 christos default: result = DNS_R_UNKNOWN; break; \
113 1.1 christos } \
114 1.1 christos break; \
115 1.1 christos case 2: result = fromtext_ns(rdclass, type, lexer, origin, options, target, callbacks); break; \
116 1.1 christos case 3: result = fromtext_md(rdclass, type, lexer, origin, options, target, callbacks); break; \
117 1.1 christos case 4: result = fromtext_mf(rdclass, type, lexer, origin, options, target, callbacks); break; \
118 1.1 christos case 5: result = fromtext_cname(rdclass, type, lexer, origin, options, target, callbacks); break; \
119 1.1 christos case 6: result = fromtext_soa(rdclass, type, lexer, origin, options, target, callbacks); break; \
120 1.1 christos case 7: result = fromtext_mb(rdclass, type, lexer, origin, options, target, callbacks); break; \
121 1.1 christos case 8: result = fromtext_mg(rdclass, type, lexer, origin, options, target, callbacks); break; \
122 1.1 christos case 9: result = fromtext_mr(rdclass, type, lexer, origin, options, target, callbacks); break; \
123 1.1 christos case 10: result = fromtext_null(rdclass, type, lexer, origin, options, target, callbacks); break; \
124 1.1 christos case 11: switch (rdclass) { \
125 1.1 christos case 1: result = fromtext_in_wks(rdclass, type, lexer, origin, options, target, callbacks); break; \
126 1.1 christos default: result = DNS_R_UNKNOWN; break; \
127 1.1 christos } \
128 1.1 christos break; \
129 1.1 christos case 12: result = fromtext_ptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
130 1.1 christos case 13: result = fromtext_hinfo(rdclass, type, lexer, origin, options, target, callbacks); break; \
131 1.1 christos case 14: result = fromtext_minfo(rdclass, type, lexer, origin, options, target, callbacks); break; \
132 1.1 christos case 15: result = fromtext_mx(rdclass, type, lexer, origin, options, target, callbacks); break; \
133 1.1 christos case 16: result = fromtext_txt(rdclass, type, lexer, origin, options, target, callbacks); break; \
134 1.1 christos case 17: result = fromtext_rp(rdclass, type, lexer, origin, options, target, callbacks); break; \
135 1.1 christos case 18: result = fromtext_afsdb(rdclass, type, lexer, origin, options, target, callbacks); break; \
136 1.1 christos case 19: result = fromtext_x25(rdclass, type, lexer, origin, options, target, callbacks); break; \
137 1.1 christos case 20: result = fromtext_isdn(rdclass, type, lexer, origin, options, target, callbacks); break; \
138 1.1 christos case 21: result = fromtext_rt(rdclass, type, lexer, origin, options, target, callbacks); break; \
139 1.1 christos case 22: switch (rdclass) { \
140 1.1 christos case 1: result = fromtext_in_nsap(rdclass, type, lexer, origin, options, target, callbacks); break; \
141 1.1 christos default: result = DNS_R_UNKNOWN; break; \
142 1.1 christos } \
143 1.1 christos break; \
144 1.1 christos case 23: switch (rdclass) { \
145 1.1 christos case 1: result = fromtext_in_nsap_ptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
146 1.1 christos default: result = DNS_R_UNKNOWN; break; \
147 1.1 christos } \
148 1.1 christos break; \
149 1.1 christos case 24: result = fromtext_sig(rdclass, type, lexer, origin, options, target, callbacks); break; \
150 1.1 christos case 25: result = fromtext_key(rdclass, type, lexer, origin, options, target, callbacks); break; \
151 1.1 christos case 26: switch (rdclass) { \
152 1.1 christos case 1: result = fromtext_in_px(rdclass, type, lexer, origin, options, target, callbacks); break; \
153 1.1 christos default: result = DNS_R_UNKNOWN; break; \
154 1.1 christos } \
155 1.1 christos break; \
156 1.1 christos case 27: result = fromtext_gpos(rdclass, type, lexer, origin, options, target, callbacks); break; \
157 1.1 christos case 28: switch (rdclass) { \
158 1.1 christos case 1: result = fromtext_in_aaaa(rdclass, type, lexer, origin, options, target, callbacks); break; \
159 1.1 christos default: result = DNS_R_UNKNOWN; break; \
160 1.1 christos } \
161 1.1 christos break; \
162 1.1 christos case 29: result = fromtext_loc(rdclass, type, lexer, origin, options, target, callbacks); break; \
163 1.1 christos case 30: result = fromtext_nxt(rdclass, type, lexer, origin, options, target, callbacks); break; \
164 1.1 christos case 33: switch (rdclass) { \
165 1.1 christos case 1: result = fromtext_in_srv(rdclass, type, lexer, origin, options, target, callbacks); break; \
166 1.1 christos default: result = DNS_R_UNKNOWN; break; \
167 1.1 christos } \
168 1.1 christos break; \
169 1.1 christos case 35: result = fromtext_naptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
170 1.1 christos case 36: switch (rdclass) { \
171 1.1 christos case 1: result = fromtext_in_kx(rdclass, type, lexer, origin, options, target, callbacks); break; \
172 1.1 christos default: result = DNS_R_UNKNOWN; break; \
173 1.1 christos } \
174 1.1 christos break; \
175 1.1 christos case 37: result = fromtext_cert(rdclass, type, lexer, origin, options, target, callbacks); break; \
176 1.1 christos case 38: switch (rdclass) { \
177 1.1 christos case 1: result = fromtext_in_a6(rdclass, type, lexer, origin, options, target, callbacks); break; \
178 1.1 christos default: result = DNS_R_UNKNOWN; break; \
179 1.1 christos } \
180 1.1 christos break; \
181 1.1 christos case 39: result = fromtext_dname(rdclass, type, lexer, origin, options, target, callbacks); break; \
182 1.1 christos case 40: result = fromtext_sink(rdclass, type, lexer, origin, options, target, callbacks); break; \
183 1.1 christos case 41: result = fromtext_opt(rdclass, type, lexer, origin, options, target, callbacks); break; \
184 1.1 christos case 42: switch (rdclass) { \
185 1.1 christos case 1: result = fromtext_in_apl(rdclass, type, lexer, origin, options, target, callbacks); break; \
186 1.1 christos default: result = DNS_R_UNKNOWN; break; \
187 1.1 christos } \
188 1.1 christos break; \
189 1.1 christos case 43: result = fromtext_ds(rdclass, type, lexer, origin, options, target, callbacks); break; \
190 1.1 christos case 44: result = fromtext_sshfp(rdclass, type, lexer, origin, options, target, callbacks); break; \
191 1.1 christos case 45: result = fromtext_ipseckey(rdclass, type, lexer, origin, options, target, callbacks); break; \
192 1.1 christos case 46: result = fromtext_rrsig(rdclass, type, lexer, origin, options, target, callbacks); break; \
193 1.1 christos case 47: result = fromtext_nsec(rdclass, type, lexer, origin, options, target, callbacks); break; \
194 1.1 christos case 48: result = fromtext_dnskey(rdclass, type, lexer, origin, options, target, callbacks); break; \
195 1.1 christos case 49: switch (rdclass) { \
196 1.1 christos case 1: result = fromtext_in_dhcid(rdclass, type, lexer, origin, options, target, callbacks); break; \
197 1.1 christos default: result = DNS_R_UNKNOWN; break; \
198 1.1 christos } \
199 1.1 christos break; \
200 1.1 christos case 50: result = fromtext_nsec3(rdclass, type, lexer, origin, options, target, callbacks); break; \
201 1.1 christos case 51: result = fromtext_nsec3param(rdclass, type, lexer, origin, options, target, callbacks); break; \
202 1.1 christos case 52: result = fromtext_tlsa(rdclass, type, lexer, origin, options, target, callbacks); break; \
203 1.1 christos case 53: result = fromtext_smimea(rdclass, type, lexer, origin, options, target, callbacks); break; \
204 1.1 christos case 55: result = fromtext_hip(rdclass, type, lexer, origin, options, target, callbacks); break; \
205 1.1 christos case 56: result = fromtext_ninfo(rdclass, type, lexer, origin, options, target, callbacks); break; \
206 1.1 christos case 57: result = fromtext_rkey(rdclass, type, lexer, origin, options, target, callbacks); break; \
207 1.1 christos case 58: result = fromtext_talink(rdclass, type, lexer, origin, options, target, callbacks); break; \
208 1.1 christos case 59: result = fromtext_cds(rdclass, type, lexer, origin, options, target, callbacks); break; \
209 1.1 christos case 60: result = fromtext_cdnskey(rdclass, type, lexer, origin, options, target, callbacks); break; \
210 1.1 christos case 61: result = fromtext_openpgpkey(rdclass, type, lexer, origin, options, target, callbacks); break; \
211 1.1 christos case 62: result = fromtext_csync(rdclass, type, lexer, origin, options, target, callbacks); break; \
212 1.1 christos case 99: result = fromtext_spf(rdclass, type, lexer, origin, options, target, callbacks); break; \
213 1.1 christos case 103: result = fromtext_unspec(rdclass, type, lexer, origin, options, target, callbacks); break; \
214 1.1 christos case 104: result = fromtext_nid(rdclass, type, lexer, origin, options, target, callbacks); break; \
215 1.1 christos case 105: result = fromtext_l32(rdclass, type, lexer, origin, options, target, callbacks); break; \
216 1.1 christos case 106: result = fromtext_l64(rdclass, type, lexer, origin, options, target, callbacks); break; \
217 1.1 christos case 107: result = fromtext_lp(rdclass, type, lexer, origin, options, target, callbacks); break; \
218 1.1 christos case 108: result = fromtext_eui48(rdclass, type, lexer, origin, options, target, callbacks); break; \
219 1.1 christos case 109: result = fromtext_eui64(rdclass, type, lexer, origin, options, target, callbacks); break; \
220 1.1 christos case 249: result = fromtext_tkey(rdclass, type, lexer, origin, options, target, callbacks); break; \
221 1.1 christos case 250: switch (rdclass) { \
222 1.1 christos case 255: result = fromtext_any_tsig(rdclass, type, lexer, origin, options, target, callbacks); break; \
223 1.1 christos default: result = DNS_R_UNKNOWN; break; \
224 1.1 christos } \
225 1.1 christos break; \
226 1.1 christos case 256: result = fromtext_uri(rdclass, type, lexer, origin, options, target, callbacks); break; \
227 1.1 christos case 257: result = fromtext_caa(rdclass, type, lexer, origin, options, target, callbacks); break; \
228 1.1 christos case 258: result = fromtext_avc(rdclass, type, lexer, origin, options, target, callbacks); break; \
229 1.1 christos case 259: result = fromtext_doa(rdclass, type, lexer, origin, options, target, callbacks); break; \
230 1.1 christos case 32768: result = fromtext_ta(rdclass, type, lexer, origin, options, target, callbacks); break; \
231 1.1 christos case 32769: result = fromtext_dlv(rdclass, type, lexer, origin, options, target, callbacks); break; \
232 1.1 christos case 65533: result = fromtext_keydata(rdclass, type, lexer, origin, options, target, callbacks); break; \
233 1.1 christos default: result = DNS_R_UNKNOWN; break; \
234 1.1 christos }
235 1.1 christos
236 1.1 christos #define TOTEXTSWITCH \
237 1.1 christos switch (rdata->type) { \
238 1.1 christos case 1: switch (rdata->rdclass) { \
239 1.1 christos case 1: result = totext_in_a(rdata, tctx, target); break; \
240 1.1 christos case 3: result = totext_ch_a(rdata, tctx, target); break; \
241 1.1 christos case 4: result = totext_hs_a(rdata, tctx, target); break; \
242 1.1 christos default: use_default = ISC_TRUE; break; \
243 1.1 christos } \
244 1.1 christos break; \
245 1.1 christos case 2: result = totext_ns(rdata, tctx, target); break; \
246 1.1 christos case 3: result = totext_md(rdata, tctx, target); break; \
247 1.1 christos case 4: result = totext_mf(rdata, tctx, target); break; \
248 1.1 christos case 5: result = totext_cname(rdata, tctx, target); break; \
249 1.1 christos case 6: result = totext_soa(rdata, tctx, target); break; \
250 1.1 christos case 7: result = totext_mb(rdata, tctx, target); break; \
251 1.1 christos case 8: result = totext_mg(rdata, tctx, target); break; \
252 1.1 christos case 9: result = totext_mr(rdata, tctx, target); break; \
253 1.1 christos case 10: result = totext_null(rdata, tctx, target); break; \
254 1.1 christos case 11: switch (rdata->rdclass) { \
255 1.1 christos case 1: result = totext_in_wks(rdata, tctx, target); break; \
256 1.1 christos default: use_default = ISC_TRUE; break; \
257 1.1 christos } \
258 1.1 christos break; \
259 1.1 christos case 12: result = totext_ptr(rdata, tctx, target); break; \
260 1.1 christos case 13: result = totext_hinfo(rdata, tctx, target); break; \
261 1.1 christos case 14: result = totext_minfo(rdata, tctx, target); break; \
262 1.1 christos case 15: result = totext_mx(rdata, tctx, target); break; \
263 1.1 christos case 16: result = totext_txt(rdata, tctx, target); break; \
264 1.1 christos case 17: result = totext_rp(rdata, tctx, target); break; \
265 1.1 christos case 18: result = totext_afsdb(rdata, tctx, target); break; \
266 1.1 christos case 19: result = totext_x25(rdata, tctx, target); break; \
267 1.1 christos case 20: result = totext_isdn(rdata, tctx, target); break; \
268 1.1 christos case 21: result = totext_rt(rdata, tctx, target); break; \
269 1.1 christos case 22: switch (rdata->rdclass) { \
270 1.1 christos case 1: result = totext_in_nsap(rdata, tctx, target); break; \
271 1.1 christos default: use_default = ISC_TRUE; break; \
272 1.1 christos } \
273 1.1 christos break; \
274 1.1 christos case 23: switch (rdata->rdclass) { \
275 1.1 christos case 1: result = totext_in_nsap_ptr(rdata, tctx, target); break; \
276 1.1 christos default: use_default = ISC_TRUE; break; \
277 1.1 christos } \
278 1.1 christos break; \
279 1.1 christos case 24: result = totext_sig(rdata, tctx, target); break; \
280 1.1 christos case 25: result = totext_key(rdata, tctx, target); break; \
281 1.1 christos case 26: switch (rdata->rdclass) { \
282 1.1 christos case 1: result = totext_in_px(rdata, tctx, target); break; \
283 1.1 christos default: use_default = ISC_TRUE; break; \
284 1.1 christos } \
285 1.1 christos break; \
286 1.1 christos case 27: result = totext_gpos(rdata, tctx, target); break; \
287 1.1 christos case 28: switch (rdata->rdclass) { \
288 1.1 christos case 1: result = totext_in_aaaa(rdata, tctx, target); break; \
289 1.1 christos default: use_default = ISC_TRUE; break; \
290 1.1 christos } \
291 1.1 christos break; \
292 1.1 christos case 29: result = totext_loc(rdata, tctx, target); break; \
293 1.1 christos case 30: result = totext_nxt(rdata, tctx, target); break; \
294 1.1 christos case 33: switch (rdata->rdclass) { \
295 1.1 christos case 1: result = totext_in_srv(rdata, tctx, target); break; \
296 1.1 christos default: use_default = ISC_TRUE; break; \
297 1.1 christos } \
298 1.1 christos break; \
299 1.1 christos case 35: result = totext_naptr(rdata, tctx, target); break; \
300 1.1 christos case 36: switch (rdata->rdclass) { \
301 1.1 christos case 1: result = totext_in_kx(rdata, tctx, target); break; \
302 1.1 christos default: use_default = ISC_TRUE; break; \
303 1.1 christos } \
304 1.1 christos break; \
305 1.1 christos case 37: result = totext_cert(rdata, tctx, target); break; \
306 1.1 christos case 38: switch (rdata->rdclass) { \
307 1.1 christos case 1: result = totext_in_a6(rdata, tctx, target); break; \
308 1.1 christos default: use_default = ISC_TRUE; break; \
309 1.1 christos } \
310 1.1 christos break; \
311 1.1 christos case 39: result = totext_dname(rdata, tctx, target); break; \
312 1.1 christos case 40: result = totext_sink(rdata, tctx, target); break; \
313 1.1 christos case 41: result = totext_opt(rdata, tctx, target); break; \
314 1.1 christos case 42: switch (rdata->rdclass) { \
315 1.1 christos case 1: result = totext_in_apl(rdata, tctx, target); break; \
316 1.1 christos default: use_default = ISC_TRUE; break; \
317 1.1 christos } \
318 1.1 christos break; \
319 1.1 christos case 43: result = totext_ds(rdata, tctx, target); break; \
320 1.1 christos case 44: result = totext_sshfp(rdata, tctx, target); break; \
321 1.1 christos case 45: result = totext_ipseckey(rdata, tctx, target); break; \
322 1.1 christos case 46: result = totext_rrsig(rdata, tctx, target); break; \
323 1.1 christos case 47: result = totext_nsec(rdata, tctx, target); break; \
324 1.1 christos case 48: result = totext_dnskey(rdata, tctx, target); break; \
325 1.1 christos case 49: switch (rdata->rdclass) { \
326 1.1 christos case 1: result = totext_in_dhcid(rdata, tctx, target); break; \
327 1.1 christos default: use_default = ISC_TRUE; break; \
328 1.1 christos } \
329 1.1 christos break; \
330 1.1 christos case 50: result = totext_nsec3(rdata, tctx, target); break; \
331 1.1 christos case 51: result = totext_nsec3param(rdata, tctx, target); break; \
332 1.1 christos case 52: result = totext_tlsa(rdata, tctx, target); break; \
333 1.1 christos case 53: result = totext_smimea(rdata, tctx, target); break; \
334 1.1 christos case 55: result = totext_hip(rdata, tctx, target); break; \
335 1.1 christos case 56: result = totext_ninfo(rdata, tctx, target); break; \
336 1.1 christos case 57: result = totext_rkey(rdata, tctx, target); break; \
337 1.1 christos case 58: result = totext_talink(rdata, tctx, target); break; \
338 1.1 christos case 59: result = totext_cds(rdata, tctx, target); break; \
339 1.1 christos case 60: result = totext_cdnskey(rdata, tctx, target); break; \
340 1.1 christos case 61: result = totext_openpgpkey(rdata, tctx, target); break; \
341 1.1 christos case 62: result = totext_csync(rdata, tctx, target); break; \
342 1.1 christos case 99: result = totext_spf(rdata, tctx, target); break; \
343 1.1 christos case 103: result = totext_unspec(rdata, tctx, target); break; \
344 1.1 christos case 104: result = totext_nid(rdata, tctx, target); break; \
345 1.1 christos case 105: result = totext_l32(rdata, tctx, target); break; \
346 1.1 christos case 106: result = totext_l64(rdata, tctx, target); break; \
347 1.1 christos case 107: result = totext_lp(rdata, tctx, target); break; \
348 1.1 christos case 108: result = totext_eui48(rdata, tctx, target); break; \
349 1.1 christos case 109: result = totext_eui64(rdata, tctx, target); break; \
350 1.1 christos case 249: result = totext_tkey(rdata, tctx, target); break; \
351 1.1 christos case 250: switch (rdata->rdclass) { \
352 1.1 christos case 255: result = totext_any_tsig(rdata, tctx, target); break; \
353 1.1 christos default: use_default = ISC_TRUE; break; \
354 1.1 christos } \
355 1.1 christos break; \
356 1.1 christos case 256: result = totext_uri(rdata, tctx, target); break; \
357 1.1 christos case 257: result = totext_caa(rdata, tctx, target); break; \
358 1.1 christos case 258: result = totext_avc(rdata, tctx, target); break; \
359 1.1 christos case 259: result = totext_doa(rdata, tctx, target); break; \
360 1.1 christos case 32768: result = totext_ta(rdata, tctx, target); break; \
361 1.1 christos case 32769: result = totext_dlv(rdata, tctx, target); break; \
362 1.1 christos case 65533: result = totext_keydata(rdata, tctx, target); break; \
363 1.1 christos default: use_default = ISC_TRUE; break; \
364 1.1 christos }
365 1.1 christos
366 1.1 christos #define FROMWIRESWITCH \
367 1.1 christos switch (type) { \
368 1.1 christos case 1: switch (rdclass) { \
369 1.1 christos case 1: result = fromwire_in_a(rdclass, type, source, dctx, options, target); break; \
370 1.1 christos case 3: result = fromwire_ch_a(rdclass, type, source, dctx, options, target); break; \
371 1.1 christos case 4: result = fromwire_hs_a(rdclass, type, source, dctx, options, target); break; \
372 1.1 christos default: use_default = ISC_TRUE; break; \
373 1.1 christos } \
374 1.1 christos break; \
375 1.1 christos case 2: result = fromwire_ns(rdclass, type, source, dctx, options, target); break; \
376 1.1 christos case 3: result = fromwire_md(rdclass, type, source, dctx, options, target); break; \
377 1.1 christos case 4: result = fromwire_mf(rdclass, type, source, dctx, options, target); break; \
378 1.1 christos case 5: result = fromwire_cname(rdclass, type, source, dctx, options, target); break; \
379 1.1 christos case 6: result = fromwire_soa(rdclass, type, source, dctx, options, target); break; \
380 1.1 christos case 7: result = fromwire_mb(rdclass, type, source, dctx, options, target); break; \
381 1.1 christos case 8: result = fromwire_mg(rdclass, type, source, dctx, options, target); break; \
382 1.1 christos case 9: result = fromwire_mr(rdclass, type, source, dctx, options, target); break; \
383 1.1 christos case 10: result = fromwire_null(rdclass, type, source, dctx, options, target); break; \
384 1.1 christos case 11: switch (rdclass) { \
385 1.1 christos case 1: result = fromwire_in_wks(rdclass, type, source, dctx, options, target); break; \
386 1.1 christos default: use_default = ISC_TRUE; break; \
387 1.1 christos } \
388 1.1 christos break; \
389 1.1 christos case 12: result = fromwire_ptr(rdclass, type, source, dctx, options, target); break; \
390 1.1 christos case 13: result = fromwire_hinfo(rdclass, type, source, dctx, options, target); break; \
391 1.1 christos case 14: result = fromwire_minfo(rdclass, type, source, dctx, options, target); break; \
392 1.1 christos case 15: result = fromwire_mx(rdclass, type, source, dctx, options, target); break; \
393 1.1 christos case 16: result = fromwire_txt(rdclass, type, source, dctx, options, target); break; \
394 1.1 christos case 17: result = fromwire_rp(rdclass, type, source, dctx, options, target); break; \
395 1.1 christos case 18: result = fromwire_afsdb(rdclass, type, source, dctx, options, target); break; \
396 1.1 christos case 19: result = fromwire_x25(rdclass, type, source, dctx, options, target); break; \
397 1.1 christos case 20: result = fromwire_isdn(rdclass, type, source, dctx, options, target); break; \
398 1.1 christos case 21: result = fromwire_rt(rdclass, type, source, dctx, options, target); break; \
399 1.1 christos case 22: switch (rdclass) { \
400 1.1 christos case 1: result = fromwire_in_nsap(rdclass, type, source, dctx, options, target); break; \
401 1.1 christos default: use_default = ISC_TRUE; break; \
402 1.1 christos } \
403 1.1 christos break; \
404 1.1 christos case 23: switch (rdclass) { \
405 1.1 christos case 1: result = fromwire_in_nsap_ptr(rdclass, type, source, dctx, options, target); break; \
406 1.1 christos default: use_default = ISC_TRUE; break; \
407 1.1 christos } \
408 1.1 christos break; \
409 1.1 christos case 24: result = fromwire_sig(rdclass, type, source, dctx, options, target); break; \
410 1.1 christos case 25: result = fromwire_key(rdclass, type, source, dctx, options, target); break; \
411 1.1 christos case 26: switch (rdclass) { \
412 1.1 christos case 1: result = fromwire_in_px(rdclass, type, source, dctx, options, target); break; \
413 1.1 christos default: use_default = ISC_TRUE; break; \
414 1.1 christos } \
415 1.1 christos break; \
416 1.1 christos case 27: result = fromwire_gpos(rdclass, type, source, dctx, options, target); break; \
417 1.1 christos case 28: switch (rdclass) { \
418 1.1 christos case 1: result = fromwire_in_aaaa(rdclass, type, source, dctx, options, target); break; \
419 1.1 christos default: use_default = ISC_TRUE; break; \
420 1.1 christos } \
421 1.1 christos break; \
422 1.1 christos case 29: result = fromwire_loc(rdclass, type, source, dctx, options, target); break; \
423 1.1 christos case 30: result = fromwire_nxt(rdclass, type, source, dctx, options, target); break; \
424 1.1 christos case 33: switch (rdclass) { \
425 1.1 christos case 1: result = fromwire_in_srv(rdclass, type, source, dctx, options, target); break; \
426 1.1 christos default: use_default = ISC_TRUE; break; \
427 1.1 christos } \
428 1.1 christos break; \
429 1.1 christos case 35: result = fromwire_naptr(rdclass, type, source, dctx, options, target); break; \
430 1.1 christos case 36: switch (rdclass) { \
431 1.1 christos case 1: result = fromwire_in_kx(rdclass, type, source, dctx, options, target); break; \
432 1.1 christos default: use_default = ISC_TRUE; break; \
433 1.1 christos } \
434 1.1 christos break; \
435 1.1 christos case 37: result = fromwire_cert(rdclass, type, source, dctx, options, target); break; \
436 1.1 christos case 38: switch (rdclass) { \
437 1.1 christos case 1: result = fromwire_in_a6(rdclass, type, source, dctx, options, target); break; \
438 1.1 christos default: use_default = ISC_TRUE; break; \
439 1.1 christos } \
440 1.1 christos break; \
441 1.1 christos case 39: result = fromwire_dname(rdclass, type, source, dctx, options, target); break; \
442 1.1 christos case 40: result = fromwire_sink(rdclass, type, source, dctx, options, target); break; \
443 1.1 christos case 41: result = fromwire_opt(rdclass, type, source, dctx, options, target); break; \
444 1.1 christos case 42: switch (rdclass) { \
445 1.1 christos case 1: result = fromwire_in_apl(rdclass, type, source, dctx, options, target); break; \
446 1.1 christos default: use_default = ISC_TRUE; break; \
447 1.1 christos } \
448 1.1 christos break; \
449 1.1 christos case 43: result = fromwire_ds(rdclass, type, source, dctx, options, target); break; \
450 1.1 christos case 44: result = fromwire_sshfp(rdclass, type, source, dctx, options, target); break; \
451 1.1 christos case 45: result = fromwire_ipseckey(rdclass, type, source, dctx, options, target); break; \
452 1.1 christos case 46: result = fromwire_rrsig(rdclass, type, source, dctx, options, target); break; \
453 1.1 christos case 47: result = fromwire_nsec(rdclass, type, source, dctx, options, target); break; \
454 1.1 christos case 48: result = fromwire_dnskey(rdclass, type, source, dctx, options, target); break; \
455 1.1 christos case 49: switch (rdclass) { \
456 1.1 christos case 1: result = fromwire_in_dhcid(rdclass, type, source, dctx, options, target); break; \
457 1.1 christos default: use_default = ISC_TRUE; break; \
458 1.1 christos } \
459 1.1 christos break; \
460 1.1 christos case 50: result = fromwire_nsec3(rdclass, type, source, dctx, options, target); break; \
461 1.1 christos case 51: result = fromwire_nsec3param(rdclass, type, source, dctx, options, target); break; \
462 1.1 christos case 52: result = fromwire_tlsa(rdclass, type, source, dctx, options, target); break; \
463 1.1 christos case 53: result = fromwire_smimea(rdclass, type, source, dctx, options, target); break; \
464 1.1 christos case 55: result = fromwire_hip(rdclass, type, source, dctx, options, target); break; \
465 1.1 christos case 56: result = fromwire_ninfo(rdclass, type, source, dctx, options, target); break; \
466 1.1 christos case 57: result = fromwire_rkey(rdclass, type, source, dctx, options, target); break; \
467 1.1 christos case 58: result = fromwire_talink(rdclass, type, source, dctx, options, target); break; \
468 1.1 christos case 59: result = fromwire_cds(rdclass, type, source, dctx, options, target); break; \
469 1.1 christos case 60: result = fromwire_cdnskey(rdclass, type, source, dctx, options, target); break; \
470 1.1 christos case 61: result = fromwire_openpgpkey(rdclass, type, source, dctx, options, target); break; \
471 1.1 christos case 62: result = fromwire_csync(rdclass, type, source, dctx, options, target); break; \
472 1.1 christos case 99: result = fromwire_spf(rdclass, type, source, dctx, options, target); break; \
473 1.1 christos case 103: result = fromwire_unspec(rdclass, type, source, dctx, options, target); break; \
474 1.1 christos case 104: result = fromwire_nid(rdclass, type, source, dctx, options, target); break; \
475 1.1 christos case 105: result = fromwire_l32(rdclass, type, source, dctx, options, target); break; \
476 1.1 christos case 106: result = fromwire_l64(rdclass, type, source, dctx, options, target); break; \
477 1.1 christos case 107: result = fromwire_lp(rdclass, type, source, dctx, options, target); break; \
478 1.1 christos case 108: result = fromwire_eui48(rdclass, type, source, dctx, options, target); break; \
479 1.1 christos case 109: result = fromwire_eui64(rdclass, type, source, dctx, options, target); break; \
480 1.1 christos case 249: result = fromwire_tkey(rdclass, type, source, dctx, options, target); break; \
481 1.1 christos case 250: switch (rdclass) { \
482 1.1 christos case 255: result = fromwire_any_tsig(rdclass, type, source, dctx, options, target); break; \
483 1.1 christos default: use_default = ISC_TRUE; break; \
484 1.1 christos } \
485 1.1 christos break; \
486 1.1 christos case 256: result = fromwire_uri(rdclass, type, source, dctx, options, target); break; \
487 1.1 christos case 257: result = fromwire_caa(rdclass, type, source, dctx, options, target); break; \
488 1.1 christos case 258: result = fromwire_avc(rdclass, type, source, dctx, options, target); break; \
489 1.1 christos case 259: result = fromwire_doa(rdclass, type, source, dctx, options, target); break; \
490 1.1 christos case 32768: result = fromwire_ta(rdclass, type, source, dctx, options, target); break; \
491 1.1 christos case 32769: result = fromwire_dlv(rdclass, type, source, dctx, options, target); break; \
492 1.1 christos case 65533: result = fromwire_keydata(rdclass, type, source, dctx, options, target); break; \
493 1.1 christos default: use_default = ISC_TRUE; break; \
494 1.1 christos }
495 1.1 christos
496 1.1 christos #define TOWIRESWITCH \
497 1.1 christos switch (rdata->type) { \
498 1.1 christos case 1: switch (rdata->rdclass) { \
499 1.1 christos case 1: result = towire_in_a(rdata, cctx, target); break; \
500 1.1 christos case 3: result = towire_ch_a(rdata, cctx, target); break; \
501 1.1 christos case 4: result = towire_hs_a(rdata, cctx, target); break; \
502 1.1 christos default: use_default = ISC_TRUE; break; \
503 1.1 christos } \
504 1.1 christos break; \
505 1.1 christos case 2: result = towire_ns(rdata, cctx, target); break; \
506 1.1 christos case 3: result = towire_md(rdata, cctx, target); break; \
507 1.1 christos case 4: result = towire_mf(rdata, cctx, target); break; \
508 1.1 christos case 5: result = towire_cname(rdata, cctx, target); break; \
509 1.1 christos case 6: result = towire_soa(rdata, cctx, target); break; \
510 1.1 christos case 7: result = towire_mb(rdata, cctx, target); break; \
511 1.1 christos case 8: result = towire_mg(rdata, cctx, target); break; \
512 1.1 christos case 9: result = towire_mr(rdata, cctx, target); break; \
513 1.1 christos case 10: result = towire_null(rdata, cctx, target); break; \
514 1.1 christos case 11: switch (rdata->rdclass) { \
515 1.1 christos case 1: result = towire_in_wks(rdata, cctx, target); break; \
516 1.1 christos default: use_default = ISC_TRUE; break; \
517 1.1 christos } \
518 1.1 christos break; \
519 1.1 christos case 12: result = towire_ptr(rdata, cctx, target); break; \
520 1.1 christos case 13: result = towire_hinfo(rdata, cctx, target); break; \
521 1.1 christos case 14: result = towire_minfo(rdata, cctx, target); break; \
522 1.1 christos case 15: result = towire_mx(rdata, cctx, target); break; \
523 1.1 christos case 16: result = towire_txt(rdata, cctx, target); break; \
524 1.1 christos case 17: result = towire_rp(rdata, cctx, target); break; \
525 1.1 christos case 18: result = towire_afsdb(rdata, cctx, target); break; \
526 1.1 christos case 19: result = towire_x25(rdata, cctx, target); break; \
527 1.1 christos case 20: result = towire_isdn(rdata, cctx, target); break; \
528 1.1 christos case 21: result = towire_rt(rdata, cctx, target); break; \
529 1.1 christos case 22: switch (rdata->rdclass) { \
530 1.1 christos case 1: result = towire_in_nsap(rdata, cctx, target); break; \
531 1.1 christos default: use_default = ISC_TRUE; break; \
532 1.1 christos } \
533 1.1 christos break; \
534 1.1 christos case 23: switch (rdata->rdclass) { \
535 1.1 christos case 1: result = towire_in_nsap_ptr(rdata, cctx, target); break; \
536 1.1 christos default: use_default = ISC_TRUE; break; \
537 1.1 christos } \
538 1.1 christos break; \
539 1.1 christos case 24: result = towire_sig(rdata, cctx, target); break; \
540 1.1 christos case 25: result = towire_key(rdata, cctx, target); break; \
541 1.1 christos case 26: switch (rdata->rdclass) { \
542 1.1 christos case 1: result = towire_in_px(rdata, cctx, target); break; \
543 1.1 christos default: use_default = ISC_TRUE; break; \
544 1.1 christos } \
545 1.1 christos break; \
546 1.1 christos case 27: result = towire_gpos(rdata, cctx, target); break; \
547 1.1 christos case 28: switch (rdata->rdclass) { \
548 1.1 christos case 1: result = towire_in_aaaa(rdata, cctx, target); break; \
549 1.1 christos default: use_default = ISC_TRUE; break; \
550 1.1 christos } \
551 1.1 christos break; \
552 1.1 christos case 29: result = towire_loc(rdata, cctx, target); break; \
553 1.1 christos case 30: result = towire_nxt(rdata, cctx, target); break; \
554 1.1 christos case 33: switch (rdata->rdclass) { \
555 1.1 christos case 1: result = towire_in_srv(rdata, cctx, target); break; \
556 1.1 christos default: use_default = ISC_TRUE; break; \
557 1.1 christos } \
558 1.1 christos break; \
559 1.1 christos case 35: result = towire_naptr(rdata, cctx, target); break; \
560 1.1 christos case 36: switch (rdata->rdclass) { \
561 1.1 christos case 1: result = towire_in_kx(rdata, cctx, target); break; \
562 1.1 christos default: use_default = ISC_TRUE; break; \
563 1.1 christos } \
564 1.1 christos break; \
565 1.1 christos case 37: result = towire_cert(rdata, cctx, target); break; \
566 1.1 christos case 38: switch (rdata->rdclass) { \
567 1.1 christos case 1: result = towire_in_a6(rdata, cctx, target); break; \
568 1.1 christos default: use_default = ISC_TRUE; break; \
569 1.1 christos } \
570 1.1 christos break; \
571 1.1 christos case 39: result = towire_dname(rdata, cctx, target); break; \
572 1.1 christos case 40: result = towire_sink(rdata, cctx, target); break; \
573 1.1 christos case 41: result = towire_opt(rdata, cctx, target); break; \
574 1.1 christos case 42: switch (rdata->rdclass) { \
575 1.1 christos case 1: result = towire_in_apl(rdata, cctx, target); break; \
576 1.1 christos default: use_default = ISC_TRUE; break; \
577 1.1 christos } \
578 1.1 christos break; \
579 1.1 christos case 43: result = towire_ds(rdata, cctx, target); break; \
580 1.1 christos case 44: result = towire_sshfp(rdata, cctx, target); break; \
581 1.1 christos case 45: result = towire_ipseckey(rdata, cctx, target); break; \
582 1.1 christos case 46: result = towire_rrsig(rdata, cctx, target); break; \
583 1.1 christos case 47: result = towire_nsec(rdata, cctx, target); break; \
584 1.1 christos case 48: result = towire_dnskey(rdata, cctx, target); break; \
585 1.1 christos case 49: switch (rdata->rdclass) { \
586 1.1 christos case 1: result = towire_in_dhcid(rdata, cctx, target); break; \
587 1.1 christos default: use_default = ISC_TRUE; break; \
588 1.1 christos } \
589 1.1 christos break; \
590 1.1 christos case 50: result = towire_nsec3(rdata, cctx, target); break; \
591 1.1 christos case 51: result = towire_nsec3param(rdata, cctx, target); break; \
592 1.1 christos case 52: result = towire_tlsa(rdata, cctx, target); break; \
593 1.1 christos case 53: result = towire_smimea(rdata, cctx, target); break; \
594 1.1 christos case 55: result = towire_hip(rdata, cctx, target); break; \
595 1.1 christos case 56: result = towire_ninfo(rdata, cctx, target); break; \
596 1.1 christos case 57: result = towire_rkey(rdata, cctx, target); break; \
597 1.1 christos case 58: result = towire_talink(rdata, cctx, target); break; \
598 1.1 christos case 59: result = towire_cds(rdata, cctx, target); break; \
599 1.1 christos case 60: result = towire_cdnskey(rdata, cctx, target); break; \
600 1.1 christos case 61: result = towire_openpgpkey(rdata, cctx, target); break; \
601 1.1 christos case 62: result = towire_csync(rdata, cctx, target); break; \
602 1.1 christos case 99: result = towire_spf(rdata, cctx, target); break; \
603 1.1 christos case 103: result = towire_unspec(rdata, cctx, target); break; \
604 1.1 christos case 104: result = towire_nid(rdata, cctx, target); break; \
605 1.1 christos case 105: result = towire_l32(rdata, cctx, target); break; \
606 1.1 christos case 106: result = towire_l64(rdata, cctx, target); break; \
607 1.1 christos case 107: result = towire_lp(rdata, cctx, target); break; \
608 1.1 christos case 108: result = towire_eui48(rdata, cctx, target); break; \
609 1.1 christos case 109: result = towire_eui64(rdata, cctx, target); break; \
610 1.1 christos case 249: result = towire_tkey(rdata, cctx, target); break; \
611 1.1 christos case 250: switch (rdata->rdclass) { \
612 1.1 christos case 255: result = towire_any_tsig(rdata, cctx, target); break; \
613 1.1 christos default: use_default = ISC_TRUE; break; \
614 1.1 christos } \
615 1.1 christos break; \
616 1.1 christos case 256: result = towire_uri(rdata, cctx, target); break; \
617 1.1 christos case 257: result = towire_caa(rdata, cctx, target); break; \
618 1.1 christos case 258: result = towire_avc(rdata, cctx, target); break; \
619 1.1 christos case 259: result = towire_doa(rdata, cctx, target); break; \
620 1.1 christos case 32768: result = towire_ta(rdata, cctx, target); break; \
621 1.1 christos case 32769: result = towire_dlv(rdata, cctx, target); break; \
622 1.1 christos case 65533: result = towire_keydata(rdata, cctx, target); break; \
623 1.1 christos default: use_default = ISC_TRUE; break; \
624 1.1 christos }
625 1.1 christos
626 1.1 christos #define COMPARESWITCH \
627 1.1 christos switch (rdata1->type) { \
628 1.1 christos case 1: switch (rdata1->rdclass) { \
629 1.1 christos case 1: result = compare_in_a(rdata1, rdata2); break; \
630 1.1 christos case 3: result = compare_ch_a(rdata1, rdata2); break; \
631 1.1 christos case 4: result = compare_hs_a(rdata1, rdata2); break; \
632 1.1 christos default: use_default = ISC_TRUE; break; \
633 1.1 christos } \
634 1.1 christos break; \
635 1.1 christos case 2: result = compare_ns(rdata1, rdata2); break; \
636 1.1 christos case 3: result = compare_md(rdata1, rdata2); break; \
637 1.1 christos case 4: result = compare_mf(rdata1, rdata2); break; \
638 1.1 christos case 5: result = compare_cname(rdata1, rdata2); break; \
639 1.1 christos case 6: result = compare_soa(rdata1, rdata2); break; \
640 1.1 christos case 7: result = compare_mb(rdata1, rdata2); break; \
641 1.1 christos case 8: result = compare_mg(rdata1, rdata2); break; \
642 1.1 christos case 9: result = compare_mr(rdata1, rdata2); break; \
643 1.1 christos case 10: result = compare_null(rdata1, rdata2); break; \
644 1.1 christos case 11: switch (rdata1->rdclass) { \
645 1.1 christos case 1: result = compare_in_wks(rdata1, rdata2); break; \
646 1.1 christos default: use_default = ISC_TRUE; break; \
647 1.1 christos } \
648 1.1 christos break; \
649 1.1 christos case 12: result = compare_ptr(rdata1, rdata2); break; \
650 1.1 christos case 13: result = compare_hinfo(rdata1, rdata2); break; \
651 1.1 christos case 14: result = compare_minfo(rdata1, rdata2); break; \
652 1.1 christos case 15: result = compare_mx(rdata1, rdata2); break; \
653 1.1 christos case 16: result = compare_txt(rdata1, rdata2); break; \
654 1.1 christos case 17: result = compare_rp(rdata1, rdata2); break; \
655 1.1 christos case 18: result = compare_afsdb(rdata1, rdata2); break; \
656 1.1 christos case 19: result = compare_x25(rdata1, rdata2); break; \
657 1.1 christos case 20: result = compare_isdn(rdata1, rdata2); break; \
658 1.1 christos case 21: result = compare_rt(rdata1, rdata2); break; \
659 1.1 christos case 22: switch (rdata1->rdclass) { \
660 1.1 christos case 1: result = compare_in_nsap(rdata1, rdata2); break; \
661 1.1 christos default: use_default = ISC_TRUE; break; \
662 1.1 christos } \
663 1.1 christos break; \
664 1.1 christos case 23: switch (rdata1->rdclass) { \
665 1.1 christos case 1: result = compare_in_nsap_ptr(rdata1, rdata2); break; \
666 1.1 christos default: use_default = ISC_TRUE; break; \
667 1.1 christos } \
668 1.1 christos break; \
669 1.1 christos case 24: result = compare_sig(rdata1, rdata2); break; \
670 1.1 christos case 25: result = compare_key(rdata1, rdata2); break; \
671 1.1 christos case 26: switch (rdata1->rdclass) { \
672 1.1 christos case 1: result = compare_in_px(rdata1, rdata2); break; \
673 1.1 christos default: use_default = ISC_TRUE; break; \
674 1.1 christos } \
675 1.1 christos break; \
676 1.1 christos case 27: result = compare_gpos(rdata1, rdata2); break; \
677 1.1 christos case 28: switch (rdata1->rdclass) { \
678 1.1 christos case 1: result = compare_in_aaaa(rdata1, rdata2); break; \
679 1.1 christos default: use_default = ISC_TRUE; break; \
680 1.1 christos } \
681 1.1 christos break; \
682 1.1 christos case 29: result = compare_loc(rdata1, rdata2); break; \
683 1.1 christos case 30: result = compare_nxt(rdata1, rdata2); break; \
684 1.1 christos case 33: switch (rdata1->rdclass) { \
685 1.1 christos case 1: result = compare_in_srv(rdata1, rdata2); break; \
686 1.1 christos default: use_default = ISC_TRUE; break; \
687 1.1 christos } \
688 1.1 christos break; \
689 1.1 christos case 35: result = compare_naptr(rdata1, rdata2); break; \
690 1.1 christos case 36: switch (rdata1->rdclass) { \
691 1.1 christos case 1: result = compare_in_kx(rdata1, rdata2); break; \
692 1.1 christos default: use_default = ISC_TRUE; break; \
693 1.1 christos } \
694 1.1 christos break; \
695 1.1 christos case 37: result = compare_cert(rdata1, rdata2); break; \
696 1.1 christos case 38: switch (rdata1->rdclass) { \
697 1.1 christos case 1: result = compare_in_a6(rdata1, rdata2); break; \
698 1.1 christos default: use_default = ISC_TRUE; break; \
699 1.1 christos } \
700 1.1 christos break; \
701 1.1 christos case 39: result = compare_dname(rdata1, rdata2); break; \
702 1.1 christos case 40: result = compare_sink(rdata1, rdata2); break; \
703 1.1 christos case 41: result = compare_opt(rdata1, rdata2); break; \
704 1.1 christos case 42: switch (rdata1->rdclass) { \
705 1.1 christos case 1: result = compare_in_apl(rdata1, rdata2); break; \
706 1.1 christos default: use_default = ISC_TRUE; break; \
707 1.1 christos } \
708 1.1 christos break; \
709 1.1 christos case 43: result = compare_ds(rdata1, rdata2); break; \
710 1.1 christos case 44: result = compare_sshfp(rdata1, rdata2); break; \
711 1.1 christos case 45: result = compare_ipseckey(rdata1, rdata2); break; \
712 1.1 christos case 46: result = compare_rrsig(rdata1, rdata2); break; \
713 1.1 christos case 47: result = compare_nsec(rdata1, rdata2); break; \
714 1.1 christos case 48: result = compare_dnskey(rdata1, rdata2); break; \
715 1.1 christos case 49: switch (rdata1->rdclass) { \
716 1.1 christos case 1: result = compare_in_dhcid(rdata1, rdata2); break; \
717 1.1 christos default: use_default = ISC_TRUE; break; \
718 1.1 christos } \
719 1.1 christos break; \
720 1.1 christos case 50: result = compare_nsec3(rdata1, rdata2); break; \
721 1.1 christos case 51: result = compare_nsec3param(rdata1, rdata2); break; \
722 1.1 christos case 52: result = compare_tlsa(rdata1, rdata2); break; \
723 1.1 christos case 53: result = compare_smimea(rdata1, rdata2); break; \
724 1.1 christos case 55: result = compare_hip(rdata1, rdata2); break; \
725 1.1 christos case 56: result = compare_ninfo(rdata1, rdata2); break; \
726 1.1 christos case 57: result = compare_rkey(rdata1, rdata2); break; \
727 1.1 christos case 58: result = compare_talink(rdata1, rdata2); break; \
728 1.1 christos case 59: result = compare_cds(rdata1, rdata2); break; \
729 1.1 christos case 60: result = compare_cdnskey(rdata1, rdata2); break; \
730 1.1 christos case 61: result = compare_openpgpkey(rdata1, rdata2); break; \
731 1.1 christos case 62: result = compare_csync(rdata1, rdata2); break; \
732 1.1 christos case 99: result = compare_spf(rdata1, rdata2); break; \
733 1.1 christos case 103: result = compare_unspec(rdata1, rdata2); break; \
734 1.1 christos case 104: result = compare_nid(rdata1, rdata2); break; \
735 1.1 christos case 105: result = compare_l32(rdata1, rdata2); break; \
736 1.1 christos case 106: result = compare_l64(rdata1, rdata2); break; \
737 1.1 christos case 107: result = compare_lp(rdata1, rdata2); break; \
738 1.1 christos case 108: result = compare_eui48(rdata1, rdata2); break; \
739 1.1 christos case 109: result = compare_eui64(rdata1, rdata2); break; \
740 1.1 christos case 249: result = compare_tkey(rdata1, rdata2); break; \
741 1.1 christos case 250: switch (rdata1->rdclass) { \
742 1.1 christos case 255: result = compare_any_tsig(rdata1, rdata2); break; \
743 1.1 christos default: use_default = ISC_TRUE; break; \
744 1.1 christos } \
745 1.1 christos break; \
746 1.1 christos case 256: result = compare_uri(rdata1, rdata2); break; \
747 1.1 christos case 257: result = compare_caa(rdata1, rdata2); break; \
748 1.1 christos case 258: result = compare_avc(rdata1, rdata2); break; \
749 1.1 christos case 259: result = compare_doa(rdata1, rdata2); break; \
750 1.1 christos case 32768: result = compare_ta(rdata1, rdata2); break; \
751 1.1 christos case 32769: result = compare_dlv(rdata1, rdata2); break; \
752 1.1 christos case 65533: result = compare_keydata(rdata1, rdata2); break; \
753 1.1 christos default: use_default = ISC_TRUE; break; \
754 1.1 christos }
755 1.1 christos
756 1.1 christos #define CASECOMPARESWITCH \
757 1.1 christos switch (rdata1->type) { \
758 1.1 christos case 1: switch (rdata1->rdclass) { \
759 1.1 christos case 1: result = casecompare_in_a(rdata1, rdata2); break; \
760 1.1 christos case 3: result = casecompare_ch_a(rdata1, rdata2); break; \
761 1.1 christos case 4: result = casecompare_hs_a(rdata1, rdata2); break; \
762 1.1 christos default: use_default = ISC_TRUE; break; \
763 1.1 christos } \
764 1.1 christos break; \
765 1.1 christos case 2: result = casecompare_ns(rdata1, rdata2); break; \
766 1.1 christos case 3: result = casecompare_md(rdata1, rdata2); break; \
767 1.1 christos case 4: result = casecompare_mf(rdata1, rdata2); break; \
768 1.1 christos case 5: result = casecompare_cname(rdata1, rdata2); break; \
769 1.1 christos case 6: result = casecompare_soa(rdata1, rdata2); break; \
770 1.1 christos case 7: result = casecompare_mb(rdata1, rdata2); break; \
771 1.1 christos case 8: result = casecompare_mg(rdata1, rdata2); break; \
772 1.1 christos case 9: result = casecompare_mr(rdata1, rdata2); break; \
773 1.1 christos case 10: result = casecompare_null(rdata1, rdata2); break; \
774 1.1 christos case 11: switch (rdata1->rdclass) { \
775 1.1 christos case 1: result = casecompare_in_wks(rdata1, rdata2); break; \
776 1.1 christos default: use_default = ISC_TRUE; break; \
777 1.1 christos } \
778 1.1 christos break; \
779 1.1 christos case 12: result = casecompare_ptr(rdata1, rdata2); break; \
780 1.1 christos case 13: result = casecompare_hinfo(rdata1, rdata2); break; \
781 1.1 christos case 14: result = casecompare_minfo(rdata1, rdata2); break; \
782 1.1 christos case 15: result = casecompare_mx(rdata1, rdata2); break; \
783 1.1 christos case 16: result = casecompare_txt(rdata1, rdata2); break; \
784 1.1 christos case 17: result = casecompare_rp(rdata1, rdata2); break; \
785 1.1 christos case 18: result = casecompare_afsdb(rdata1, rdata2); break; \
786 1.1 christos case 19: result = casecompare_x25(rdata1, rdata2); break; \
787 1.1 christos case 20: result = casecompare_isdn(rdata1, rdata2); break; \
788 1.1 christos case 21: result = casecompare_rt(rdata1, rdata2); break; \
789 1.1 christos case 22: switch (rdata1->rdclass) { \
790 1.1 christos case 1: result = casecompare_in_nsap(rdata1, rdata2); break; \
791 1.1 christos default: use_default = ISC_TRUE; break; \
792 1.1 christos } \
793 1.1 christos break; \
794 1.1 christos case 23: switch (rdata1->rdclass) { \
795 1.1 christos case 1: result = casecompare_in_nsap_ptr(rdata1, rdata2); break; \
796 1.1 christos default: use_default = ISC_TRUE; break; \
797 1.1 christos } \
798 1.1 christos break; \
799 1.1 christos case 24: result = casecompare_sig(rdata1, rdata2); break; \
800 1.1 christos case 25: result = casecompare_key(rdata1, rdata2); break; \
801 1.1 christos case 26: switch (rdata1->rdclass) { \
802 1.1 christos case 1: result = casecompare_in_px(rdata1, rdata2); break; \
803 1.1 christos default: use_default = ISC_TRUE; break; \
804 1.1 christos } \
805 1.1 christos break; \
806 1.1 christos case 27: result = casecompare_gpos(rdata1, rdata2); break; \
807 1.1 christos case 28: switch (rdata1->rdclass) { \
808 1.1 christos case 1: result = casecompare_in_aaaa(rdata1, rdata2); break; \
809 1.1 christos default: use_default = ISC_TRUE; break; \
810 1.1 christos } \
811 1.1 christos break; \
812 1.1 christos case 29: result = casecompare_loc(rdata1, rdata2); break; \
813 1.1 christos case 30: result = casecompare_nxt(rdata1, rdata2); break; \
814 1.1 christos case 33: switch (rdata1->rdclass) { \
815 1.1 christos case 1: result = casecompare_in_srv(rdata1, rdata2); break; \
816 1.1 christos default: use_default = ISC_TRUE; break; \
817 1.1 christos } \
818 1.1 christos break; \
819 1.1 christos case 35: result = casecompare_naptr(rdata1, rdata2); break; \
820 1.1 christos case 36: switch (rdata1->rdclass) { \
821 1.1 christos case 1: result = casecompare_in_kx(rdata1, rdata2); break; \
822 1.1 christos default: use_default = ISC_TRUE; break; \
823 1.1 christos } \
824 1.1 christos break; \
825 1.1 christos case 37: result = casecompare_cert(rdata1, rdata2); break; \
826 1.1 christos case 38: switch (rdata1->rdclass) { \
827 1.1 christos case 1: result = casecompare_in_a6(rdata1, rdata2); break; \
828 1.1 christos default: use_default = ISC_TRUE; break; \
829 1.1 christos } \
830 1.1 christos break; \
831 1.1 christos case 39: result = casecompare_dname(rdata1, rdata2); break; \
832 1.1 christos case 40: result = casecompare_sink(rdata1, rdata2); break; \
833 1.1 christos case 41: result = casecompare_opt(rdata1, rdata2); break; \
834 1.1 christos case 42: switch (rdata1->rdclass) { \
835 1.1 christos case 1: result = casecompare_in_apl(rdata1, rdata2); break; \
836 1.1 christos default: use_default = ISC_TRUE; break; \
837 1.1 christos } \
838 1.1 christos break; \
839 1.1 christos case 43: result = casecompare_ds(rdata1, rdata2); break; \
840 1.1 christos case 44: result = casecompare_sshfp(rdata1, rdata2); break; \
841 1.1 christos case 45: result = casecompare_ipseckey(rdata1, rdata2); break; \
842 1.1 christos case 46: result = casecompare_rrsig(rdata1, rdata2); break; \
843 1.1 christos case 47: result = casecompare_nsec(rdata1, rdata2); break; \
844 1.1 christos case 48: result = casecompare_dnskey(rdata1, rdata2); break; \
845 1.1 christos case 49: switch (rdata1->rdclass) { \
846 1.1 christos case 1: result = casecompare_in_dhcid(rdata1, rdata2); break; \
847 1.1 christos default: use_default = ISC_TRUE; break; \
848 1.1 christos } \
849 1.1 christos break; \
850 1.1 christos case 50: result = casecompare_nsec3(rdata1, rdata2); break; \
851 1.1 christos case 51: result = casecompare_nsec3param(rdata1, rdata2); break; \
852 1.1 christos case 52: result = casecompare_tlsa(rdata1, rdata2); break; \
853 1.1 christos case 53: result = casecompare_smimea(rdata1, rdata2); break; \
854 1.1 christos case 55: result = casecompare_hip(rdata1, rdata2); break; \
855 1.1 christos case 56: result = casecompare_ninfo(rdata1, rdata2); break; \
856 1.1 christos case 57: result = casecompare_rkey(rdata1, rdata2); break; \
857 1.1 christos case 58: result = casecompare_talink(rdata1, rdata2); break; \
858 1.1 christos case 59: result = casecompare_cds(rdata1, rdata2); break; \
859 1.1 christos case 60: result = casecompare_cdnskey(rdata1, rdata2); break; \
860 1.1 christos case 61: result = casecompare_openpgpkey(rdata1, rdata2); break; \
861 1.1 christos case 62: result = casecompare_csync(rdata1, rdata2); break; \
862 1.1 christos case 99: result = casecompare_spf(rdata1, rdata2); break; \
863 1.1 christos case 103: result = casecompare_unspec(rdata1, rdata2); break; \
864 1.1 christos case 104: result = casecompare_nid(rdata1, rdata2); break; \
865 1.1 christos case 105: result = casecompare_l32(rdata1, rdata2); break; \
866 1.1 christos case 106: result = casecompare_l64(rdata1, rdata2); break; \
867 1.1 christos case 107: result = casecompare_lp(rdata1, rdata2); break; \
868 1.1 christos case 108: result = casecompare_eui48(rdata1, rdata2); break; \
869 1.1 christos case 109: result = casecompare_eui64(rdata1, rdata2); break; \
870 1.1 christos case 249: result = casecompare_tkey(rdata1, rdata2); break; \
871 1.1 christos case 250: switch (rdata1->rdclass) { \
872 1.1 christos case 255: result = casecompare_any_tsig(rdata1, rdata2); break; \
873 1.1 christos default: use_default = ISC_TRUE; break; \
874 1.1 christos } \
875 1.1 christos break; \
876 1.1 christos case 256: result = casecompare_uri(rdata1, rdata2); break; \
877 1.1 christos case 257: result = casecompare_caa(rdata1, rdata2); break; \
878 1.1 christos case 258: result = casecompare_avc(rdata1, rdata2); break; \
879 1.1 christos case 259: result = casecompare_doa(rdata1, rdata2); break; \
880 1.1 christos case 32768: result = casecompare_ta(rdata1, rdata2); break; \
881 1.1 christos case 32769: result = casecompare_dlv(rdata1, rdata2); break; \
882 1.1 christos case 65533: result = casecompare_keydata(rdata1, rdata2); break; \
883 1.1 christos default: use_default = ISC_TRUE; break; \
884 1.1 christos }
885 1.1 christos
886 1.1 christos #define FROMSTRUCTSWITCH \
887 1.1 christos switch (type) { \
888 1.1 christos case 1: switch (rdclass) { \
889 1.1 christos case 1: result = fromstruct_in_a(rdclass, type, source, target); break; \
890 1.1 christos case 3: result = fromstruct_ch_a(rdclass, type, source, target); break; \
891 1.1 christos case 4: result = fromstruct_hs_a(rdclass, type, source, target); break; \
892 1.1 christos default: use_default = ISC_TRUE; break; \
893 1.1 christos } \
894 1.1 christos break; \
895 1.1 christos case 2: result = fromstruct_ns(rdclass, type, source, target); break; \
896 1.1 christos case 3: result = fromstruct_md(rdclass, type, source, target); break; \
897 1.1 christos case 4: result = fromstruct_mf(rdclass, type, source, target); break; \
898 1.1 christos case 5: result = fromstruct_cname(rdclass, type, source, target); break; \
899 1.1 christos case 6: result = fromstruct_soa(rdclass, type, source, target); break; \
900 1.1 christos case 7: result = fromstruct_mb(rdclass, type, source, target); break; \
901 1.1 christos case 8: result = fromstruct_mg(rdclass, type, source, target); break; \
902 1.1 christos case 9: result = fromstruct_mr(rdclass, type, source, target); break; \
903 1.1 christos case 10: result = fromstruct_null(rdclass, type, source, target); break; \
904 1.1 christos case 11: switch (rdclass) { \
905 1.1 christos case 1: result = fromstruct_in_wks(rdclass, type, source, target); break; \
906 1.1 christos default: use_default = ISC_TRUE; break; \
907 1.1 christos } \
908 1.1 christos break; \
909 1.1 christos case 12: result = fromstruct_ptr(rdclass, type, source, target); break; \
910 1.1 christos case 13: result = fromstruct_hinfo(rdclass, type, source, target); break; \
911 1.1 christos case 14: result = fromstruct_minfo(rdclass, type, source, target); break; \
912 1.1 christos case 15: result = fromstruct_mx(rdclass, type, source, target); break; \
913 1.1 christos case 16: result = fromstruct_txt(rdclass, type, source, target); break; \
914 1.1 christos case 17: result = fromstruct_rp(rdclass, type, source, target); break; \
915 1.1 christos case 18: result = fromstruct_afsdb(rdclass, type, source, target); break; \
916 1.1 christos case 19: result = fromstruct_x25(rdclass, type, source, target); break; \
917 1.1 christos case 20: result = fromstruct_isdn(rdclass, type, source, target); break; \
918 1.1 christos case 21: result = fromstruct_rt(rdclass, type, source, target); break; \
919 1.1 christos case 22: switch (rdclass) { \
920 1.1 christos case 1: result = fromstruct_in_nsap(rdclass, type, source, target); break; \
921 1.1 christos default: use_default = ISC_TRUE; break; \
922 1.1 christos } \
923 1.1 christos break; \
924 1.1 christos case 23: switch (rdclass) { \
925 1.1 christos case 1: result = fromstruct_in_nsap_ptr(rdclass, type, source, target); break; \
926 1.1 christos default: use_default = ISC_TRUE; break; \
927 1.1 christos } \
928 1.1 christos break; \
929 1.1 christos case 24: result = fromstruct_sig(rdclass, type, source, target); break; \
930 1.1 christos case 25: result = fromstruct_key(rdclass, type, source, target); break; \
931 1.1 christos case 26: switch (rdclass) { \
932 1.1 christos case 1: result = fromstruct_in_px(rdclass, type, source, target); break; \
933 1.1 christos default: use_default = ISC_TRUE; break; \
934 1.1 christos } \
935 1.1 christos break; \
936 1.1 christos case 27: result = fromstruct_gpos(rdclass, type, source, target); break; \
937 1.1 christos case 28: switch (rdclass) { \
938 1.1 christos case 1: result = fromstruct_in_aaaa(rdclass, type, source, target); break; \
939 1.1 christos default: use_default = ISC_TRUE; break; \
940 1.1 christos } \
941 1.1 christos break; \
942 1.1 christos case 29: result = fromstruct_loc(rdclass, type, source, target); break; \
943 1.1 christos case 30: result = fromstruct_nxt(rdclass, type, source, target); break; \
944 1.1 christos case 33: switch (rdclass) { \
945 1.1 christos case 1: result = fromstruct_in_srv(rdclass, type, source, target); break; \
946 1.1 christos default: use_default = ISC_TRUE; break; \
947 1.1 christos } \
948 1.1 christos break; \
949 1.1 christos case 35: result = fromstruct_naptr(rdclass, type, source, target); break; \
950 1.1 christos case 36: switch (rdclass) { \
951 1.1 christos case 1: result = fromstruct_in_kx(rdclass, type, source, target); break; \
952 1.1 christos default: use_default = ISC_TRUE; break; \
953 1.1 christos } \
954 1.1 christos break; \
955 1.1 christos case 37: result = fromstruct_cert(rdclass, type, source, target); break; \
956 1.1 christos case 38: switch (rdclass) { \
957 1.1 christos case 1: result = fromstruct_in_a6(rdclass, type, source, target); break; \
958 1.1 christos default: use_default = ISC_TRUE; break; \
959 1.1 christos } \
960 1.1 christos break; \
961 1.1 christos case 39: result = fromstruct_dname(rdclass, type, source, target); break; \
962 1.1 christos case 40: result = fromstruct_sink(rdclass, type, source, target); break; \
963 1.1 christos case 41: result = fromstruct_opt(rdclass, type, source, target); break; \
964 1.1 christos case 42: switch (rdclass) { \
965 1.1 christos case 1: result = fromstruct_in_apl(rdclass, type, source, target); break; \
966 1.1 christos default: use_default = ISC_TRUE; break; \
967 1.1 christos } \
968 1.1 christos break; \
969 1.1 christos case 43: result = fromstruct_ds(rdclass, type, source, target); break; \
970 1.1 christos case 44: result = fromstruct_sshfp(rdclass, type, source, target); break; \
971 1.1 christos case 45: result = fromstruct_ipseckey(rdclass, type, source, target); break; \
972 1.1 christos case 46: result = fromstruct_rrsig(rdclass, type, source, target); break; \
973 1.1 christos case 47: result = fromstruct_nsec(rdclass, type, source, target); break; \
974 1.1 christos case 48: result = fromstruct_dnskey(rdclass, type, source, target); break; \
975 1.1 christos case 49: switch (rdclass) { \
976 1.1 christos case 1: result = fromstruct_in_dhcid(rdclass, type, source, target); break; \
977 1.1 christos default: use_default = ISC_TRUE; break; \
978 1.1 christos } \
979 1.1 christos break; \
980 1.1 christos case 50: result = fromstruct_nsec3(rdclass, type, source, target); break; \
981 1.1 christos case 51: result = fromstruct_nsec3param(rdclass, type, source, target); break; \
982 1.1 christos case 52: result = fromstruct_tlsa(rdclass, type, source, target); break; \
983 1.1 christos case 53: result = fromstruct_smimea(rdclass, type, source, target); break; \
984 1.1 christos case 55: result = fromstruct_hip(rdclass, type, source, target); break; \
985 1.1 christos case 56: result = fromstruct_ninfo(rdclass, type, source, target); break; \
986 1.1 christos case 57: result = fromstruct_rkey(rdclass, type, source, target); break; \
987 1.1 christos case 58: result = fromstruct_talink(rdclass, type, source, target); break; \
988 1.1 christos case 59: result = fromstruct_cds(rdclass, type, source, target); break; \
989 1.1 christos case 60: result = fromstruct_cdnskey(rdclass, type, source, target); break; \
990 1.1 christos case 61: result = fromstruct_openpgpkey(rdclass, type, source, target); break; \
991 1.1 christos case 62: result = fromstruct_csync(rdclass, type, source, target); break; \
992 1.1 christos case 99: result = fromstruct_spf(rdclass, type, source, target); break; \
993 1.1 christos case 103: result = fromstruct_unspec(rdclass, type, source, target); break; \
994 1.1 christos case 104: result = fromstruct_nid(rdclass, type, source, target); break; \
995 1.1 christos case 105: result = fromstruct_l32(rdclass, type, source, target); break; \
996 1.1 christos case 106: result = fromstruct_l64(rdclass, type, source, target); break; \
997 1.1 christos case 107: result = fromstruct_lp(rdclass, type, source, target); break; \
998 1.1 christos case 108: result = fromstruct_eui48(rdclass, type, source, target); break; \
999 1.1 christos case 109: result = fromstruct_eui64(rdclass, type, source, target); break; \
1000 1.1 christos case 249: result = fromstruct_tkey(rdclass, type, source, target); break; \
1001 1.1 christos case 250: switch (rdclass) { \
1002 1.1 christos case 255: result = fromstruct_any_tsig(rdclass, type, source, target); break; \
1003 1.1 christos default: use_default = ISC_TRUE; break; \
1004 1.1 christos } \
1005 1.1 christos break; \
1006 1.1 christos case 256: result = fromstruct_uri(rdclass, type, source, target); break; \
1007 1.1 christos case 257: result = fromstruct_caa(rdclass, type, source, target); break; \
1008 1.1 christos case 258: result = fromstruct_avc(rdclass, type, source, target); break; \
1009 1.1 christos case 259: result = fromstruct_doa(rdclass, type, source, target); break; \
1010 1.1 christos case 32768: result = fromstruct_ta(rdclass, type, source, target); break; \
1011 1.1 christos case 32769: result = fromstruct_dlv(rdclass, type, source, target); break; \
1012 1.1 christos case 65533: result = fromstruct_keydata(rdclass, type, source, target); break; \
1013 1.1 christos default: use_default = ISC_TRUE; break; \
1014 1.1 christos }
1015 1.1 christos
1016 1.1 christos #define TOSTRUCTSWITCH \
1017 1.1 christos switch (rdata->type) { \
1018 1.1 christos case 1: switch (rdata->rdclass) { \
1019 1.1 christos case 1: result = tostruct_in_a(rdata, target, mctx); break; \
1020 1.1 christos case 3: result = tostruct_ch_a(rdata, target, mctx); break; \
1021 1.1 christos case 4: result = tostruct_hs_a(rdata, target, mctx); break; \
1022 1.1 christos default: use_default = ISC_TRUE; break; \
1023 1.1 christos } \
1024 1.1 christos break; \
1025 1.1 christos case 2: result = tostruct_ns(rdata, target, mctx); break; \
1026 1.1 christos case 3: result = tostruct_md(rdata, target, mctx); break; \
1027 1.1 christos case 4: result = tostruct_mf(rdata, target, mctx); break; \
1028 1.1 christos case 5: result = tostruct_cname(rdata, target, mctx); break; \
1029 1.1 christos case 6: result = tostruct_soa(rdata, target, mctx); break; \
1030 1.1 christos case 7: result = tostruct_mb(rdata, target, mctx); break; \
1031 1.1 christos case 8: result = tostruct_mg(rdata, target, mctx); break; \
1032 1.1 christos case 9: result = tostruct_mr(rdata, target, mctx); break; \
1033 1.1 christos case 10: result = tostruct_null(rdata, target, mctx); break; \
1034 1.1 christos case 11: switch (rdata->rdclass) { \
1035 1.1 christos case 1: result = tostruct_in_wks(rdata, target, mctx); break; \
1036 1.1 christos default: use_default = ISC_TRUE; break; \
1037 1.1 christos } \
1038 1.1 christos break; \
1039 1.1 christos case 12: result = tostruct_ptr(rdata, target, mctx); break; \
1040 1.1 christos case 13: result = tostruct_hinfo(rdata, target, mctx); break; \
1041 1.1 christos case 14: result = tostruct_minfo(rdata, target, mctx); break; \
1042 1.1 christos case 15: result = tostruct_mx(rdata, target, mctx); break; \
1043 1.1 christos case 16: result = tostruct_txt(rdata, target, mctx); break; \
1044 1.1 christos case 17: result = tostruct_rp(rdata, target, mctx); break; \
1045 1.1 christos case 18: result = tostruct_afsdb(rdata, target, mctx); break; \
1046 1.1 christos case 19: result = tostruct_x25(rdata, target, mctx); break; \
1047 1.1 christos case 20: result = tostruct_isdn(rdata, target, mctx); break; \
1048 1.1 christos case 21: result = tostruct_rt(rdata, target, mctx); break; \
1049 1.1 christos case 22: switch (rdata->rdclass) { \
1050 1.1 christos case 1: result = tostruct_in_nsap(rdata, target, mctx); break; \
1051 1.1 christos default: use_default = ISC_TRUE; break; \
1052 1.1 christos } \
1053 1.1 christos break; \
1054 1.1 christos case 23: switch (rdata->rdclass) { \
1055 1.1 christos case 1: result = tostruct_in_nsap_ptr(rdata, target, mctx); break; \
1056 1.1 christos default: use_default = ISC_TRUE; break; \
1057 1.1 christos } \
1058 1.1 christos break; \
1059 1.1 christos case 24: result = tostruct_sig(rdata, target, mctx); break; \
1060 1.1 christos case 25: result = tostruct_key(rdata, target, mctx); break; \
1061 1.1 christos case 26: switch (rdata->rdclass) { \
1062 1.1 christos case 1: result = tostruct_in_px(rdata, target, mctx); break; \
1063 1.1 christos default: use_default = ISC_TRUE; break; \
1064 1.1 christos } \
1065 1.1 christos break; \
1066 1.1 christos case 27: result = tostruct_gpos(rdata, target, mctx); break; \
1067 1.1 christos case 28: switch (rdata->rdclass) { \
1068 1.1 christos case 1: result = tostruct_in_aaaa(rdata, target, mctx); break; \
1069 1.1 christos default: use_default = ISC_TRUE; break; \
1070 1.1 christos } \
1071 1.1 christos break; \
1072 1.1 christos case 29: result = tostruct_loc(rdata, target, mctx); break; \
1073 1.1 christos case 30: result = tostruct_nxt(rdata, target, mctx); break; \
1074 1.1 christos case 33: switch (rdata->rdclass) { \
1075 1.1 christos case 1: result = tostruct_in_srv(rdata, target, mctx); break; \
1076 1.1 christos default: use_default = ISC_TRUE; break; \
1077 1.1 christos } \
1078 1.1 christos break; \
1079 1.1 christos case 35: result = tostruct_naptr(rdata, target, mctx); break; \
1080 1.1 christos case 36: switch (rdata->rdclass) { \
1081 1.1 christos case 1: result = tostruct_in_kx(rdata, target, mctx); break; \
1082 1.1 christos default: use_default = ISC_TRUE; break; \
1083 1.1 christos } \
1084 1.1 christos break; \
1085 1.1 christos case 37: result = tostruct_cert(rdata, target, mctx); break; \
1086 1.1 christos case 38: switch (rdata->rdclass) { \
1087 1.1 christos case 1: result = tostruct_in_a6(rdata, target, mctx); break; \
1088 1.1 christos default: use_default = ISC_TRUE; break; \
1089 1.1 christos } \
1090 1.1 christos break; \
1091 1.1 christos case 39: result = tostruct_dname(rdata, target, mctx); break; \
1092 1.1 christos case 40: result = tostruct_sink(rdata, target, mctx); break; \
1093 1.1 christos case 41: result = tostruct_opt(rdata, target, mctx); break; \
1094 1.1 christos case 42: switch (rdata->rdclass) { \
1095 1.1 christos case 1: result = tostruct_in_apl(rdata, target, mctx); break; \
1096 1.1 christos default: use_default = ISC_TRUE; break; \
1097 1.1 christos } \
1098 1.1 christos break; \
1099 1.1 christos case 43: result = tostruct_ds(rdata, target, mctx); break; \
1100 1.1 christos case 44: result = tostruct_sshfp(rdata, target, mctx); break; \
1101 1.1 christos case 45: result = tostruct_ipseckey(rdata, target, mctx); break; \
1102 1.1 christos case 46: result = tostruct_rrsig(rdata, target, mctx); break; \
1103 1.1 christos case 47: result = tostruct_nsec(rdata, target, mctx); break; \
1104 1.1 christos case 48: result = tostruct_dnskey(rdata, target, mctx); break; \
1105 1.1 christos case 49: switch (rdata->rdclass) { \
1106 1.1 christos case 1: result = tostruct_in_dhcid(rdata, target, mctx); break; \
1107 1.1 christos default: use_default = ISC_TRUE; break; \
1108 1.1 christos } \
1109 1.1 christos break; \
1110 1.1 christos case 50: result = tostruct_nsec3(rdata, target, mctx); break; \
1111 1.1 christos case 51: result = tostruct_nsec3param(rdata, target, mctx); break; \
1112 1.1 christos case 52: result = tostruct_tlsa(rdata, target, mctx); break; \
1113 1.1 christos case 53: result = tostruct_smimea(rdata, target, mctx); break; \
1114 1.1 christos case 55: result = tostruct_hip(rdata, target, mctx); break; \
1115 1.1 christos case 56: result = tostruct_ninfo(rdata, target, mctx); break; \
1116 1.1 christos case 57: result = tostruct_rkey(rdata, target, mctx); break; \
1117 1.1 christos case 58: result = tostruct_talink(rdata, target, mctx); break; \
1118 1.1 christos case 59: result = tostruct_cds(rdata, target, mctx); break; \
1119 1.1 christos case 60: result = tostruct_cdnskey(rdata, target, mctx); break; \
1120 1.1 christos case 61: result = tostruct_openpgpkey(rdata, target, mctx); break; \
1121 1.1 christos case 62: result = tostruct_csync(rdata, target, mctx); break; \
1122 1.1 christos case 99: result = tostruct_spf(rdata, target, mctx); break; \
1123 1.1 christos case 103: result = tostruct_unspec(rdata, target, mctx); break; \
1124 1.1 christos case 104: result = tostruct_nid(rdata, target, mctx); break; \
1125 1.1 christos case 105: result = tostruct_l32(rdata, target, mctx); break; \
1126 1.1 christos case 106: result = tostruct_l64(rdata, target, mctx); break; \
1127 1.1 christos case 107: result = tostruct_lp(rdata, target, mctx); break; \
1128 1.1 christos case 108: result = tostruct_eui48(rdata, target, mctx); break; \
1129 1.1 christos case 109: result = tostruct_eui64(rdata, target, mctx); break; \
1130 1.1 christos case 249: result = tostruct_tkey(rdata, target, mctx); break; \
1131 1.1 christos case 250: switch (rdata->rdclass) { \
1132 1.1 christos case 255: result = tostruct_any_tsig(rdata, target, mctx); break; \
1133 1.1 christos default: use_default = ISC_TRUE; break; \
1134 1.1 christos } \
1135 1.1 christos break; \
1136 1.1 christos case 256: result = tostruct_uri(rdata, target, mctx); break; \
1137 1.1 christos case 257: result = tostruct_caa(rdata, target, mctx); break; \
1138 1.1 christos case 258: result = tostruct_avc(rdata, target, mctx); break; \
1139 1.1 christos case 259: result = tostruct_doa(rdata, target, mctx); break; \
1140 1.1 christos case 32768: result = tostruct_ta(rdata, target, mctx); break; \
1141 1.1 christos case 32769: result = tostruct_dlv(rdata, target, mctx); break; \
1142 1.1 christos case 65533: result = tostruct_keydata(rdata, target, mctx); break; \
1143 1.1 christos default: use_default = ISC_TRUE; break; \
1144 1.1 christos }
1145 1.1 christos
1146 1.1 christos #define FREESTRUCTSWITCH \
1147 1.1 christos switch (common->rdtype) { \
1148 1.1 christos case 1: switch (common->rdclass) { \
1149 1.1 christos case 1: freestruct_in_a(source); break; \
1150 1.1 christos case 3: freestruct_ch_a(source); break; \
1151 1.1 christos case 4: freestruct_hs_a(source); break; \
1152 1.1 christos default: break; \
1153 1.1 christos } \
1154 1.1 christos break; \
1155 1.1 christos case 2: freestruct_ns(source); break; \
1156 1.1 christos case 3: freestruct_md(source); break; \
1157 1.1 christos case 4: freestruct_mf(source); break; \
1158 1.1 christos case 5: freestruct_cname(source); break; \
1159 1.1 christos case 6: freestruct_soa(source); break; \
1160 1.1 christos case 7: freestruct_mb(source); break; \
1161 1.1 christos case 8: freestruct_mg(source); break; \
1162 1.1 christos case 9: freestruct_mr(source); break; \
1163 1.1 christos case 10: freestruct_null(source); break; \
1164 1.1 christos case 11: switch (common->rdclass) { \
1165 1.1 christos case 1: freestruct_in_wks(source); break; \
1166 1.1 christos default: break; \
1167 1.1 christos } \
1168 1.1 christos break; \
1169 1.1 christos case 12: freestruct_ptr(source); break; \
1170 1.1 christos case 13: freestruct_hinfo(source); break; \
1171 1.1 christos case 14: freestruct_minfo(source); break; \
1172 1.1 christos case 15: freestruct_mx(source); break; \
1173 1.1 christos case 16: freestruct_txt(source); break; \
1174 1.1 christos case 17: freestruct_rp(source); break; \
1175 1.1 christos case 18: freestruct_afsdb(source); break; \
1176 1.1 christos case 19: freestruct_x25(source); break; \
1177 1.1 christos case 20: freestruct_isdn(source); break; \
1178 1.1 christos case 21: freestruct_rt(source); break; \
1179 1.1 christos case 22: switch (common->rdclass) { \
1180 1.1 christos case 1: freestruct_in_nsap(source); break; \
1181 1.1 christos default: break; \
1182 1.1 christos } \
1183 1.1 christos break; \
1184 1.1 christos case 23: switch (common->rdclass) { \
1185 1.1 christos case 1: freestruct_in_nsap_ptr(source); break; \
1186 1.1 christos default: break; \
1187 1.1 christos } \
1188 1.1 christos break; \
1189 1.1 christos case 24: freestruct_sig(source); break; \
1190 1.1 christos case 25: freestruct_key(source); break; \
1191 1.1 christos case 26: switch (common->rdclass) { \
1192 1.1 christos case 1: freestruct_in_px(source); break; \
1193 1.1 christos default: break; \
1194 1.1 christos } \
1195 1.1 christos break; \
1196 1.1 christos case 27: freestruct_gpos(source); break; \
1197 1.1 christos case 28: switch (common->rdclass) { \
1198 1.1 christos case 1: freestruct_in_aaaa(source); break; \
1199 1.1 christos default: break; \
1200 1.1 christos } \
1201 1.1 christos break; \
1202 1.1 christos case 29: freestruct_loc(source); break; \
1203 1.1 christos case 30: freestruct_nxt(source); break; \
1204 1.1 christos case 33: switch (common->rdclass) { \
1205 1.1 christos case 1: freestruct_in_srv(source); break; \
1206 1.1 christos default: break; \
1207 1.1 christos } \
1208 1.1 christos break; \
1209 1.1 christos case 35: freestruct_naptr(source); break; \
1210 1.1 christos case 36: switch (common->rdclass) { \
1211 1.1 christos case 1: freestruct_in_kx(source); break; \
1212 1.1 christos default: break; \
1213 1.1 christos } \
1214 1.1 christos break; \
1215 1.1 christos case 37: freestruct_cert(source); break; \
1216 1.1 christos case 38: switch (common->rdclass) { \
1217 1.1 christos case 1: freestruct_in_a6(source); break; \
1218 1.1 christos default: break; \
1219 1.1 christos } \
1220 1.1 christos break; \
1221 1.1 christos case 39: freestruct_dname(source); break; \
1222 1.1 christos case 40: freestruct_sink(source); break; \
1223 1.1 christos case 41: freestruct_opt(source); break; \
1224 1.1 christos case 42: switch (common->rdclass) { \
1225 1.1 christos case 1: freestruct_in_apl(source); break; \
1226 1.1 christos default: break; \
1227 1.1 christos } \
1228 1.1 christos break; \
1229 1.1 christos case 43: freestruct_ds(source); break; \
1230 1.1 christos case 44: freestruct_sshfp(source); break; \
1231 1.1 christos case 45: freestruct_ipseckey(source); break; \
1232 1.1 christos case 46: freestruct_rrsig(source); break; \
1233 1.1 christos case 47: freestruct_nsec(source); break; \
1234 1.1 christos case 48: freestruct_dnskey(source); break; \
1235 1.1 christos case 49: switch (common->rdclass) { \
1236 1.1 christos case 1: freestruct_in_dhcid(source); break; \
1237 1.1 christos default: break; \
1238 1.1 christos } \
1239 1.1 christos break; \
1240 1.1 christos case 50: freestruct_nsec3(source); break; \
1241 1.1 christos case 51: freestruct_nsec3param(source); break; \
1242 1.1 christos case 52: freestruct_tlsa(source); break; \
1243 1.1 christos case 53: freestruct_smimea(source); break; \
1244 1.1 christos case 55: freestruct_hip(source); break; \
1245 1.1 christos case 56: freestruct_ninfo(source); break; \
1246 1.1 christos case 57: freestruct_rkey(source); break; \
1247 1.1 christos case 58: freestruct_talink(source); break; \
1248 1.1 christos case 59: freestruct_cds(source); break; \
1249 1.1 christos case 60: freestruct_cdnskey(source); break; \
1250 1.1 christos case 61: freestruct_openpgpkey(source); break; \
1251 1.1 christos case 62: freestruct_csync(source); break; \
1252 1.1 christos case 99: freestruct_spf(source); break; \
1253 1.1 christos case 103: freestruct_unspec(source); break; \
1254 1.1 christos case 104: freestruct_nid(source); break; \
1255 1.1 christos case 105: freestruct_l32(source); break; \
1256 1.1 christos case 106: freestruct_l64(source); break; \
1257 1.1 christos case 107: freestruct_lp(source); break; \
1258 1.1 christos case 108: freestruct_eui48(source); break; \
1259 1.1 christos case 109: freestruct_eui64(source); break; \
1260 1.1 christos case 249: freestruct_tkey(source); break; \
1261 1.1 christos case 250: switch (common->rdclass) { \
1262 1.1 christos case 255: freestruct_any_tsig(source); break; \
1263 1.1 christos default: break; \
1264 1.1 christos } \
1265 1.1 christos break; \
1266 1.1 christos case 256: freestruct_uri(source); break; \
1267 1.1 christos case 257: freestruct_caa(source); break; \
1268 1.1 christos case 258: freestruct_avc(source); break; \
1269 1.1 christos case 259: freestruct_doa(source); break; \
1270 1.1 christos case 32768: freestruct_ta(source); break; \
1271 1.1 christos case 32769: freestruct_dlv(source); break; \
1272 1.1 christos case 65533: freestruct_keydata(source); break; \
1273 1.1 christos default: break; \
1274 1.1 christos }
1275 1.1 christos
1276 1.1 christos #define ADDITIONALDATASWITCH \
1277 1.1 christos switch (rdata->type) { \
1278 1.1 christos case 1: switch (rdata->rdclass) { \
1279 1.1 christos case 1: result = additionaldata_in_a(rdata, add, arg); break; \
1280 1.1 christos case 3: result = additionaldata_ch_a(rdata, add, arg); break; \
1281 1.1 christos case 4: result = additionaldata_hs_a(rdata, add, arg); break; \
1282 1.1 christos default: use_default = ISC_TRUE; break; \
1283 1.1 christos } \
1284 1.1 christos break; \
1285 1.1 christos case 2: result = additionaldata_ns(rdata, add, arg); break; \
1286 1.1 christos case 3: result = additionaldata_md(rdata, add, arg); break; \
1287 1.1 christos case 4: result = additionaldata_mf(rdata, add, arg); break; \
1288 1.1 christos case 5: result = additionaldata_cname(rdata, add, arg); break; \
1289 1.1 christos case 6: result = additionaldata_soa(rdata, add, arg); break; \
1290 1.1 christos case 7: result = additionaldata_mb(rdata, add, arg); break; \
1291 1.1 christos case 8: result = additionaldata_mg(rdata, add, arg); break; \
1292 1.1 christos case 9: result = additionaldata_mr(rdata, add, arg); break; \
1293 1.1 christos case 10: result = additionaldata_null(rdata, add, arg); break; \
1294 1.1 christos case 11: switch (rdata->rdclass) { \
1295 1.1 christos case 1: result = additionaldata_in_wks(rdata, add, arg); break; \
1296 1.1 christos default: use_default = ISC_TRUE; break; \
1297 1.1 christos } \
1298 1.1 christos break; \
1299 1.1 christos case 12: result = additionaldata_ptr(rdata, add, arg); break; \
1300 1.1 christos case 13: result = additionaldata_hinfo(rdata, add, arg); break; \
1301 1.1 christos case 14: result = additionaldata_minfo(rdata, add, arg); break; \
1302 1.1 christos case 15: result = additionaldata_mx(rdata, add, arg); break; \
1303 1.1 christos case 16: result = additionaldata_txt(rdata, add, arg); break; \
1304 1.1 christos case 17: result = additionaldata_rp(rdata, add, arg); break; \
1305 1.1 christos case 18: result = additionaldata_afsdb(rdata, add, arg); break; \
1306 1.1 christos case 19: result = additionaldata_x25(rdata, add, arg); break; \
1307 1.1 christos case 20: result = additionaldata_isdn(rdata, add, arg); break; \
1308 1.1 christos case 21: result = additionaldata_rt(rdata, add, arg); break; \
1309 1.1 christos case 22: switch (rdata->rdclass) { \
1310 1.1 christos case 1: result = additionaldata_in_nsap(rdata, add, arg); break; \
1311 1.1 christos default: use_default = ISC_TRUE; break; \
1312 1.1 christos } \
1313 1.1 christos break; \
1314 1.1 christos case 23: switch (rdata->rdclass) { \
1315 1.1 christos case 1: result = additionaldata_in_nsap_ptr(rdata, add, arg); break; \
1316 1.1 christos default: use_default = ISC_TRUE; break; \
1317 1.1 christos } \
1318 1.1 christos break; \
1319 1.1 christos case 24: result = additionaldata_sig(rdata, add, arg); break; \
1320 1.1 christos case 25: result = additionaldata_key(rdata, add, arg); break; \
1321 1.1 christos case 26: switch (rdata->rdclass) { \
1322 1.1 christos case 1: result = additionaldata_in_px(rdata, add, arg); break; \
1323 1.1 christos default: use_default = ISC_TRUE; break; \
1324 1.1 christos } \
1325 1.1 christos break; \
1326 1.1 christos case 27: result = additionaldata_gpos(rdata, add, arg); break; \
1327 1.1 christos case 28: switch (rdata->rdclass) { \
1328 1.1 christos case 1: result = additionaldata_in_aaaa(rdata, add, arg); break; \
1329 1.1 christos default: use_default = ISC_TRUE; break; \
1330 1.1 christos } \
1331 1.1 christos break; \
1332 1.1 christos case 29: result = additionaldata_loc(rdata, add, arg); break; \
1333 1.1 christos case 30: result = additionaldata_nxt(rdata, add, arg); break; \
1334 1.1 christos case 33: switch (rdata->rdclass) { \
1335 1.1 christos case 1: result = additionaldata_in_srv(rdata, add, arg); break; \
1336 1.1 christos default: use_default = ISC_TRUE; break; \
1337 1.1 christos } \
1338 1.1 christos break; \
1339 1.1 christos case 35: result = additionaldata_naptr(rdata, add, arg); break; \
1340 1.1 christos case 36: switch (rdata->rdclass) { \
1341 1.1 christos case 1: result = additionaldata_in_kx(rdata, add, arg); break; \
1342 1.1 christos default: use_default = ISC_TRUE; break; \
1343 1.1 christos } \
1344 1.1 christos break; \
1345 1.1 christos case 37: result = additionaldata_cert(rdata, add, arg); break; \
1346 1.1 christos case 38: switch (rdata->rdclass) { \
1347 1.1 christos case 1: result = additionaldata_in_a6(rdata, add, arg); break; \
1348 1.1 christos default: use_default = ISC_TRUE; break; \
1349 1.1 christos } \
1350 1.1 christos break; \
1351 1.1 christos case 39: result = additionaldata_dname(rdata, add, arg); break; \
1352 1.1 christos case 40: result = additionaldata_sink(rdata, add, arg); break; \
1353 1.1 christos case 41: result = additionaldata_opt(rdata, add, arg); break; \
1354 1.1 christos case 42: switch (rdata->rdclass) { \
1355 1.1 christos case 1: result = additionaldata_in_apl(rdata, add, arg); break; \
1356 1.1 christos default: use_default = ISC_TRUE; break; \
1357 1.1 christos } \
1358 1.1 christos break; \
1359 1.1 christos case 43: result = additionaldata_ds(rdata, add, arg); break; \
1360 1.1 christos case 44: result = additionaldata_sshfp(rdata, add, arg); break; \
1361 1.1 christos case 45: result = additionaldata_ipseckey(rdata, add, arg); break; \
1362 1.1 christos case 46: result = additionaldata_rrsig(rdata, add, arg); break; \
1363 1.1 christos case 47: result = additionaldata_nsec(rdata, add, arg); break; \
1364 1.1 christos case 48: result = additionaldata_dnskey(rdata, add, arg); break; \
1365 1.1 christos case 49: switch (rdata->rdclass) { \
1366 1.1 christos case 1: result = additionaldata_in_dhcid(rdata, add, arg); break; \
1367 1.1 christos default: use_default = ISC_TRUE; break; \
1368 1.1 christos } \
1369 1.1 christos break; \
1370 1.1 christos case 50: result = additionaldata_nsec3(rdata, add, arg); break; \
1371 1.1 christos case 51: result = additionaldata_nsec3param(rdata, add, arg); break; \
1372 1.1 christos case 52: result = additionaldata_tlsa(rdata, add, arg); break; \
1373 1.1 christos case 53: result = additionaldata_smimea(rdata, add, arg); break; \
1374 1.1 christos case 55: result = additionaldata_hip(rdata, add, arg); break; \
1375 1.1 christos case 56: result = additionaldata_ninfo(rdata, add, arg); break; \
1376 1.1 christos case 57: result = additionaldata_rkey(rdata, add, arg); break; \
1377 1.1 christos case 58: result = additionaldata_talink(rdata, add, arg); break; \
1378 1.1 christos case 59: result = additionaldata_cds(rdata, add, arg); break; \
1379 1.1 christos case 60: result = additionaldata_cdnskey(rdata, add, arg); break; \
1380 1.1 christos case 61: result = additionaldata_openpgpkey(rdata, add, arg); break; \
1381 1.1 christos case 62: result = additionaldata_csync(rdata, add, arg); break; \
1382 1.1 christos case 99: result = additionaldata_spf(rdata, add, arg); break; \
1383 1.1 christos case 103: result = additionaldata_unspec(rdata, add, arg); break; \
1384 1.1 christos case 104: result = additionaldata_nid(rdata, add, arg); break; \
1385 1.1 christos case 105: result = additionaldata_l32(rdata, add, arg); break; \
1386 1.1 christos case 106: result = additionaldata_l64(rdata, add, arg); break; \
1387 1.1 christos case 107: result = additionaldata_lp(rdata, add, arg); break; \
1388 1.1 christos case 108: result = additionaldata_eui48(rdata, add, arg); break; \
1389 1.1 christos case 109: result = additionaldata_eui64(rdata, add, arg); break; \
1390 1.1 christos case 249: result = additionaldata_tkey(rdata, add, arg); break; \
1391 1.1 christos case 250: switch (rdata->rdclass) { \
1392 1.1 christos case 255: result = additionaldata_any_tsig(rdata, add, arg); break; \
1393 1.1 christos default: use_default = ISC_TRUE; break; \
1394 1.1 christos } \
1395 1.1 christos break; \
1396 1.1 christos case 256: result = additionaldata_uri(rdata, add, arg); break; \
1397 1.1 christos case 257: result = additionaldata_caa(rdata, add, arg); break; \
1398 1.1 christos case 258: result = additionaldata_avc(rdata, add, arg); break; \
1399 1.1 christos case 259: result = additionaldata_doa(rdata, add, arg); break; \
1400 1.1 christos case 32768: result = additionaldata_ta(rdata, add, arg); break; \
1401 1.1 christos case 32769: result = additionaldata_dlv(rdata, add, arg); break; \
1402 1.1 christos case 65533: result = additionaldata_keydata(rdata, add, arg); break; \
1403 1.1 christos default: use_default = ISC_TRUE; break; \
1404 1.1 christos }
1405 1.1 christos
1406 1.1 christos #define DIGESTSWITCH \
1407 1.1 christos switch (rdata->type) { \
1408 1.1 christos case 1: switch (rdata->rdclass) { \
1409 1.1 christos case 1: result = digest_in_a(rdata, digest, arg); break; \
1410 1.1 christos case 3: result = digest_ch_a(rdata, digest, arg); break; \
1411 1.1 christos case 4: result = digest_hs_a(rdata, digest, arg); break; \
1412 1.1 christos default: use_default = ISC_TRUE; break; \
1413 1.1 christos } \
1414 1.1 christos break; \
1415 1.1 christos case 2: result = digest_ns(rdata, digest, arg); break; \
1416 1.1 christos case 3: result = digest_md(rdata, digest, arg); break; \
1417 1.1 christos case 4: result = digest_mf(rdata, digest, arg); break; \
1418 1.1 christos case 5: result = digest_cname(rdata, digest, arg); break; \
1419 1.1 christos case 6: result = digest_soa(rdata, digest, arg); break; \
1420 1.1 christos case 7: result = digest_mb(rdata, digest, arg); break; \
1421 1.1 christos case 8: result = digest_mg(rdata, digest, arg); break; \
1422 1.1 christos case 9: result = digest_mr(rdata, digest, arg); break; \
1423 1.1 christos case 10: result = digest_null(rdata, digest, arg); break; \
1424 1.1 christos case 11: switch (rdata->rdclass) { \
1425 1.1 christos case 1: result = digest_in_wks(rdata, digest, arg); break; \
1426 1.1 christos default: use_default = ISC_TRUE; break; \
1427 1.1 christos } \
1428 1.1 christos break; \
1429 1.1 christos case 12: result = digest_ptr(rdata, digest, arg); break; \
1430 1.1 christos case 13: result = digest_hinfo(rdata, digest, arg); break; \
1431 1.1 christos case 14: result = digest_minfo(rdata, digest, arg); break; \
1432 1.1 christos case 15: result = digest_mx(rdata, digest, arg); break; \
1433 1.1 christos case 16: result = digest_txt(rdata, digest, arg); break; \
1434 1.1 christos case 17: result = digest_rp(rdata, digest, arg); break; \
1435 1.1 christos case 18: result = digest_afsdb(rdata, digest, arg); break; \
1436 1.1 christos case 19: result = digest_x25(rdata, digest, arg); break; \
1437 1.1 christos case 20: result = digest_isdn(rdata, digest, arg); break; \
1438 1.1 christos case 21: result = digest_rt(rdata, digest, arg); break; \
1439 1.1 christos case 22: switch (rdata->rdclass) { \
1440 1.1 christos case 1: result = digest_in_nsap(rdata, digest, arg); break; \
1441 1.1 christos default: use_default = ISC_TRUE; break; \
1442 1.1 christos } \
1443 1.1 christos break; \
1444 1.1 christos case 23: switch (rdata->rdclass) { \
1445 1.1 christos case 1: result = digest_in_nsap_ptr(rdata, digest, arg); break; \
1446 1.1 christos default: use_default = ISC_TRUE; break; \
1447 1.1 christos } \
1448 1.1 christos break; \
1449 1.1 christos case 24: result = digest_sig(rdata, digest, arg); break; \
1450 1.1 christos case 25: result = digest_key(rdata, digest, arg); break; \
1451 1.1 christos case 26: switch (rdata->rdclass) { \
1452 1.1 christos case 1: result = digest_in_px(rdata, digest, arg); break; \
1453 1.1 christos default: use_default = ISC_TRUE; break; \
1454 1.1 christos } \
1455 1.1 christos break; \
1456 1.1 christos case 27: result = digest_gpos(rdata, digest, arg); break; \
1457 1.1 christos case 28: switch (rdata->rdclass) { \
1458 1.1 christos case 1: result = digest_in_aaaa(rdata, digest, arg); break; \
1459 1.1 christos default: use_default = ISC_TRUE; break; \
1460 1.1 christos } \
1461 1.1 christos break; \
1462 1.1 christos case 29: result = digest_loc(rdata, digest, arg); break; \
1463 1.1 christos case 30: result = digest_nxt(rdata, digest, arg); break; \
1464 1.1 christos case 33: switch (rdata->rdclass) { \
1465 1.1 christos case 1: result = digest_in_srv(rdata, digest, arg); break; \
1466 1.1 christos default: use_default = ISC_TRUE; break; \
1467 1.1 christos } \
1468 1.1 christos break; \
1469 1.1 christos case 35: result = digest_naptr(rdata, digest, arg); break; \
1470 1.1 christos case 36: switch (rdata->rdclass) { \
1471 1.1 christos case 1: result = digest_in_kx(rdata, digest, arg); break; \
1472 1.1 christos default: use_default = ISC_TRUE; break; \
1473 1.1 christos } \
1474 1.1 christos break; \
1475 1.1 christos case 37: result = digest_cert(rdata, digest, arg); break; \
1476 1.1 christos case 38: switch (rdata->rdclass) { \
1477 1.1 christos case 1: result = digest_in_a6(rdata, digest, arg); break; \
1478 1.1 christos default: use_default = ISC_TRUE; break; \
1479 1.1 christos } \
1480 1.1 christos break; \
1481 1.1 christos case 39: result = digest_dname(rdata, digest, arg); break; \
1482 1.1 christos case 40: result = digest_sink(rdata, digest, arg); break; \
1483 1.1 christos case 41: result = digest_opt(rdata, digest, arg); break; \
1484 1.1 christos case 42: switch (rdata->rdclass) { \
1485 1.1 christos case 1: result = digest_in_apl(rdata, digest, arg); break; \
1486 1.1 christos default: use_default = ISC_TRUE; break; \
1487 1.1 christos } \
1488 1.1 christos break; \
1489 1.1 christos case 43: result = digest_ds(rdata, digest, arg); break; \
1490 1.1 christos case 44: result = digest_sshfp(rdata, digest, arg); break; \
1491 1.1 christos case 45: result = digest_ipseckey(rdata, digest, arg); break; \
1492 1.1 christos case 46: result = digest_rrsig(rdata, digest, arg); break; \
1493 1.1 christos case 47: result = digest_nsec(rdata, digest, arg); break; \
1494 1.1 christos case 48: result = digest_dnskey(rdata, digest, arg); break; \
1495 1.1 christos case 49: switch (rdata->rdclass) { \
1496 1.1 christos case 1: result = digest_in_dhcid(rdata, digest, arg); break; \
1497 1.1 christos default: use_default = ISC_TRUE; break; \
1498 1.1 christos } \
1499 1.1 christos break; \
1500 1.1 christos case 50: result = digest_nsec3(rdata, digest, arg); break; \
1501 1.1 christos case 51: result = digest_nsec3param(rdata, digest, arg); break; \
1502 1.1 christos case 52: result = digest_tlsa(rdata, digest, arg); break; \
1503 1.1 christos case 53: result = digest_smimea(rdata, digest, arg); break; \
1504 1.1 christos case 55: result = digest_hip(rdata, digest, arg); break; \
1505 1.1 christos case 56: result = digest_ninfo(rdata, digest, arg); break; \
1506 1.1 christos case 57: result = digest_rkey(rdata, digest, arg); break; \
1507 1.1 christos case 58: result = digest_talink(rdata, digest, arg); break; \
1508 1.1 christos case 59: result = digest_cds(rdata, digest, arg); break; \
1509 1.1 christos case 60: result = digest_cdnskey(rdata, digest, arg); break; \
1510 1.1 christos case 61: result = digest_openpgpkey(rdata, digest, arg); break; \
1511 1.1 christos case 62: result = digest_csync(rdata, digest, arg); break; \
1512 1.1 christos case 99: result = digest_spf(rdata, digest, arg); break; \
1513 1.1 christos case 103: result = digest_unspec(rdata, digest, arg); break; \
1514 1.1 christos case 104: result = digest_nid(rdata, digest, arg); break; \
1515 1.1 christos case 105: result = digest_l32(rdata, digest, arg); break; \
1516 1.1 christos case 106: result = digest_l64(rdata, digest, arg); break; \
1517 1.1 christos case 107: result = digest_lp(rdata, digest, arg); break; \
1518 1.1 christos case 108: result = digest_eui48(rdata, digest, arg); break; \
1519 1.1 christos case 109: result = digest_eui64(rdata, digest, arg); break; \
1520 1.1 christos case 249: result = digest_tkey(rdata, digest, arg); break; \
1521 1.1 christos case 250: switch (rdata->rdclass) { \
1522 1.1 christos case 255: result = digest_any_tsig(rdata, digest, arg); break; \
1523 1.1 christos default: use_default = ISC_TRUE; break; \
1524 1.1 christos } \
1525 1.1 christos break; \
1526 1.1 christos case 256: result = digest_uri(rdata, digest, arg); break; \
1527 1.1 christos case 257: result = digest_caa(rdata, digest, arg); break; \
1528 1.1 christos case 258: result = digest_avc(rdata, digest, arg); break; \
1529 1.1 christos case 259: result = digest_doa(rdata, digest, arg); break; \
1530 1.1 christos case 32768: result = digest_ta(rdata, digest, arg); break; \
1531 1.1 christos case 32769: result = digest_dlv(rdata, digest, arg); break; \
1532 1.1 christos case 65533: result = digest_keydata(rdata, digest, arg); break; \
1533 1.1 christos default: use_default = ISC_TRUE; break; \
1534 1.1 christos }
1535 1.1 christos
1536 1.1 christos #define CHECKOWNERSWITCH \
1537 1.1 christos switch (type) { \
1538 1.1 christos case 1: switch (rdclass) { \
1539 1.1 christos case 1: result = checkowner_in_a(name, rdclass, type, wildcard); break; \
1540 1.1 christos case 3: result = checkowner_ch_a(name, rdclass, type, wildcard); break; \
1541 1.1 christos case 4: result = checkowner_hs_a(name, rdclass, type, wildcard); break; \
1542 1.1 christos default: result = ISC_TRUE; break; \
1543 1.1 christos } \
1544 1.1 christos break; \
1545 1.1 christos case 2: result = checkowner_ns(name, rdclass, type, wildcard); break; \
1546 1.1 christos case 3: result = checkowner_md(name, rdclass, type, wildcard); break; \
1547 1.1 christos case 4: result = checkowner_mf(name, rdclass, type, wildcard); break; \
1548 1.1 christos case 5: result = checkowner_cname(name, rdclass, type, wildcard); break; \
1549 1.1 christos case 6: result = checkowner_soa(name, rdclass, type, wildcard); break; \
1550 1.1 christos case 7: result = checkowner_mb(name, rdclass, type, wildcard); break; \
1551 1.1 christos case 8: result = checkowner_mg(name, rdclass, type, wildcard); break; \
1552 1.1 christos case 9: result = checkowner_mr(name, rdclass, type, wildcard); break; \
1553 1.1 christos case 10: result = checkowner_null(name, rdclass, type, wildcard); break; \
1554 1.1 christos case 11: switch (rdclass) { \
1555 1.1 christos case 1: result = checkowner_in_wks(name, rdclass, type, wildcard); break; \
1556 1.1 christos default: result = ISC_TRUE; break; \
1557 1.1 christos } \
1558 1.1 christos break; \
1559 1.1 christos case 12: result = checkowner_ptr(name, rdclass, type, wildcard); break; \
1560 1.1 christos case 13: result = checkowner_hinfo(name, rdclass, type, wildcard); break; \
1561 1.1 christos case 14: result = checkowner_minfo(name, rdclass, type, wildcard); break; \
1562 1.1 christos case 15: result = checkowner_mx(name, rdclass, type, wildcard); break; \
1563 1.1 christos case 16: result = checkowner_txt(name, rdclass, type, wildcard); break; \
1564 1.1 christos case 17: result = checkowner_rp(name, rdclass, type, wildcard); break; \
1565 1.1 christos case 18: result = checkowner_afsdb(name, rdclass, type, wildcard); break; \
1566 1.1 christos case 19: result = checkowner_x25(name, rdclass, type, wildcard); break; \
1567 1.1 christos case 20: result = checkowner_isdn(name, rdclass, type, wildcard); break; \
1568 1.1 christos case 21: result = checkowner_rt(name, rdclass, type, wildcard); break; \
1569 1.1 christos case 22: switch (rdclass) { \
1570 1.1 christos case 1: result = checkowner_in_nsap(name, rdclass, type, wildcard); break; \
1571 1.1 christos default: result = ISC_TRUE; break; \
1572 1.1 christos } \
1573 1.1 christos break; \
1574 1.1 christos case 23: switch (rdclass) { \
1575 1.1 christos case 1: result = checkowner_in_nsap_ptr(name, rdclass, type, wildcard); break; \
1576 1.1 christos default: result = ISC_TRUE; break; \
1577 1.1 christos } \
1578 1.1 christos break; \
1579 1.1 christos case 24: result = checkowner_sig(name, rdclass, type, wildcard); break; \
1580 1.1 christos case 25: result = checkowner_key(name, rdclass, type, wildcard); break; \
1581 1.1 christos case 26: switch (rdclass) { \
1582 1.1 christos case 1: result = checkowner_in_px(name, rdclass, type, wildcard); break; \
1583 1.1 christos default: result = ISC_TRUE; break; \
1584 1.1 christos } \
1585 1.1 christos break; \
1586 1.1 christos case 27: result = checkowner_gpos(name, rdclass, type, wildcard); break; \
1587 1.1 christos case 28: switch (rdclass) { \
1588 1.1 christos case 1: result = checkowner_in_aaaa(name, rdclass, type, wildcard); break; \
1589 1.1 christos default: result = ISC_TRUE; break; \
1590 1.1 christos } \
1591 1.1 christos break; \
1592 1.1 christos case 29: result = checkowner_loc(name, rdclass, type, wildcard); break; \
1593 1.1 christos case 30: result = checkowner_nxt(name, rdclass, type, wildcard); break; \
1594 1.1 christos case 33: switch (rdclass) { \
1595 1.1 christos case 1: result = checkowner_in_srv(name, rdclass, type, wildcard); break; \
1596 1.1 christos default: result = ISC_TRUE; break; \
1597 1.1 christos } \
1598 1.1 christos break; \
1599 1.1 christos case 35: result = checkowner_naptr(name, rdclass, type, wildcard); break; \
1600 1.1 christos case 36: switch (rdclass) { \
1601 1.1 christos case 1: result = checkowner_in_kx(name, rdclass, type, wildcard); break; \
1602 1.1 christos default: result = ISC_TRUE; break; \
1603 1.1 christos } \
1604 1.1 christos break; \
1605 1.1 christos case 37: result = checkowner_cert(name, rdclass, type, wildcard); break; \
1606 1.1 christos case 38: switch (rdclass) { \
1607 1.1 christos case 1: result = checkowner_in_a6(name, rdclass, type, wildcard); break; \
1608 1.1 christos default: result = ISC_TRUE; break; \
1609 1.1 christos } \
1610 1.1 christos break; \
1611 1.1 christos case 39: result = checkowner_dname(name, rdclass, type, wildcard); break; \
1612 1.1 christos case 40: result = checkowner_sink(name, rdclass, type, wildcard); break; \
1613 1.1 christos case 41: result = checkowner_opt(name, rdclass, type, wildcard); break; \
1614 1.1 christos case 42: switch (rdclass) { \
1615 1.1 christos case 1: result = checkowner_in_apl(name, rdclass, type, wildcard); break; \
1616 1.1 christos default: result = ISC_TRUE; break; \
1617 1.1 christos } \
1618 1.1 christos break; \
1619 1.1 christos case 43: result = checkowner_ds(name, rdclass, type, wildcard); break; \
1620 1.1 christos case 44: result = checkowner_sshfp(name, rdclass, type, wildcard); break; \
1621 1.1 christos case 45: result = checkowner_ipseckey(name, rdclass, type, wildcard); break; \
1622 1.1 christos case 46: result = checkowner_rrsig(name, rdclass, type, wildcard); break; \
1623 1.1 christos case 47: result = checkowner_nsec(name, rdclass, type, wildcard); break; \
1624 1.1 christos case 48: result = checkowner_dnskey(name, rdclass, type, wildcard); break; \
1625 1.1 christos case 49: switch (rdclass) { \
1626 1.1 christos case 1: result = checkowner_in_dhcid(name, rdclass, type, wildcard); break; \
1627 1.1 christos default: result = ISC_TRUE; break; \
1628 1.1 christos } \
1629 1.1 christos break; \
1630 1.1 christos case 50: result = checkowner_nsec3(name, rdclass, type, wildcard); break; \
1631 1.1 christos case 51: result = checkowner_nsec3param(name, rdclass, type, wildcard); break; \
1632 1.1 christos case 52: result = checkowner_tlsa(name, rdclass, type, wildcard); break; \
1633 1.1 christos case 53: result = checkowner_smimea(name, rdclass, type, wildcard); break; \
1634 1.1 christos case 55: result = checkowner_hip(name, rdclass, type, wildcard); break; \
1635 1.1 christos case 56: result = checkowner_ninfo(name, rdclass, type, wildcard); break; \
1636 1.1 christos case 57: result = checkowner_rkey(name, rdclass, type, wildcard); break; \
1637 1.1 christos case 58: result = checkowner_talink(name, rdclass, type, wildcard); break; \
1638 1.1 christos case 59: result = checkowner_cds(name, rdclass, type, wildcard); break; \
1639 1.1 christos case 60: result = checkowner_cdnskey(name, rdclass, type, wildcard); break; \
1640 1.1 christos case 61: result = checkowner_openpgpkey(name, rdclass, type, wildcard); break; \
1641 1.1 christos case 62: result = checkowner_csync(name, rdclass, type, wildcard); break; \
1642 1.1 christos case 99: result = checkowner_spf(name, rdclass, type, wildcard); break; \
1643 1.1 christos case 103: result = checkowner_unspec(name, rdclass, type, wildcard); break; \
1644 1.1 christos case 104: result = checkowner_nid(name, rdclass, type, wildcard); break; \
1645 1.1 christos case 105: result = checkowner_l32(name, rdclass, type, wildcard); break; \
1646 1.1 christos case 106: result = checkowner_l64(name, rdclass, type, wildcard); break; \
1647 1.1 christos case 107: result = checkowner_lp(name, rdclass, type, wildcard); break; \
1648 1.1 christos case 108: result = checkowner_eui48(name, rdclass, type, wildcard); break; \
1649 1.1 christos case 109: result = checkowner_eui64(name, rdclass, type, wildcard); break; \
1650 1.1 christos case 249: result = checkowner_tkey(name, rdclass, type, wildcard); break; \
1651 1.1 christos case 250: switch (rdclass) { \
1652 1.1 christos case 255: result = checkowner_any_tsig(name, rdclass, type, wildcard); break; \
1653 1.1 christos default: result = ISC_TRUE; break; \
1654 1.1 christos } \
1655 1.1 christos break; \
1656 1.1 christos case 256: result = checkowner_uri(name, rdclass, type, wildcard); break; \
1657 1.1 christos case 257: result = checkowner_caa(name, rdclass, type, wildcard); break; \
1658 1.1 christos case 258: result = checkowner_avc(name, rdclass, type, wildcard); break; \
1659 1.1 christos case 259: result = checkowner_doa(name, rdclass, type, wildcard); break; \
1660 1.1 christos case 32768: result = checkowner_ta(name, rdclass, type, wildcard); break; \
1661 1.1 christos case 32769: result = checkowner_dlv(name, rdclass, type, wildcard); break; \
1662 1.1 christos case 65533: result = checkowner_keydata(name, rdclass, type, wildcard); break; \
1663 1.1 christos default: result = ISC_TRUE; break; \
1664 1.1 christos }
1665 1.1 christos
1666 1.1 christos #define CHECKNAMESSWITCH \
1667 1.1 christos switch (rdata->type) { \
1668 1.1 christos case 1: switch (rdata->rdclass) { \
1669 1.1 christos case 1: result = checknames_in_a(rdata, owner, bad); break; \
1670 1.1 christos case 3: result = checknames_ch_a(rdata, owner, bad); break; \
1671 1.1 christos case 4: result = checknames_hs_a(rdata, owner, bad); break; \
1672 1.1 christos default: result = ISC_TRUE; break; \
1673 1.1 christos } \
1674 1.1 christos break; \
1675 1.1 christos case 2: result = checknames_ns(rdata, owner, bad); break; \
1676 1.1 christos case 3: result = checknames_md(rdata, owner, bad); break; \
1677 1.1 christos case 4: result = checknames_mf(rdata, owner, bad); break; \
1678 1.1 christos case 5: result = checknames_cname(rdata, owner, bad); break; \
1679 1.1 christos case 6: result = checknames_soa(rdata, owner, bad); break; \
1680 1.1 christos case 7: result = checknames_mb(rdata, owner, bad); break; \
1681 1.1 christos case 8: result = checknames_mg(rdata, owner, bad); break; \
1682 1.1 christos case 9: result = checknames_mr(rdata, owner, bad); break; \
1683 1.1 christos case 10: result = checknames_null(rdata, owner, bad); break; \
1684 1.1 christos case 11: switch (rdata->rdclass) { \
1685 1.1 christos case 1: result = checknames_in_wks(rdata, owner, bad); break; \
1686 1.1 christos default: result = ISC_TRUE; break; \
1687 1.1 christos } \
1688 1.1 christos break; \
1689 1.1 christos case 12: result = checknames_ptr(rdata, owner, bad); break; \
1690 1.1 christos case 13: result = checknames_hinfo(rdata, owner, bad); break; \
1691 1.1 christos case 14: result = checknames_minfo(rdata, owner, bad); break; \
1692 1.1 christos case 15: result = checknames_mx(rdata, owner, bad); break; \
1693 1.1 christos case 16: result = checknames_txt(rdata, owner, bad); break; \
1694 1.1 christos case 17: result = checknames_rp(rdata, owner, bad); break; \
1695 1.1 christos case 18: result = checknames_afsdb(rdata, owner, bad); break; \
1696 1.1 christos case 19: result = checknames_x25(rdata, owner, bad); break; \
1697 1.1 christos case 20: result = checknames_isdn(rdata, owner, bad); break; \
1698 1.1 christos case 21: result = checknames_rt(rdata, owner, bad); break; \
1699 1.1 christos case 22: switch (rdata->rdclass) { \
1700 1.1 christos case 1: result = checknames_in_nsap(rdata, owner, bad); break; \
1701 1.1 christos default: result = ISC_TRUE; break; \
1702 1.1 christos } \
1703 1.1 christos break; \
1704 1.1 christos case 23: switch (rdata->rdclass) { \
1705 1.1 christos case 1: result = checknames_in_nsap_ptr(rdata, owner, bad); break; \
1706 1.1 christos default: result = ISC_TRUE; break; \
1707 1.1 christos } \
1708 1.1 christos break; \
1709 1.1 christos case 24: result = checknames_sig(rdata, owner, bad); break; \
1710 1.1 christos case 25: result = checknames_key(rdata, owner, bad); break; \
1711 1.1 christos case 26: switch (rdata->rdclass) { \
1712 1.1 christos case 1: result = checknames_in_px(rdata, owner, bad); break; \
1713 1.1 christos default: result = ISC_TRUE; break; \
1714 1.1 christos } \
1715 1.1 christos break; \
1716 1.1 christos case 27: result = checknames_gpos(rdata, owner, bad); break; \
1717 1.1 christos case 28: switch (rdata->rdclass) { \
1718 1.1 christos case 1: result = checknames_in_aaaa(rdata, owner, bad); break; \
1719 1.1 christos default: result = ISC_TRUE; break; \
1720 1.1 christos } \
1721 1.1 christos break; \
1722 1.1 christos case 29: result = checknames_loc(rdata, owner, bad); break; \
1723 1.1 christos case 30: result = checknames_nxt(rdata, owner, bad); break; \
1724 1.1 christos case 33: switch (rdata->rdclass) { \
1725 1.1 christos case 1: result = checknames_in_srv(rdata, owner, bad); break; \
1726 1.1 christos default: result = ISC_TRUE; break; \
1727 1.1 christos } \
1728 1.1 christos break; \
1729 1.1 christos case 35: result = checknames_naptr(rdata, owner, bad); break; \
1730 1.1 christos case 36: switch (rdata->rdclass) { \
1731 1.1 christos case 1: result = checknames_in_kx(rdata, owner, bad); break; \
1732 1.1 christos default: result = ISC_TRUE; break; \
1733 1.1 christos } \
1734 1.1 christos break; \
1735 1.1 christos case 37: result = checknames_cert(rdata, owner, bad); break; \
1736 1.1 christos case 38: switch (rdata->rdclass) { \
1737 1.1 christos case 1: result = checknames_in_a6(rdata, owner, bad); break; \
1738 1.1 christos default: result = ISC_TRUE; break; \
1739 1.1 christos } \
1740 1.1 christos break; \
1741 1.1 christos case 39: result = checknames_dname(rdata, owner, bad); break; \
1742 1.1 christos case 40: result = checknames_sink(rdata, owner, bad); break; \
1743 1.1 christos case 41: result = checknames_opt(rdata, owner, bad); break; \
1744 1.1 christos case 42: switch (rdata->rdclass) { \
1745 1.1 christos case 1: result = checknames_in_apl(rdata, owner, bad); break; \
1746 1.1 christos default: result = ISC_TRUE; break; \
1747 1.1 christos } \
1748 1.1 christos break; \
1749 1.1 christos case 43: result = checknames_ds(rdata, owner, bad); break; \
1750 1.1 christos case 44: result = checknames_sshfp(rdata, owner, bad); break; \
1751 1.1 christos case 45: result = checknames_ipseckey(rdata, owner, bad); break; \
1752 1.1 christos case 46: result = checknames_rrsig(rdata, owner, bad); break; \
1753 1.1 christos case 47: result = checknames_nsec(rdata, owner, bad); break; \
1754 1.1 christos case 48: result = checknames_dnskey(rdata, owner, bad); break; \
1755 1.1 christos case 49: switch (rdata->rdclass) { \
1756 1.1 christos case 1: result = checknames_in_dhcid(rdata, owner, bad); break; \
1757 1.1 christos default: result = ISC_TRUE; break; \
1758 1.1 christos } \
1759 1.1 christos break; \
1760 1.1 christos case 50: result = checknames_nsec3(rdata, owner, bad); break; \
1761 1.1 christos case 51: result = checknames_nsec3param(rdata, owner, bad); break; \
1762 1.1 christos case 52: result = checknames_tlsa(rdata, owner, bad); break; \
1763 1.1 christos case 53: result = checknames_smimea(rdata, owner, bad); break; \
1764 1.1 christos case 55: result = checknames_hip(rdata, owner, bad); break; \
1765 1.1 christos case 56: result = checknames_ninfo(rdata, owner, bad); break; \
1766 1.1 christos case 57: result = checknames_rkey(rdata, owner, bad); break; \
1767 1.1 christos case 58: result = checknames_talink(rdata, owner, bad); break; \
1768 1.1 christos case 59: result = checknames_cds(rdata, owner, bad); break; \
1769 1.1 christos case 60: result = checknames_cdnskey(rdata, owner, bad); break; \
1770 1.1 christos case 61: result = checknames_openpgpkey(rdata, owner, bad); break; \
1771 1.1 christos case 62: result = checknames_csync(rdata, owner, bad); break; \
1772 1.1 christos case 99: result = checknames_spf(rdata, owner, bad); break; \
1773 1.1 christos case 103: result = checknames_unspec(rdata, owner, bad); break; \
1774 1.1 christos case 104: result = checknames_nid(rdata, owner, bad); break; \
1775 1.1 christos case 105: result = checknames_l32(rdata, owner, bad); break; \
1776 1.1 christos case 106: result = checknames_l64(rdata, owner, bad); break; \
1777 1.1 christos case 107: result = checknames_lp(rdata, owner, bad); break; \
1778 1.1 christos case 108: result = checknames_eui48(rdata, owner, bad); break; \
1779 1.1 christos case 109: result = checknames_eui64(rdata, owner, bad); break; \
1780 1.1 christos case 249: result = checknames_tkey(rdata, owner, bad); break; \
1781 1.1 christos case 250: switch (rdata->rdclass) { \
1782 1.1 christos case 255: result = checknames_any_tsig(rdata, owner, bad); break; \
1783 1.1 christos default: result = ISC_TRUE; break; \
1784 1.1 christos } \
1785 1.1 christos break; \
1786 1.1 christos case 256: result = checknames_uri(rdata, owner, bad); break; \
1787 1.1 christos case 257: result = checknames_caa(rdata, owner, bad); break; \
1788 1.1 christos case 258: result = checknames_avc(rdata, owner, bad); break; \
1789 1.1 christos case 259: result = checknames_doa(rdata, owner, bad); break; \
1790 1.1 christos case 32768: result = checknames_ta(rdata, owner, bad); break; \
1791 1.1 christos case 32769: result = checknames_dlv(rdata, owner, bad); break; \
1792 1.1 christos case 65533: result = checknames_keydata(rdata, owner, bad); break; \
1793 1.1 christos default: result = ISC_TRUE; break; \
1794 1.1 christos }
1795 1.1 christos #define RDATATYPE_COMPARE(_s, _d, _tn, _n, _tp) \
1796 1.1 christos do { \
1797 1.1 christos if (sizeof(_s) - 1 == _n && \
1798 1.1 christos strncasecmp(_s,(_tn),(sizeof(_s) - 1)) == 0) { \
1799 1.1 christos if ((dns_rdatatype_attributes(_d) & DNS_RDATATYPEATTR_RESERVED) != 0) \
1800 1.1 christos return (ISC_R_NOTIMPLEMENTED); \
1801 1.1 christos *(_tp) = _d; \
1802 1.1 christos return (ISC_R_SUCCESS); \
1803 1.1 christos } \
1804 1.1 christos } while (0)
1805 1.1 christos
1806 1.1 christos #define RDATATYPE_FROMTEXT_SW(_hash,_typename,_length,_typep) \
1807 1.1 christos switch (_hash) { \
1808 1.1 christos case 16: \
1809 1.1 christos RDATATYPE_COMPARE("reserved0", 0, _typename, _length, _typep); \
1810 1.1 christos break; \
1811 1.1 christos case 34: \
1812 1.1 christos RDATATYPE_COMPARE("a", 1, _typename, _length, _typep); \
1813 1.1 christos break; \
1814 1.1 christos case 80: \
1815 1.1 christos RDATATYPE_COMPARE("ns", 2, _typename, _length, _typep); \
1816 1.1 christos break; \
1817 1.1 christos case 92: \
1818 1.1 christos RDATATYPE_COMPARE("md", 3, _typename, _length, _typep); \
1819 1.1 christos break; \
1820 1.1 christos case 58: \
1821 1.1 christos RDATATYPE_COMPARE("mf", 4, _typename, _length, _typep); \
1822 1.1 christos break; \
1823 1.1 christos case 8: \
1824 1.1 christos RDATATYPE_COMPARE("cname", 5, _typename, _length, _typep); \
1825 1.1 christos RDATATYPE_COMPARE("mx", 15, _typename, _length, _typep); \
1826 1.1 christos break; \
1827 1.1 christos case 182: \
1828 1.1 christos RDATATYPE_COMPARE("soa", 6, _typename, _length, _typep); \
1829 1.1 christos RDATATYPE_COMPARE("ta", 32768, _typename, _length, _typep); \
1830 1.1 christos break; \
1831 1.1 christos case 126: \
1832 1.1 christos RDATATYPE_COMPARE("mb", 7, _typename, _length, _typep); \
1833 1.1 christos break; \
1834 1.1 christos case 169: \
1835 1.1 christos RDATATYPE_COMPARE("mg", 8, _typename, _length, _typep); \
1836 1.1 christos break; \
1837 1.1 christos case 110: \
1838 1.1 christos RDATATYPE_COMPARE("mr", 9, _typename, _length, _typep); \
1839 1.1 christos RDATATYPE_COMPARE("minfo", 14, _typename, _length, _typep); \
1840 1.1 christos break; \
1841 1.1 christos case 24: \
1842 1.1 christos RDATATYPE_COMPARE("null", 10, _typename, _length, _typep); \
1843 1.1 christos RDATATYPE_COMPARE("kx", 36, _typename, _length, _typep); \
1844 1.1 christos RDATATYPE_COMPARE("nsec3param", 51, _typename, _length, _typep); \
1845 1.1 christos break; \
1846 1.1 christos case 206: \
1847 1.1 christos RDATATYPE_COMPARE("wks", 11, _typename, _length, _typep); \
1848 1.1 christos break; \
1849 1.1 christos case 54: \
1850 1.1 christos RDATATYPE_COMPARE("ptr", 12, _typename, _length, _typep); \
1851 1.1 christos RDATATYPE_COMPARE("naptr", 35, _typename, _length, _typep); \
1852 1.1 christos break; \
1853 1.1 christos case 67: \
1854 1.1 christos RDATATYPE_COMPARE("hinfo", 13, _typename, _length, _typep); \
1855 1.1 christos break; \
1856 1.1 christos case 236: \
1857 1.1 christos RDATATYPE_COMPARE("txt", 16, _typename, _length, _typep); \
1858 1.1 christos break; \
1859 1.1 christos case 192: \
1860 1.1 christos RDATATYPE_COMPARE("rp", 17, _typename, _length, _typep); \
1861 1.1 christos break; \
1862 1.1 christos case 12: \
1863 1.1 christos RDATATYPE_COMPARE("afsdb", 18, _typename, _length, _typep); \
1864 1.1 christos break; \
1865 1.1 christos case 119: \
1866 1.1 christos RDATATYPE_COMPARE("x25", 19, _typename, _length, _typep); \
1867 1.1 christos break; \
1868 1.1 christos case 214: \
1869 1.1 christos RDATATYPE_COMPARE("isdn", 20, _typename, _length, _typep); \
1870 1.1 christos break; \
1871 1.1 christos case 144: \
1872 1.1 christos RDATATYPE_COMPARE("rt", 21, _typename, _length, _typep); \
1873 1.1 christos break; \
1874 1.1 christos case 224: \
1875 1.1 christos RDATATYPE_COMPARE("nsap", 22, _typename, _length, _typep); \
1876 1.1 christos RDATATYPE_COMPARE("uid", 101, _typename, _length, _typep); \
1877 1.1 christos break; \
1878 1.1 christos case 140: \
1879 1.1 christos RDATATYPE_COMPARE("nsap-ptr", 23, _typename, _length, _typep); \
1880 1.1 christos RDATATYPE_COMPARE("l64", 106, _typename, _length, _typep); \
1881 1.1 christos break; \
1882 1.1 christos case 122: \
1883 1.1 christos RDATATYPE_COMPARE("sig", 24, _typename, _length, _typep); \
1884 1.1 christos RDATATYPE_COMPARE("dlv", 32769, _typename, _length, _typep); \
1885 1.1 christos break; \
1886 1.1 christos case 254: \
1887 1.1 christos RDATATYPE_COMPARE("key", 25, _typename, _length, _typep); \
1888 1.1 christos RDATATYPE_COMPARE("talink", 58, _typename, _length, _typep); \
1889 1.1 christos break; \
1890 1.1 christos case 112: \
1891 1.1 christos RDATATYPE_COMPARE("px", 26, _typename, _length, _typep); \
1892 1.1 christos break; \
1893 1.1 christos case 17: \
1894 1.1 christos RDATATYPE_COMPARE("gpos", 27, _typename, _length, _typep); \
1895 1.1 christos break; \
1896 1.1 christos case 69: \
1897 1.1 christos RDATATYPE_COMPARE("aaaa", 28, _typename, _length, _typep); \
1898 1.1 christos RDATATYPE_COMPARE("atma", 34, _typename, _length, _typep); \
1899 1.1 christos break; \
1900 1.1 christos case 237: \
1901 1.1 christos RDATATYPE_COMPARE("loc", 29, _typename, _length, _typep); \
1902 1.1 christos break; \
1903 1.1 christos case 52: \
1904 1.1 christos RDATATYPE_COMPARE("nxt", 30, _typename, _length, _typep); \
1905 1.1 christos break; \
1906 1.1 christos case 160: \
1907 1.1 christos RDATATYPE_COMPARE("eid", 31, _typename, _length, _typep); \
1908 1.1 christos break; \
1909 1.1 christos case 220: \
1910 1.1 christos RDATATYPE_COMPARE("nimloc", 32, _typename, _length, _typep); \
1911 1.1 christos break; \
1912 1.1 christos case 100: \
1913 1.1 christos RDATATYPE_COMPARE("srv", 33, _typename, _length, _typep); \
1914 1.1 christos break; \
1915 1.1 christos case 172: \
1916 1.1 christos RDATATYPE_COMPARE("cert", 37, _typename, _length, _typep); \
1917 1.1 christos RDATATYPE_COMPARE("avc", 258, _typename, _length, _typep); \
1918 1.1 christos break; \
1919 1.1 christos case 226: \
1920 1.1 christos RDATATYPE_COMPARE("a6", 38, _typename, _length, _typep); \
1921 1.1 christos break; \
1922 1.1 christos case 109: \
1923 1.1 christos RDATATYPE_COMPARE("dname", 39, _typename, _length, _typep); \
1924 1.1 christos break; \
1925 1.1 christos case 189: \
1926 1.1 christos RDATATYPE_COMPARE("sink", 40, _typename, _length, _typep); \
1927 1.1 christos break; \
1928 1.1 christos case 168: \
1929 1.1 christos RDATATYPE_COMPARE("opt", 41, _typename, _length, _typep); \
1930 1.1 christos break; \
1931 1.1 christos case 48: \
1932 1.1 christos RDATATYPE_COMPARE("apl", 42, _typename, _length, _typep); \
1933 1.1 christos RDATATYPE_COMPARE("eui48", 108, _typename, _length, _typep); \
1934 1.1 christos break; \
1935 1.1 christos case 210: \
1936 1.1 christos RDATATYPE_COMPARE("ds", 43, _typename, _length, _typep); \
1937 1.1 christos RDATATYPE_COMPARE("cds", 59, _typename, _length, _typep); \
1938 1.1 christos break; \
1939 1.1 christos case 128: \
1940 1.1 christos RDATATYPE_COMPARE("sshfp", 44, _typename, _length, _typep); \
1941 1.1 christos break; \
1942 1.1 christos case 105: \
1943 1.1 christos RDATATYPE_COMPARE("ipseckey", 45, _typename, _length, _typep); \
1944 1.1 christos break; \
1945 1.1 christos case 225: \
1946 1.1 christos RDATATYPE_COMPARE("rrsig", 46, _typename, _length, _typep); \
1947 1.1 christos break; \
1948 1.1 christos case 22: \
1949 1.1 christos RDATATYPE_COMPARE("nsec", 47, _typename, _length, _typep); \
1950 1.1 christos break; \
1951 1.1 christos case 26: \
1952 1.1 christos RDATATYPE_COMPARE("dnskey", 48, _typename, _length, _typep); \
1953 1.1 christos RDATATYPE_COMPARE("cdnskey", 60, _typename, _length, _typep); \
1954 1.1 christos break; \
1955 1.1 christos case 4: \
1956 1.1 christos RDATATYPE_COMPARE("dhcid", 49, _typename, _length, _typep); \
1957 1.1 christos RDATATYPE_COMPARE("spf", 99, _typename, _length, _typep); \
1958 1.1 christos break; \
1959 1.1 christos case 233: \
1960 1.1 christos RDATATYPE_COMPARE("nsec3", 50, _typename, _length, _typep); \
1961 1.1 christos break; \
1962 1.1 christos case 120: \
1963 1.1 christos RDATATYPE_COMPARE("tlsa", 52, _typename, _length, _typep); \
1964 1.1 christos break; \
1965 1.1 christos case 217: \
1966 1.1 christos RDATATYPE_COMPARE("smimea", 53, _typename, _length, _typep); \
1967 1.1 christos break; \
1968 1.1 christos case 208: \
1969 1.1 christos RDATATYPE_COMPARE("hip", 55, _typename, _length, _typep); \
1970 1.1 christos break; \
1971 1.1 christos case 221: \
1972 1.1 christos RDATATYPE_COMPARE("ninfo", 56, _typename, _length, _typep); \
1973 1.1 christos break; \
1974 1.1 christos case 198: \
1975 1.1 christos RDATATYPE_COMPARE("rkey", 57, _typename, _length, _typep); \
1976 1.1 christos break; \
1977 1.1 christos case 49: \
1978 1.1 christos RDATATYPE_COMPARE("openpgpkey", 61, _typename, _length, _typep); \
1979 1.1 christos break; \
1980 1.1 christos case 56: \
1981 1.1 christos RDATATYPE_COMPARE("csync", 62, _typename, _length, _typep); \
1982 1.1 christos RDATATYPE_COMPARE("uri", 256, _typename, _length, _typep); \
1983 1.1 christos break; \
1984 1.1 christos case 230: \
1985 1.1 christos RDATATYPE_COMPARE("uinfo", 100, _typename, _length, _typep); \
1986 1.1 christos break; \
1987 1.1 christos case 104: \
1988 1.1 christos RDATATYPE_COMPARE("gid", 102, _typename, _length, _typep); \
1989 1.1 christos break; \
1990 1.1 christos case 145: \
1991 1.1 christos RDATATYPE_COMPARE("unspec", 103, _typename, _length, _typep); \
1992 1.1 christos break; \
1993 1.1 christos case 36: \
1994 1.1 christos RDATATYPE_COMPARE("nid", 104, _typename, _length, _typep); \
1995 1.1 christos break; \
1996 1.1 christos case 174: \
1997 1.1 christos RDATATYPE_COMPARE("l32", 105, _typename, _length, _typep); \
1998 1.1 christos break; \
1999 1.1 christos case 32: \
2000 1.1 christos RDATATYPE_COMPARE("lp", 107, _typename, _length, _typep); \
2001 1.1 christos break; \
2002 1.1 christos case 136: \
2003 1.1 christos RDATATYPE_COMPARE("eui64", 109, _typename, _length, _typep); \
2004 1.1 christos break; \
2005 1.1 christos case 184: \
2006 1.1 christos RDATATYPE_COMPARE("tkey", 249, _typename, _length, _typep); \
2007 1.1 christos break; \
2008 1.1 christos case 72: \
2009 1.1 christos RDATATYPE_COMPARE("tsig", 250, _typename, _length, _typep); \
2010 1.1 christos break; \
2011 1.1 christos case 138: \
2012 1.1 christos RDATATYPE_COMPARE("ixfr", 251, _typename, _length, _typep); \
2013 1.1 christos break; \
2014 1.1 christos case 250: \
2015 1.1 christos RDATATYPE_COMPARE("axfr", 252, _typename, _length, _typep); \
2016 1.1 christos break; \
2017 1.1 christos case 164: \
2018 1.1 christos RDATATYPE_COMPARE("mailb", 253, _typename, _length, _typep); \
2019 1.1 christos break; \
2020 1.1 christos case 50: \
2021 1.1 christos RDATATYPE_COMPARE("maila", 254, _typename, _length, _typep); \
2022 1.1 christos RDATATYPE_COMPARE("keydata", 65533, _typename, _length, _typep); \
2023 1.1 christos break; \
2024 1.1 christos case 68: \
2025 1.1 christos RDATATYPE_COMPARE("any", 255, _typename, _length, _typep); \
2026 1.1 christos break; \
2027 1.1 christos case 166: \
2028 1.1 christos RDATATYPE_COMPARE("caa", 257, _typename, _length, _typep); \
2029 1.1 christos break; \
2030 1.1 christos case 7: \
2031 1.1 christos RDATATYPE_COMPARE("doa", 259, _typename, _length, _typep); \
2032 1.1 christos break; \
2033 1.1 christos }
2034 1.1 christos #define RDATATYPE_ATTRIBUTE_SW \
2035 1.1 christos switch (type) { \
2036 1.1 christos case 0: return (DNS_RDATATYPEATTR_RESERVED); \
2037 1.1 christos case 1: return (RRTYPE_A_ATTRIBUTES); \
2038 1.1 christos case 2: return (RRTYPE_NS_ATTRIBUTES); \
2039 1.1 christos case 3: return (RRTYPE_MD_ATTRIBUTES); \
2040 1.1 christos case 4: return (RRTYPE_MF_ATTRIBUTES); \
2041 1.1 christos case 5: return (RRTYPE_CNAME_ATTRIBUTES); \
2042 1.1 christos case 6: return (RRTYPE_SOA_ATTRIBUTES); \
2043 1.1 christos case 7: return (RRTYPE_MB_ATTRIBUTES); \
2044 1.1 christos case 8: return (RRTYPE_MG_ATTRIBUTES); \
2045 1.1 christos case 9: return (RRTYPE_MR_ATTRIBUTES); \
2046 1.1 christos case 10: return (RRTYPE_NULL_ATTRIBUTES); \
2047 1.1 christos case 11: return (RRTYPE_WKS_ATTRIBUTES); \
2048 1.1 christos case 12: return (RRTYPE_PTR_ATTRIBUTES); \
2049 1.1 christos case 13: return (RRTYPE_HINFO_ATTRIBUTES); \
2050 1.1 christos case 14: return (RRTYPE_MINFO_ATTRIBUTES); \
2051 1.1 christos case 15: return (RRTYPE_MX_ATTRIBUTES); \
2052 1.1 christos case 16: return (RRTYPE_TXT_ATTRIBUTES); \
2053 1.1 christos case 17: return (RRTYPE_RP_ATTRIBUTES); \
2054 1.1 christos case 18: return (RRTYPE_AFSDB_ATTRIBUTES); \
2055 1.1 christos case 19: return (RRTYPE_X25_ATTRIBUTES); \
2056 1.1 christos case 20: return (RRTYPE_ISDN_ATTRIBUTES); \
2057 1.1 christos case 21: return (RRTYPE_RT_ATTRIBUTES); \
2058 1.1 christos case 22: return (RRTYPE_NSAP_ATTRIBUTES); \
2059 1.1 christos case 23: return (RRTYPE_NSAP_PTR_ATTRIBUTES); \
2060 1.1 christos case 24: return (RRTYPE_SIG_ATTRIBUTES); \
2061 1.1 christos case 25: return (RRTYPE_KEY_ATTRIBUTES); \
2062 1.1 christos case 26: return (RRTYPE_PX_ATTRIBUTES); \
2063 1.1 christos case 27: return (RRTYPE_GPOS_ATTRIBUTES); \
2064 1.1 christos case 28: return (RRTYPE_AAAA_ATTRIBUTES); \
2065 1.1 christos case 29: return (RRTYPE_LOC_ATTRIBUTES); \
2066 1.1 christos case 30: return (RRTYPE_NXT_ATTRIBUTES); \
2067 1.1 christos case 31: return (DNS_RDATATYPEATTR_RESERVED); \
2068 1.1 christos case 32: return (DNS_RDATATYPEATTR_RESERVED); \
2069 1.1 christos case 33: return (RRTYPE_SRV_ATTRIBUTES); \
2070 1.1 christos case 34: return (DNS_RDATATYPEATTR_RESERVED); \
2071 1.1 christos case 35: return (RRTYPE_NAPTR_ATTRIBUTES); \
2072 1.1 christos case 36: return (RRTYPE_KX_ATTRIBUTES); \
2073 1.1 christos case 37: return (RRTYPE_CERT_ATTRIBUTES); \
2074 1.1 christos case 38: return (RRTYPE_A6_ATTRIBUTES); \
2075 1.1 christos case 39: return (RRTYPE_DNAME_ATTRIBUTES); \
2076 1.1 christos case 40: return (RRTYPE_SINK_ATTRIBUTES); \
2077 1.1 christos case 41: return (RRTYPE_OPT_ATTRIBUTES); \
2078 1.1 christos case 42: return (RRTYPE_APL_ATTRIBUTES); \
2079 1.1 christos case 43: return (RRTYPE_DS_ATTRIBUTES); \
2080 1.1 christos case 44: return (RRTYPE_SSHFP_ATTRIBUTES); \
2081 1.1 christos case 45: return (RRTYPE_IPSECKEY_ATTRIBUTES); \
2082 1.1 christos case 46: return (RRTYPE_RRSIG_ATTRIBUTES); \
2083 1.1 christos case 47: return (RRTYPE_NSEC_ATTRIBUTES); \
2084 1.1 christos case 48: return (RRTYPE_DNSKEY_ATTRIBUTES); \
2085 1.1 christos case 49: return (RRTYPE_DHCID_ATTRIBUTES); \
2086 1.1 christos case 50: return (RRTYPE_NSEC3_ATTRIBUTES); \
2087 1.1 christos case 51: return (RRTYPE_NSEC3PARAM_ATTRIBUTES); \
2088 1.1 christos case 52: return (RRTYPE_TLSA_ATTRIBUTES); \
2089 1.1 christos case 53: return (RRTYPE_SMIMEA_ATTRIBUTES); \
2090 1.1 christos case 55: return (RRTYPE_HIP_ATTRIBUTES); \
2091 1.1 christos case 56: return (RRTYPE_NINFO_ATTRIBUTES); \
2092 1.1 christos case 57: return (RRTYPE_RKEY_ATTRIBUTES); \
2093 1.1 christos case 58: return (RRTYPE_TALINK_ATTRIBUTES); \
2094 1.1 christos case 59: return (RRTYPE_CDS_ATTRIBUTES); \
2095 1.1 christos case 60: return (RRTYPE_CDNSKEY_ATTRIBUTES); \
2096 1.1 christos case 61: return (RRTYPE_OPENPGPKEY_ATTRIBUTES); \
2097 1.1 christos case 62: return (RRTYPE_CSYNC_ATTRIBUTES); \
2098 1.1 christos case 99: return (RRTYPE_SPF_ATTRIBUTES); \
2099 1.1 christos case 100: return (DNS_RDATATYPEATTR_RESERVED); \
2100 1.1 christos case 101: return (DNS_RDATATYPEATTR_RESERVED); \
2101 1.1 christos case 102: return (DNS_RDATATYPEATTR_RESERVED); \
2102 1.1 christos case 103: return (RRTYPE_UNSPEC_ATTRIBUTES); \
2103 1.1 christos case 104: return (RRTYPE_NID_ATTRIBUTES); \
2104 1.1 christos case 105: return (RRTYPE_L32_ATTRIBUTES); \
2105 1.1 christos case 106: return (RRTYPE_L64_ATTRIBUTES); \
2106 1.1 christos case 107: return (RRTYPE_LP_ATTRIBUTES); \
2107 1.1 christos case 108: return (RRTYPE_EUI48_ATTRIBUTES); \
2108 1.1 christos case 109: return (RRTYPE_EUI64_ATTRIBUTES); \
2109 1.1 christos case 249: return (RRTYPE_TKEY_ATTRIBUTES); \
2110 1.1 christos case 250: return (RRTYPE_TSIG_ATTRIBUTES); \
2111 1.1 christos case 251: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
2112 1.1 christos case 252: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
2113 1.1 christos case 253: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
2114 1.1 christos case 254: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
2115 1.1 christos case 255: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
2116 1.1 christos case 256: return (RRTYPE_URI_ATTRIBUTES); \
2117 1.1 christos case 257: return (RRTYPE_CAA_ATTRIBUTES); \
2118 1.1 christos case 258: return (RRTYPE_AVC_ATTRIBUTES); \
2119 1.1 christos case 259: return (RRTYPE_DOA_ATTRIBUTES); \
2120 1.1 christos case 32768: return (RRTYPE_TA_ATTRIBUTES); \
2121 1.1 christos case 32769: return (RRTYPE_DLV_ATTRIBUTES); \
2122 1.1 christos case 65533: return (RRTYPE_KEYDATA_ATTRIBUTES); \
2123 1.1 christos }
2124 1.1 christos #define RDATATYPE_TOTEXT_SW \
2125 1.1 christos switch (type) { \
2126 1.1 christos case 0: return (str_totext("RESERVED0", target)); \
2127 1.1 christos case 1: return (str_totext("A", target)); \
2128 1.1 christos case 2: return (str_totext("NS", target)); \
2129 1.1 christos case 3: return (str_totext("MD", target)); \
2130 1.1 christos case 4: return (str_totext("MF", target)); \
2131 1.1 christos case 5: return (str_totext("CNAME", target)); \
2132 1.1 christos case 6: return (str_totext("SOA", target)); \
2133 1.1 christos case 7: return (str_totext("MB", target)); \
2134 1.1 christos case 8: return (str_totext("MG", target)); \
2135 1.1 christos case 9: return (str_totext("MR", target)); \
2136 1.1 christos case 10: return (str_totext("NULL", target)); \
2137 1.1 christos case 11: return (str_totext("WKS", target)); \
2138 1.1 christos case 12: return (str_totext("PTR", target)); \
2139 1.1 christos case 13: return (str_totext("HINFO", target)); \
2140 1.1 christos case 14: return (str_totext("MINFO", target)); \
2141 1.1 christos case 15: return (str_totext("MX", target)); \
2142 1.1 christos case 16: return (str_totext("TXT", target)); \
2143 1.1 christos case 17: return (str_totext("RP", target)); \
2144 1.1 christos case 18: return (str_totext("AFSDB", target)); \
2145 1.1 christos case 19: return (str_totext("X25", target)); \
2146 1.1 christos case 20: return (str_totext("ISDN", target)); \
2147 1.1 christos case 21: return (str_totext("RT", target)); \
2148 1.1 christos case 22: return (str_totext("NSAP", target)); \
2149 1.1 christos case 23: return (str_totext("NSAP-PTR", target)); \
2150 1.1 christos case 24: return (str_totext("SIG", target)); \
2151 1.1 christos case 25: return (str_totext("KEY", target)); \
2152 1.1 christos case 26: return (str_totext("PX", target)); \
2153 1.1 christos case 27: return (str_totext("GPOS", target)); \
2154 1.1 christos case 28: return (str_totext("AAAA", target)); \
2155 1.1 christos case 29: return (str_totext("LOC", target)); \
2156 1.1 christos case 30: return (str_totext("NXT", target)); \
2157 1.1 christos case 31: return (str_totext("EID", target)); \
2158 1.1 christos case 32: return (str_totext("NIMLOC", target)); \
2159 1.1 christos case 33: return (str_totext("SRV", target)); \
2160 1.1 christos case 34: return (str_totext("ATMA", target)); \
2161 1.1 christos case 35: return (str_totext("NAPTR", target)); \
2162 1.1 christos case 36: return (str_totext("KX", target)); \
2163 1.1 christos case 37: return (str_totext("CERT", target)); \
2164 1.1 christos case 38: return (str_totext("A6", target)); \
2165 1.1 christos case 39: return (str_totext("DNAME", target)); \
2166 1.1 christos case 40: return (str_totext("SINK", target)); \
2167 1.1 christos case 41: return (str_totext("OPT", target)); \
2168 1.1 christos case 42: return (str_totext("APL", target)); \
2169 1.1 christos case 43: return (str_totext("DS", target)); \
2170 1.1 christos case 44: return (str_totext("SSHFP", target)); \
2171 1.1 christos case 45: return (str_totext("IPSECKEY", target)); \
2172 1.1 christos case 46: return (str_totext("RRSIG", target)); \
2173 1.1 christos case 47: return (str_totext("NSEC", target)); \
2174 1.1 christos case 48: return (str_totext("DNSKEY", target)); \
2175 1.1 christos case 49: return (str_totext("DHCID", target)); \
2176 1.1 christos case 50: return (str_totext("NSEC3", target)); \
2177 1.1 christos case 51: return (str_totext("NSEC3PARAM", target)); \
2178 1.1 christos case 52: return (str_totext("TLSA", target)); \
2179 1.1 christos case 53: return (str_totext("SMIMEA", target)); \
2180 1.1 christos case 55: return (str_totext("HIP", target)); \
2181 1.1 christos case 56: return (str_totext("NINFO", target)); \
2182 1.1 christos case 57: return (str_totext("RKEY", target)); \
2183 1.1 christos case 58: return (str_totext("TALINK", target)); \
2184 1.1 christos case 59: return (str_totext("CDS", target)); \
2185 1.1 christos case 60: return (str_totext("CDNSKEY", target)); \
2186 1.1 christos case 61: return (str_totext("OPENPGPKEY", target)); \
2187 1.1 christos case 62: return (str_totext("CSYNC", target)); \
2188 1.1 christos case 99: return (str_totext("SPF", target)); \
2189 1.1 christos case 100: return (str_totext("UINFO", target)); \
2190 1.1 christos case 101: return (str_totext("UID", target)); \
2191 1.1 christos case 102: return (str_totext("GID", target)); \
2192 1.1 christos case 103: return (str_totext("UNSPEC", target)); \
2193 1.1 christos case 104: return (str_totext("NID", target)); \
2194 1.1 christos case 105: return (str_totext("L32", target)); \
2195 1.1 christos case 106: return (str_totext("L64", target)); \
2196 1.1 christos case 107: return (str_totext("LP", target)); \
2197 1.1 christos case 108: return (str_totext("EUI48", target)); \
2198 1.1 christos case 109: return (str_totext("EUI64", target)); \
2199 1.1 christos case 249: return (str_totext("TKEY", target)); \
2200 1.1 christos case 250: return (str_totext("TSIG", target)); \
2201 1.1 christos case 251: return (str_totext("IXFR", target)); \
2202 1.1 christos case 252: return (str_totext("AXFR", target)); \
2203 1.1 christos case 253: return (str_totext("MAILB", target)); \
2204 1.1 christos case 254: return (str_totext("MAILA", target)); \
2205 1.1 christos case 255: return (str_totext("ANY", target)); \
2206 1.1 christos case 256: return (str_totext("URI", target)); \
2207 1.1 christos case 257: return (str_totext("CAA", target)); \
2208 1.1 christos case 258: return (str_totext("AVC", target)); \
2209 1.1 christos case 259: return (str_totext("DOA", target)); \
2210 1.1 christos case 32768: return (str_totext("TA", target)); \
2211 1.1 christos case 32769: return (str_totext("DLV", target)); \
2212 1.1 christos }
2213 1.1 christos #endif /* DNS_CODE_H */
2214