Skip to main content

Module text

Module text 

Source
Expand description

Presentation-format (zone-file text) helpers shared by Display implementations: escaping (RFC 1035 §5.1), hex, base64 and base32hex (RFC 4648), and the generic RDATA form of RFC 3597 §5.

Record-data Display impls should use these rather than rolling their own, so every type escapes and encodes identically.

Structs§

Base64
Display adapter: standard base64 with padding (RFC 4648 §4), as used by DNSKEY, RRSIG, CERT, OPENPGPKEY, DHCID, …
Base32Hex
Display adapter: base32 with the “extended hex” alphabet, uppercase, unpadded (RFC 4648 §7), as used by NSEC3 (RFC 5155 §3.3).
Hex
Display adapter: uppercase hexadecimal, no separators.

Functions§

fmt_generic_rdata
Writes RDATA in the generic RFC 3597 §5 form: \# <length> <hex> (just \# 0 when empty).
fmt_label
Writes a label in presentation format: ., \, ", (, ), ;, @ and $ are backslash-escaped; space and non-printable bytes become \DDD (RFC 1035 §5.1, RFC 4343 §2.1).
fmt_quoted
Writes a <character-string> in quoted presentation format: " and \ are backslash-escaped; non-printable bytes become \DDD (RFC 1035 §5.1).