Expand description
mDNS/DNS-SD: Multicast DNS and Service Discovery for VeridianOS
Implements RFC 6762 (Multicast DNS) and RFC 6763 (DNS-Based Service
Discovery) for zero-configuration networking on the .local domain.
Features:
- mDNS query/response on 224.0.0.251:5353 (IPv4) / [ff02::fb]:5353 (IPv6)
- One-shot and continuous query modes
- Known-answer suppression
- Conflict resolution: probe (3x, 250ms) then announce (2x, 1s)
- DNS-SD service registration, browsing, and deregistration
- PTR/SRV/TXT record handling for service instances
- TTL-based cache with expiry
- Goodbye packets (TTL=0) on shutdown
Structs§
- Cache
Entry - A cached mDNS record with expiry tracking
- Mdns
Question - An mDNS question
- Mdns
Record - An mDNS resource record
- Mdns
Responder - Core mDNS responder managing registered services and cached records
- Service
Instance - A registered DNS-SD service instance
- Service
Type - A parsed DNS-SD service type
- SrvRecord
- SRV record data (RFC 2782)
- TxtEntry
- Single TXT record entry
- TxtRecord
- TXT record: collection of key=value pairs
Enums§
- Mdns
Class - DNS class (IN = Internet)
- Mdns
Error - Errors from mDNS operations
- Mdns
Record Type - DNS record type codes used by mDNS/DNS-SD
- Probe
State - State of a name-claiming probe sequence
Constants§
- ANNOUNCE_
COUNT - Number of announcements after claiming a name
- ANNOUNCE_
INTERVAL_ MS - Announce interval in milliseconds
- LOCAL_
SUFFIX .localsuffix- MDNS_
IPV4_ ADDR - mDNS multicast IPv4 address: 224.0.0.251
- MDNS_
IPV6_ ADDR - mDNS multicast IPv6 address: ff02::fb
- MDNS_
PORT - mDNS port
- PROBE_
COUNT - Number of probe attempts before claiming a name
- PROBE_
INTERVAL_ MS - Probe interval in milliseconds
- TTL_
SHARED - Default TTL for shared records (PTR, service types)
- TTL_
UNIQUE - Default TTL for unique records (host addresses, SRV)
Functions§
- build_
probe_ query - Build an mDNS probe query message for the given name (ANY type, QU bit set)
- decode_
dns_ name - Decode a DNS wire-format name from a buffer at the given offset.
Returns the decoded name and the number of bytes consumed from
offset. - encode_
dns_ name - Encode a domain name to DNS wire format (label-length prefixed)
- ipv4_
reverse_ name - Build a reverse lookup name for an IPv4 address
- is_
local_ name - Check if a name is in the
.localdomain - is_
reverse_ lookup - Check if a name is a reverse lookup address (.arpa)