]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - contrib/bind9/lib/dns/include/dns/rdata.h
Upgrade to 9.6-ESV-R7-P3:
[FreeBSD/stable/8.git] / contrib / bind9 / lib / dns / include / dns / rdata.h
1 /*
2  * Copyright (C) 2004-2009, 2012  Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (C) 1998-2003  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and/or 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.
8  *
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.
16  */
17
18 /* $Id$ */
19
20 #ifndef DNS_RDATA_H
21 #define DNS_RDATA_H 1
22
23 /*****
24  ***** Module Info
25  *****/
26
27 /*! \file dns/rdata.h
28  * \brief
29  * Provides facilities for manipulating DNS rdata, including conversions to
30  * and from wire format and text format.
31  *
32  * Given the large amount of rdata possible in a nameserver, it was important
33  * to come up with a very efficient way of storing rdata, but at the same
34  * time allow it to be manipulated.
35  *
36  * The decision was to store rdata in uncompressed wire format,
37  * and not to make it a fully abstracted object; i.e. certain parts of the
38  * server know rdata is stored that way.  This saves a lot of memory, and
39  * makes adding rdata to messages easy.  Having much of the server know
40  * the representation would be perilous, and we certainly don't want each
41  * user of rdata to be manipulating such a low-level structure.  This is
42  * where the rdata module comes in.  The module allows rdata handles to be
43  * created and attached to uncompressed wire format regions.  All rdata
44  * operations and conversions are done through these handles.
45  *
46  * Implementation Notes:
47  *
48  *\li   The routines in this module are expected to be synthesized by the
49  *      build process from a set of source files, one per rdata type.  For
50  *      portability, it's probably best that the building be done by a C
51  *      program.  Adding a new rdata type will be a simple matter of adding
52  *      a file to a directory and rebuilding the server.  *All* knowledge of
53  *      the format of a particular rdata type is in this file.
54  *
55  * MP:
56  *\li   Clients of this module must impose any required synchronization.
57  *
58  * Reliability:
59  *\li   This module deals with low-level byte streams.  Errors in any of
60  *      the functions are likely to crash the server or corrupt memory.
61  *
62  *\li   Rdata is typed, and the caller must know what type of rdata it has.
63  *      A caller that gets this wrong could crash the server.
64  *
65  *\li   The fromstruct() and tostruct() routines use a void * pointer to
66  *      represent the structure.  The caller must ensure that it passes a
67  *      pointer to the appropriate type, or the server could crash or memory
68  *      could be corrupted.
69  *
70  * Resources:
71  *\li   None.
72  *
73  * Security:
74  *
75  *\li   *** WARNING ***
76  *      dns_rdata_fromwire() deals with raw network data.  An error in
77  *      this routine could result in the failure or hijacking of the server.
78  *
79  * Standards:
80  *\li   RFC1035
81  *\li   Draft EDNS0 (0)
82  *\li   Draft EDNS1 (0)
83  *\li   Draft Binary Labels (2)
84  *\li   Draft Local Compression (1)
85  *\li   Various RFCs for particular types; these will be documented in the
86  *       sources files of the types.
87  *
88  */
89
90 /***
91  *** Imports
92  ***/
93
94 #include <isc/lang.h>
95
96 #include <dns/types.h>
97 #include <dns/name.h>
98
99 ISC_LANG_BEGINDECLS
100
101
102 /***
103  *** Types
104  ***/
105
106 /*%
107  ***** An 'rdata' is a handle to a binary region.  The handle has an RR
108  ***** class and type, and the data in the binary region is in the format
109  ***** of the given class and type.
110  *****/
111 /*%
112  * Clients are strongly discouraged from using this type directly, with
113  * the exception of the 'link' field which may be used directly for whatever
114  * purpose the client desires.
115  */
116 struct dns_rdata {
117         unsigned char *                 data;
118         unsigned int                    length;
119         dns_rdataclass_t                rdclass;
120         dns_rdatatype_t                 type;
121         unsigned int                    flags;
122         ISC_LINK(dns_rdata_t)           link;
123 };
124
125 #define DNS_RDATA_INIT { NULL, 0, 0, 0, 0, {(void*)(-1), (void *)(-1)}}
126
127 #define DNS_RDATA_UPDATE        0x0001          /*%< update pseudo record. */
128 #define DNS_RDATA_OFFLINE       0x0002          /*%< RRSIG has a offline key. */
129
130 /*
131  * The maximum length of a RDATA that can be sent on the wire.
132  * Max packet size (65535) less header (12), less name (1), type (2),
133  * class (2), ttl(4), length (2).
134  *
135  * None of the defined types that support name compression can exceed
136  * this and all new types are to be sent uncompressed.
137  */
138
139 #define DNS_RDATA_MAXLENGTH     65512U
140
141 /*
142  * Flags affecting rdata formatting style.  Flags 0xFFFF0000
143  * are used by masterfile-level formatting and defined elsewhere.
144  * See additional comments at dns_rdata_tofmttext().
145  */
146
147 /*% Split the rdata into multiple lines to try to keep it
148  within the "width". */
149 #define DNS_STYLEFLAG_MULTILINE         0x00000001U
150
151 /*% Output explanatory comments. */
152 #define DNS_STYLEFLAG_COMMENT           0x00000002U
153
154 #define DNS_RDATA_DOWNCASE              DNS_NAME_DOWNCASE
155 #define DNS_RDATA_CHECKNAMES            DNS_NAME_CHECKNAMES
156 #define DNS_RDATA_CHECKNAMESFAIL        DNS_NAME_CHECKNAMESFAIL
157 #define DNS_RDATA_CHECKREVERSE          DNS_NAME_CHECKREVERSE
158 #define DNS_RDATA_CHECKMX               DNS_NAME_CHECKMX
159 #define DNS_RDATA_CHECKMXFAIL           DNS_NAME_CHECKMXFAIL
160
161 /***
162  *** Initialization
163  ***/
164
165 void
166 dns_rdata_init(dns_rdata_t *rdata);
167 /*%<
168  * Make 'rdata' empty.
169  *
170  * Requires:
171  *      'rdata' is a valid rdata (i.e. not NULL, points to a struct dns_rdata)
172  */
173
174 void
175 dns_rdata_reset(dns_rdata_t *rdata);
176 /*%<
177  * Make 'rdata' empty.
178  *
179  * Requires:
180  *\li   'rdata' is a previously initialized rdata and is not linked.
181  */
182
183 void
184 dns_rdata_clone(const dns_rdata_t *src, dns_rdata_t *target);
185 /*%<
186  * Clone 'target' from 'src'.
187  *
188  * Requires:
189  *\li   'src' to be initialized.
190  *\li   'target' to be initialized.
191  */
192
193 /***
194  *** Comparisons
195  ***/
196
197 int
198 dns_rdata_compare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2);
199 /*%<
200  * Determine the relative ordering under the DNSSEC order relation of
201  * 'rdata1' and 'rdata2'.
202  *
203  * Requires:
204  *
205  *\li   'rdata1' is a valid, non-empty rdata
206  *
207  *\li   'rdata2' is a valid, non-empty rdata
208  *
209  * Returns:
210  *\li   < 0             'rdata1' is less than 'rdata2'
211  *\li   0               'rdata1' is equal to 'rdata2'
212  *\li   > 0             'rdata1' is greater than 'rdata2'
213  */
214
215 /***
216  *** Conversions
217  ***/
218
219 void
220 dns_rdata_fromregion(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
221                      dns_rdatatype_t type, isc_region_t *r);
222 /*%<
223  * Make 'rdata' refer to region 'r'.
224  *
225  * Requires:
226  *
227  *\li   The data in 'r' is properly formatted for whatever type it is.
228  */
229
230 void
231 dns_rdata_toregion(const dns_rdata_t *rdata, isc_region_t *r);
232 /*%<
233  * Make 'r' refer to 'rdata'.
234  */
235
236 isc_result_t
237 dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
238                    dns_rdatatype_t type, isc_buffer_t *source,
239                    dns_decompress_t *dctx, unsigned int options,
240                    isc_buffer_t *target);
241 /*%<
242  * Copy the possibly-compressed rdata at source into the target region.
243  *
244  * Notes:
245  *\li   Name decompression policy is controlled by 'dctx'.
246  *
247  *      'options'
248  *\li   DNS_RDATA_DOWNCASE      downcase domain names when they are copied
249  *                              into target.
250  *
251  * Requires:
252  *
253  *\li   'rdclass' and 'type' are valid.
254  *
255  *\li   'source' is a valid buffer, and the active region of 'source'
256  *      references the rdata to be processed.
257  *
258  *\li   'target' is a valid buffer.
259  *
260  *\li   'dctx' is a valid decompression context.
261  *
262  * Ensures,
263  *      if result is success:
264  *      \li     If 'rdata' is not NULL, it is attached to the target.
265  *      \li     The conditions dns_name_fromwire() ensures for names hold
266  *              for all names in the rdata.
267  *      \li     The current location in source is advanced, and the used space
268  *              in target is updated.
269  *
270  * Result:
271  *\li   Success
272  *\li   Any non-success status from dns_name_fromwire()
273  *\li   Various 'Bad Form' class failures depending on class and type
274  *\li   Bad Form: Input too short
275  *\li   Resource Limit: Not enough space
276  */
277
278 isc_result_t
279 dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
280                  isc_buffer_t *target);
281 /*%<
282  * Convert 'rdata' into wire format, compressing it as specified by the
283  * compression context 'cctx', and storing the result in 'target'.
284  *
285  * Notes:
286  *\li   If the compression context allows global compression, then the
287  *      global compression table may be updated.
288  *
289  * Requires:
290  *\li   'rdata' is a valid, non-empty rdata
291  *
292  *\li   target is a valid buffer
293  *
294  *\li   Any offsets specified in a global compression table are valid
295  *      for target.
296  *
297  * Ensures,
298  *      if the result is success:
299  *      \li     The used space in target is updated.
300  *
301  * Returns:
302  *\li   Success
303  *\li   Any non-success status from dns_name_towire()
304  *\li   Resource Limit: Not enough space
305  */
306
307 isc_result_t
308 dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
309                    dns_rdatatype_t type, isc_lex_t *lexer, dns_name_t *origin,
310                    unsigned int options, isc_mem_t *mctx,
311                    isc_buffer_t *target, dns_rdatacallbacks_t *callbacks);
312 /*%<
313  * Convert the textual representation of a DNS rdata into uncompressed wire
314  * form stored in the target region.  Tokens constituting the text of the rdata
315  * are taken from 'lexer'.
316  *
317  * Notes:
318  *\li   Relative domain names in the rdata will have 'origin' appended to them.
319  *      A NULL origin implies "origin == dns_rootname".
320  *
321  *
322  *      'options'
323  *\li   DNS_RDATA_DOWNCASE      downcase domain names when they are copied
324  *                              into target.
325  *\li   DNS_RDATA_CHECKNAMES    perform checknames checks.
326  *\li   DNS_RDATA_CHECKNAMESFAIL fail if the checknames check fail.  If
327  *                              not set a warning will be issued.
328  *\li   DNS_RDATA_CHECKREVERSE  this should set if the owner name ends
329  *                              in IP6.ARPA, IP6.INT or IN-ADDR.ARPA.
330  *
331  * Requires:
332  *
333  *\li   'rdclass' and 'type' are valid.
334  *
335  *\li   'lexer' is a valid isc_lex_t.
336  *
337  *\li   'mctx' is a valid isc_mem_t.
338  *
339  *\li   'target' is a valid region.
340  *
341  *\li   'origin' if non NULL it must be absolute.
342  *
343  *\li   'callbacks' to be NULL or callbacks->warn and callbacks->error be
344  *      initialized.
345  *
346  * Ensures,
347  *      if result is success:
348  *\li           If 'rdata' is not NULL, it is attached to the target.
349
350  *\li           The conditions dns_name_fromtext() ensures for names hold
351  *              for all names in the rdata.
352
353  *\li           The used space in target is updated.
354  *
355  * Result:
356  *\li   Success
357  *\li   Translated result codes from isc_lex_gettoken
358  *\li   Various 'Bad Form' class failures depending on class and type
359  *\li   Bad Form: Input too short
360  *\li   Resource Limit: Not enough space
361  *\li   Resource Limit: Not enough memory
362  */
363
364 isc_result_t
365 dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target);
366 /*%<
367  * Convert 'rdata' into text format, storing the result in 'target'.
368  * The text will consist of a single line, with fields separated by
369  * single spaces.
370  *
371  * Notes:
372  *\li   If 'origin' is not NULL, then any names in the rdata that are
373  *      subdomains of 'origin' will be made relative it.
374  *
375  *\li   XXX Do we *really* want to support 'origin'?  I'm inclined towards "no"
376  *      at the moment.
377  *
378  * Requires:
379  *
380  *\li   'rdata' is a valid, non-empty rdata
381  *
382  *\li   'origin' is NULL, or is a valid name
383  *
384  *\li   'target' is a valid text buffer
385  *
386  * Ensures,
387  *      if the result is success:
388  *
389  *      \li     The used space in target is updated.
390  *
391  * Returns:
392  *\li   Success
393  *\li   Any non-success status from dns_name_totext()
394  *\li   Resource Limit: Not enough space
395  */
396
397 isc_result_t
398 dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags,
399                     unsigned int width, const char *linebreak,
400                     isc_buffer_t *target);
401 /*%<
402  * Like dns_rdata_totext, but do formatted output suitable for
403  * database dumps.  This is intended for use by dns_db_dump();
404  * library users are discouraged from calling it directly.
405  *
406  * If (flags & #DNS_STYLEFLAG_MULTILINE) != 0, attempt to stay
407  * within 'width' by breaking the text into multiple lines.
408  * The string 'linebreak' is inserted between lines, and parentheses
409  * are added when necessary.  Because RRs contain unbreakable elements
410  * such as domain names whose length is variable, unpredictable, and
411  * potentially large, there is no guarantee that the lines will
412  * not exceed 'width' anyway.
413  *
414  * If (flags & #DNS_STYLEFLAG_MULTILINE) == 0, the rdata is always
415  * printed as a single line, and no parentheses are used.
416  * The 'width' and 'linebreak' arguments are ignored.
417  *
418  * If (flags & #DNS_STYLEFLAG_COMMENT) != 0, output explanatory
419  * comments next to things like the SOA timer fields.  Some
420  * comments (e.g., the SOA ones) are only printed when multiline
421  * output is selected.
422  */
423
424 isc_result_t
425 dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
426                      dns_rdatatype_t type, void *source, isc_buffer_t *target);
427 /*%<
428  * Convert the C structure representation of an rdata into uncompressed wire
429  * format in 'target'.
430  *
431  * XXX  Should we have a 'size' parameter as a sanity check on target?
432  *
433  * Requires:
434  *
435  *\li   'rdclass' and 'type' are valid.
436  *
437  *\li   'source' points to a valid C struct for the class and type.
438  *
439  *\li   'target' is a valid buffer.
440  *
441  *\li   All structure pointers to memory blocks should be NULL if their
442  *      corresponding length values are zero.
443  *
444  * Ensures,
445  *      if result is success:
446  *      \li     If 'rdata' is not NULL, it is attached to the target.
447  *
448  *      \li     The used space in 'target' is updated.
449  *
450  * Result:
451  *\li   Success
452  *\li   Various 'Bad Form' class failures depending on class and type
453  *\li   Resource Limit: Not enough space
454  */
455
456 isc_result_t
457 dns_rdata_tostruct(dns_rdata_t *rdata, void *target, isc_mem_t *mctx);
458 /*%<
459  * Convert an rdata into its C structure representation.
460  *
461  * If 'mctx' is NULL then 'rdata' must persist while 'target' is being used.
462  *
463  * If 'mctx' is non NULL then memory will be allocated if required.
464  *
465  * Requires:
466  *
467  *\li   'rdata' is a valid, non-empty rdata.
468  *
469  *\li   'target' to point to a valid pointer for the type and class.
470  *
471  * Result:
472  *\li   Success
473  *\li   Resource Limit: Not enough memory
474  */
475
476 void
477 dns_rdata_freestruct(void *source);
478 /*%<
479  * Free dynamic memory attached to 'source' (if any).
480  *
481  * Requires:
482  *
483  *\li   'source' to point to the structure previously filled in by
484  *      dns_rdata_tostruct().
485  */
486
487 isc_boolean_t
488 dns_rdatatype_ismeta(dns_rdatatype_t type);
489 /*%<
490  * Return true iff the rdata type 'type' is a meta-type
491  * like ANY or AXFR.
492  */
493
494 isc_boolean_t
495 dns_rdatatype_issingleton(dns_rdatatype_t type);
496 /*%<
497  * Return true iff the rdata type 'type' is a singleton type,
498  * like CNAME or SOA.
499  *
500  * Requires:
501  * \li  'type' is a valid rdata type.
502  *
503  */
504
505 isc_boolean_t
506 dns_rdataclass_ismeta(dns_rdataclass_t rdclass);
507 /*%<
508  * Return true iff the rdata class 'rdclass' is a meta-class
509  * like ANY or NONE.
510  */
511
512 isc_boolean_t
513 dns_rdatatype_isdnssec(dns_rdatatype_t type);
514 /*%<
515  * Return true iff 'type' is one of the DNSSEC
516  * rdata types that may exist alongside a CNAME record.
517  *
518  * Requires:
519  * \li  'type' is a valid rdata type.
520  */
521
522 isc_boolean_t
523 dns_rdatatype_iszonecutauth(dns_rdatatype_t type);
524 /*%<
525  * Return true iff rdata of type 'type' is considered authoritative
526  * data (not glue) in the NSEC chain when it occurs in the parent zone
527  * at a zone cut.
528  *
529  * Requires:
530  * \li  'type' is a valid rdata type.
531  *
532  */
533
534 isc_boolean_t
535 dns_rdatatype_isknown(dns_rdatatype_t type);
536 /*%<
537  * Return true iff the rdata type 'type' is known.
538  *
539  * Requires:
540  * \li  'type' is a valid rdata type.
541  *
542  */
543
544
545 isc_result_t
546 dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add,
547                          void *arg);
548 /*%<
549  * Call 'add' for each name and type from 'rdata' which is subject to
550  * additional section processing.
551  *
552  * Requires:
553  *
554  *\li   'rdata' is a valid, non-empty rdata.
555  *
556  *\li   'add' is a valid dns_additionalfunc_t.
557  *
558  * Ensures:
559  *
560  *\li   If successful, then add() will have been called for each name
561  *      and type subject to additional section processing.
562  *
563  *\li   If add() returns something other than #ISC_R_SUCCESS, that result
564  *      will be returned as the result of dns_rdata_additionaldata().
565  *
566  * Returns:
567  *
568  *\li   ISC_R_SUCCESS
569  *
570  *\li   Many other results are possible if not successful.
571  */
572
573 isc_result_t
574 dns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg);
575 /*%<
576  * Send 'rdata' in DNSSEC canonical form to 'digest'.
577  *
578  * Note:
579  *\li   'digest' may be called more than once by dns_rdata_digest().  The
580  *      concatenation of all the regions, in the order they were given
581  *      to 'digest', will be the DNSSEC canonical form of 'rdata'.
582  *
583  * Requires:
584  *
585  *\li   'rdata' is a valid, non-empty rdata.
586  *
587  *\li   'digest' is a valid dns_digestfunc_t.
588  *
589  * Ensures:
590  *
591  *\li   If successful, then all of the rdata's data has been sent, in
592  *      DNSSEC canonical form, to 'digest'.
593  *
594  *\li   If digest() returns something other than ISC_R_SUCCESS, that result
595  *      will be returned as the result of dns_rdata_digest().
596  *
597  * Returns:
598  *
599  *\li   ISC_R_SUCCESS
600  *
601  *\li   Many other results are possible if not successful.
602  */
603
604 isc_boolean_t
605 dns_rdatatype_questiononly(dns_rdatatype_t type);
606 /*%<
607  * Return true iff rdata of type 'type' can only appear in the question
608  * section of a properly formatted message.
609  *
610  * Requires:
611  * \li  'type' is a valid rdata type.
612  *
613  */
614
615 isc_boolean_t
616 dns_rdatatype_notquestion(dns_rdatatype_t type);
617 /*%<
618  * Return true iff rdata of type 'type' can not appear in the question
619  * section of a properly formatted message.
620  *
621  * Requires:
622  * \li  'type' is a valid rdata type.
623  *
624  */
625
626 isc_boolean_t
627 dns_rdatatype_atparent(dns_rdatatype_t type);
628 /*%<
629  * Return true iff rdata of type 'type' should appear at the parent of
630  * a zone cut.
631  *
632  * Requires:
633  * \li  'type' is a valid rdata type.
634  *
635  */
636
637 unsigned int
638 dns_rdatatype_attributes(dns_rdatatype_t rdtype);
639 /*%<
640  * Return attributes for the given type.
641  *
642  * Requires:
643  *\li   'rdtype' are known.
644  *
645  * Returns:
646  *\li   a bitmask consisting of the following flags.
647  */
648
649 /*% only one may exist for a name */
650 #define DNS_RDATATYPEATTR_SINGLETON             0x00000001U
651 /*% requires no other data be present */
652 #define DNS_RDATATYPEATTR_EXCLUSIVE             0x00000002U
653 /*% Is a meta type */
654 #define DNS_RDATATYPEATTR_META                  0x00000004U
655 /*% Is a DNSSEC type, like RRSIG or NSEC */
656 #define DNS_RDATATYPEATTR_DNSSEC                0x00000008U
657 /*% Is a zone cut authority type */
658 #define DNS_RDATATYPEATTR_ZONECUTAUTH           0x00000010U
659 /*% Is reserved (unusable) */
660 #define DNS_RDATATYPEATTR_RESERVED              0x00000020U
661 /*% Is an unknown type */
662 #define DNS_RDATATYPEATTR_UNKNOWN               0x00000040U
663 /*% Is META, and can only be in a question section */
664 #define DNS_RDATATYPEATTR_QUESTIONONLY          0x00000080U
665 /*% is META, and can NOT be in a question section */
666 #define DNS_RDATATYPEATTR_NOTQUESTION           0x00000100U
667 /*% Is present at zone cuts in the parent, not the child */
668 #define DNS_RDATATYPEATTR_ATPARENT              0x00000200U
669
670 dns_rdatatype_t
671 dns_rdata_covers(dns_rdata_t *rdata);
672 /*%<
673  * Return the rdatatype that this type covers.
674  *
675  * Requires:
676  *\li   'rdata' is a valid, non-empty rdata.
677  *
678  *\li   'rdata' is a type that covers other rdata types.
679  *
680  * Returns:
681  *\li   The type covered.
682  */
683
684 isc_boolean_t
685 dns_rdata_checkowner(dns_name_t* name, dns_rdataclass_t rdclass,
686                      dns_rdatatype_t type, isc_boolean_t wildcard);
687 /*
688  * Returns whether this is a valid ownername for this <type,class>.
689  * If wildcard is true allow the first label to be a wildcard if
690  * appropriate.
691  *
692  * Requires:
693  *      'name' is a valid name.
694  */
695
696 isc_boolean_t
697 dns_rdata_checknames(dns_rdata_t *rdata, dns_name_t *owner, dns_name_t *bad);
698 /*
699  * Returns whether 'rdata' contains valid domain names.  The checks are
700  * sensitive to the owner name.
701  *
702  * If 'bad' is non-NULL and a domain name fails the check the
703  * the offending name will be return in 'bad' by cloning from
704  * the 'rdata' contents.
705  *
706  * Requires:
707  *      'rdata' to be valid.
708  *      'owner' to be valid.
709  *      'bad'   to be NULL or valid.
710  */
711
712 ISC_LANG_ENDDECLS
713
714 #endif /* DNS_RDATA_H */