1 /* $NetBSD: ncache.c,v 1.10 2015/09/03 07:33:34 christos Exp $ */
4 * Copyright (C) 2004, 2005, 2007, 2008, 2010-2014 Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2003 Internet Software Consortium.
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
26 #include <isc/buffer.h>
30 #include <dns/message.h>
31 #include <dns/ncache.h>
32 #include <dns/rdata.h>
33 #include <dns/rdatalist.h>
34 #include <dns/rdataset.h>
35 #include <dns/rdatastruct.h>
37 #define DNS_NCACHE_RDATA 20U
40 * The format of an ncache rdata is a sequence of zero or more records of
41 * the following format:
47 * rdata length These two occur 'rdata count'
53 addoptout(dns_message_t
*message
, dns_db_t
*cache
, dns_dbnode_t
*node
,
54 dns_rdatatype_t covers
, isc_stdtime_t now
, dns_ttl_t maxttl
,
55 isc_boolean_t optout
, isc_boolean_t secure
,
56 dns_rdataset_t
*addedrdataset
);
58 static inline isc_result_t
59 copy_rdataset(dns_rdataset_t
*rdataset
, isc_buffer_t
*buffer
) {
63 dns_rdata_t rdata
= DNS_RDATA_INIT
;
66 * Copy the rdataset count to the buffer.
68 isc_buffer_availableregion(buffer
, &ar
);
70 return (ISC_R_NOSPACE
);
71 count
= dns_rdataset_count(rdataset
);
72 INSIST(count
<= 65535);
73 isc_buffer_putuint16(buffer
, (isc_uint16_t
)count
);
75 result
= dns_rdataset_first(rdataset
);
76 while (result
== ISC_R_SUCCESS
) {
77 dns_rdataset_current(rdataset
, &rdata
);
78 dns_rdata_toregion(&rdata
, &r
);
79 INSIST(r
.length
<= 65535);
80 isc_buffer_availableregion(buffer
, &ar
);
82 return (ISC_R_NOSPACE
);
84 * Copy the rdata length to the buffer.
86 isc_buffer_putuint16(buffer
, (isc_uint16_t
)r
.length
);
88 * Copy the rdata to the buffer.
90 result
= isc_buffer_copyregion(buffer
, &r
);
91 if (result
!= ISC_R_SUCCESS
)
93 dns_rdata_reset(&rdata
);
94 result
= dns_rdataset_next(rdataset
);
96 if (result
!= ISC_R_NOMORE
)
99 return (ISC_R_SUCCESS
);
103 dns_ncache_add(dns_message_t
*message
, dns_db_t
*cache
, dns_dbnode_t
*node
,
104 dns_rdatatype_t covers
, isc_stdtime_t now
, dns_ttl_t maxttl
,
105 dns_rdataset_t
*addedrdataset
)
107 return (addoptout(message
, cache
, node
, covers
, now
, maxttl
,
108 ISC_FALSE
, ISC_FALSE
, addedrdataset
));
112 dns_ncache_addoptout(dns_message_t
*message
, dns_db_t
*cache
,
113 dns_dbnode_t
*node
, dns_rdatatype_t covers
,
114 isc_stdtime_t now
, dns_ttl_t maxttl
,
115 isc_boolean_t optout
, dns_rdataset_t
*addedrdataset
)
117 return (addoptout(message
, cache
, node
, covers
, now
, maxttl
,
118 optout
, ISC_TRUE
, addedrdataset
));
122 addoptout(dns_message_t
*message
, dns_db_t
*cache
, dns_dbnode_t
*node
,
123 dns_rdatatype_t covers
, isc_stdtime_t now
, dns_ttl_t maxttl
,
124 isc_boolean_t optout
, isc_boolean_t secure
,
125 dns_rdataset_t
*addedrdataset
)
130 dns_rdataset_t
*rdataset
;
131 dns_rdatatype_t type
;
135 dns_rdata_t rdata
[DNS_NCACHE_RDATA
];
136 dns_rdataset_t ncrdataset
;
137 dns_rdatalist_t ncrdatalist
;
138 unsigned char data
[4096];
139 unsigned int next
= 0;
142 * Convert the authority data from 'message' into a negative cache
143 * rdataset, and store it in 'cache' at 'node'.
146 REQUIRE(message
!= NULL
);
149 * We assume that all data in the authority section has been
150 * validated by the caller.
154 * Initialize the list.
156 ncrdatalist
.rdclass
= dns_db_class(cache
);
157 ncrdatalist
.type
= 0;
158 ncrdatalist
.covers
= covers
;
159 ncrdatalist
.ttl
= maxttl
;
160 ISC_LIST_INIT(ncrdatalist
.rdata
);
161 ISC_LINK_INIT(&ncrdatalist
, link
);
164 * Build an ncache rdatas into buffer.
168 isc_buffer_init(&buffer
, data
, sizeof(data
));
169 if (message
->counts
[DNS_SECTION_AUTHORITY
])
170 result
= dns_message_firstname(message
, DNS_SECTION_AUTHORITY
);
172 result
= ISC_R_NOMORE
;
173 while (result
== ISC_R_SUCCESS
) {
175 dns_message_currentname(message
, DNS_SECTION_AUTHORITY
,
177 if ((name
->attributes
& DNS_NAMEATTR_NCACHE
) != 0) {
178 for (rdataset
= ISC_LIST_HEAD(name
->list
);
180 rdataset
= ISC_LIST_NEXT(rdataset
, link
)) {
181 if ((rdataset
->attributes
&
182 DNS_RDATASETATTR_NCACHE
) == 0)
184 type
= rdataset
->type
;
185 if (type
== dns_rdatatype_rrsig
)
186 type
= rdataset
->covers
;
187 if (type
== dns_rdatatype_soa
||
188 type
== dns_rdatatype_nsec
||
189 type
== dns_rdatatype_nsec3
) {
190 if (ttl
> rdataset
->ttl
)
192 if (trust
> rdataset
->trust
)
193 trust
= rdataset
->trust
;
195 * Copy the owner name to the buffer.
197 dns_name_toregion(name
, &r
);
198 result
= isc_buffer_copyregion(&buffer
,
200 if (result
!= ISC_R_SUCCESS
)
203 * Copy the type to the buffer.
205 isc_buffer_availableregion(&buffer
,
208 return (ISC_R_NOSPACE
);
209 isc_buffer_putuint16(&buffer
,
211 isc_buffer_putuint8(&buffer
,
212 (unsigned char)rdataset
->trust
);
214 * Copy the rdataset into the buffer.
216 result
= copy_rdataset(rdataset
,
218 if (result
!= ISC_R_SUCCESS
)
221 if (next
>= DNS_NCACHE_RDATA
)
222 return (ISC_R_NOSPACE
);
223 dns_rdata_init(&rdata
[next
]);
224 isc_buffer_remainingregion(&buffer
, &r
);
225 rdata
[next
].data
= r
.base
;
226 rdata
[next
].length
= r
.length
;
227 rdata
[next
].rdclass
=
229 rdata
[next
].type
= 0;
230 rdata
[next
].flags
= 0;
231 ISC_LIST_APPEND(ncrdatalist
.rdata
,
233 isc_buffer_forward(&buffer
, r
.length
);
238 result
= dns_message_nextname(message
, DNS_SECTION_AUTHORITY
);
240 if (result
!= ISC_R_NOMORE
)
243 if (trust
== 0xffff) {
244 if ((message
->flags
& DNS_MESSAGEFLAG_AA
) != 0 &&
245 message
->counts
[DNS_SECTION_ANSWER
] == 0) {
247 * The response has aa set and we haven't followed
248 * any CNAME or DNAME chains.
250 trust
= dns_trust_authauthority
;
252 trust
= dns_trust_additional
;
256 INSIST(trust
!= 0xffff);
258 ncrdatalist
.ttl
= ttl
;
260 dns_rdataset_init(&ncrdataset
);
261 RUNTIME_CHECK(dns_rdatalist_tordataset(&ncrdatalist
, &ncrdataset
)
263 if (!secure
&& trust
> dns_trust_answer
)
264 trust
= dns_trust_answer
;
265 ncrdataset
.trust
= trust
;
266 ncrdataset
.attributes
|= DNS_RDATASETATTR_NEGATIVE
;
267 if (message
->rcode
== dns_rcode_nxdomain
)
268 ncrdataset
.attributes
|= DNS_RDATASETATTR_NXDOMAIN
;
270 ncrdataset
.attributes
|= DNS_RDATASETATTR_OPTOUT
;
272 return (dns_db_addrdataset(cache
, node
, NULL
, now
, &ncrdataset
,
277 dns_ncache_towire(dns_rdataset_t
*rdataset
, dns_compress_t
*cctx
,
278 isc_buffer_t
*target
, unsigned int options
,
279 unsigned int *countp
)
281 dns_rdata_t rdata
= DNS_RDATA_INIT
;
283 isc_region_t remaining
, tavailable
;
284 isc_buffer_t source
, savedbuffer
, rdlen
;
286 dns_rdatatype_t type
;
287 unsigned int i
, rcount
, count
;
290 * Convert the negative caching rdataset 'rdataset' to wire format,
291 * compressing names as specified in 'cctx', and storing the result in
295 REQUIRE(rdataset
!= NULL
);
296 REQUIRE(rdataset
->type
== 0);
297 REQUIRE((rdataset
->attributes
& DNS_RDATASETATTR_NEGATIVE
) != 0);
299 savedbuffer
= *target
;
302 result
= dns_rdataset_first(rdataset
);
303 while (result
== ISC_R_SUCCESS
) {
304 dns_rdataset_current(rdataset
, &rdata
);
305 isc_buffer_init(&source
, rdata
.data
, rdata
.length
);
306 isc_buffer_add(&source
, rdata
.length
);
307 dns_name_init(&name
, NULL
);
308 isc_buffer_remainingregion(&source
, &remaining
);
309 dns_name_fromregion(&name
, &remaining
);
310 INSIST(remaining
.length
>= name
.length
);
311 isc_buffer_forward(&source
, name
.length
);
312 remaining
.length
-= name
.length
;
314 INSIST(remaining
.length
>= 5);
315 type
= isc_buffer_getuint16(&source
);
316 isc_buffer_forward(&source
, 1);
317 rcount
= isc_buffer_getuint16(&source
);
319 for (i
= 0; i
< rcount
; i
++) {
321 * Get the length of this rdata and set up an
322 * rdata structure for it.
324 isc_buffer_remainingregion(&source
, &remaining
);
325 INSIST(remaining
.length
>= 2);
326 dns_rdata_reset(&rdata
);
327 rdata
.length
= isc_buffer_getuint16(&source
);
328 isc_buffer_remainingregion(&source
, &remaining
);
329 rdata
.data
= remaining
.base
;
331 rdata
.rdclass
= rdataset
->rdclass
;
332 INSIST(remaining
.length
>= rdata
.length
);
333 isc_buffer_forward(&source
, rdata
.length
);
335 if ((options
& DNS_NCACHETOWIRE_OMITDNSSEC
) != 0 &&
336 dns_rdatatype_isdnssec(type
))
342 dns_compress_setmethods(cctx
, DNS_COMPRESS_GLOBAL14
);
343 result
= dns_name_towire(&name
, cctx
, target
);
344 if (result
!= ISC_R_SUCCESS
)
348 * See if we have space for type, class, ttl, and
349 * rdata length. Write the type, class, and ttl.
351 isc_buffer_availableregion(target
, &tavailable
);
352 if (tavailable
.length
< 10) {
353 result
= ISC_R_NOSPACE
;
356 isc_buffer_putuint16(target
, type
);
357 isc_buffer_putuint16(target
, rdataset
->rdclass
);
358 isc_buffer_putuint32(target
, rdataset
->ttl
);
361 * Save space for rdata length.
364 isc_buffer_add(target
, 2);
369 result
= dns_rdata_towire(&rdata
, cctx
, target
);
370 if (result
!= ISC_R_SUCCESS
)
374 * Set the rdata length field to the compressed
377 INSIST((target
->used
>= rdlen
.used
+ 2) &&
378 (target
->used
- rdlen
.used
- 2 < 65536));
379 isc_buffer_putuint16(&rdlen
,
380 (isc_uint16_t
)(target
->used
-
385 INSIST(isc_buffer_remaininglength(&source
) == 0);
386 result
= dns_rdataset_next(rdataset
);
387 dns_rdata_reset(&rdata
);
389 if (result
!= ISC_R_NOMORE
)
394 return (ISC_R_SUCCESS
);
397 INSIST(savedbuffer
.used
< 65536);
398 dns_compress_rollback(cctx
, (isc_uint16_t
)savedbuffer
.used
);
400 *target
= savedbuffer
;
406 rdataset_disassociate(dns_rdataset_t
*rdataset
) {
411 rdataset_first(dns_rdataset_t
*rdataset
) {
412 unsigned char *raw
= rdataset
->private3
;
415 count
= raw
[0] * 256 + raw
[1];
417 rdataset
->private5
= NULL
;
418 return (ISC_R_NOMORE
);
422 * The privateuint4 field is the number of rdata beyond the cursor
423 * position, so we decrement the total count by one before storing
427 rdataset
->privateuint4
= count
;
428 rdataset
->private5
= raw
;
430 return (ISC_R_SUCCESS
);
434 rdataset_next(dns_rdataset_t
*rdataset
) {
439 count
= rdataset
->privateuint4
;
441 return (ISC_R_NOMORE
);
443 rdataset
->privateuint4
= count
;
444 raw
= rdataset
->private5
;
445 length
= raw
[0] * 256 + raw
[1];
447 rdataset
->private5
= raw
;
449 return (ISC_R_SUCCESS
);
453 rdataset_current(dns_rdataset_t
*rdataset
, dns_rdata_t
*rdata
) {
454 unsigned char *raw
= rdataset
->private5
;
457 REQUIRE(raw
!= NULL
);
459 r
.length
= raw
[0] * 256 + raw
[1];
462 dns_rdata_fromregion(rdata
, rdataset
->rdclass
, rdataset
->type
, &r
);
466 rdataset_clone(dns_rdataset_t
*source
, dns_rdataset_t
*target
) {
470 * Reset iterator state.
472 target
->privateuint4
= 0;
473 target
->private5
= NULL
;
477 rdataset_count(dns_rdataset_t
*rdataset
) {
478 unsigned char *raw
= rdataset
->private3
;
481 count
= raw
[0] * 256 + raw
[1];
487 rdataset_settrust(dns_rdataset_t
*rdataset
, dns_trust_t trust
) {
488 unsigned char *raw
= rdataset
->private3
;
490 raw
[-1] = (unsigned char)trust
;
493 static dns_rdatasetmethods_t rdataset_methods
= {
494 rdataset_disassociate
,
513 dns_ncache_getrdataset(dns_rdataset_t
*ncacherdataset
, dns_name_t
*name
,
514 dns_rdatatype_t type
, dns_rdataset_t
*rdataset
)
517 dns_rdata_t rdata
= DNS_RDATA_INIT
;
518 isc_region_t remaining
;
521 dns_rdatatype_t ttype
;
522 dns_trust_t trust
= dns_trust_none
;
523 dns_rdataset_t clone
;
525 REQUIRE(ncacherdataset
!= NULL
);
526 REQUIRE(ncacherdataset
->type
== 0);
527 REQUIRE((ncacherdataset
->attributes
& DNS_RDATASETATTR_NEGATIVE
) != 0);
528 REQUIRE(name
!= NULL
);
529 REQUIRE(!dns_rdataset_isassociated(rdataset
));
530 REQUIRE(type
!= dns_rdatatype_rrsig
);
532 dns_rdataset_init(&clone
);
533 dns_rdataset_clone(ncacherdataset
, &clone
);
534 result
= dns_rdataset_first(&clone
);
535 while (result
== ISC_R_SUCCESS
) {
536 dns_rdataset_current(&clone
, &rdata
);
537 isc_buffer_init(&source
, rdata
.data
, rdata
.length
);
538 isc_buffer_add(&source
, rdata
.length
);
539 dns_name_init(&tname
, NULL
);
540 isc_buffer_remainingregion(&source
, &remaining
);
541 dns_name_fromregion(&tname
, &remaining
);
542 INSIST(remaining
.length
>= tname
.length
);
543 isc_buffer_forward(&source
, tname
.length
);
544 remaining
.length
-= tname
.length
;
546 INSIST(remaining
.length
>= 3);
547 ttype
= isc_buffer_getuint16(&source
);
549 if (ttype
== type
&& dns_name_equal(&tname
, name
)) {
550 trust
= isc_buffer_getuint8(&source
);
551 INSIST(trust
<= dns_trust_ultimate
);
552 isc_buffer_remainingregion(&source
, &remaining
);
555 result
= dns_rdataset_next(&clone
);
556 dns_rdata_reset(&rdata
);
558 dns_rdataset_disassociate(&clone
);
559 if (result
== ISC_R_NOMORE
)
560 return (ISC_R_NOTFOUND
);
561 if (result
!= ISC_R_SUCCESS
)
564 INSIST(remaining
.length
!= 0);
566 rdataset
->methods
= &rdataset_methods
;
567 rdataset
->rdclass
= ncacherdataset
->rdclass
;
568 rdataset
->type
= type
;
569 rdataset
->covers
= 0;
570 rdataset
->ttl
= ncacherdataset
->ttl
;
571 rdataset
->trust
= trust
;
572 rdataset
->private1
= NULL
;
573 rdataset
->private2
= NULL
;
575 rdataset
->private3
= remaining
.base
;
578 * Reset iterator state.
580 rdataset
->privateuint4
= 0;
581 rdataset
->private5
= NULL
;
582 rdataset
->private6
= NULL
;
583 return (ISC_R_SUCCESS
);
587 dns_ncache_getsigrdataset(dns_rdataset_t
*ncacherdataset
, dns_name_t
*name
,
588 dns_rdatatype_t covers
, dns_rdataset_t
*rdataset
)
591 dns_rdata_rrsig_t rrsig
;
592 dns_rdata_t rdata
= DNS_RDATA_INIT
;
593 dns_rdataset_t clone
;
594 dns_rdatatype_t type
;
595 dns_trust_t trust
= dns_trust_none
;
597 isc_region_t remaining
, sigregion
;
602 REQUIRE(ncacherdataset
!= NULL
);
603 REQUIRE(ncacherdataset
->type
== 0);
604 REQUIRE((ncacherdataset
->attributes
& DNS_RDATASETATTR_NEGATIVE
) != 0);
605 REQUIRE(name
!= NULL
);
606 REQUIRE(!dns_rdataset_isassociated(rdataset
));
608 dns_rdataset_init(&clone
);
609 dns_rdataset_clone(ncacherdataset
, &clone
);
610 result
= dns_rdataset_first(&clone
);
611 while (result
== ISC_R_SUCCESS
) {
612 dns_rdataset_current(&clone
, &rdata
);
613 isc_buffer_init(&source
, rdata
.data
, rdata
.length
);
614 isc_buffer_add(&source
, rdata
.length
);
615 dns_name_init(&tname
, NULL
);
616 isc_buffer_remainingregion(&source
, &remaining
);
617 dns_name_fromregion(&tname
, &remaining
);
618 INSIST(remaining
.length
>= tname
.length
);
619 isc_buffer_forward(&source
, tname
.length
);
620 isc_region_consume(&remaining
, tname
.length
);
622 INSIST(remaining
.length
>= 2);
623 type
= isc_buffer_getuint16(&source
);
624 isc_region_consume(&remaining
, 2);
626 if (type
!= dns_rdatatype_rrsig
||
627 !dns_name_equal(&tname
, name
)) {
628 result
= dns_rdataset_next(&clone
);
629 dns_rdata_reset(&rdata
);
633 INSIST(remaining
.length
>= 1);
634 trust
= isc_buffer_getuint8(&source
);
635 INSIST(trust
<= dns_trust_ultimate
);
636 isc_region_consume(&remaining
, 1);
638 raw
= remaining
.base
;
639 count
= raw
[0] * 256 + raw
[1];
642 sigregion
.length
= raw
[0] * 256 + raw
[1];
644 sigregion
.base
= raw
;
645 dns_rdata_reset(&rdata
);
646 dns_rdata_fromregion(&rdata
, rdataset
->rdclass
,
647 dns_rdatatype_rrsig
, &sigregion
);
648 (void)dns_rdata_tostruct(&rdata
, &rrsig
, NULL
);
649 if (rrsig
.covered
== covers
) {
650 isc_buffer_remainingregion(&source
, &remaining
);
654 result
= dns_rdataset_next(&clone
);
655 dns_rdata_reset(&rdata
);
657 dns_rdataset_disassociate(&clone
);
658 if (result
== ISC_R_NOMORE
)
659 return (ISC_R_NOTFOUND
);
660 if (result
!= ISC_R_SUCCESS
)
663 INSIST(remaining
.length
!= 0);
665 rdataset
->methods
= &rdataset_methods
;
666 rdataset
->rdclass
= ncacherdataset
->rdclass
;
667 rdataset
->type
= dns_rdatatype_rrsig
;
668 rdataset
->covers
= covers
;
669 rdataset
->ttl
= ncacherdataset
->ttl
;
670 rdataset
->trust
= trust
;
671 rdataset
->private1
= NULL
;
672 rdataset
->private2
= NULL
;
674 rdataset
->private3
= remaining
.base
;
677 * Reset iterator state.
679 rdataset
->privateuint4
= 0;
680 rdataset
->private5
= NULL
;
681 rdataset
->private6
= NULL
;
682 return (ISC_R_SUCCESS
);
686 dns_ncache_current(dns_rdataset_t
*ncacherdataset
, dns_name_t
*found
,
687 dns_rdataset_t
*rdataset
)
689 dns_rdata_t rdata
= DNS_RDATA_INIT
;
691 isc_region_t remaining
, sigregion
;
694 dns_rdatatype_t type
;
696 dns_rdata_rrsig_t rrsig
;
699 REQUIRE(ncacherdataset
!= NULL
);
700 REQUIRE(ncacherdataset
->type
== 0);
701 REQUIRE((ncacherdataset
->attributes
& DNS_RDATASETATTR_NEGATIVE
) != 0);
702 REQUIRE(found
!= NULL
);
703 REQUIRE(!dns_rdataset_isassociated(rdataset
));
705 dns_rdataset_current(ncacherdataset
, &rdata
);
706 isc_buffer_init(&source
, rdata
.data
, rdata
.length
);
707 isc_buffer_add(&source
, rdata
.length
);
709 dns_name_init(&tname
, NULL
);
710 isc_buffer_remainingregion(&source
, &remaining
);
711 dns_name_fromregion(found
, &remaining
);
712 INSIST(remaining
.length
>= found
->length
);
713 isc_buffer_forward(&source
, found
->length
);
714 remaining
.length
-= found
->length
;
716 INSIST(remaining
.length
>= 5);
717 type
= isc_buffer_getuint16(&source
);
718 trust
= isc_buffer_getuint8(&source
);
719 INSIST(trust
<= dns_trust_ultimate
);
720 isc_buffer_remainingregion(&source
, &remaining
);
722 rdataset
->methods
= &rdataset_methods
;
723 rdataset
->rdclass
= ncacherdataset
->rdclass
;
724 rdataset
->type
= type
;
725 if (type
== dns_rdatatype_rrsig
) {
727 * Extract covers from RRSIG.
729 raw
= remaining
.base
;
730 count
= raw
[0] * 256 + raw
[1];
733 sigregion
.length
= raw
[0] * 256 + raw
[1];
735 sigregion
.base
= raw
;
736 dns_rdata_reset(&rdata
);
737 dns_rdata_fromregion(&rdata
, rdataset
->rdclass
,
738 rdataset
->type
, &sigregion
);
739 (void)dns_rdata_tostruct(&rdata
, &rrsig
, NULL
);
740 rdataset
->covers
= rrsig
.covered
;
742 rdataset
->covers
= 0;
743 rdataset
->ttl
= ncacherdataset
->ttl
;
744 rdataset
->trust
= trust
;
745 rdataset
->private1
= NULL
;
746 rdataset
->private2
= NULL
;
748 rdataset
->private3
= remaining
.base
;
751 * Reset iterator state.
753 rdataset
->privateuint4
= 0;
754 rdataset
->private5
= NULL
;
755 rdataset
->private6
= NULL
;