⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module mdns

Module mdns 

Source
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§

CacheEntry
A cached mDNS record with expiry tracking
MdnsQuestion
An mDNS question
MdnsRecord
An mDNS resource record
MdnsResponder
Core mDNS responder managing registered services and cached records
ServiceInstance
A registered DNS-SD service instance
ServiceType
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§

MdnsClass
DNS class (IN = Internet)
MdnsError
Errors from mDNS operations
MdnsRecordType
DNS record type codes used by mDNS/DNS-SD
ProbeState
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
.local suffix
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 .local domain
is_reverse_lookup
Check if a name is a reverse lookup address (.arpa)