mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 03:09:52 +00:00
[dnssd-server] implement DNS-SD discovery proxy functionality in core (#10050)
This commit implements a generic discovery proxy in the DNS-SD server. It uses a set of newly added `otPlatDnssd` platform DNS-SD(mDNS) APIs to start or stop browsers, SRV/TXT resolvers, and IPv6/IPv4 address resolvers. These APIs closely match the native OpenThread mDNS implementation. OpenThread DNS-SD's existing `QueryCallback` mechanism, enabling customized discovery proxy implementations, remains supported. This commit includes a comprehensive unit test. This test validates the discovery proxy's behavior, covering: standard use cases, request timeout, s hared resolver/browser usage for multiple queries with the same name, filtering of invalid addresses, and various edge cases.
This commit is contained in:
@@ -877,6 +877,66 @@ OT_TOOL_WEAK void otPlatDnssdUnregisterKey(otInstance *aInstance
|
||||
OT_UNUSED_VARIABLE(aCallback);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStartBrowser(otInstance *aInstance, const otPlatDnssdBrowser *aBrowser)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aBrowser);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStopBrowser(otInstance *aInstance, const otPlatDnssdBrowser *aBrowser)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aBrowser);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStartSrvResolver(otInstance *aInstance, const otPlatDnssdSrvResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStopSrvResolver(otInstance *aInstance, const otPlatDnssdSrvResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStartTxtResolver(otInstance *aInstance, const otPlatDnssdTxtResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStopTxtResolver(otInstance *aInstance, const otPlatDnssdTxtResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStartIp6AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStopIp6AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStartIp4AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otPlatDnssdStopIp4AddressResolver(otInstance *aInstance, const otPlatDnssdAddressResolver *aResolver)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aResolver);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_PLATFORM_DNSSD_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_LOG_CRASH_DUMP_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user