Expand description
Parser and builder for the dnsRecord blob — how an Active-Directory-integrated DNS
zone stores each resource record (MS-DNSP §2.3.2.2, DNS_RPC_RECORD).
A dnsNode object under DC=<zone>,CN=MicrosoftDNS,… carries one multi-valued
dnsRecord attribute; every value is one of these blobs: a 24-byte header followed by
type-specific data. Nothing here talks to a network or to LDAP — it is bytes in, records
out, and back again.
use ms_dnsp::{DnsRecord, RecordData};
use std::net::Ipv4Addr;
let rec = DnsRecord::new(RecordData::A("10.0.0.1".parse().unwrap())).with_ttl(600);
let blob = rec.to_bytes();
assert_eq!(DnsRecord::parse(&blob).unwrap(), rec);Parsing never panics: every length byte is validated against the buffer first.
Modules§
- name
- The two length-prefixed name encodings MS-DNSP uses inside record data.
- rank
- Where the record came from — DNS uses this to decide which copy wins.
- ty
DNS_RECORD_TYPEvalues this crate models explicitly.
Structs§
- DnsRecord
- One
dnsRecordattribute value.
Enums§
- DnsError
- Record
Data - The type-specific half of a record.
Constants§
- HEADER_
LEN - Size of the fixed
DNS_RPC_RECORDheader that precedes the record data. - VERSION
- The record-structure version Windows writes.