1/*
2 * Copyright (C) 2004-2012  Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-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_RDATASET_H
21#define DNS_RDATASET_H 1
22
23/*****
24 ***** Module Info
25 *****/
26
27/*! \file dns/rdataset.h
28 * \brief
29 * A DNS rdataset is a handle that can be associated with a collection of
30 * rdata all having a common owner name, class, and type.
31 *
32 * The dns_rdataset_t type is like a "virtual class".  To actually use
33 * rdatasets, an implementation of the method suite (e.g. "slabbed rdata") is
34 * required.
35 *
36 * XXX <more> XXX
37 *
38 * MP:
39 *\li	Clients of this module must impose any required synchronization.
40 *
41 * Reliability:
42 *\li	No anticipated impact.
43 *
44 * Resources:
45 *\li	TBS
46 *
47 * Security:
48 *\li	No anticipated impact.
49 *
50 * Standards:
51 *\li	None.
52 */
53
54#include <isc/lang.h>
55#include <isc/magic.h>
56#include <isc/stdtime.h>
57
58#include <dns/types.h>
59
60ISC_LANG_BEGINDECLS
61
62typedef enum {
63	dns_rdatasetadditional_fromauth,
64	dns_rdatasetadditional_fromcache,
65	dns_rdatasetadditional_fromglue
66} dns_rdatasetadditional_t;
67
68typedef struct dns_rdatasetmethods {
69	void			(*disassociate)(dns_rdataset_t *rdataset);
70	isc_result_t		(*first)(dns_rdataset_t *rdataset);
71	isc_result_t		(*next)(dns_rdataset_t *rdataset);
72	void			(*current)(dns_rdataset_t *rdataset,
73					   dns_rdata_t *rdata);
74	void			(*clone)(dns_rdataset_t *source,
75					 dns_rdataset_t *target);
76	unsigned int		(*count)(dns_rdataset_t *rdataset);
77	isc_result_t		(*addnoqname)(dns_rdataset_t *rdataset,
78					      dns_name_t *name);
79	isc_result_t		(*getnoqname)(dns_rdataset_t *rdataset,
80					      dns_name_t *name,
81					      dns_rdataset_t *neg,
82					      dns_rdataset_t *negsig);
83	isc_result_t		(*addclosest)(dns_rdataset_t *rdataset,
84					      dns_name_t *name);
85	isc_result_t		(*getclosest)(dns_rdataset_t *rdataset,
86					      dns_name_t *name,
87					      dns_rdataset_t *neg,
88					      dns_rdataset_t *negsig);
89	isc_result_t		(*getadditional)(dns_rdataset_t *rdataset,
90						 dns_rdatasetadditional_t type,
91						 dns_rdatatype_t qtype,
92						 dns_acache_t *acache,
93						 dns_zone_t **zonep,
94						 dns_db_t **dbp,
95						 dns_dbversion_t **versionp,
96						 dns_dbnode_t **nodep,
97						 dns_name_t *fname,
98						 dns_message_t *msg,
99						 isc_stdtime_t now);
100	isc_result_t		(*setadditional)(dns_rdataset_t *rdataset,
101						 dns_rdatasetadditional_t type,
102						 dns_rdatatype_t qtype,
103						 dns_acache_t *acache,
104						 dns_zone_t *zone,
105						 dns_db_t *db,
106						 dns_dbversion_t *version,
107						 dns_dbnode_t *node,
108						 dns_name_t *fname);
109	isc_result_t		(*putadditional)(dns_acache_t *acache,
110						 dns_rdataset_t *rdataset,
111						 dns_rdatasetadditional_t type,
112						 dns_rdatatype_t qtype);
113	void			(*settrust)(dns_rdataset_t *rdataset,
114					    dns_trust_t trust);
115	void			(*expire)(dns_rdataset_t *rdataset);
116} dns_rdatasetmethods_t;
117
118#define DNS_RDATASET_MAGIC	       ISC_MAGIC('D','N','S','R')
119#define DNS_RDATASET_VALID(set)	       ISC_MAGIC_VALID(set, DNS_RDATASET_MAGIC)
120
121/*%
122 * Direct use of this structure by clients is strongly discouraged, except
123 * for the 'link' field which may be used however the client wishes.  The
124 * 'private', 'current', and 'index' fields MUST NOT be changed by clients.
125 * rdataset implementations may change any of the fields.
126 */
127struct dns_rdataset {
128	unsigned int			magic;		/* XXX ? */
129	dns_rdatasetmethods_t *		methods;
130	ISC_LINK(dns_rdataset_t)	link;
131	/*
132	 * XXX do we need these, or should they be retrieved by methods?
133	 * Leaning towards the latter, since they are not frequently required
134	 * once you have the rdataset.
135	 */
136	dns_rdataclass_t		rdclass;
137	dns_rdatatype_t			type;
138	dns_ttl_t			ttl;
139	dns_trust_t			trust;
140	dns_rdatatype_t			covers;
141	/*
142	 * attributes
143	 */
144	unsigned int			attributes;
145	/*%
146	 * the counter provides the starting point in the "cyclic" order.
147	 * The value ISC_UINT32_MAX has a special meaning of "picking up a
148	 * random value." in order to take care of databases that do not
149	 * increment the counter.
150	 */
151	isc_uint32_t			count;
152	/*
153	 * This RRSIG RRset should be re-generated around this time.
154	 * Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
155	 */
156	isc_stdtime_t			resign;
157	/*@{*/
158	/*%
159	 * These are for use by the rdataset implementation, and MUST NOT
160	 * be changed by clients.
161	 */
162	void *				private1;
163	void *				private2;
164	void *				private3;
165	unsigned int			privateuint4;
166	void *				private5;
167	void *				private6;
168	void *				private7;
169	/*@}*/
170
171};
172
173/*!
174 * \def DNS_RDATASETATTR_RENDERED
175 *	Used by message.c to indicate that the rdataset was rendered.
176 *
177 * \def DNS_RDATASETATTR_TTLADJUSTED
178 *	Used by message.c to indicate that the rdataset's rdata had differing
179 *	TTL values, and the rdataset->ttl holds the smallest.
180 *
181 * \def DNS_RDATASETATTR_LOADORDER
182 *	Output the RRset in load order.
183 */
184
185#define DNS_RDATASETATTR_QUESTION	0x00000001
186#define DNS_RDATASETATTR_RENDERED	0x00000002	/*%< Used by message.c */
187#define DNS_RDATASETATTR_ANSWERED	0x00000004	/*%< Used by server. */
188#define DNS_RDATASETATTR_CACHE		0x00000008	/*%< Used by resolver. */
189#define DNS_RDATASETATTR_ANSWER		0x00000010	/*%< Used by resolver. */
190#define DNS_RDATASETATTR_ANSWERSIG	0x00000020	/*%< Used by resolver. */
191#define DNS_RDATASETATTR_EXTERNAL	0x00000040	/*%< Used by resolver. */
192#define DNS_RDATASETATTR_NCACHE		0x00000080	/*%< Used by resolver. */
193#define DNS_RDATASETATTR_CHAINING	0x00000100	/*%< Used by resolver. */
194#define DNS_RDATASETATTR_TTLADJUSTED	0x00000200	/*%< Used by message.c */
195#define DNS_RDATASETATTR_FIXEDORDER	0x00000400
196#define DNS_RDATASETATTR_RANDOMIZE	0x00000800
197#define DNS_RDATASETATTR_CHASE		0x00001000	/*%< Used by resolver. */
198#define DNS_RDATASETATTR_NXDOMAIN	0x00002000
199#define DNS_RDATASETATTR_NOQNAME	0x00004000
200#define DNS_RDATASETATTR_CHECKNAMES	0x00008000	/*%< Used by resolver. */
201#define DNS_RDATASETATTR_REQUIREDGLUE	0x00010000
202#define DNS_RDATASETATTR_LOADORDER	0x00020000
203#define DNS_RDATASETATTR_RESIGN		0x00040000
204#define DNS_RDATASETATTR_CLOSEST	0x00080000
205#define DNS_RDATASETATTR_OPTOUT		0x00100000	/*%< OPTOUT proof */
206#define DNS_RDATASETATTR_NEGATIVE	0x00200000
207
208/*%
209 * _OMITDNSSEC:
210 * 	Omit DNSSEC records when rendering ncache records.
211 */
212#define DNS_RDATASETTOWIRE_OMITDNSSEC	0x0001
213
214void
215dns_rdataset_init(dns_rdataset_t *rdataset);
216/*%<
217 * Make 'rdataset' a valid, disassociated rdataset.
218 *
219 * Requires:
220 *\li	'rdataset' is not NULL.
221 *
222 * Ensures:
223 *\li	'rdataset' is a valid, disassociated rdataset.
224 */
225
226void
227dns_rdataset_invalidate(dns_rdataset_t *rdataset);
228/*%<
229 * Invalidate 'rdataset'.
230 *
231 * Requires:
232 *\li	'rdataset' is a valid, disassociated rdataset.
233 *
234 * Ensures:
235 *\li	If assertion checking is enabled, future attempts to use 'rdataset'
236 *	without initializing it will cause an assertion failure.
237 */
238
239void
240dns_rdataset_disassociate(dns_rdataset_t *rdataset);
241/*%<
242 * Disassociate 'rdataset' from its rdata, allowing it to be reused.
243 *
244 * Notes:
245 *\li	The client must ensure it has no references to rdata in the rdataset
246 *	before disassociating.
247 *
248 * Requires:
249 *\li	'rdataset' is a valid, associated rdataset.
250 *
251 * Ensures:
252 *\li	'rdataset' is a valid, disassociated rdataset.
253 */
254
255isc_boolean_t
256dns_rdataset_isassociated(dns_rdataset_t *rdataset);
257/*%<
258 * Is 'rdataset' associated?
259 *
260 * Requires:
261 *\li	'rdataset' is a valid rdataset.
262 *
263 * Returns:
264 *\li	#ISC_TRUE			'rdataset' is associated.
265 *\li	#ISC_FALSE			'rdataset' is not associated.
266 */
267
268void
269dns_rdataset_makequestion(dns_rdataset_t *rdataset, dns_rdataclass_t rdclass,
270			  dns_rdatatype_t type);
271/*%<
272 * Make 'rdataset' a valid, associated, question rdataset, with a
273 * question class of 'rdclass' and type 'type'.
274 *
275 * Notes:
276 *\li	Question rdatasets have a class and type, but no rdata.
277 *
278 * Requires:
279 *\li	'rdataset' is a valid, disassociated rdataset.
280 *
281 * Ensures:
282 *\li	'rdataset' is a valid, associated, question rdataset.
283 */
284
285void
286dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target);
287/*%<
288 * Make 'target' refer to the same rdataset as 'source'.
289 *
290 * Requires:
291 *\li	'source' is a valid, associated rdataset.
292 *
293 *\li	'target' is a valid, dissociated rdataset.
294 *
295 * Ensures:
296 *\li	'target' references the same rdataset as 'source'.
297 */
298
299unsigned int
300dns_rdataset_count(dns_rdataset_t *rdataset);
301/*%<
302 * Return the number of records in 'rdataset'.
303 *
304 * Requires:
305 *\li	'rdataset' is a valid, associated rdataset.
306 *
307 * Returns:
308 *\li	The number of records in 'rdataset'.
309 */
310
311isc_result_t
312dns_rdataset_first(dns_rdataset_t *rdataset);
313/*%<
314 * Move the rdata cursor to the first rdata in the rdataset (if any).
315 *
316 * Requires:
317 *\li	'rdataset' is a valid, associated rdataset.
318 *
319 * Returns:
320 *\li	#ISC_R_SUCCESS
321 *\li	#ISC_R_NOMORE			There are no rdata in the set.
322 */
323
324isc_result_t
325dns_rdataset_next(dns_rdataset_t *rdataset);
326/*%<
327 * Move the rdata cursor to the next rdata in the rdataset (if any).
328 *
329 * Requires:
330 *\li	'rdataset' is a valid, associated rdataset.
331 *
332 * Returns:
333 *\li	#ISC_R_SUCCESS
334 *\li	#ISC_R_NOMORE			There are no more rdata in the set.
335 */
336
337void
338dns_rdataset_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata);
339/*%<
340 * Make 'rdata' refer to the current rdata.
341 *
342 * Notes:
343 *
344 *\li	The data returned in 'rdata' is valid for the life of the
345 *	rdataset; in particular, subsequent changes in the cursor position
346 *	do not invalidate 'rdata'.
347 *
348 * Requires:
349 *\li	'rdataset' is a valid, associated rdataset.
350 *
351 *\li	The rdata cursor of 'rdataset' is at a valid location (i.e. the
352 *	result of last call to a cursor movement command was ISC_R_SUCCESS).
353 *
354 * Ensures:
355 *\li	'rdata' refers to the rdata at the rdata cursor location of
356 *\li	'rdataset'.
357 */
358
359isc_result_t
360dns_rdataset_totext(dns_rdataset_t *rdataset,
361		    dns_name_t *owner_name,
362		    isc_boolean_t omit_final_dot,
363		    isc_boolean_t question,
364		    isc_buffer_t *target);
365/*%<
366 * Convert 'rdataset' to text format, storing the result in 'target'.
367 *
368 * Notes:
369 *\li	The rdata cursor position will be changed.
370 *
371 *\li	The 'question' flag should normally be #ISC_FALSE.  If it is
372 *	#ISC_TRUE, the TTL and rdata fields are not printed.  This is
373 *	for use when printing an rdata representing a question section.
374 *
375 *\li	This interface is deprecated; use dns_master_rdatasettottext()
376 * 	and/or dns_master_questiontotext() instead.
377 *
378 * Requires:
379 *\li	'rdataset' is a valid rdataset.
380 *
381 *\li	'rdataset' is not empty.
382 */
383
384isc_result_t
385dns_rdataset_towire(dns_rdataset_t *rdataset,
386		    dns_name_t *owner_name,
387		    dns_compress_t *cctx,
388		    isc_buffer_t *target,
389		    unsigned int options,
390		    unsigned int *countp);
391/*%<
392 * Convert 'rdataset' to wire format, compressing names as specified
393 * in 'cctx', and storing the result in 'target'.
394 *
395 * Notes:
396 *\li	The rdata cursor position will be changed.
397 *
398 *\li	The number of RRs added to target will be added to *countp.
399 *
400 * Requires:
401 *\li	'rdataset' is a valid rdataset.
402 *
403 *\li	'rdataset' is not empty.
404 *
405 *\li	'countp' is a valid pointer.
406 *
407 * Ensures:
408 *\li	On a return of ISC_R_SUCCESS, 'target' contains a wire format
409 *	for the data contained in 'rdataset'.  Any error return leaves
410 *	the buffer unchanged.
411 *
412 *\li	*countp has been incremented by the number of RRs added to
413 *	target.
414 *
415 * Returns:
416 *\li	#ISC_R_SUCCESS		- all ok
417 *\li	#ISC_R_NOSPACE		- 'target' doesn't have enough room
418 *
419 *\li	Any error returned by dns_rdata_towire(), dns_rdataset_next(),
420 *	dns_name_towire().
421 */
422
423isc_result_t
424dns_rdataset_towiresorted(dns_rdataset_t *rdataset,
425			  const dns_name_t *owner_name,
426			  dns_compress_t *cctx,
427			  isc_buffer_t *target,
428			  dns_rdatasetorderfunc_t order,
429			  const void *order_arg,
430			  unsigned int options,
431			  unsigned int *countp);
432/*%<
433 * Like dns_rdataset_towire(), but sorting the rdatasets according to
434 * the integer value returned by 'order' when called with the rdataset
435 * and 'order_arg' as arguments.
436 *
437 * Requires:
438 *\li	All the requirements of dns_rdataset_towire(), and
439 *	that order_arg is NULL if and only if order is NULL.
440 */
441
442isc_result_t
443dns_rdataset_towirepartial(dns_rdataset_t *rdataset,
444			   const dns_name_t *owner_name,
445			   dns_compress_t *cctx,
446			   isc_buffer_t *target,
447			   dns_rdatasetorderfunc_t order,
448			   const void *order_arg,
449			   unsigned int options,
450			   unsigned int *countp,
451			   void **state);
452/*%<
453 * Like dns_rdataset_towiresorted() except that a partial rdataset
454 * may be written.
455 *
456 * Requires:
457 *\li	All the requirements of dns_rdataset_towiresorted().
458 *	If 'state' is non NULL then the current position in the
459 *	rdataset will be remembered if the rdataset in not
460 *	completely written and should be passed on on subsequent
461 *	calls (NOT CURRENTLY IMPLEMENTED).
462 *
463 * Returns:
464 *\li	#ISC_R_SUCCESS if all of the records were written.
465 *\li	#ISC_R_NOSPACE if unable to fit in all of the records. *countp
466 *		      will be updated to reflect the number of records
467 *		      written.
468 */
469
470isc_result_t
471dns_rdataset_additionaldata(dns_rdataset_t *rdataset,
472			    dns_additionaldatafunc_t add, void *arg);
473/*%<
474 * For each rdata in rdataset, call 'add' for each name and type in the
475 * rdata which is subject to additional section processing.
476 *
477 * Requires:
478 *
479 *\li	'rdataset' is a valid, non-question rdataset.
480 *
481 *\li	'add' is a valid dns_additionaldatafunc_t
482 *
483 * Ensures:
484 *
485 *\li	If successful, dns_rdata_additionaldata() will have been called for
486 *	each rdata in 'rdataset'.
487 *
488 *\li	If a call to dns_rdata_additionaldata() is not successful, the
489 *	result returned will be the result of dns_rdataset_additionaldata().
490 *
491 * Returns:
492 *
493 *\li	#ISC_R_SUCCESS
494 *
495 *\li	Any error that dns_rdata_additionaldata() can return.
496 */
497
498isc_result_t
499dns_rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
500			dns_rdataset_t *neg, dns_rdataset_t *negsig);
501/*%<
502 * Return the noqname proof for this record.
503 *
504 * Requires:
505 *\li	'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
506 *\li	'name' to be valid.
507 *\li	'neg' and 'negsig' to be valid and not associated.
508 */
509
510isc_result_t
511dns_rdataset_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name);
512/*%<
513 * Associate a noqname proof with this record.
514 * Sets #DNS_RDATASETATTR_NOQNAME if successful.
515 * Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
516 * the 'nsec'/'nsec3' and 'rrsig(nsec)'/'rrsig(nsec3)' ttl.
517 *
518 * Requires:
519 *\li	'rdataset' to be valid and #DNS_RDATASETATTR_NOQNAME to be set.
520 *\li	'name' to be valid and have NSEC or NSEC3 and associated RRSIG
521 *	 rdatasets.
522 */
523
524isc_result_t
525dns_rdataset_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
526			dns_rdataset_t *nsec, dns_rdataset_t *nsecsig);
527/*%<
528 * Return the closest encloser for this record.
529 *
530 * Requires:
531 *\li	'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
532 *\li	'name' to be valid.
533 *\li	'nsec' and 'nsecsig' to be valid and not associated.
534 */
535
536isc_result_t
537dns_rdataset_addclosest(dns_rdataset_t *rdataset, dns_name_t *name);
538/*%<
539 * Associate a closest encloset proof with this record.
540 * Sets #DNS_RDATASETATTR_CLOSEST if successful.
541 * Adjusts the 'rdataset->ttl' to minimum of the 'rdataset->ttl' and
542 * the 'nsec' and 'rrsig(nsec)' ttl.
543 *
544 * Requires:
545 *\li	'rdataset' to be valid and #DNS_RDATASETATTR_CLOSEST to be set.
546 *\li	'name' to be valid and have NSEC3 and RRSIG(NSEC3) rdatasets.
547 */
548
549isc_result_t
550dns_rdataset_getadditional(dns_rdataset_t *rdataset,
551			   dns_rdatasetadditional_t type,
552			   dns_rdatatype_t qtype,
553			   dns_acache_t *acache,
554			   dns_zone_t **zonep,
555			   dns_db_t **dbp,
556			   dns_dbversion_t **versionp,
557			   dns_dbnode_t **nodep,
558			   dns_name_t *fname,
559			   dns_message_t *msg,
560			   isc_stdtime_t now);
561/*%<
562 * Get cached additional information from the DB node for a particular
563 * 'rdataset.'  'type' is one of dns_rdatasetadditional_fromauth,
564 * dns_rdatasetadditional_fromcache, and dns_rdatasetadditional_fromglue,
565 * which specifies the origin of the information.  'qtype' is intended to
566 * be used for specifying a particular rdata type in the cached information.
567 *
568 * Requires:
569 * \li	'rdataset' is a valid rdataset.
570 * \li	'acache' can be NULL, in which case this function will simply return
571 * 	ISC_R_FAILURE.
572 * \li	For the other pointers, see dns_acache_getentry().
573 *
574 * Ensures:
575 * \li	See dns_acache_getentry().
576 *
577 * Returns:
578 * \li	#ISC_R_SUCCESS
579 * \li	#ISC_R_FAILURE	- additional information caching is not supported.
580 * \li	#ISC_R_NOTFOUND	- the corresponding DB node has not cached additional
581 *			  information for 'rdataset.'
582 * \li	Any error that dns_acache_getentry() can return.
583 */
584
585isc_result_t
586dns_rdataset_setadditional(dns_rdataset_t *rdataset,
587			   dns_rdatasetadditional_t type,
588			   dns_rdatatype_t qtype,
589			   dns_acache_t *acache,
590			   dns_zone_t *zone,
591			   dns_db_t *db,
592			   dns_dbversion_t *version,
593			   dns_dbnode_t *node,
594			   dns_name_t *fname);
595/*%<
596 * Set cached additional information to the DB node for a particular
597 * 'rdataset.'  See dns_rdataset_getadditional for the semantics of 'type'
598 * and 'qtype'.
599 *
600 * Requires:
601 * \li	'rdataset' is a valid rdataset.
602 * \li	'acache' can be NULL, in which case this function will simply return
603 *	ISC_R_FAILURE.
604 * \li	For the other pointers, see dns_acache_setentry().
605 *
606 * Ensures:
607 * \li	See dns_acache_setentry().
608 *
609 * Returns:
610 * \li	#ISC_R_SUCCESS
611 * \li	#ISC_R_FAILURE	- additional information caching is not supported.
612 * \li	#ISC_R_NOMEMORY
613 * \li	Any error that dns_acache_setentry() can return.
614 */
615
616isc_result_t
617dns_rdataset_putadditional(dns_acache_t *acache,
618			   dns_rdataset_t *rdataset,
619			   dns_rdatasetadditional_t type,
620			   dns_rdatatype_t qtype);
621/*%<
622 * Discard cached additional information stored in the DB node for a particular
623 * 'rdataset.'  See dns_rdataset_getadditional for the semantics of 'type'
624 * and 'qtype'.
625 *
626 * Requires:
627 * \li	'rdataset' is a valid rdataset.
628 * \li	'acache' can be NULL, in which case this function will simply return
629 *	ISC_R_FAILURE.
630 *
631 * Ensures:
632 * \li	See dns_acache_cancelentry().
633 *
634 * Returns:
635 * \li	#ISC_R_SUCCESS
636 * \li	#ISC_R_FAILURE	- additional information caching is not supported.
637 * \li	#ISC_R_NOTFOUND	- the corresponding DB node has not cached additional
638 *			  information for 'rdataset.'
639 */
640
641void
642dns_rdataset_settrust(dns_rdataset_t *rdataset, dns_trust_t trust);
643/*%<
644 * Set the trust of the 'rdataset' to trust in any in the backing database.
645 * The local trust level of 'rdataset' is also set.
646 */
647
648void
649dns_rdataset_expire(dns_rdataset_t *rdataset);
650/*%<
651 * Mark the rdataset to be expired in the backing database.
652 */
653
654const char *
655dns_trust_totext(dns_trust_t trust);
656/*
657 * Display trust in textual form.
658 */
659
660ISC_LANG_ENDDECLS
661
662#endif /* DNS_RDATASET_H */
663