.gitignore: properly spell cscope, add empty vim swap files
[dragonfly.git] / usr.sbin / named / code.h
blobc10b6f1c39be3aaddddcaa12b5606ecf696da864
1 /*
2 * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1998-2003 Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
17 /* $DragonFly: src/usr.sbin/named/code.h,v 1.3 2007/02/15 20:28:49 victor Exp $ */
19 /***************
20 ***************
21 *************** THIS FILE IS AUTOMATICALLY GENERATED BY gen.c.
22 *************** DO NOT EDIT!
23 ***************
24 ***************/
26 #ifndef DNS_CODE_H
27 #define DNS_CODE_H 1
29 #include <isc/boolean.h>
30 #include <isc/result.h>
32 #include <dns/name.h>
34 #include "./rdata/in_1/a_1.c"
35 #include "./rdata/hs_4/a_1.c"
36 #include "./rdata/generic/ns_2.c"
37 #include "./rdata/generic/md_3.c"
38 #include "./rdata/generic/mf_4.c"
39 #include "./rdata/generic/cname_5.c"
40 #include "./rdata/generic/soa_6.c"
41 #include "./rdata/generic/mb_7.c"
42 #include "./rdata/generic/mg_8.c"
43 #include "./rdata/generic/mr_9.c"
44 #include "./rdata/generic/null_10.c"
45 #include "./rdata/in_1/wks_11.c"
46 #include "./rdata/generic/ptr_12.c"
47 #include "./rdata/generic/hinfo_13.c"
48 #include "./rdata/generic/minfo_14.c"
49 #include "./rdata/generic/mx_15.c"
50 #include "./rdata/generic/txt_16.c"
51 #include "./rdata/generic/rp_17.c"
52 #include "./rdata/generic/afsdb_18.c"
53 #include "./rdata/generic/x25_19.c"
54 #include "./rdata/generic/isdn_20.c"
55 #include "./rdata/generic/rt_21.c"
56 #include "./rdata/in_1/nsap_22.c"
57 #include "./rdata/in_1/nsap-ptr_23.c"
58 #include "./rdata/generic/sig_24.c"
59 #include "./rdata/generic/key_25.c"
60 #include "./rdata/in_1/px_26.c"
61 #include "./rdata/generic/gpos_27.c"
62 #include "./rdata/in_1/aaaa_28.c"
63 #include "./rdata/generic/loc_29.c"
64 #include "./rdata/generic/nxt_30.c"
65 #include "./rdata/in_1/srv_33.c"
66 #include "./rdata/in_1/naptr_35.c"
67 #include "./rdata/in_1/kx_36.c"
68 #include "./rdata/generic/cert_37.c"
69 #include "./rdata/in_1/a6_38.c"
70 #include "./rdata/generic/dname_39.c"
71 #include "./rdata/generic/opt_41.c"
72 #include "./rdata/in_1/apl_42.c"
73 #include "./rdata/generic/ds_43.c"
74 #include "./rdata/generic/sshfp_44.c"
75 #include "./rdata/generic/rrsig_46.c"
76 #include "./rdata/generic/nsec_47.c"
77 #include "./rdata/generic/dnskey_48.c"
78 #include "./rdata/generic/unspec_103.c"
79 #include "./rdata/generic/tkey_249.c"
80 #include "./rdata/any_255/tsig_250.c"
81 #include "./rdata/generic/dlv_32769.c"
85 #define FROMTEXTSWITCH \
86 switch (type) { \
87 case 1: switch (rdclass) { \
88 case 1: result = fromtext_in_a(rdclass, type, lexer, origin, options, target, callbacks); break; \
89 case 4: result = fromtext_hs_a(rdclass, type, lexer, origin, options, target, callbacks); break; \
90 default: result = DNS_R_UNKNOWN; break; \
91 } \
92 break; \
93 case 2: result = fromtext_ns(rdclass, type, lexer, origin, options, target, callbacks); break; \
94 case 3: result = fromtext_md(rdclass, type, lexer, origin, options, target, callbacks); break; \
95 case 4: result = fromtext_mf(rdclass, type, lexer, origin, options, target, callbacks); break; \
96 case 5: result = fromtext_cname(rdclass, type, lexer, origin, options, target, callbacks); break; \
97 case 6: result = fromtext_soa(rdclass, type, lexer, origin, options, target, callbacks); break; \
98 case 7: result = fromtext_mb(rdclass, type, lexer, origin, options, target, callbacks); break; \
99 case 8: result = fromtext_mg(rdclass, type, lexer, origin, options, target, callbacks); break; \
100 case 9: result = fromtext_mr(rdclass, type, lexer, origin, options, target, callbacks); break; \
101 case 10: result = fromtext_null(rdclass, type, lexer, origin, options, target, callbacks); break; \
102 case 11: switch (rdclass) { \
103 case 1: result = fromtext_in_wks(rdclass, type, lexer, origin, options, target, callbacks); break; \
104 default: result = DNS_R_UNKNOWN; break; \
106 break; \
107 case 12: result = fromtext_ptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
108 case 13: result = fromtext_hinfo(rdclass, type, lexer, origin, options, target, callbacks); break; \
109 case 14: result = fromtext_minfo(rdclass, type, lexer, origin, options, target, callbacks); break; \
110 case 15: result = fromtext_mx(rdclass, type, lexer, origin, options, target, callbacks); break; \
111 case 16: result = fromtext_txt(rdclass, type, lexer, origin, options, target, callbacks); break; \
112 case 17: result = fromtext_rp(rdclass, type, lexer, origin, options, target, callbacks); break; \
113 case 18: result = fromtext_afsdb(rdclass, type, lexer, origin, options, target, callbacks); break; \
114 case 19: result = fromtext_x25(rdclass, type, lexer, origin, options, target, callbacks); break; \
115 case 20: result = fromtext_isdn(rdclass, type, lexer, origin, options, target, callbacks); break; \
116 case 21: result = fromtext_rt(rdclass, type, lexer, origin, options, target, callbacks); break; \
117 case 22: switch (rdclass) { \
118 case 1: result = fromtext_in_nsap(rdclass, type, lexer, origin, options, target, callbacks); break; \
119 default: result = DNS_R_UNKNOWN; break; \
121 break; \
122 case 23: switch (rdclass) { \
123 case 1: result = fromtext_in_nsap_ptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
124 default: result = DNS_R_UNKNOWN; break; \
126 break; \
127 case 24: result = fromtext_sig(rdclass, type, lexer, origin, options, target, callbacks); break; \
128 case 25: result = fromtext_key(rdclass, type, lexer, origin, options, target, callbacks); break; \
129 case 26: switch (rdclass) { \
130 case 1: result = fromtext_in_px(rdclass, type, lexer, origin, options, target, callbacks); break; \
131 default: result = DNS_R_UNKNOWN; break; \
133 break; \
134 case 27: result = fromtext_gpos(rdclass, type, lexer, origin, options, target, callbacks); break; \
135 case 28: switch (rdclass) { \
136 case 1: result = fromtext_in_aaaa(rdclass, type, lexer, origin, options, target, callbacks); break; \
137 default: result = DNS_R_UNKNOWN; break; \
139 break; \
140 case 29: result = fromtext_loc(rdclass, type, lexer, origin, options, target, callbacks); break; \
141 case 30: result = fromtext_nxt(rdclass, type, lexer, origin, options, target, callbacks); break; \
142 case 33: switch (rdclass) { \
143 case 1: result = fromtext_in_srv(rdclass, type, lexer, origin, options, target, callbacks); break; \
144 default: result = DNS_R_UNKNOWN; break; \
146 break; \
147 case 35: switch (rdclass) { \
148 case 1: result = fromtext_in_naptr(rdclass, type, lexer, origin, options, target, callbacks); break; \
149 default: result = DNS_R_UNKNOWN; break; \
151 break; \
152 case 36: switch (rdclass) { \
153 case 1: result = fromtext_in_kx(rdclass, type, lexer, origin, options, target, callbacks); break; \
154 default: result = DNS_R_UNKNOWN; break; \
156 break; \
157 case 37: result = fromtext_cert(rdclass, type, lexer, origin, options, target, callbacks); break; \
158 case 38: switch (rdclass) { \
159 case 1: result = fromtext_in_a6(rdclass, type, lexer, origin, options, target, callbacks); break; \
160 default: result = DNS_R_UNKNOWN; break; \
162 break; \
163 case 39: result = fromtext_dname(rdclass, type, lexer, origin, options, target, callbacks); break; \
164 case 41: result = fromtext_opt(rdclass, type, lexer, origin, options, target, callbacks); break; \
165 case 42: switch (rdclass) { \
166 case 1: result = fromtext_in_apl(rdclass, type, lexer, origin, options, target, callbacks); break; \
167 default: result = DNS_R_UNKNOWN; break; \
169 break; \
170 case 43: result = fromtext_ds(rdclass, type, lexer, origin, options, target, callbacks); break; \
171 case 44: result = fromtext_sshfp(rdclass, type, lexer, origin, options, target, callbacks); break; \
172 case 46: result = fromtext_rrsig(rdclass, type, lexer, origin, options, target, callbacks); break; \
173 case 47: result = fromtext_nsec(rdclass, type, lexer, origin, options, target, callbacks); break; \
174 case 48: result = fromtext_dnskey(rdclass, type, lexer, origin, options, target, callbacks); break; \
175 case 103: result = fromtext_unspec(rdclass, type, lexer, origin, options, target, callbacks); break; \
176 case 249: result = fromtext_tkey(rdclass, type, lexer, origin, options, target, callbacks); break; \
177 case 250: switch (rdclass) { \
178 case 255: result = fromtext_any_tsig(rdclass, type, lexer, origin, options, target, callbacks); break; \
179 default: result = DNS_R_UNKNOWN; break; \
181 break; \
182 case 32769: result = fromtext_dlv(rdclass, type, lexer, origin, options, target, callbacks); break; \
183 default: result = DNS_R_UNKNOWN; break; \
186 #define TOTEXTSWITCH \
187 switch (rdata->type) { \
188 case 1: switch (rdata->rdclass) { \
189 case 1: result = totext_in_a(rdata, tctx, target); break; \
190 case 4: result = totext_hs_a(rdata, tctx, target); break; \
191 default: use_default = ISC_TRUE; break; \
193 break; \
194 case 2: result = totext_ns(rdata, tctx, target); break; \
195 case 3: result = totext_md(rdata, tctx, target); break; \
196 case 4: result = totext_mf(rdata, tctx, target); break; \
197 case 5: result = totext_cname(rdata, tctx, target); break; \
198 case 6: result = totext_soa(rdata, tctx, target); break; \
199 case 7: result = totext_mb(rdata, tctx, target); break; \
200 case 8: result = totext_mg(rdata, tctx, target); break; \
201 case 9: result = totext_mr(rdata, tctx, target); break; \
202 case 10: result = totext_null(rdata, tctx, target); break; \
203 case 11: switch (rdata->rdclass) { \
204 case 1: result = totext_in_wks(rdata, tctx, target); break; \
205 default: use_default = ISC_TRUE; break; \
207 break; \
208 case 12: result = totext_ptr(rdata, tctx, target); break; \
209 case 13: result = totext_hinfo(rdata, tctx, target); break; \
210 case 14: result = totext_minfo(rdata, tctx, target); break; \
211 case 15: result = totext_mx(rdata, tctx, target); break; \
212 case 16: result = totext_txt(rdata, tctx, target); break; \
213 case 17: result = totext_rp(rdata, tctx, target); break; \
214 case 18: result = totext_afsdb(rdata, tctx, target); break; \
215 case 19: result = totext_x25(rdata, tctx, target); break; \
216 case 20: result = totext_isdn(rdata, tctx, target); break; \
217 case 21: result = totext_rt(rdata, tctx, target); break; \
218 case 22: switch (rdata->rdclass) { \
219 case 1: result = totext_in_nsap(rdata, tctx, target); break; \
220 default: use_default = ISC_TRUE; break; \
222 break; \
223 case 23: switch (rdata->rdclass) { \
224 case 1: result = totext_in_nsap_ptr(rdata, tctx, target); break; \
225 default: use_default = ISC_TRUE; break; \
227 break; \
228 case 24: result = totext_sig(rdata, tctx, target); break; \
229 case 25: result = totext_key(rdata, tctx, target); break; \
230 case 26: switch (rdata->rdclass) { \
231 case 1: result = totext_in_px(rdata, tctx, target); break; \
232 default: use_default = ISC_TRUE; break; \
234 break; \
235 case 27: result = totext_gpos(rdata, tctx, target); break; \
236 case 28: switch (rdata->rdclass) { \
237 case 1: result = totext_in_aaaa(rdata, tctx, target); break; \
238 default: use_default = ISC_TRUE; break; \
240 break; \
241 case 29: result = totext_loc(rdata, tctx, target); break; \
242 case 30: result = totext_nxt(rdata, tctx, target); break; \
243 case 33: switch (rdata->rdclass) { \
244 case 1: result = totext_in_srv(rdata, tctx, target); break; \
245 default: use_default = ISC_TRUE; break; \
247 break; \
248 case 35: switch (rdata->rdclass) { \
249 case 1: result = totext_in_naptr(rdata, tctx, target); break; \
250 default: use_default = ISC_TRUE; break; \
252 break; \
253 case 36: switch (rdata->rdclass) { \
254 case 1: result = totext_in_kx(rdata, tctx, target); break; \
255 default: use_default = ISC_TRUE; break; \
257 break; \
258 case 37: result = totext_cert(rdata, tctx, target); break; \
259 case 38: switch (rdata->rdclass) { \
260 case 1: result = totext_in_a6(rdata, tctx, target); break; \
261 default: use_default = ISC_TRUE; break; \
263 break; \
264 case 39: result = totext_dname(rdata, tctx, target); break; \
265 case 41: result = totext_opt(rdata, tctx, target); break; \
266 case 42: switch (rdata->rdclass) { \
267 case 1: result = totext_in_apl(rdata, tctx, target); break; \
268 default: use_default = ISC_TRUE; break; \
270 break; \
271 case 43: result = totext_ds(rdata, tctx, target); break; \
272 case 44: result = totext_sshfp(rdata, tctx, target); break; \
273 case 46: result = totext_rrsig(rdata, tctx, target); break; \
274 case 47: result = totext_nsec(rdata, tctx, target); break; \
275 case 48: result = totext_dnskey(rdata, tctx, target); break; \
276 case 103: result = totext_unspec(rdata, tctx, target); break; \
277 case 249: result = totext_tkey(rdata, tctx, target); break; \
278 case 250: switch (rdata->rdclass) { \
279 case 255: result = totext_any_tsig(rdata, tctx, target); break; \
280 default: use_default = ISC_TRUE; break; \
282 break; \
283 case 32769: result = totext_dlv(rdata, tctx, target); break; \
284 default: use_default = ISC_TRUE; break; \
287 #define FROMWIRESWITCH \
288 switch (type) { \
289 case 1: switch (rdclass) { \
290 case 1: result = fromwire_in_a(rdclass, type, source, dctx, options, target); break; \
291 case 4: result = fromwire_hs_a(rdclass, type, source, dctx, options, target); break; \
292 default: use_default = ISC_TRUE; break; \
294 break; \
295 case 2: result = fromwire_ns(rdclass, type, source, dctx, options, target); break; \
296 case 3: result = fromwire_md(rdclass, type, source, dctx, options, target); break; \
297 case 4: result = fromwire_mf(rdclass, type, source, dctx, options, target); break; \
298 case 5: result = fromwire_cname(rdclass, type, source, dctx, options, target); break; \
299 case 6: result = fromwire_soa(rdclass, type, source, dctx, options, target); break; \
300 case 7: result = fromwire_mb(rdclass, type, source, dctx, options, target); break; \
301 case 8: result = fromwire_mg(rdclass, type, source, dctx, options, target); break; \
302 case 9: result = fromwire_mr(rdclass, type, source, dctx, options, target); break; \
303 case 10: result = fromwire_null(rdclass, type, source, dctx, options, target); break; \
304 case 11: switch (rdclass) { \
305 case 1: result = fromwire_in_wks(rdclass, type, source, dctx, options, target); break; \
306 default: use_default = ISC_TRUE; break; \
308 break; \
309 case 12: result = fromwire_ptr(rdclass, type, source, dctx, options, target); break; \
310 case 13: result = fromwire_hinfo(rdclass, type, source, dctx, options, target); break; \
311 case 14: result = fromwire_minfo(rdclass, type, source, dctx, options, target); break; \
312 case 15: result = fromwire_mx(rdclass, type, source, dctx, options, target); break; \
313 case 16: result = fromwire_txt(rdclass, type, source, dctx, options, target); break; \
314 case 17: result = fromwire_rp(rdclass, type, source, dctx, options, target); break; \
315 case 18: result = fromwire_afsdb(rdclass, type, source, dctx, options, target); break; \
316 case 19: result = fromwire_x25(rdclass, type, source, dctx, options, target); break; \
317 case 20: result = fromwire_isdn(rdclass, type, source, dctx, options, target); break; \
318 case 21: result = fromwire_rt(rdclass, type, source, dctx, options, target); break; \
319 case 22: switch (rdclass) { \
320 case 1: result = fromwire_in_nsap(rdclass, type, source, dctx, options, target); break; \
321 default: use_default = ISC_TRUE; break; \
323 break; \
324 case 23: switch (rdclass) { \
325 case 1: result = fromwire_in_nsap_ptr(rdclass, type, source, dctx, options, target); break; \
326 default: use_default = ISC_TRUE; break; \
328 break; \
329 case 24: result = fromwire_sig(rdclass, type, source, dctx, options, target); break; \
330 case 25: result = fromwire_key(rdclass, type, source, dctx, options, target); break; \
331 case 26: switch (rdclass) { \
332 case 1: result = fromwire_in_px(rdclass, type, source, dctx, options, target); break; \
333 default: use_default = ISC_TRUE; break; \
335 break; \
336 case 27: result = fromwire_gpos(rdclass, type, source, dctx, options, target); break; \
337 case 28: switch (rdclass) { \
338 case 1: result = fromwire_in_aaaa(rdclass, type, source, dctx, options, target); break; \
339 default: use_default = ISC_TRUE; break; \
341 break; \
342 case 29: result = fromwire_loc(rdclass, type, source, dctx, options, target); break; \
343 case 30: result = fromwire_nxt(rdclass, type, source, dctx, options, target); break; \
344 case 33: switch (rdclass) { \
345 case 1: result = fromwire_in_srv(rdclass, type, source, dctx, options, target); break; \
346 default: use_default = ISC_TRUE; break; \
348 break; \
349 case 35: switch (rdclass) { \
350 case 1: result = fromwire_in_naptr(rdclass, type, source, dctx, options, target); break; \
351 default: use_default = ISC_TRUE; break; \
353 break; \
354 case 36: switch (rdclass) { \
355 case 1: result = fromwire_in_kx(rdclass, type, source, dctx, options, target); break; \
356 default: use_default = ISC_TRUE; break; \
358 break; \
359 case 37: result = fromwire_cert(rdclass, type, source, dctx, options, target); break; \
360 case 38: switch (rdclass) { \
361 case 1: result = fromwire_in_a6(rdclass, type, source, dctx, options, target); break; \
362 default: use_default = ISC_TRUE; break; \
364 break; \
365 case 39: result = fromwire_dname(rdclass, type, source, dctx, options, target); break; \
366 case 41: result = fromwire_opt(rdclass, type, source, dctx, options, target); break; \
367 case 42: switch (rdclass) { \
368 case 1: result = fromwire_in_apl(rdclass, type, source, dctx, options, target); break; \
369 default: use_default = ISC_TRUE; break; \
371 break; \
372 case 43: result = fromwire_ds(rdclass, type, source, dctx, options, target); break; \
373 case 44: result = fromwire_sshfp(rdclass, type, source, dctx, options, target); break; \
374 case 46: result = fromwire_rrsig(rdclass, type, source, dctx, options, target); break; \
375 case 47: result = fromwire_nsec(rdclass, type, source, dctx, options, target); break; \
376 case 48: result = fromwire_dnskey(rdclass, type, source, dctx, options, target); break; \
377 case 103: result = fromwire_unspec(rdclass, type, source, dctx, options, target); break; \
378 case 249: result = fromwire_tkey(rdclass, type, source, dctx, options, target); break; \
379 case 250: switch (rdclass) { \
380 case 255: result = fromwire_any_tsig(rdclass, type, source, dctx, options, target); break; \
381 default: use_default = ISC_TRUE; break; \
383 break; \
384 case 32769: result = fromwire_dlv(rdclass, type, source, dctx, options, target); break; \
385 default: use_default = ISC_TRUE; break; \
388 #define TOWIRESWITCH \
389 switch (rdata->type) { \
390 case 1: switch (rdata->rdclass) { \
391 case 1: result = towire_in_a(rdata, cctx, target); break; \
392 case 4: result = towire_hs_a(rdata, cctx, target); break; \
393 default: use_default = ISC_TRUE; break; \
395 break; \
396 case 2: result = towire_ns(rdata, cctx, target); break; \
397 case 3: result = towire_md(rdata, cctx, target); break; \
398 case 4: result = towire_mf(rdata, cctx, target); break; \
399 case 5: result = towire_cname(rdata, cctx, target); break; \
400 case 6: result = towire_soa(rdata, cctx, target); break; \
401 case 7: result = towire_mb(rdata, cctx, target); break; \
402 case 8: result = towire_mg(rdata, cctx, target); break; \
403 case 9: result = towire_mr(rdata, cctx, target); break; \
404 case 10: result = towire_null(rdata, cctx, target); break; \
405 case 11: switch (rdata->rdclass) { \
406 case 1: result = towire_in_wks(rdata, cctx, target); break; \
407 default: use_default = ISC_TRUE; break; \
409 break; \
410 case 12: result = towire_ptr(rdata, cctx, target); break; \
411 case 13: result = towire_hinfo(rdata, cctx, target); break; \
412 case 14: result = towire_minfo(rdata, cctx, target); break; \
413 case 15: result = towire_mx(rdata, cctx, target); break; \
414 case 16: result = towire_txt(rdata, cctx, target); break; \
415 case 17: result = towire_rp(rdata, cctx, target); break; \
416 case 18: result = towire_afsdb(rdata, cctx, target); break; \
417 case 19: result = towire_x25(rdata, cctx, target); break; \
418 case 20: result = towire_isdn(rdata, cctx, target); break; \
419 case 21: result = towire_rt(rdata, cctx, target); break; \
420 case 22: switch (rdata->rdclass) { \
421 case 1: result = towire_in_nsap(rdata, cctx, target); break; \
422 default: use_default = ISC_TRUE; break; \
424 break; \
425 case 23: switch (rdata->rdclass) { \
426 case 1: result = towire_in_nsap_ptr(rdata, cctx, target); break; \
427 default: use_default = ISC_TRUE; break; \
429 break; \
430 case 24: result = towire_sig(rdata, cctx, target); break; \
431 case 25: result = towire_key(rdata, cctx, target); break; \
432 case 26: switch (rdata->rdclass) { \
433 case 1: result = towire_in_px(rdata, cctx, target); break; \
434 default: use_default = ISC_TRUE; break; \
436 break; \
437 case 27: result = towire_gpos(rdata, cctx, target); break; \
438 case 28: switch (rdata->rdclass) { \
439 case 1: result = towire_in_aaaa(rdata, cctx, target); break; \
440 default: use_default = ISC_TRUE; break; \
442 break; \
443 case 29: result = towire_loc(rdata, cctx, target); break; \
444 case 30: result = towire_nxt(rdata, cctx, target); break; \
445 case 33: switch (rdata->rdclass) { \
446 case 1: result = towire_in_srv(rdata, cctx, target); break; \
447 default: use_default = ISC_TRUE; break; \
449 break; \
450 case 35: switch (rdata->rdclass) { \
451 case 1: result = towire_in_naptr(rdata, cctx, target); break; \
452 default: use_default = ISC_TRUE; break; \
454 break; \
455 case 36: switch (rdata->rdclass) { \
456 case 1: result = towire_in_kx(rdata, cctx, target); break; \
457 default: use_default = ISC_TRUE; break; \
459 break; \
460 case 37: result = towire_cert(rdata, cctx, target); break; \
461 case 38: switch (rdata->rdclass) { \
462 case 1: result = towire_in_a6(rdata, cctx, target); break; \
463 default: use_default = ISC_TRUE; break; \
465 break; \
466 case 39: result = towire_dname(rdata, cctx, target); break; \
467 case 41: result = towire_opt(rdata, cctx, target); break; \
468 case 42: switch (rdata->rdclass) { \
469 case 1: result = towire_in_apl(rdata, cctx, target); break; \
470 default: use_default = ISC_TRUE; break; \
472 break; \
473 case 43: result = towire_ds(rdata, cctx, target); break; \
474 case 44: result = towire_sshfp(rdata, cctx, target); break; \
475 case 46: result = towire_rrsig(rdata, cctx, target); break; \
476 case 47: result = towire_nsec(rdata, cctx, target); break; \
477 case 48: result = towire_dnskey(rdata, cctx, target); break; \
478 case 103: result = towire_unspec(rdata, cctx, target); break; \
479 case 249: result = towire_tkey(rdata, cctx, target); break; \
480 case 250: switch (rdata->rdclass) { \
481 case 255: result = towire_any_tsig(rdata, cctx, target); break; \
482 default: use_default = ISC_TRUE; break; \
484 break; \
485 case 32769: result = towire_dlv(rdata, cctx, target); break; \
486 default: use_default = ISC_TRUE; break; \
489 #define COMPARESWITCH \
490 switch (rdata1->type) { \
491 case 1: switch (rdata1->rdclass) { \
492 case 1: result = compare_in_a(rdata1, rdata2); break; \
493 case 4: result = compare_hs_a(rdata1, rdata2); break; \
494 default: use_default = ISC_TRUE; break; \
496 break; \
497 case 2: result = compare_ns(rdata1, rdata2); break; \
498 case 3: result = compare_md(rdata1, rdata2); break; \
499 case 4: result = compare_mf(rdata1, rdata2); break; \
500 case 5: result = compare_cname(rdata1, rdata2); break; \
501 case 6: result = compare_soa(rdata1, rdata2); break; \
502 case 7: result = compare_mb(rdata1, rdata2); break; \
503 case 8: result = compare_mg(rdata1, rdata2); break; \
504 case 9: result = compare_mr(rdata1, rdata2); break; \
505 case 10: result = compare_null(rdata1, rdata2); break; \
506 case 11: switch (rdata1->rdclass) { \
507 case 1: result = compare_in_wks(rdata1, rdata2); break; \
508 default: use_default = ISC_TRUE; break; \
510 break; \
511 case 12: result = compare_ptr(rdata1, rdata2); break; \
512 case 13: result = compare_hinfo(rdata1, rdata2); break; \
513 case 14: result = compare_minfo(rdata1, rdata2); break; \
514 case 15: result = compare_mx(rdata1, rdata2); break; \
515 case 16: result = compare_txt(rdata1, rdata2); break; \
516 case 17: result = compare_rp(rdata1, rdata2); break; \
517 case 18: result = compare_afsdb(rdata1, rdata2); break; \
518 case 19: result = compare_x25(rdata1, rdata2); break; \
519 case 20: result = compare_isdn(rdata1, rdata2); break; \
520 case 21: result = compare_rt(rdata1, rdata2); break; \
521 case 22: switch (rdata1->rdclass) { \
522 case 1: result = compare_in_nsap(rdata1, rdata2); break; \
523 default: use_default = ISC_TRUE; break; \
525 break; \
526 case 23: switch (rdata1->rdclass) { \
527 case 1: result = compare_in_nsap_ptr(rdata1, rdata2); break; \
528 default: use_default = ISC_TRUE; break; \
530 break; \
531 case 24: result = compare_sig(rdata1, rdata2); break; \
532 case 25: result = compare_key(rdata1, rdata2); break; \
533 case 26: switch (rdata1->rdclass) { \
534 case 1: result = compare_in_px(rdata1, rdata2); break; \
535 default: use_default = ISC_TRUE; break; \
537 break; \
538 case 27: result = compare_gpos(rdata1, rdata2); break; \
539 case 28: switch (rdata1->rdclass) { \
540 case 1: result = compare_in_aaaa(rdata1, rdata2); break; \
541 default: use_default = ISC_TRUE; break; \
543 break; \
544 case 29: result = compare_loc(rdata1, rdata2); break; \
545 case 30: result = compare_nxt(rdata1, rdata2); break; \
546 case 33: switch (rdata1->rdclass) { \
547 case 1: result = compare_in_srv(rdata1, rdata2); break; \
548 default: use_default = ISC_TRUE; break; \
550 break; \
551 case 35: switch (rdata1->rdclass) { \
552 case 1: result = compare_in_naptr(rdata1, rdata2); break; \
553 default: use_default = ISC_TRUE; break; \
555 break; \
556 case 36: switch (rdata1->rdclass) { \
557 case 1: result = compare_in_kx(rdata1, rdata2); break; \
558 default: use_default = ISC_TRUE; break; \
560 break; \
561 case 37: result = compare_cert(rdata1, rdata2); break; \
562 case 38: switch (rdata1->rdclass) { \
563 case 1: result = compare_in_a6(rdata1, rdata2); break; \
564 default: use_default = ISC_TRUE; break; \
566 break; \
567 case 39: result = compare_dname(rdata1, rdata2); break; \
568 case 41: result = compare_opt(rdata1, rdata2); break; \
569 case 42: switch (rdata1->rdclass) { \
570 case 1: result = compare_in_apl(rdata1, rdata2); break; \
571 default: use_default = ISC_TRUE; break; \
573 break; \
574 case 43: result = compare_ds(rdata1, rdata2); break; \
575 case 44: result = compare_sshfp(rdata1, rdata2); break; \
576 case 46: result = compare_rrsig(rdata1, rdata2); break; \
577 case 47: result = compare_nsec(rdata1, rdata2); break; \
578 case 48: result = compare_dnskey(rdata1, rdata2); break; \
579 case 103: result = compare_unspec(rdata1, rdata2); break; \
580 case 249: result = compare_tkey(rdata1, rdata2); break; \
581 case 250: switch (rdata1->rdclass) { \
582 case 255: result = compare_any_tsig(rdata1, rdata2); break; \
583 default: use_default = ISC_TRUE; break; \
585 break; \
586 case 32769: result = compare_dlv(rdata1, rdata2); break; \
587 default: use_default = ISC_TRUE; break; \
590 #define FROMSTRUCTSWITCH \
591 switch (type) { \
592 case 1: switch (rdclass) { \
593 case 1: result = fromstruct_in_a(rdclass, type, source, target); break; \
594 case 4: result = fromstruct_hs_a(rdclass, type, source, target); break; \
595 default: use_default = ISC_TRUE; break; \
597 break; \
598 case 2: result = fromstruct_ns(rdclass, type, source, target); break; \
599 case 3: result = fromstruct_md(rdclass, type, source, target); break; \
600 case 4: result = fromstruct_mf(rdclass, type, source, target); break; \
601 case 5: result = fromstruct_cname(rdclass, type, source, target); break; \
602 case 6: result = fromstruct_soa(rdclass, type, source, target); break; \
603 case 7: result = fromstruct_mb(rdclass, type, source, target); break; \
604 case 8: result = fromstruct_mg(rdclass, type, source, target); break; \
605 case 9: result = fromstruct_mr(rdclass, type, source, target); break; \
606 case 10: result = fromstruct_null(rdclass, type, source, target); break; \
607 case 11: switch (rdclass) { \
608 case 1: result = fromstruct_in_wks(rdclass, type, source, target); break; \
609 default: use_default = ISC_TRUE; break; \
611 break; \
612 case 12: result = fromstruct_ptr(rdclass, type, source, target); break; \
613 case 13: result = fromstruct_hinfo(rdclass, type, source, target); break; \
614 case 14: result = fromstruct_minfo(rdclass, type, source, target); break; \
615 case 15: result = fromstruct_mx(rdclass, type, source, target); break; \
616 case 16: result = fromstruct_txt(rdclass, type, source, target); break; \
617 case 17: result = fromstruct_rp(rdclass, type, source, target); break; \
618 case 18: result = fromstruct_afsdb(rdclass, type, source, target); break; \
619 case 19: result = fromstruct_x25(rdclass, type, source, target); break; \
620 case 20: result = fromstruct_isdn(rdclass, type, source, target); break; \
621 case 21: result = fromstruct_rt(rdclass, type, source, target); break; \
622 case 22: switch (rdclass) { \
623 case 1: result = fromstruct_in_nsap(rdclass, type, source, target); break; \
624 default: use_default = ISC_TRUE; break; \
626 break; \
627 case 23: switch (rdclass) { \
628 case 1: result = fromstruct_in_nsap_ptr(rdclass, type, source, target); break; \
629 default: use_default = ISC_TRUE; break; \
631 break; \
632 case 24: result = fromstruct_sig(rdclass, type, source, target); break; \
633 case 25: result = fromstruct_key(rdclass, type, source, target); break; \
634 case 26: switch (rdclass) { \
635 case 1: result = fromstruct_in_px(rdclass, type, source, target); break; \
636 default: use_default = ISC_TRUE; break; \
638 break; \
639 case 27: result = fromstruct_gpos(rdclass, type, source, target); break; \
640 case 28: switch (rdclass) { \
641 case 1: result = fromstruct_in_aaaa(rdclass, type, source, target); break; \
642 default: use_default = ISC_TRUE; break; \
644 break; \
645 case 29: result = fromstruct_loc(rdclass, type, source, target); break; \
646 case 30: result = fromstruct_nxt(rdclass, type, source, target); break; \
647 case 33: switch (rdclass) { \
648 case 1: result = fromstruct_in_srv(rdclass, type, source, target); break; \
649 default: use_default = ISC_TRUE; break; \
651 break; \
652 case 35: switch (rdclass) { \
653 case 1: result = fromstruct_in_naptr(rdclass, type, source, target); break; \
654 default: use_default = ISC_TRUE; break; \
656 break; \
657 case 36: switch (rdclass) { \
658 case 1: result = fromstruct_in_kx(rdclass, type, source, target); break; \
659 default: use_default = ISC_TRUE; break; \
661 break; \
662 case 37: result = fromstruct_cert(rdclass, type, source, target); break; \
663 case 38: switch (rdclass) { \
664 case 1: result = fromstruct_in_a6(rdclass, type, source, target); break; \
665 default: use_default = ISC_TRUE; break; \
667 break; \
668 case 39: result = fromstruct_dname(rdclass, type, source, target); break; \
669 case 41: result = fromstruct_opt(rdclass, type, source, target); break; \
670 case 42: switch (rdclass) { \
671 case 1: result = fromstruct_in_apl(rdclass, type, source, target); break; \
672 default: use_default = ISC_TRUE; break; \
674 break; \
675 case 43: result = fromstruct_ds(rdclass, type, source, target); break; \
676 case 44: result = fromstruct_sshfp(rdclass, type, source, target); break; \
677 case 46: result = fromstruct_rrsig(rdclass, type, source, target); break; \
678 case 47: result = fromstruct_nsec(rdclass, type, source, target); break; \
679 case 48: result = fromstruct_dnskey(rdclass, type, source, target); break; \
680 case 103: result = fromstruct_unspec(rdclass, type, source, target); break; \
681 case 249: result = fromstruct_tkey(rdclass, type, source, target); break; \
682 case 250: switch (rdclass) { \
683 case 255: result = fromstruct_any_tsig(rdclass, type, source, target); break; \
684 default: use_default = ISC_TRUE; break; \
686 break; \
687 case 32769: result = fromstruct_dlv(rdclass, type, source, target); break; \
688 default: use_default = ISC_TRUE; break; \
691 #define TOSTRUCTSWITCH \
692 switch (rdata->type) { \
693 case 1: switch (rdata->rdclass) { \
694 case 1: result = tostruct_in_a(rdata, target, mctx); break; \
695 case 4: result = tostruct_hs_a(rdata, target, mctx); break; \
696 default: use_default = ISC_TRUE; break; \
698 break; \
699 case 2: result = tostruct_ns(rdata, target, mctx); break; \
700 case 3: result = tostruct_md(rdata, target, mctx); break; \
701 case 4: result = tostruct_mf(rdata, target, mctx); break; \
702 case 5: result = tostruct_cname(rdata, target, mctx); break; \
703 case 6: result = tostruct_soa(rdata, target, mctx); break; \
704 case 7: result = tostruct_mb(rdata, target, mctx); break; \
705 case 8: result = tostruct_mg(rdata, target, mctx); break; \
706 case 9: result = tostruct_mr(rdata, target, mctx); break; \
707 case 10: result = tostruct_null(rdata, target, mctx); break; \
708 case 11: switch (rdata->rdclass) { \
709 case 1: result = tostruct_in_wks(rdata, target, mctx); break; \
710 default: use_default = ISC_TRUE; break; \
712 break; \
713 case 12: result = tostruct_ptr(rdata, target, mctx); break; \
714 case 13: result = tostruct_hinfo(rdata, target, mctx); break; \
715 case 14: result = tostruct_minfo(rdata, target, mctx); break; \
716 case 15: result = tostruct_mx(rdata, target, mctx); break; \
717 case 16: result = tostruct_txt(rdata, target, mctx); break; \
718 case 17: result = tostruct_rp(rdata, target, mctx); break; \
719 case 18: result = tostruct_afsdb(rdata, target, mctx); break; \
720 case 19: result = tostruct_x25(rdata, target, mctx); break; \
721 case 20: result = tostruct_isdn(rdata, target, mctx); break; \
722 case 21: result = tostruct_rt(rdata, target, mctx); break; \
723 case 22: switch (rdata->rdclass) { \
724 case 1: result = tostruct_in_nsap(rdata, target, mctx); break; \
725 default: use_default = ISC_TRUE; break; \
727 break; \
728 case 23: switch (rdata->rdclass) { \
729 case 1: result = tostruct_in_nsap_ptr(rdata, target, mctx); break; \
730 default: use_default = ISC_TRUE; break; \
732 break; \
733 case 24: result = tostruct_sig(rdata, target, mctx); break; \
734 case 25: result = tostruct_key(rdata, target, mctx); break; \
735 case 26: switch (rdata->rdclass) { \
736 case 1: result = tostruct_in_px(rdata, target, mctx); break; \
737 default: use_default = ISC_TRUE; break; \
739 break; \
740 case 27: result = tostruct_gpos(rdata, target, mctx); break; \
741 case 28: switch (rdata->rdclass) { \
742 case 1: result = tostruct_in_aaaa(rdata, target, mctx); break; \
743 default: use_default = ISC_TRUE; break; \
745 break; \
746 case 29: result = tostruct_loc(rdata, target, mctx); break; \
747 case 30: result = tostruct_nxt(rdata, target, mctx); break; \
748 case 33: switch (rdata->rdclass) { \
749 case 1: result = tostruct_in_srv(rdata, target, mctx); break; \
750 default: use_default = ISC_TRUE; break; \
752 break; \
753 case 35: switch (rdata->rdclass) { \
754 case 1: result = tostruct_in_naptr(rdata, target, mctx); break; \
755 default: use_default = ISC_TRUE; break; \
757 break; \
758 case 36: switch (rdata->rdclass) { \
759 case 1: result = tostruct_in_kx(rdata, target, mctx); break; \
760 default: use_default = ISC_TRUE; break; \
762 break; \
763 case 37: result = tostruct_cert(rdata, target, mctx); break; \
764 case 38: switch (rdata->rdclass) { \
765 case 1: result = tostruct_in_a6(rdata, target, mctx); break; \
766 default: use_default = ISC_TRUE; break; \
768 break; \
769 case 39: result = tostruct_dname(rdata, target, mctx); break; \
770 case 41: result = tostruct_opt(rdata, target, mctx); break; \
771 case 42: switch (rdata->rdclass) { \
772 case 1: result = tostruct_in_apl(rdata, target, mctx); break; \
773 default: use_default = ISC_TRUE; break; \
775 break; \
776 case 43: result = tostruct_ds(rdata, target, mctx); break; \
777 case 44: result = tostruct_sshfp(rdata, target, mctx); break; \
778 case 46: result = tostruct_rrsig(rdata, target, mctx); break; \
779 case 47: result = tostruct_nsec(rdata, target, mctx); break; \
780 case 48: result = tostruct_dnskey(rdata, target, mctx); break; \
781 case 103: result = tostruct_unspec(rdata, target, mctx); break; \
782 case 249: result = tostruct_tkey(rdata, target, mctx); break; \
783 case 250: switch (rdata->rdclass) { \
784 case 255: result = tostruct_any_tsig(rdata, target, mctx); break; \
785 default: use_default = ISC_TRUE; break; \
787 break; \
788 case 32769: result = tostruct_dlv(rdata, target, mctx); break; \
789 default: use_default = ISC_TRUE; break; \
792 #define FREESTRUCTSWITCH \
793 switch (common->rdtype) { \
794 case 1: switch (common->rdclass) { \
795 case 1: freestruct_in_a(source); break; \
796 case 4: freestruct_hs_a(source); break; \
797 default: break; \
799 break; \
800 case 2: freestruct_ns(source); break; \
801 case 3: freestruct_md(source); break; \
802 case 4: freestruct_mf(source); break; \
803 case 5: freestruct_cname(source); break; \
804 case 6: freestruct_soa(source); break; \
805 case 7: freestruct_mb(source); break; \
806 case 8: freestruct_mg(source); break; \
807 case 9: freestruct_mr(source); break; \
808 case 10: freestruct_null(source); break; \
809 case 11: switch (common->rdclass) { \
810 case 1: freestruct_in_wks(source); break; \
811 default: break; \
813 break; \
814 case 12: freestruct_ptr(source); break; \
815 case 13: freestruct_hinfo(source); break; \
816 case 14: freestruct_minfo(source); break; \
817 case 15: freestruct_mx(source); break; \
818 case 16: freestruct_txt(source); break; \
819 case 17: freestruct_rp(source); break; \
820 case 18: freestruct_afsdb(source); break; \
821 case 19: freestruct_x25(source); break; \
822 case 20: freestruct_isdn(source); break; \
823 case 21: freestruct_rt(source); break; \
824 case 22: switch (common->rdclass) { \
825 case 1: freestruct_in_nsap(source); break; \
826 default: break; \
828 break; \
829 case 23: switch (common->rdclass) { \
830 case 1: freestruct_in_nsap_ptr(source); break; \
831 default: break; \
833 break; \
834 case 24: freestruct_sig(source); break; \
835 case 25: freestruct_key(source); break; \
836 case 26: switch (common->rdclass) { \
837 case 1: freestruct_in_px(source); break; \
838 default: break; \
840 break; \
841 case 27: freestruct_gpos(source); break; \
842 case 28: switch (common->rdclass) { \
843 case 1: freestruct_in_aaaa(source); break; \
844 default: break; \
846 break; \
847 case 29: freestruct_loc(source); break; \
848 case 30: freestruct_nxt(source); break; \
849 case 33: switch (common->rdclass) { \
850 case 1: freestruct_in_srv(source); break; \
851 default: break; \
853 break; \
854 case 35: switch (common->rdclass) { \
855 case 1: freestruct_in_naptr(source); break; \
856 default: break; \
858 break; \
859 case 36: switch (common->rdclass) { \
860 case 1: freestruct_in_kx(source); break; \
861 default: break; \
863 break; \
864 case 37: freestruct_cert(source); break; \
865 case 38: switch (common->rdclass) { \
866 case 1: freestruct_in_a6(source); break; \
867 default: break; \
869 break; \
870 case 39: freestruct_dname(source); break; \
871 case 41: freestruct_opt(source); break; \
872 case 42: switch (common->rdclass) { \
873 case 1: freestruct_in_apl(source); break; \
874 default: break; \
876 break; \
877 case 43: freestruct_ds(source); break; \
878 case 44: freestruct_sshfp(source); break; \
879 case 46: freestruct_rrsig(source); break; \
880 case 47: freestruct_nsec(source); break; \
881 case 48: freestruct_dnskey(source); break; \
882 case 103: freestruct_unspec(source); break; \
883 case 249: freestruct_tkey(source); break; \
884 case 250: switch (common->rdclass) { \
885 case 255: freestruct_any_tsig(source); break; \
886 default: break; \
888 break; \
889 case 32769: freestruct_dlv(source); break; \
890 default: break; \
893 #define ADDITIONALDATASWITCH \
894 switch (rdata->type) { \
895 case 1: switch (rdata->rdclass) { \
896 case 1: result = additionaldata_in_a(rdata, add, arg); break; \
897 case 4: result = additionaldata_hs_a(rdata, add, arg); break; \
898 default: use_default = ISC_TRUE; break; \
900 break; \
901 case 2: result = additionaldata_ns(rdata, add, arg); break; \
902 case 3: result = additionaldata_md(rdata, add, arg); break; \
903 case 4: result = additionaldata_mf(rdata, add, arg); break; \
904 case 5: result = additionaldata_cname(rdata, add, arg); break; \
905 case 6: result = additionaldata_soa(rdata, add, arg); break; \
906 case 7: result = additionaldata_mb(rdata, add, arg); break; \
907 case 8: result = additionaldata_mg(rdata, add, arg); break; \
908 case 9: result = additionaldata_mr(rdata, add, arg); break; \
909 case 10: result = additionaldata_null(rdata, add, arg); break; \
910 case 11: switch (rdata->rdclass) { \
911 case 1: result = additionaldata_in_wks(rdata, add, arg); break; \
912 default: use_default = ISC_TRUE; break; \
914 break; \
915 case 12: result = additionaldata_ptr(rdata, add, arg); break; \
916 case 13: result = additionaldata_hinfo(rdata, add, arg); break; \
917 case 14: result = additionaldata_minfo(rdata, add, arg); break; \
918 case 15: result = additionaldata_mx(rdata, add, arg); break; \
919 case 16: result = additionaldata_txt(rdata, add, arg); break; \
920 case 17: result = additionaldata_rp(rdata, add, arg); break; \
921 case 18: result = additionaldata_afsdb(rdata, add, arg); break; \
922 case 19: result = additionaldata_x25(rdata, add, arg); break; \
923 case 20: result = additionaldata_isdn(rdata, add, arg); break; \
924 case 21: result = additionaldata_rt(rdata, add, arg); break; \
925 case 22: switch (rdata->rdclass) { \
926 case 1: result = additionaldata_in_nsap(rdata, add, arg); break; \
927 default: use_default = ISC_TRUE; break; \
929 break; \
930 case 23: switch (rdata->rdclass) { \
931 case 1: result = additionaldata_in_nsap_ptr(rdata, add, arg); break; \
932 default: use_default = ISC_TRUE; break; \
934 break; \
935 case 24: result = additionaldata_sig(rdata, add, arg); break; \
936 case 25: result = additionaldata_key(rdata, add, arg); break; \
937 case 26: switch (rdata->rdclass) { \
938 case 1: result = additionaldata_in_px(rdata, add, arg); break; \
939 default: use_default = ISC_TRUE; break; \
941 break; \
942 case 27: result = additionaldata_gpos(rdata, add, arg); break; \
943 case 28: switch (rdata->rdclass) { \
944 case 1: result = additionaldata_in_aaaa(rdata, add, arg); break; \
945 default: use_default = ISC_TRUE; break; \
947 break; \
948 case 29: result = additionaldata_loc(rdata, add, arg); break; \
949 case 30: result = additionaldata_nxt(rdata, add, arg); break; \
950 case 33: switch (rdata->rdclass) { \
951 case 1: result = additionaldata_in_srv(rdata, add, arg); break; \
952 default: use_default = ISC_TRUE; break; \
954 break; \
955 case 35: switch (rdata->rdclass) { \
956 case 1: result = additionaldata_in_naptr(rdata, add, arg); break; \
957 default: use_default = ISC_TRUE; break; \
959 break; \
960 case 36: switch (rdata->rdclass) { \
961 case 1: result = additionaldata_in_kx(rdata, add, arg); break; \
962 default: use_default = ISC_TRUE; break; \
964 break; \
965 case 37: result = additionaldata_cert(rdata, add, arg); break; \
966 case 38: switch (rdata->rdclass) { \
967 case 1: result = additionaldata_in_a6(rdata, add, arg); break; \
968 default: use_default = ISC_TRUE; break; \
970 break; \
971 case 39: result = additionaldata_dname(rdata, add, arg); break; \
972 case 41: result = additionaldata_opt(rdata, add, arg); break; \
973 case 42: switch (rdata->rdclass) { \
974 case 1: result = additionaldata_in_apl(rdata, add, arg); break; \
975 default: use_default = ISC_TRUE; break; \
977 break; \
978 case 43: result = additionaldata_ds(rdata, add, arg); break; \
979 case 44: result = additionaldata_sshfp(rdata, add, arg); break; \
980 case 46: result = additionaldata_rrsig(rdata, add, arg); break; \
981 case 47: result = additionaldata_nsec(rdata, add, arg); break; \
982 case 48: result = additionaldata_dnskey(rdata, add, arg); break; \
983 case 103: result = additionaldata_unspec(rdata, add, arg); break; \
984 case 249: result = additionaldata_tkey(rdata, add, arg); break; \
985 case 250: switch (rdata->rdclass) { \
986 case 255: result = additionaldata_any_tsig(rdata, add, arg); break; \
987 default: use_default = ISC_TRUE; break; \
989 break; \
990 case 32769: result = additionaldata_dlv(rdata, add, arg); break; \
991 default: use_default = ISC_TRUE; break; \
994 #define DIGESTSWITCH \
995 switch (rdata->type) { \
996 case 1: switch (rdata->rdclass) { \
997 case 1: result = digest_in_a(rdata, digest, arg); break; \
998 case 4: result = digest_hs_a(rdata, digest, arg); break; \
999 default: use_default = ISC_TRUE; break; \
1001 break; \
1002 case 2: result = digest_ns(rdata, digest, arg); break; \
1003 case 3: result = digest_md(rdata, digest, arg); break; \
1004 case 4: result = digest_mf(rdata, digest, arg); break; \
1005 case 5: result = digest_cname(rdata, digest, arg); break; \
1006 case 6: result = digest_soa(rdata, digest, arg); break; \
1007 case 7: result = digest_mb(rdata, digest, arg); break; \
1008 case 8: result = digest_mg(rdata, digest, arg); break; \
1009 case 9: result = digest_mr(rdata, digest, arg); break; \
1010 case 10: result = digest_null(rdata, digest, arg); break; \
1011 case 11: switch (rdata->rdclass) { \
1012 case 1: result = digest_in_wks(rdata, digest, arg); break; \
1013 default: use_default = ISC_TRUE; break; \
1015 break; \
1016 case 12: result = digest_ptr(rdata, digest, arg); break; \
1017 case 13: result = digest_hinfo(rdata, digest, arg); break; \
1018 case 14: result = digest_minfo(rdata, digest, arg); break; \
1019 case 15: result = digest_mx(rdata, digest, arg); break; \
1020 case 16: result = digest_txt(rdata, digest, arg); break; \
1021 case 17: result = digest_rp(rdata, digest, arg); break; \
1022 case 18: result = digest_afsdb(rdata, digest, arg); break; \
1023 case 19: result = digest_x25(rdata, digest, arg); break; \
1024 case 20: result = digest_isdn(rdata, digest, arg); break; \
1025 case 21: result = digest_rt(rdata, digest, arg); break; \
1026 case 22: switch (rdata->rdclass) { \
1027 case 1: result = digest_in_nsap(rdata, digest, arg); break; \
1028 default: use_default = ISC_TRUE; break; \
1030 break; \
1031 case 23: switch (rdata->rdclass) { \
1032 case 1: result = digest_in_nsap_ptr(rdata, digest, arg); break; \
1033 default: use_default = ISC_TRUE; break; \
1035 break; \
1036 case 24: result = digest_sig(rdata, digest, arg); break; \
1037 case 25: result = digest_key(rdata, digest, arg); break; \
1038 case 26: switch (rdata->rdclass) { \
1039 case 1: result = digest_in_px(rdata, digest, arg); break; \
1040 default: use_default = ISC_TRUE; break; \
1042 break; \
1043 case 27: result = digest_gpos(rdata, digest, arg); break; \
1044 case 28: switch (rdata->rdclass) { \
1045 case 1: result = digest_in_aaaa(rdata, digest, arg); break; \
1046 default: use_default = ISC_TRUE; break; \
1048 break; \
1049 case 29: result = digest_loc(rdata, digest, arg); break; \
1050 case 30: result = digest_nxt(rdata, digest, arg); break; \
1051 case 33: switch (rdata->rdclass) { \
1052 case 1: result = digest_in_srv(rdata, digest, arg); break; \
1053 default: use_default = ISC_TRUE; break; \
1055 break; \
1056 case 35: switch (rdata->rdclass) { \
1057 case 1: result = digest_in_naptr(rdata, digest, arg); break; \
1058 default: use_default = ISC_TRUE; break; \
1060 break; \
1061 case 36: switch (rdata->rdclass) { \
1062 case 1: result = digest_in_kx(rdata, digest, arg); break; \
1063 default: use_default = ISC_TRUE; break; \
1065 break; \
1066 case 37: result = digest_cert(rdata, digest, arg); break; \
1067 case 38: switch (rdata->rdclass) { \
1068 case 1: result = digest_in_a6(rdata, digest, arg); break; \
1069 default: use_default = ISC_TRUE; break; \
1071 break; \
1072 case 39: result = digest_dname(rdata, digest, arg); break; \
1073 case 41: result = digest_opt(rdata, digest, arg); break; \
1074 case 42: switch (rdata->rdclass) { \
1075 case 1: result = digest_in_apl(rdata, digest, arg); break; \
1076 default: use_default = ISC_TRUE; break; \
1078 break; \
1079 case 43: result = digest_ds(rdata, digest, arg); break; \
1080 case 44: result = digest_sshfp(rdata, digest, arg); break; \
1081 case 46: result = digest_rrsig(rdata, digest, arg); break; \
1082 case 47: result = digest_nsec(rdata, digest, arg); break; \
1083 case 48: result = digest_dnskey(rdata, digest, arg); break; \
1084 case 103: result = digest_unspec(rdata, digest, arg); break; \
1085 case 249: result = digest_tkey(rdata, digest, arg); break; \
1086 case 250: switch (rdata->rdclass) { \
1087 case 255: result = digest_any_tsig(rdata, digest, arg); break; \
1088 default: use_default = ISC_TRUE; break; \
1090 break; \
1091 case 32769: result = digest_dlv(rdata, digest, arg); break; \
1092 default: use_default = ISC_TRUE; break; \
1095 #define CHECKOWNERSWITCH \
1096 switch (type) { \
1097 case 1: switch (rdclass) { \
1098 case 1: result = checkowner_in_a(name, rdclass, type, wildcard); break; \
1099 case 4: result = checkowner_hs_a(name, rdclass, type, wildcard); break; \
1100 default: result = ISC_TRUE; break; \
1102 break; \
1103 case 2: result = checkowner_ns(name, rdclass, type, wildcard); break; \
1104 case 3: result = checkowner_md(name, rdclass, type, wildcard); break; \
1105 case 4: result = checkowner_mf(name, rdclass, type, wildcard); break; \
1106 case 5: result = checkowner_cname(name, rdclass, type, wildcard); break; \
1107 case 6: result = checkowner_soa(name, rdclass, type, wildcard); break; \
1108 case 7: result = checkowner_mb(name, rdclass, type, wildcard); break; \
1109 case 8: result = checkowner_mg(name, rdclass, type, wildcard); break; \
1110 case 9: result = checkowner_mr(name, rdclass, type, wildcard); break; \
1111 case 10: result = checkowner_null(name, rdclass, type, wildcard); break; \
1112 case 11: switch (rdclass) { \
1113 case 1: result = checkowner_in_wks(name, rdclass, type, wildcard); break; \
1114 default: result = ISC_TRUE; break; \
1116 break; \
1117 case 12: result = checkowner_ptr(name, rdclass, type, wildcard); break; \
1118 case 13: result = checkowner_hinfo(name, rdclass, type, wildcard); break; \
1119 case 14: result = checkowner_minfo(name, rdclass, type, wildcard); break; \
1120 case 15: result = checkowner_mx(name, rdclass, type, wildcard); break; \
1121 case 16: result = checkowner_txt(name, rdclass, type, wildcard); break; \
1122 case 17: result = checkowner_rp(name, rdclass, type, wildcard); break; \
1123 case 18: result = checkowner_afsdb(name, rdclass, type, wildcard); break; \
1124 case 19: result = checkowner_x25(name, rdclass, type, wildcard); break; \
1125 case 20: result = checkowner_isdn(name, rdclass, type, wildcard); break; \
1126 case 21: result = checkowner_rt(name, rdclass, type, wildcard); break; \
1127 case 22: switch (rdclass) { \
1128 case 1: result = checkowner_in_nsap(name, rdclass, type, wildcard); break; \
1129 default: result = ISC_TRUE; break; \
1131 break; \
1132 case 23: switch (rdclass) { \
1133 case 1: result = checkowner_in_nsap_ptr(name, rdclass, type, wildcard); break; \
1134 default: result = ISC_TRUE; break; \
1136 break; \
1137 case 24: result = checkowner_sig(name, rdclass, type, wildcard); break; \
1138 case 25: result = checkowner_key(name, rdclass, type, wildcard); break; \
1139 case 26: switch (rdclass) { \
1140 case 1: result = checkowner_in_px(name, rdclass, type, wildcard); break; \
1141 default: result = ISC_TRUE; break; \
1143 break; \
1144 case 27: result = checkowner_gpos(name, rdclass, type, wildcard); break; \
1145 case 28: switch (rdclass) { \
1146 case 1: result = checkowner_in_aaaa(name, rdclass, type, wildcard); break; \
1147 default: result = ISC_TRUE; break; \
1149 break; \
1150 case 29: result = checkowner_loc(name, rdclass, type, wildcard); break; \
1151 case 30: result = checkowner_nxt(name, rdclass, type, wildcard); break; \
1152 case 33: switch (rdclass) { \
1153 case 1: result = checkowner_in_srv(name, rdclass, type, wildcard); break; \
1154 default: result = ISC_TRUE; break; \
1156 break; \
1157 case 35: switch (rdclass) { \
1158 case 1: result = checkowner_in_naptr(name, rdclass, type, wildcard); break; \
1159 default: result = ISC_TRUE; break; \
1161 break; \
1162 case 36: switch (rdclass) { \
1163 case 1: result = checkowner_in_kx(name, rdclass, type, wildcard); break; \
1164 default: result = ISC_TRUE; break; \
1166 break; \
1167 case 37: result = checkowner_cert(name, rdclass, type, wildcard); break; \
1168 case 38: switch (rdclass) { \
1169 case 1: result = checkowner_in_a6(name, rdclass, type, wildcard); break; \
1170 default: result = ISC_TRUE; break; \
1172 break; \
1173 case 39: result = checkowner_dname(name, rdclass, type, wildcard); break; \
1174 case 41: result = checkowner_opt(name, rdclass, type, wildcard); break; \
1175 case 42: switch (rdclass) { \
1176 case 1: result = checkowner_in_apl(name, rdclass, type, wildcard); break; \
1177 default: result = ISC_TRUE; break; \
1179 break; \
1180 case 43: result = checkowner_ds(name, rdclass, type, wildcard); break; \
1181 case 44: result = checkowner_sshfp(name, rdclass, type, wildcard); break; \
1182 case 46: result = checkowner_rrsig(name, rdclass, type, wildcard); break; \
1183 case 47: result = checkowner_nsec(name, rdclass, type, wildcard); break; \
1184 case 48: result = checkowner_dnskey(name, rdclass, type, wildcard); break; \
1185 case 103: result = checkowner_unspec(name, rdclass, type, wildcard); break; \
1186 case 249: result = checkowner_tkey(name, rdclass, type, wildcard); break; \
1187 case 250: switch (rdclass) { \
1188 case 255: result = checkowner_any_tsig(name, rdclass, type, wildcard); break; \
1189 default: result = ISC_TRUE; break; \
1191 break; \
1192 case 32769: result = checkowner_dlv(name, rdclass, type, wildcard); break; \
1193 default: result = ISC_TRUE; break; \
1196 #define CHECKNAMESSWITCH \
1197 switch (rdata->type) { \
1198 case 1: switch (rdata->rdclass) { \
1199 case 1: result = checknames_in_a(rdata, owner, bad); break; \
1200 case 4: result = checknames_hs_a(rdata, owner, bad); break; \
1201 default: result = ISC_TRUE; break; \
1203 break; \
1204 case 2: result = checknames_ns(rdata, owner, bad); break; \
1205 case 3: result = checknames_md(rdata, owner, bad); break; \
1206 case 4: result = checknames_mf(rdata, owner, bad); break; \
1207 case 5: result = checknames_cname(rdata, owner, bad); break; \
1208 case 6: result = checknames_soa(rdata, owner, bad); break; \
1209 case 7: result = checknames_mb(rdata, owner, bad); break; \
1210 case 8: result = checknames_mg(rdata, owner, bad); break; \
1211 case 9: result = checknames_mr(rdata, owner, bad); break; \
1212 case 10: result = checknames_null(rdata, owner, bad); break; \
1213 case 11: switch (rdata->rdclass) { \
1214 case 1: result = checknames_in_wks(rdata, owner, bad); break; \
1215 default: result = ISC_TRUE; break; \
1217 break; \
1218 case 12: result = checknames_ptr(rdata, owner, bad); break; \
1219 case 13: result = checknames_hinfo(rdata, owner, bad); break; \
1220 case 14: result = checknames_minfo(rdata, owner, bad); break; \
1221 case 15: result = checknames_mx(rdata, owner, bad); break; \
1222 case 16: result = checknames_txt(rdata, owner, bad); break; \
1223 case 17: result = checknames_rp(rdata, owner, bad); break; \
1224 case 18: result = checknames_afsdb(rdata, owner, bad); break; \
1225 case 19: result = checknames_x25(rdata, owner, bad); break; \
1226 case 20: result = checknames_isdn(rdata, owner, bad); break; \
1227 case 21: result = checknames_rt(rdata, owner, bad); break; \
1228 case 22: switch (rdata->rdclass) { \
1229 case 1: result = checknames_in_nsap(rdata, owner, bad); break; \
1230 default: result = ISC_TRUE; break; \
1232 break; \
1233 case 23: switch (rdata->rdclass) { \
1234 case 1: result = checknames_in_nsap_ptr(rdata, owner, bad); break; \
1235 default: result = ISC_TRUE; break; \
1237 break; \
1238 case 24: result = checknames_sig(rdata, owner, bad); break; \
1239 case 25: result = checknames_key(rdata, owner, bad); break; \
1240 case 26: switch (rdata->rdclass) { \
1241 case 1: result = checknames_in_px(rdata, owner, bad); break; \
1242 default: result = ISC_TRUE; break; \
1244 break; \
1245 case 27: result = checknames_gpos(rdata, owner, bad); break; \
1246 case 28: switch (rdata->rdclass) { \
1247 case 1: result = checknames_in_aaaa(rdata, owner, bad); break; \
1248 default: result = ISC_TRUE; break; \
1250 break; \
1251 case 29: result = checknames_loc(rdata, owner, bad); break; \
1252 case 30: result = checknames_nxt(rdata, owner, bad); break; \
1253 case 33: switch (rdata->rdclass) { \
1254 case 1: result = checknames_in_srv(rdata, owner, bad); break; \
1255 default: result = ISC_TRUE; break; \
1257 break; \
1258 case 35: switch (rdata->rdclass) { \
1259 case 1: result = checknames_in_naptr(rdata, owner, bad); break; \
1260 default: result = ISC_TRUE; break; \
1262 break; \
1263 case 36: switch (rdata->rdclass) { \
1264 case 1: result = checknames_in_kx(rdata, owner, bad); break; \
1265 default: result = ISC_TRUE; break; \
1267 break; \
1268 case 37: result = checknames_cert(rdata, owner, bad); break; \
1269 case 38: switch (rdata->rdclass) { \
1270 case 1: result = checknames_in_a6(rdata, owner, bad); break; \
1271 default: result = ISC_TRUE; break; \
1273 break; \
1274 case 39: result = checknames_dname(rdata, owner, bad); break; \
1275 case 41: result = checknames_opt(rdata, owner, bad); break; \
1276 case 42: switch (rdata->rdclass) { \
1277 case 1: result = checknames_in_apl(rdata, owner, bad); break; \
1278 default: result = ISC_TRUE; break; \
1280 break; \
1281 case 43: result = checknames_ds(rdata, owner, bad); break; \
1282 case 44: result = checknames_sshfp(rdata, owner, bad); break; \
1283 case 46: result = checknames_rrsig(rdata, owner, bad); break; \
1284 case 47: result = checknames_nsec(rdata, owner, bad); break; \
1285 case 48: result = checknames_dnskey(rdata, owner, bad); break; \
1286 case 103: result = checknames_unspec(rdata, owner, bad); break; \
1287 case 249: result = checknames_tkey(rdata, owner, bad); break; \
1288 case 250: switch (rdata->rdclass) { \
1289 case 255: result = checknames_any_tsig(rdata, owner, bad); break; \
1290 default: result = ISC_TRUE; break; \
1292 break; \
1293 case 32769: result = checknames_dlv(rdata, owner, bad); break; \
1294 default: result = ISC_TRUE; break; \
1296 #define RDATATYPE_COMPARE(_s, _d, _tn, _n, _tp) \
1297 do { \
1298 if (sizeof(_s) - 1 == _n && \
1299 strncasecmp(_s,(_tn),(sizeof(_s) - 1)) == 0) { \
1300 if ((dns_rdatatype_attributes(_d) & DNS_RDATATYPEATTR_RESERVED) != 0) \
1301 return (ISC_R_NOTIMPLEMENTED); \
1302 *(_tp) = _d; \
1303 return (ISC_R_SUCCESS); \
1305 } while (0)
1307 #define RDATATYPE_FROMTEXT_SW(_hash,_typename,_length,_typep) \
1308 switch (_hash) { \
1309 case 16: \
1310 RDATATYPE_COMPARE("reserved0", 0, _typename, _length, _typep); \
1311 break; \
1312 case 34: \
1313 RDATATYPE_COMPARE("a", 1, _typename, _length, _typep); \
1314 break; \
1315 case 80: \
1316 RDATATYPE_COMPARE("ns", 2, _typename, _length, _typep); \
1317 break; \
1318 case 92: \
1319 RDATATYPE_COMPARE("md", 3, _typename, _length, _typep); \
1320 break; \
1321 case 58: \
1322 RDATATYPE_COMPARE("mf", 4, _typename, _length, _typep); \
1323 break; \
1324 case 8: \
1325 RDATATYPE_COMPARE("cname", 5, _typename, _length, _typep); \
1326 RDATATYPE_COMPARE("mx", 15, _typename, _length, _typep); \
1327 break; \
1328 case 182: \
1329 RDATATYPE_COMPARE("soa", 6, _typename, _length, _typep); \
1330 break; \
1331 case 126: \
1332 RDATATYPE_COMPARE("mb", 7, _typename, _length, _typep); \
1333 break; \
1334 case 169: \
1335 RDATATYPE_COMPARE("mg", 8, _typename, _length, _typep); \
1336 break; \
1337 case 110: \
1338 RDATATYPE_COMPARE("mr", 9, _typename, _length, _typep); \
1339 RDATATYPE_COMPARE("minfo", 14, _typename, _length, _typep); \
1340 break; \
1341 case 24: \
1342 RDATATYPE_COMPARE("null", 10, _typename, _length, _typep); \
1343 RDATATYPE_COMPARE("kx", 36, _typename, _length, _typep); \
1344 break; \
1345 case 206: \
1346 RDATATYPE_COMPARE("wks", 11, _typename, _length, _typep); \
1347 break; \
1348 case 54: \
1349 RDATATYPE_COMPARE("ptr", 12, _typename, _length, _typep); \
1350 RDATATYPE_COMPARE("naptr", 35, _typename, _length, _typep); \
1351 break; \
1352 case 67: \
1353 RDATATYPE_COMPARE("hinfo", 13, _typename, _length, _typep); \
1354 break; \
1355 case 236: \
1356 RDATATYPE_COMPARE("txt", 16, _typename, _length, _typep); \
1357 break; \
1358 case 192: \
1359 RDATATYPE_COMPARE("rp", 17, _typename, _length, _typep); \
1360 break; \
1361 case 12: \
1362 RDATATYPE_COMPARE("afsdb", 18, _typename, _length, _typep); \
1363 break; \
1364 case 119: \
1365 RDATATYPE_COMPARE("x25", 19, _typename, _length, _typep); \
1366 break; \
1367 case 214: \
1368 RDATATYPE_COMPARE("isdn", 20, _typename, _length, _typep); \
1369 break; \
1370 case 144: \
1371 RDATATYPE_COMPARE("rt", 21, _typename, _length, _typep); \
1372 break; \
1373 case 224: \
1374 RDATATYPE_COMPARE("nsap", 22, _typename, _length, _typep); \
1375 RDATATYPE_COMPARE("uid", 101, _typename, _length, _typep); \
1376 break; \
1377 case 140: \
1378 RDATATYPE_COMPARE("nsap-ptr", 23, _typename, _length, _typep); \
1379 break; \
1380 case 122: \
1381 RDATATYPE_COMPARE("sig", 24, _typename, _length, _typep); \
1382 RDATATYPE_COMPARE("dlv", 32769, _typename, _length, _typep); \
1383 break; \
1384 case 254: \
1385 RDATATYPE_COMPARE("key", 25, _typename, _length, _typep); \
1386 break; \
1387 case 112: \
1388 RDATATYPE_COMPARE("px", 26, _typename, _length, _typep); \
1389 break; \
1390 case 17: \
1391 RDATATYPE_COMPARE("gpos", 27, _typename, _length, _typep); \
1392 break; \
1393 case 69: \
1394 RDATATYPE_COMPARE("aaaa", 28, _typename, _length, _typep); \
1395 RDATATYPE_COMPARE("atma", 34, _typename, _length, _typep); \
1396 break; \
1397 case 237: \
1398 RDATATYPE_COMPARE("loc", 29, _typename, _length, _typep); \
1399 break; \
1400 case 52: \
1401 RDATATYPE_COMPARE("nxt", 30, _typename, _length, _typep); \
1402 break; \
1403 case 160: \
1404 RDATATYPE_COMPARE("eid", 31, _typename, _length, _typep); \
1405 break; \
1406 case 220: \
1407 RDATATYPE_COMPARE("nimloc", 32, _typename, _length, _typep); \
1408 break; \
1409 case 100: \
1410 RDATATYPE_COMPARE("srv", 33, _typename, _length, _typep); \
1411 break; \
1412 case 172: \
1413 RDATATYPE_COMPARE("cert", 37, _typename, _length, _typep); \
1414 break; \
1415 case 226: \
1416 RDATATYPE_COMPARE("a6", 38, _typename, _length, _typep); \
1417 break; \
1418 case 109: \
1419 RDATATYPE_COMPARE("dname", 39, _typename, _length, _typep); \
1420 break; \
1421 case 168: \
1422 RDATATYPE_COMPARE("opt", 41, _typename, _length, _typep); \
1423 break; \
1424 case 48: \
1425 RDATATYPE_COMPARE("apl", 42, _typename, _length, _typep); \
1426 break; \
1427 case 210: \
1428 RDATATYPE_COMPARE("ds", 43, _typename, _length, _typep); \
1429 break; \
1430 case 128: \
1431 RDATATYPE_COMPARE("sshfp", 44, _typename, _length, _typep); \
1432 break; \
1433 case 225: \
1434 RDATATYPE_COMPARE("rrsig", 46, _typename, _length, _typep); \
1435 break; \
1436 case 22: \
1437 RDATATYPE_COMPARE("nsec", 47, _typename, _length, _typep); \
1438 break; \
1439 case 26: \
1440 RDATATYPE_COMPARE("dnskey", 48, _typename, _length, _typep); \
1441 break; \
1442 case 230: \
1443 RDATATYPE_COMPARE("uinfo", 100, _typename, _length, _typep); \
1444 break; \
1445 case 104: \
1446 RDATATYPE_COMPARE("gid", 102, _typename, _length, _typep); \
1447 break; \
1448 case 145: \
1449 RDATATYPE_COMPARE("unspec", 103, _typename, _length, _typep); \
1450 break; \
1451 case 184: \
1452 RDATATYPE_COMPARE("tkey", 249, _typename, _length, _typep); \
1453 break; \
1454 case 72: \
1455 RDATATYPE_COMPARE("tsig", 250, _typename, _length, _typep); \
1456 break; \
1457 case 138: \
1458 RDATATYPE_COMPARE("ixfr", 251, _typename, _length, _typep); \
1459 break; \
1460 case 250: \
1461 RDATATYPE_COMPARE("axfr", 252, _typename, _length, _typep); \
1462 break; \
1463 case 164: \
1464 RDATATYPE_COMPARE("mailb", 253, _typename, _length, _typep); \
1465 break; \
1466 case 50: \
1467 RDATATYPE_COMPARE("maila", 254, _typename, _length, _typep); \
1468 break; \
1469 case 68: \
1470 RDATATYPE_COMPARE("any", 255, _typename, _length, _typep); \
1471 break; \
1473 #define RDATATYPE_ATTRIBUTE_SW \
1474 switch (type) { \
1475 case 0: return (DNS_RDATATYPEATTR_RESERVED); \
1476 case 1: return (RRTYPE_A_ATTRIBUTES); \
1477 case 2: return (RRTYPE_NS_ATTRIBUTES); \
1478 case 3: return (RRTYPE_MD_ATTRIBUTES); \
1479 case 4: return (RRTYPE_MF_ATTRIBUTES); \
1480 case 5: return (RRTYPE_CNAME_ATTRIBUTES); \
1481 case 6: return (RRTYPE_SOA_ATTRIBUTES); \
1482 case 7: return (RRTYPE_MB_ATTRIBUTES); \
1483 case 8: return (RRTYPE_MG_ATTRIBUTES); \
1484 case 9: return (RRTYPE_MR_ATTRIBUTES); \
1485 case 10: return (RRTYPE_NULL_ATTRIBUTES); \
1486 case 11: return (RRTYPE_WKS_ATTRIBUTES); \
1487 case 12: return (RRTYPE_PTR_ATTRIBUTES); \
1488 case 13: return (RRTYPE_HINFO_ATTRIBUTES); \
1489 case 14: return (RRTYPE_MINFO_ATTRIBUTES); \
1490 case 15: return (RRTYPE_MX_ATTRIBUTES); \
1491 case 16: return (RRTYPE_TXT_ATTRIBUTES); \
1492 case 17: return (RRTYPE_RP_ATTRIBUTES); \
1493 case 18: return (RRTYPE_AFSDB_ATTRIBUTES); \
1494 case 19: return (RRTYPE_X25_ATTRIBUTES); \
1495 case 20: return (RRTYPE_ISDN_ATTRIBUTES); \
1496 case 21: return (RRTYPE_RT_ATTRIBUTES); \
1497 case 22: return (RRTYPE_NSAP_ATTRIBUTES); \
1498 case 23: return (RRTYPE_NSAP_PTR_ATTRIBUTES); \
1499 case 24: return (RRTYPE_SIG_ATTRIBUTES); \
1500 case 25: return (RRTYPE_KEY_ATTRIBUTES); \
1501 case 26: return (RRTYPE_PX_ATTRIBUTES); \
1502 case 27: return (RRTYPE_GPOS_ATTRIBUTES); \
1503 case 28: return (RRTYPE_AAAA_ATTRIBUTES); \
1504 case 29: return (RRTYPE_LOC_ATTRIBUTES); \
1505 case 30: return (RRTYPE_NXT_ATTRIBUTES); \
1506 case 31: return (DNS_RDATATYPEATTR_RESERVED); \
1507 case 32: return (DNS_RDATATYPEATTR_RESERVED); \
1508 case 33: return (RRTYPE_SRV_ATTRIBUTES); \
1509 case 34: return (DNS_RDATATYPEATTR_RESERVED); \
1510 case 35: return (RRTYPE_NAPTR_ATTRIBUTES); \
1511 case 36: return (RRTYPE_KX_ATTRIBUTES); \
1512 case 37: return (RRTYPE_CERT_ATTRIBUTES); \
1513 case 38: return (RRTYPE_A6_ATTRIBUTES); \
1514 case 39: return (RRTYPE_DNAME_ATTRIBUTES); \
1515 case 41: return (RRTYPE_OPT_ATTRIBUTES); \
1516 case 42: return (RRTYPE_APL_ATTRIBUTES); \
1517 case 43: return (RRTYPE_DS_ATTRIBUTES); \
1518 case 44: return (RRTYPE_SSHFP_ATTRIBUTES); \
1519 case 46: return (RRTYPE_RRSIG_ATTRIBUTES); \
1520 case 47: return (RRTYPE_NSEC_ATTRIBUTES); \
1521 case 48: return (RRTYPE_DNSKEY_ATTRIBUTES); \
1522 case 100: return (DNS_RDATATYPEATTR_RESERVED); \
1523 case 101: return (DNS_RDATATYPEATTR_RESERVED); \
1524 case 102: return (DNS_RDATATYPEATTR_RESERVED); \
1525 case 103: return (RRTYPE_UNSPEC_ATTRIBUTES); \
1526 case 249: return (RRTYPE_TKEY_ATTRIBUTES); \
1527 case 250: return (RRTYPE_TSIG_ATTRIBUTES); \
1528 case 251: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
1529 case 252: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
1530 case 253: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
1531 case 254: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
1532 case 255: return (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_QUESTIONONLY); \
1533 case 32769: return (RRTYPE_DLV_ATTRIBUTES); \
1535 #define RDATATYPE_TOTEXT_SW \
1536 switch (type) { \
1537 case 0: return (str_totext("RESERVED0", target)); \
1538 case 1: return (str_totext("A", target)); \
1539 case 2: return (str_totext("NS", target)); \
1540 case 3: return (str_totext("MD", target)); \
1541 case 4: return (str_totext("MF", target)); \
1542 case 5: return (str_totext("CNAME", target)); \
1543 case 6: return (str_totext("SOA", target)); \
1544 case 7: return (str_totext("MB", target)); \
1545 case 8: return (str_totext("MG", target)); \
1546 case 9: return (str_totext("MR", target)); \
1547 case 10: return (str_totext("NULL", target)); \
1548 case 11: return (str_totext("WKS", target)); \
1549 case 12: return (str_totext("PTR", target)); \
1550 case 13: return (str_totext("HINFO", target)); \
1551 case 14: return (str_totext("MINFO", target)); \
1552 case 15: return (str_totext("MX", target)); \
1553 case 16: return (str_totext("TXT", target)); \
1554 case 17: return (str_totext("RP", target)); \
1555 case 18: return (str_totext("AFSDB", target)); \
1556 case 19: return (str_totext("X25", target)); \
1557 case 20: return (str_totext("ISDN", target)); \
1558 case 21: return (str_totext("RT", target)); \
1559 case 22: return (str_totext("NSAP", target)); \
1560 case 23: return (str_totext("NSAP-PTR", target)); \
1561 case 24: return (str_totext("SIG", target)); \
1562 case 25: return (str_totext("KEY", target)); \
1563 case 26: return (str_totext("PX", target)); \
1564 case 27: return (str_totext("GPOS", target)); \
1565 case 28: return (str_totext("AAAA", target)); \
1566 case 29: return (str_totext("LOC", target)); \
1567 case 30: return (str_totext("NXT", target)); \
1568 case 31: return (str_totext("EID", target)); \
1569 case 32: return (str_totext("NIMLOC", target)); \
1570 case 33: return (str_totext("SRV", target)); \
1571 case 34: return (str_totext("ATMA", target)); \
1572 case 35: return (str_totext("NAPTR", target)); \
1573 case 36: return (str_totext("KX", target)); \
1574 case 37: return (str_totext("CERT", target)); \
1575 case 38: return (str_totext("A6", target)); \
1576 case 39: return (str_totext("DNAME", target)); \
1577 case 41: return (str_totext("OPT", target)); \
1578 case 42: return (str_totext("APL", target)); \
1579 case 43: return (str_totext("DS", target)); \
1580 case 44: return (str_totext("SSHFP", target)); \
1581 case 46: return (str_totext("RRSIG", target)); \
1582 case 47: return (str_totext("NSEC", target)); \
1583 case 48: return (str_totext("DNSKEY", target)); \
1584 case 100: return (str_totext("UINFO", target)); \
1585 case 101: return (str_totext("UID", target)); \
1586 case 102: return (str_totext("GID", target)); \
1587 case 103: return (str_totext("UNSPEC", target)); \
1588 case 249: return (str_totext("TKEY", target)); \
1589 case 250: return (str_totext("TSIG", target)); \
1590 case 251: return (str_totext("IXFR", target)); \
1591 case 252: return (str_totext("AXFR", target)); \
1592 case 253: return (str_totext("MAILB", target)); \
1593 case 254: return (str_totext("MAILA", target)); \
1594 case 255: return (str_totext("ANY", target)); \
1595 case 32769: return (str_totext("DLV", target)); \
1597 #endif /* DNS_CODE_H */