/contrib/bind9/lib/dns/include/dns/rdataset.h

https://bitbucket.org/freebsd/freebsd-head/ · C Header · 662 lines · 207 code · 42 blank · 413 comment · 0 complexity · 07e0e197edae7dd2e6718a78dfd1367a MD5 · raw file

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