]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Document the memory layout of rdatavec
authorAlessio Podda <alessio@isc.org>
Wed, 10 Dec 2025 10:11:39 +0000 (11:11 +0100)
committerAlessio Podda <alessio@isc.org>
Wed, 10 Dec 2025 11:18:34 +0000 (12:18 +0100)
lib/dns/rdatavec.c

index 3dd9eeb2cb8e22c2a489a850760e036a5486d888..7f7c38045dba495904fcccefb75b2b1aa9a58dc8 100644 (file)
  * The memory structure of an rdatavec is as follows:
  *
  *     header          (dns_vecheader_t)
- *     record count    (2 bytes)
+ *     record count    (2 bytes, big endian)
  *     data records
- *             data length     (2 bytes)
- *             order           (2 bytes)
- *             meta data       (1 byte for RRSIG, 0 for all other types)
+ *             data length     (2 bytes, big endian)
+ *             meta data       (1 byte for RRSIG, 0 bytes for all other types)
  *             data            (data length bytes)
  *
- * A "bare" rdatavec is everything after "header".
+ * A "bare" rdatavec is everything after the header. The first two bytes
+ * contain the count of rdata records in the rdatavec. For records with
+ * the DNS_VECHEADERATTR_NONEXISTENT attribute, the record count is omitted
+ * entirely.
  *
- * When a vec is created, data records are sorted into DNSSEC order.
+ * After the count, the rdata records are stored sequentially in memory.
+ * Each record consists of a length field, optional metadata, and the actual
+ * rdata bytes.
+ *
+ * The rdata format depends on the RR type and is defined by the type-specific
+ * *_fromwire and *_towire functions (e.g., lib/dns/rdata/in_1/a_1.c for A
+ * records). The data is typically stored in wire format.
+ *
+ * When a vec is created, data records are sorted into DNSSEC canonical order.
  */
 
 static void