mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 18:20:06 +00:00
[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.
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_MLR_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 0
|
||||
#define OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE 1
|
||||
@@ -99,5 +100,6 @@
|
||||
#define OPENTHREAD_CONFIG_DNS_DSO_MOCK_PLAT_APIS_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_BORDER_ROUTING_MOCK_PLAT_APIS_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_MOCK_PLAT_APIS_ENABLE 1
|
||||
#define OPENTHREAD_CONFIG_MULTICAST_DNS_MOCK_PLAT_APIS_ENABLE 1
|
||||
|
||||
#endif // OT_CORE_CONFIG_CHECK_SIZE_BR_H_
|
||||
|
||||
Reference in New Issue
Block a user