Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mdns] add native mDNS support in OT (#9797)
This commit introduces native mDNS support within the OpenThread stack, implementing RFC 6762 compliant registration of hosts, services, and keys. It supports the following functionalities: - Sending probes to claim names. - Sending announcements on initial registration and changes. - Sending "goodbye" announcements when unregistered or upon record removal. - Negative responses (NSEC). - Support for service sub-types and their addition/removal. - Support for `_services._dns-sd._udp` queries (all service types). - Responding to queries (including "QU" questions). - Delay mechanism when responding to multi-question query messages, ensuring unique answers. - Providing extra records in the Additional Data section if not already in the Answer section (e.g., on a PTR query, include SRV and host AAAA addresses). - Implementing Known-Answer Suppression. - Supporting multi-packet queries with known answers in follow-up messages. - Rate-limiting record multicasts (once per second). - Rate-limiting probe responses (once per 250ms). - Detecting conflicts after probes. - Limiting the size of emitted responses or probes, breaking into multiple messages if necessary. - Detecting self originating messages (sent by mDNS module). - Support for service browser. - Support for service resolvers (SRV and TXT records) and IPv4/IPv6 address resolvers for hostnames. - Introduces smart cache management: - Passively caches service records for active browsers. - Passively caches address records for active service resolvers. - Enables multiple simultaneous browsers/resolvers for the same service/host. This commit introduces public `otMdns` OpenThread APIs and related CLI commands for the mDNS module. For platform abstraction, `otPlatMdns` APIs are defined in `mdns_socket.h` (e.g., to send or receive mDNS messages): - An implementation of the platform APIs is provided for posix. - Also under the simulation platform, a simplified implementation of the `otPlatMdns` APIs is provided (intended for testing). This commit also adds a detailed `test_mdns` unit test, validating various functionalities and covering potential edge cases.
- Loading branch information