Skip to main content

Crate ms_dnsp

Crate ms_dnsp 

Source
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_TYPE values this crate models explicitly.

Structs§

DnsRecord
One dnsRecord attribute value.

Enums§

DnsError
RecordData
The type-specific half of a record.

Constants§

HEADER_LEN
Size of the fixed DNS_RPC_RECORD header that precedes the record data.
VERSION
The record-structure version Windows writes.

Type Aliases§

Result