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#include <dns/message.h> 99 100ISC_LANG_BEGINDECLS 101 102 103/*** 104 *** Types 105 ***/ 106 107/*% 108 ***** An 'rdata' is a handle to a binary region. The handle has an RR 109 ***** class and type, and the data in the binary region is in the format 110 ***** of the given class and type. 111 *****/ 112/*% 113 * Clients are strongly discouraged from using this type directly, with 114 * the exception of the 'link' field which may be used directly for whatever 115 * purpose the client desires. 116 */ 117struct dns_rdata { 118 unsigned char * data; 119 unsigned int length; 120 dns_rdataclass_t rdclass; 121 dns_rdatatype_t type; 122 unsigned int flags; 123 ISC_LINK(dns_rdata_t) link; 124}; 125 126#define DNS_RDATA_INIT { NULL, 0, 0, 0, 0, {(void*)(-1), (void *)(-1)}} 127 128#define DNS_RDATA_CHECKINITIALIZED 129#ifdef DNS_RDATA_CHECKINITIALIZED 130#define DNS_RDATA_INITIALIZED(rdata) \ 131 ((rdata)->data == NULL && (rdata)->length == 0 && \ 132 (rdata)->rdclass == 0 && (rdata)->type == 0 && (rdata)->flags == 0 && \ 133 !ISC_LINK_LINKED((rdata), link)) 134#else 135#ifdef ISC_LIST_CHECKINIT 136#define DNS_RDATA_INITIALIZED(rdata) \ 137 (!ISC_LINK_LINKED((rdata), link)) 138#else 139#define DNS_RDATA_INITIALIZED(rdata) ISC_TRUE 140#endif 141#endif 142 143#define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record. */ 144#define DNS_RDATA_OFFLINE 0x0002 /*%< RRSIG has a offline key. */ 145 146#define DNS_RDATA_VALIDFLAGS(rdata) \ 147 (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) 148 149/* 150 * Flags affecting rdata formatting style. Flags 0xFFFF0000 151 * are used by masterfile-level formatting and defined elsewhere. 152 * See additional comments at dns_rdata_tofmttext(). 153 */ 154 155/*% Split the rdata into multiple lines to try to keep it 156 within the "width". */ 157#define DNS_STYLEFLAG_MULTILINE 0x00000001U 158 159/*% Output explanatory comments. */ 160#define DNS_STYLEFLAG_COMMENT 0x00000002U 161 162#define DNS_RDATA_DOWNCASE DNS_NAME_DOWNCASE 163#define DNS_RDATA_CHECKNAMES DNS_NAME_CHECKNAMES 164#define DNS_RDATA_CHECKNAMESFAIL DNS_NAME_CHECKNAMESFAIL 165#define DNS_RDATA_CHECKREVERSE DNS_NAME_CHECKREVERSE 166#define DNS_RDATA_CHECKMX DNS_NAME_CHECKMX 167#define DNS_RDATA_CHECKMXFAIL DNS_NAME_CHECKMXFAIL 168 169/*** 170 *** Initialization 171 ***/ 172 173void 174dns_rdata_init(dns_rdata_t *rdata); 175/*%< 176 * Make 'rdata' empty. 177 * 178 * Requires: 179 * 'rdata' is a valid rdata (i.e. not NULL, points to a struct dns_rdata) 180 */ 181 182void 183dns_rdata_reset(dns_rdata_t *rdata); 184/*%< 185 * Make 'rdata' empty. 186 * 187 * Requires: 188 *\li 'rdata' is a previously initialized rdata and is not linked. 189 */ 190 191void 192dns_rdata_clone(const dns_rdata_t *src, dns_rdata_t *target); 193/*%< 194 * Clone 'target' from 'src'. 195 * 196 * Requires: 197 *\li 'src' to be initialized. 198 *\li 'target' to be initialized. 199 */ 200 201/*** 202 *** Comparisons 203 ***/ 204 205int 206dns_rdata_compare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2); 207/*%< 208 * Determine the relative ordering under the DNSSEC order relation of 209 * 'rdata1' and 'rdata2'. 210 * 211 * Requires: 212 * 213 *\li 'rdata1' is a valid, non-empty rdata 214 * 215 *\li 'rdata2' is a valid, non-empty rdata 216 * 217 * Returns: 218 *\li < 0 'rdata1' is less than 'rdata2' 219 *\li 0 'rdata1' is equal to 'rdata2' 220 *\li > 0 'rdata1' is greater than 'rdata2' 221 */ 222 223int 224dns_rdata_casecompare(const dns_rdata_t *rdata1, const dns_rdata_t *rdata2); 225/*%< 226 * dns_rdata_casecompare() is similar to dns_rdata_compare() but also 227 * compares domain names case insensitively in known rdata types that 228 * are treated as opaque data by dns_rdata_compare(). 229 * 230 * Requires: 231 * 232 *\li 'rdata1' is a valid, non-empty rdata 233 * 234 *\li 'rdata2' is a valid, non-empty rdata 235 * 236 * Returns: 237 *\li < 0 'rdata1' is less than 'rdata2' 238 *\li 0 'rdata1' is equal to 'rdata2' 239 *\li > 0 'rdata1' is greater than 'rdata2' 240 */ 241 242/*** 243 *** Conversions 244 ***/ 245 246void 247dns_rdata_fromregion(dns_rdata_t *rdata, dns_rdataclass_t rdclass, 248 dns_rdatatype_t type, isc_region_t *r); 249/*%< 250 * Make 'rdata' refer to region 'r'. 251 * 252 * Requires: 253 * 254 *\li The data in 'r' is properly formatted for whatever type it is. 255 */ 256 257void 258dns_rdata_toregion(const dns_rdata_t *rdata, isc_region_t *r); 259/*%< 260 * Make 'r' refer to 'rdata'. 261 */ 262 263isc_result_t 264dns_rdata_fromwire(dns_rdata_t *rdata, dns_rdataclass_t rdclass, 265 dns_rdatatype_t type, isc_buffer_t *source, 266 dns_decompress_t *dctx, unsigned int options, 267 isc_buffer_t *target); 268/*%< 269 * Copy the possibly-compressed rdata at source into the target region. 270 * 271 * Notes: 272 *\li Name decompression policy is controlled by 'dctx'. 273 * 274 * 'options' 275 *\li DNS_RDATA_DOWNCASE downcase domain names when they are copied 276 * into target. 277 * 278 * Requires: 279 * 280 *\li 'rdclass' and 'type' are valid. 281 * 282 *\li 'source' is a valid buffer, and the active region of 'source' 283 * references the rdata to be processed. 284 * 285 *\li 'target' is a valid buffer. 286 * 287 *\li 'dctx' is a valid decompression context. 288 * 289 * Ensures, 290 * if result is success: 291 * \li If 'rdata' is not NULL, it is attached to the target. 292 * \li The conditions dns_name_fromwire() ensures for names hold 293 * for all names in the rdata. 294 * \li The current location in source is advanced, and the used space 295 * in target is updated. 296 * 297 * Result: 298 *\li Success 299 *\li Any non-success status from dns_name_fromwire() 300 *\li Various 'Bad Form' class failures depending on class and type 301 *\li Bad Form: Input too short 302 *\li Resource Limit: Not enough space 303 */ 304 305isc_result_t 306dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx, 307 isc_buffer_t *target); 308/*%< 309 * Convert 'rdata' into wire format, compressing it as specified by the 310 * compression context 'cctx', and storing the result in 'target'. 311 * 312 * Notes: 313 *\li If the compression context allows global compression, then the 314 * global compression table may be updated. 315 * 316 * Requires: 317 *\li 'rdata' is a valid, non-empty rdata 318 * 319 *\li target is a valid buffer 320 * 321 *\li Any offsets specified in a global compression table are valid 322 * for target. 323 * 324 * Ensures, 325 * if the result is success: 326 * \li The used space in target is updated. 327 * 328 * Returns: 329 *\li Success 330 *\li Any non-success status from dns_name_towire() 331 *\li Resource Limit: Not enough space 332 */ 333 334isc_result_t 335dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t rdclass, 336 dns_rdatatype_t type, isc_lex_t *lexer, dns_name_t *origin, 337 unsigned int options, isc_mem_t *mctx, 338 isc_buffer_t *target, dns_rdatacallbacks_t *callbacks); 339/*%< 340 * Convert the textual representation of a DNS rdata into uncompressed wire 341 * form stored in the target region. Tokens constituting the text of the rdata 342 * are taken from 'lexer'. 343 * 344 * Notes: 345 *\li Relative domain names in the rdata will have 'origin' appended to them. 346 * A NULL origin implies "origin == dns_rootname". 347 * 348 * 349 * 'options' 350 *\li DNS_RDATA_DOWNCASE downcase domain names when they are copied 351 * into target. 352 *\li DNS_RDATA_CHECKNAMES perform checknames checks. 353 *\li DNS_RDATA_CHECKNAMESFAIL fail if the checknames check fail. If 354 * not set a warning will be issued. 355 *\li DNS_RDATA_CHECKREVERSE this should set if the owner name ends 356 * in IP6.ARPA, IP6.INT or IN-ADDR.ARPA. 357 * 358 * Requires: 359 * 360 *\li 'rdclass' and 'type' are valid. 361 * 362 *\li 'lexer' is a valid isc_lex_t. 363 * 364 *\li 'mctx' is a valid isc_mem_t. 365 * 366 *\li 'target' is a valid region. 367 * 368 *\li 'origin' if non NULL it must be absolute. 369 * 370 *\li 'callbacks' to be NULL or callbacks->warn and callbacks->error be 371 * initialized. 372 * 373 * Ensures, 374 * if result is success: 375 *\li If 'rdata' is not NULL, it is attached to the target. 376 377 *\li The conditions dns_name_fromtext() ensures for names hold 378 * for all names in the rdata. 379 380 *\li The used space in target is updated. 381 * 382 * Result: 383 *\li Success 384 *\li Translated result codes from isc_lex_gettoken 385 *\li Various 'Bad Form' class failures depending on class and type 386 *\li Bad Form: Input too short 387 *\li Resource Limit: Not enough space 388 *\li Resource Limit: Not enough memory 389 */ 390 391isc_result_t 392dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target); 393/*%< 394 * Convert 'rdata' into text format, storing the result in 'target'. 395 * The text will consist of a single line, with fields separated by 396 * single spaces. 397 * 398 * Notes: 399 *\li If 'origin' is not NULL, then any names in the rdata that are 400 * subdomains of 'origin' will be made relative it. 401 * 402 *\li XXX Do we *really* want to support 'origin'? I'm inclined towards "no" 403 * at the moment. 404 * 405 * Requires: 406 * 407 *\li 'rdata' is a valid, non-empty rdata 408 * 409 *\li 'origin' is NULL, or is a valid name 410 * 411 *\li 'target' is a valid text buffer 412 * 413 * Ensures, 414 * if the result is success: 415 * 416 * \li The used space in target is updated. 417 * 418 * Returns: 419 *\li Success 420 *\li Any non-success status from dns_name_totext() 421 *\li Resource Limit: Not enough space 422 */ 423 424isc_result_t 425dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin, unsigned int flags, 426 unsigned int width, const char *linebreak, 427 isc_buffer_t *target); 428/*%< 429 * Like dns_rdata_totext, but do formatted output suitable for 430 * database dumps. This is intended for use by dns_db_dump(); 431 * library users are discouraged from calling it directly. 432 * 433 * If (flags & #DNS_STYLEFLAG_MULTILINE) != 0, attempt to stay 434 * within 'width' by breaking the text into multiple lines. 435 * The string 'linebreak' is inserted between lines, and parentheses 436 * are added when necessary. Because RRs contain unbreakable elements 437 * such as domain names whose length is variable, unpredictable, and 438 * potentially large, there is no guarantee that the lines will 439 * not exceed 'width' anyway. 440 * 441 * If (flags & #DNS_STYLEFLAG_MULTILINE) == 0, the rdata is always 442 * printed as a single line, and no parentheses are used. 443 * The 'width' and 'linebreak' arguments are ignored. 444 * 445 * If (flags & #DNS_STYLEFLAG_COMMENT) != 0, output explanatory 446 * comments next to things like the SOA timer fields. Some 447 * comments (e.g., the SOA ones) are only printed when multiline 448 * output is selected. 449 */ 450 451isc_result_t 452dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t rdclass, 453 dns_rdatatype_t type, void *source, isc_buffer_t *target); 454/*%< 455 * Convert the C structure representation of an rdata into uncompressed wire 456 * format in 'target'. 457 * 458 * XXX Should we have a 'size' parameter as a sanity check on target? 459 * 460 * Requires: 461 * 462 *\li 'rdclass' and 'type' are valid. 463 * 464 *\li 'source' points to a valid C struct for the class and type. 465 * 466 *\li 'target' is a valid buffer. 467 * 468 *\li All structure pointers to memory blocks should be NULL if their 469 * corresponding length values are zero. 470 * 471 * Ensures, 472 * if result is success: 473 * \li If 'rdata' is not NULL, it is attached to the target. 474 * 475 * \li The used space in 'target' is updated. 476 * 477 * Result: 478 *\li Success 479 *\li Various 'Bad Form' class failures depending on class and type 480 *\li Resource Limit: Not enough space 481 */ 482 483isc_result_t 484dns_rdata_tostruct(dns_rdata_t *rdata, void *target, isc_mem_t *mctx); 485/*%< 486 * Convert an rdata into its C structure representation. 487 * 488 * If 'mctx' is NULL then 'rdata' must persist while 'target' is being used. 489 * 490 * If 'mctx' is non NULL then memory will be allocated if required. 491 * 492 * Requires: 493 * 494 *\li 'rdata' is a valid, non-empty rdata. 495 * 496 *\li 'target' to point to a valid pointer for the type and class. 497 * 498 * Result: 499 *\li Success 500 *\li Resource Limit: Not enough memory 501 */ 502 503void 504dns_rdata_freestruct(void *source); 505/*%< 506 * Free dynamic memory attached to 'source' (if any). 507 * 508 * Requires: 509 * 510 *\li 'source' to point to the structure previously filled in by 511 * dns_rdata_tostruct(). 512 */ 513 514isc_boolean_t 515dns_rdatatype_ismeta(dns_rdatatype_t type); 516/*%< 517 * Return true iff the rdata type 'type' is a meta-type 518 * like ANY or AXFR. 519 */ 520 521isc_boolean_t 522dns_rdatatype_issingleton(dns_rdatatype_t type); 523/*%< 524 * Return true iff the rdata type 'type' is a singleton type, 525 * like CNAME or SOA. 526 * 527 * Requires: 528 * \li 'type' is a valid rdata type. 529 * 530 */ 531 532isc_boolean_t 533dns_rdataclass_ismeta(dns_rdataclass_t rdclass); 534/*%< 535 * Return true iff the rdata class 'rdclass' is a meta-class 536 * like ANY or NONE. 537 */ 538 539isc_boolean_t 540dns_rdatatype_isdnssec(dns_rdatatype_t type); 541/*%< 542 * Return true iff 'type' is one of the DNSSEC 543 * rdata types that may exist alongside a CNAME record. 544 * 545 * Requires: 546 * \li 'type' is a valid rdata type. 547 */ 548 549isc_boolean_t 550dns_rdatatype_iszonecutauth(dns_rdatatype_t type); 551/*%< 552 * Return true iff rdata of type 'type' is considered authoritative 553 * data (not glue) in the NSEC chain when it occurs in the parent zone 554 * at a zone cut. 555 * 556 * Requires: 557 * \li 'type' is a valid rdata type. 558 * 559 */ 560 561isc_boolean_t 562dns_rdatatype_isknown(dns_rdatatype_t type); 563/*%< 564 * Return true iff the rdata type 'type' is known. 565 * 566 * Requires: 567 * \li 'type' is a valid rdata type. 568 * 569 */ 570 571 572isc_result_t 573dns_rdata_additionaldata(dns_rdata_t *rdata, dns_additionaldatafunc_t add, 574 void *arg); 575/*%< 576 * Call 'add' for each name and type from 'rdata' which is subject to 577 * additional section processing. 578 * 579 * Requires: 580 * 581 *\li 'rdata' is a valid, non-empty rdata. 582 * 583 *\li 'add' is a valid dns_additionalfunc_t. 584 * 585 * Ensures: 586 * 587 *\li If successful, then add() will have been called for each name 588 * and type subject to additional section processing. 589 * 590 *\li If add() returns something other than #ISC_R_SUCCESS, that result 591 * will be returned as the result of dns_rdata_additionaldata(). 592 * 593 * Returns: 594 * 595 *\li ISC_R_SUCCESS 596 * 597 *\li Many other results are possible if not successful. 598 */ 599 600isc_result_t 601dns_rdata_digest(dns_rdata_t *rdata, dns_digestfunc_t digest, void *arg); 602/*%< 603 * Send 'rdata' in DNSSEC canonical form to 'digest'. 604 * 605 * Note: 606 *\li 'digest' may be called more than once by dns_rdata_digest(). The 607 * concatenation of all the regions, in the order they were given 608 * to 'digest', will be the DNSSEC canonical form of 'rdata'. 609 * 610 * Requires: 611 * 612 *\li 'rdata' is a valid, non-empty rdata. 613 * 614 *\li 'digest' is a valid dns_digestfunc_t. 615 * 616 * Ensures: 617 * 618 *\li If successful, then all of the rdata's data has been sent, in 619 * DNSSEC canonical form, to 'digest'. 620 * 621 *\li If digest() returns something other than ISC_R_SUCCESS, that result 622 * will be returned as the result of dns_rdata_digest(). 623 * 624 * Returns: 625 * 626 *\li ISC_R_SUCCESS 627 * 628 *\li Many other results are possible if not successful. 629 */ 630 631isc_boolean_t 632dns_rdatatype_questiononly(dns_rdatatype_t type); 633/*%< 634 * Return true iff rdata of type 'type' can only appear in the question 635 * section of a properly formatted message. 636 * 637 * Requires: 638 * \li 'type' is a valid rdata type. 639 * 640 */ 641 642isc_boolean_t 643dns_rdatatype_notquestion(dns_rdatatype_t type); 644/*%< 645 * Return true iff rdata of type 'type' can not appear in the question 646 * section of a properly formatted message. 647 * 648 * Requires: 649 * \li 'type' is a valid rdata type. 650 * 651 */ 652 653isc_boolean_t 654dns_rdatatype_atparent(dns_rdatatype_t type); 655/*%< 656 * Return true iff rdata of type 'type' should appear at the parent of 657 * a zone cut. 658 * 659 * Requires: 660 * \li 'type' is a valid rdata type. 661 * 662 */ 663 664unsigned int 665dns_rdatatype_attributes(dns_rdatatype_t rdtype); 666/*%< 667 * Return attributes for the given type. 668 * 669 * Requires: 670 *\li 'rdtype' are known. 671 * 672 * Returns: 673 *\li a bitmask consisting of the following flags. 674 */ 675 676/*% only one may exist for a name */ 677#define DNS_RDATATYPEATTR_SINGLETON 0x00000001U 678/*% requires no other data be present */ 679#define DNS_RDATATYPEATTR_EXCLUSIVE 0x00000002U 680/*% Is a meta type */ 681#define DNS_RDATATYPEATTR_META 0x00000004U 682/*% Is a DNSSEC type, like RRSIG or NSEC */ 683#define DNS_RDATATYPEATTR_DNSSEC 0x00000008U 684/*% Is a zone cut authority type */ 685#define DNS_RDATATYPEATTR_ZONECUTAUTH 0x00000010U 686/*% Is reserved (unusable) */ 687#define DNS_RDATATYPEATTR_RESERVED 0x00000020U 688/*% Is an unknown type */ 689#define DNS_RDATATYPEATTR_UNKNOWN 0x00000040U 690/*% Is META, and can only be in a question section */ 691#define DNS_RDATATYPEATTR_QUESTIONONLY 0x00000080U 692/*% is META, and can NOT be in a question section */ 693#define DNS_RDATATYPEATTR_NOTQUESTION 0x00000100U 694/*% Is present at zone cuts in the parent, not the child */ 695#define DNS_RDATATYPEATTR_ATPARENT 0x00000200U 696 697dns_rdatatype_t 698dns_rdata_covers(dns_rdata_t *rdata); 699/*%< 700 * Return the rdatatype that this type covers. 701 * 702 * Requires: 703 *\li 'rdata' is a valid, non-empty rdata. 704 * 705 *\li 'rdata' is a type that covers other rdata types. 706 * 707 * Returns: 708 *\li The type covered. 709 */ 710 711isc_boolean_t 712dns_rdata_checkowner(dns_name_t* name, dns_rdataclass_t rdclass, 713 dns_rdatatype_t type, isc_boolean_t wildcard); 714/* 715 * Returns whether this is a valid ownername for this <type,class>. 716 * If wildcard is true allow the first label to be a wildcard if 717 * appropriate. 718 * 719 * Requires: 720 * 'name' is a valid name. 721 */ 722 723isc_boolean_t 724dns_rdata_checknames(dns_rdata_t *rdata, dns_name_t *owner, dns_name_t *bad); 725/* 726 * Returns whether 'rdata' contains valid domain names. The checks are 727 * sensitive to the owner name. 728 * 729 * If 'bad' is non-NULL and a domain name fails the check the 730 * the offending name will be return in 'bad' by cloning from 731 * the 'rdata' contents. 732 * 733 * Requires: 734 * 'rdata' to be valid. 735 * 'owner' to be valid. 736 * 'bad' to be NULL or valid. 737 */ 738 739void 740dns_rdata_exists(dns_rdata_t *rdata, dns_rdatatype_t type); 741 742void 743dns_rdata_notexist(dns_rdata_t *rdata, dns_rdatatype_t type); 744 745void 746dns_rdata_deleterrset(dns_rdata_t *rdata, dns_rdatatype_t type); 747 748void 749dns_rdata_makedelete(dns_rdata_t *rdata); 750 751const char * 752dns_rdata_updateop(dns_rdata_t *rdata, dns_section_t section); 753 754ISC_LANG_ENDDECLS 755 756#endif /* DNS_RDATA_H */ 757