}
/** Dematerialize a rdataset. */
- int rdataset_dematerialize(const knot_rdataset_t *rds, void * restrict data);
+ int rdataset_dematerialize(const knot_rdataset_t *rds, uint8_t * restrict data);
+/** NSEC* parameters; almost nothing is meaningful for NSEC. */
+struct nsec_p {
+ const uint8_t *raw; /**< Pointer to raw NSEC3 parameters; NULL for NSEC. */
+ nsec_p_hash_t hash; /**< Hash of `raw`, used for cache keys. */
+ dnssec_nsec3_params_t libknot; /**< Format for libknot; owns malloced memory! */
+};
+
/** Partially constructed answer when gathering RRsets from cache. */
struct answer {
- int rcode; /**< PKT_NODATA, etc. */
- uint8_t nsec_v; /**< 1 or 3 */
- knot_mm_t *mm; /**< Allocator for rrsets */
+ int rcode; /**< PKT_NODATA, etc. */
+ struct nsec_p nsec_p; /**< Don't mix different NSEC* parameters in one answer. */
+ knot_mm_t *mm; /**< Allocator for rrsets */
struct answer_rrset {
ranked_rr_array_entry_t set; /**< set+rank for the main data */
knot_rdataset_t sig_rds; /**< RRSIG data, if any */