Expand description
The mdns.advertise and mdns.browse plugin methods: DNS-SD on the LAN,
done by the host on a plugin’s behalf.
A sandboxed plugin cannot run an mDNS responder itself. Every plugin unit
carries SocketBindDeny=any, and systemd’s bind filter matches every port
under any, the ephemeral port 0 included, so an in-process daemon fails at
its first bind (the signal socket) before it could reach the multicast
port. The host is not sandboxed and publishes the record with the same
library and the same SRV-target rule core’s own _ados._tcp advert uses:
the system hostname as crate::reach::mdns_hostname resolves it, the one
name avahi answers for.
An advert is owned by the plugin connection that made it and is withdrawn
when that connection ends, so a record never outlives the process serving
the port it names. Its port must be one of the plugin’s declared
listen_ports: a plugin can only advertise what the sandbox lets it serve.
The service types core publishes itself (RESERVED_SERVICE_TYPES) are
refused, so a plugin cannot impersonate a node’s pairing record or a ground
station’s receiver. Browsing any well-formed type is allowed.
The types are the wire shape: the host decodes the request and serializes the reply with them, and the SDK does the reverse, so the two cannot drift.
Structs§
- Advertise
Request - An
mdns.advertiserequest. - Advertised
- The record the host published.
- Browse
Reply - What one browse found.
- Browse
Request - An
mdns.browserequest. - Discovered
Service - One resolved service instance.
Constants§
- ADVERTISE_
CAPABILITY - The capability
mdns.advertiseis gated on: advertising a port is offering it to the network, which is whatnetwork.listengrants. - ADVERTISE_
METHOD - The advertise method’s wire name.
- BROWSE_
CAPABILITY - The capability
mdns.browseis gated on: a browse finds peers to connect out to. - BROWSE_
DEFAULT_ TIMEOUT_ MS - The browse window when the request names none.
- BROWSE_
MAX_ RESULTS - The most services one browse returns.
- BROWSE_
MAX_ TIMEOUT_ MS - The longest browse window a request may ask for.
- BROWSE_
METHOD - The browse method’s wire name.
- BROWSE_
MIN_ TIMEOUT_ MS - The shortest browse window: one mDNS query round trip.
- RESERVED_
SERVICE_ TYPES - The service types core publishes. A plugin may browse them but never
advertise one:
_ados._tcpis every node’s pairing record (the control front publishes it on every profile and interface) and_ados-receiver._tcpis the ground-station mesh receiver. - TXT_
MAX_ ENTRIES - The most TXT entries one advert may carry.
- TXT_
MAX_ KEY_ LEN - The longest TXT key.
- TXT_
MAX_ VALUE_ LEN - The longest TXT value, in bytes.
Functions§
- advertisable_
service_ type - The service type a plugin may advertise, canonical: TCP, well formed, and not one core publishes.
- normalize_
service_ type - The canonical
_<name>._<tcp|udp>form of a service type (a trailing.local.or.localis stripped), or why it is not one. - validate_
txt - Check a TXT record against the size and key rules: at most
TXT_MAX_ENTRIESentries, keys of 1..=TXT_MAX_KEY_LENprintable ASCII characters without=, values of at mostTXT_MAX_VALUE_LENbytes.