Multicast DNS#
This module includes APIs for Multicast DNS (mDNS).
The mDNS APIs are available when the mDNS support OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE is enabled and the OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE is also enabled.
Modules#
Enumerations#
Represents a host/service/key entry state.
Typedefs#
Represents a request ID (uint32_t value) for registering a host, a service, or a key service.
Represents the callback function to report the outcome of a host, service, or key registration request.
Represents the callback function to report a detected name conflict after successful registration of an entry.
Represents an mDNS host.
Represents an mDNS service.
Represents an mDNS key record.
Represents an mDNS entry iterator.
Represents a host/service/key entry state.
Represents the callback function used to report a browse result.
Represents the callback function used to report an SRV resolve result.
Represents the callback function used to report a TXT resolve result.
Represents the callback function use to report a IPv6/IPv4 address resolve result.
Represents a service browser.
Represents an SRV service resolver.
Represents a TXT service resolver.
Represents an address resolver.
Represents a discovered host address and its TTL.
Functions#
Enables or disables the mDNS module.
Indicates whether the mDNS module is enabled.
Sets whether the mDNS module is allowed to send questions requesting unicast responses referred to as "QU" questions.
Indicates whether mDNS module is allowed to send "QU" questions requesting unicast response.
Sets the post-registration conflict callback.
Registers or updates a host on mDNS.
Unregisters a host on mDNS.
Registers or updates a service on mDNS.
Unregisters a service on mDNS module.
Registers or updates a key record on mDNS module.
Unregisters a key record on mDNS.
Allocates a new iterator.
Frees a previously allocated iterator.
Iterates over registered host entries.
Iterates over registered service entries.
Iterates over registered key entries.
Starts a service browser.
Stops a service browser.
Starts an SRV record resolver.
Stops an SRV record resolver.
Starts a TXT record resolver.
Stops a TXT record resolver.
Starts an IPv6 address resolver.
Stops an IPv6 address resolver.
Starts an IPv4 address resolver.
Stops an IPv4 address resolver.
Enumeration Documentation#
otMdnsEntryState#
otMdnsEntryState
Represents a host/service/key entry state.
| Enumerator | |
|---|---|
| OT_MDNS_ENTRY_STATE_PROBING | Probing to claim the name. |
| OT_MDNS_ENTRY_STATE_REGISTERED | Entry is successfully registered. |
| OT_MDNS_ENTRY_STATE_CONFLICT | Name conflict was detected. |
| OT_MDNS_ENTRY_STATE_REMOVING | Entry is being removed (sending "goodbye" announcements). |
Typedef Documentation#
otMdnsRequestId#
typedef otPlatDnssdRequestId otMdnsRequestId
Represents a request ID (uint32_t value) for registering a host, a service, or a key service.
otMdnsRegisterCallback#
typedef otPlatDnssdRegisterCallback otMdnsRegisterCallback
Represents the callback function to report the outcome of a host, service, or key registration request.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aRequestId | The request ID. | |
| [in] | aError | Error indicating the outcome of request. |
The outcome of a registration request is reported back by invoking this callback with one of the following aError inputs:
OT_ERROR_NONEindicates registration was successful.OT_ERROR_DUPLICATEDindicates a name conflict while probing, i.e., name is claimed by another mDNS responder.
See otMdnsRegisterHost(), otMdnsRegisterService(), and otMdnsRegisterKey() for more details about when the callback will be invoked.
otMdnsConflictCallback#
typedef void(* otMdnsConflictCallback) (otInstance *aInstance, const char *aName, const char *aServiceType) )(otInstance *aInstance, const char *aName, const char *aServiceType)
Represents the callback function to report a detected name conflict after successful registration of an entry.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aName | The host name or the service instance label. | |
| [in] | aServiceType | The service type (e.g., |
If a conflict is detected while registering an entry, it is reported through the provided otMdnsRegisterCallback. The otMdnsConflictCallback is used only when a name conflict is detected after an entry has been successfully registered.
A non-NULL aServiceType indicates that conflict is for a service entry. In this case aName specifies the service instance label (treated as as a single DNS label and can potentially include dot . character).
A NULL aServiceType indicates that conflict is for a host entry. In this case Name specifies the host name. It does not include the domain name.
otMdnsHost#
typedef otPlatDnssdHost otMdnsHost
Represents an mDNS host.
This type is used to register or unregister a host (otMdnsRegisterHost() and otMdnsUnregisterHost()).
See the description of each function for more details on how different fields are used in each case.
otMdnsService#
typedef otPlatDnssdService otMdnsService
Represents an mDNS service.
This type is used to register or unregister a service (otMdnsRegisterService() and otMdnsUnregisterService()).
See the description of each function for more details on how different fields are used in each case.
otMdnsKey#
typedef otPlatDnssdKey otMdnsKey
Represents an mDNS key record.
See otMdnsRegisterKey(), otMdnsUnregisterKey() for more details about fields in each case.
otMdnsEntryState#
typedef enum otMdnsEntryState otMdnsEntryState
Represents a host/service/key entry state.
otMdnsBrowseCallback#
typedef void(* otMdnsBrowseCallback) (otInstance *aInstance, const otMdnsBrowseResult *aResult) )(otInstance *aInstance, const otMdnsBrowseResult *aResult)
Represents the callback function used to report a browse result.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aResult | The browse result. |
otMdnsSrvCallback#
typedef void(* otMdnsSrvCallback) (otInstance *aInstance, const otMdnsSrvResult *aResult) )(otInstance *aInstance, const otMdnsSrvResult *aResult)
Represents the callback function used to report an SRV resolve result.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aResult | The SRV resolve result. |
otMdnsTxtCallback#
typedef void(* otMdnsTxtCallback) (otInstance *aInstance, const otMdnsTxtResult *aResult) )(otInstance *aInstance, const otMdnsTxtResult *aResult)
Represents the callback function used to report a TXT resolve result.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aResult | The TXT resolve result. |
otMdnsAddressCallback#
typedef void(* otMdnsAddressCallback) (otInstance *aInstance, const otMdnsAddressResult *aResult) )(otInstance *aInstance, const otMdnsAddressResult *aResult)
Represents the callback function use to report a IPv6/IPv4 address resolve result.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| [in] | aInstance | The OpenThread instance. | |
| [in] | aResult | The address resolve result. |
otMdnsSrvResolver#
typedef struct otMdnsSrvResolver otMdnsSrvResolver
Represents an SRV service resolver.
otMdnsTxtResolver#
typedef struct otMdnsTxtResolver otMdnsTxtResolver
Represents a TXT service resolver.
otMdnsAddressResolver#
typedef struct otMdnsAddressResolver otMdnsAddressResolver
Represents an address resolver.
otMdnsAddressAndTtl#
typedef struct otMdnsAddressAndTtl otMdnsAddressAndTtl
Represents a discovered host address and its TTL.
Function Documentation#
otMdnsSetEnabled#
otError otMdnsSetEnabled (otInstance * aInstance, bool aEnable, uint32_t aInfraIfIndex)
Enables or disables the mDNS module.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| bool | [in] | aEnable | Boolean to indicate whether to enable (on |
| uint32_t | [in] | aInfraIfIndex | The network interface index for mDNS operation. Value is ignored when disabling |
The mDNS module should be enabled before registration any host, service, or key entries. Disabling mDNS will immediately stop all operations and any communication (multicast or unicast tx) and remove any previously registered entries without sending any "goodbye" announcements or invoking their callback. Once disabled, all currently active browsers and resolvers are stopped.
otMdnsIsEnabled#
bool otMdnsIsEnabled (otInstance * aInstance)
Indicates whether the mDNS module is enabled.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
otMdnsSetQuestionUnicastAllowed#
void otMdnsSetQuestionUnicastAllowed (otInstance * aInstance, bool aAllow)
Sets whether the mDNS module is allowed to send questions requesting unicast responses referred to as "QU" questions.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| bool | [in] | aAllow | Indicates whether or not to allow "QU" questions. |
The "QU" questions request unicast responses, in contrast to "QM" questions which request multicast responses.
When allowed, the first probe will be sent as a "QU" question. This API can be used to address platform limitation where platform socket cannot accept unicast response received on mDNS port (due to it being already bound).
otMdnsIsQuestionUnicastAllowed#
bool otMdnsIsQuestionUnicastAllowed (otInstance * aInstance)
Indicates whether mDNS module is allowed to send "QU" questions requesting unicast response.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | N/A | aInstance |
otMdnsSetConflictCallback#
void otMdnsSetConflictCallback (otInstance * aInstance, otMdnsConflictCallback aCallback)
Sets the post-registration conflict callback.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| otMdnsConflictCallback | [in] | aCallback | The conflict callback. |
If a conflict is detected while registering an entry, it is reported through the provided otMdnsRegisterCallback. The otMdnsConflictCallback is used only when a name conflict is detected after an entry has been successfully registered.
aCallback can be set to NULL if not needed. Subsequent calls will replace any previously set callback.
otMdnsRegisterHost#
otError otMdnsRegisterHost (otInstance * aInstance, const otMdnsHost * aHost, otMdnsRequestId aRequestId, otMdnsRegisterCallback aCallback)
Registers or updates a host on mDNS.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsHost * | [in] | aHost | Information about the host to register. |
| otMdnsRequestId | [in] | aRequestId | The ID associated with this request. |
| otMdnsRegisterCallback | [in] | aCallback | The callback function pointer to report the outcome (can be NULL if not needed). |
The fields in aHost follow these rules:
The
mHostNamefield specifies the host name to register (e.g., "myhost"). MUST NOT contain the domain name.The
mAddressesis array of IPv6 addresses to register with the host.mAddressesLengthprovides the number of entries inmAddressesarray.The
mAddressesarray can be empty with zeromAddressesLength. In this case, mDNS will treat it as if host is unregistered and stops advertising any addresses for this the host name.The
mTtlspecifies the TTL if non-zero. If zero, the mDNS core will choose the default TTL of 120 seconds.Other fields in
aHoststructure are ignored in anotMdnsRegisterHost()call.
This function can be called again for the same mHostName to update a previously registered host entry, for example, to change the list of addresses of the host. In this case, the mDNS module will send "goodbye" announcements for any previously registered and now removed addresses and announce any newly added addresses.
The outcome of the registration request is reported back by invoking the provided aCallback with aRequestId as its input and one of the following aError inputs:
OT_ERROR_NONEindicates registration was successful.OT_ERROR_DULICATEDindicates a name conflict while probing, i.e., name is claimed by another mDNS responder.
For caller convenience, the OpenThread mDNS module guarantees that the callback will be invoked after this function returns, even in cases of immediate registration success. The aCallback can be NULL if caller does not want to be notified of the outcome.
otMdnsUnregisterHost#
otError otMdnsUnregisterHost (otInstance * aInstance, const otMdnsHost * aHost)
Unregisters a host on mDNS.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsHost * | [in] | aHost | Information about the host to unregister. |
The fields in aHost follow these rules:
The
mHostNamefield specifies the host name to unregister (e.g., "myhost"). MUST NOT contain the domain name.Other fields in
aHoststructure are ignored in anotMdnsUnregisterHost()call.
If there is no previously registered host with the same name, no action is performed.
If there is a previously registered host with the same name, the mDNS module will send "goodbye" announcement for all previously advertised address records.
otMdnsRegisterService#
otError otMdnsRegisterService (otInstance * aInstance, const otMdnsService * aService, otMdnsRequestId aRequestId, otMdnsRegisterCallback aCallback)
Registers or updates a service on mDNS.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsService * | [in] | aService | Information about the service to register. |
| otMdnsRequestId | [in] | aRequestId | The ID associated with this request. |
| otMdnsRegisterCallback | [in] | aCallback | The callback function pointer to report the outcome (can be NULL if not needed). |
The fields in aService follow these rules:
The
mServiceInstancespecifies the service instance label. It is treated as a single DNS name label. It may contain dot.character which is allowed in a service instance label.The
mServiceTypespecifies the service type (e.g., "_tst._udp"). It is treated as multiple dot.separated labels. It MUST NOT contain the domain name.The
mHostNamefield specifies the host name of the service. MUST NOT contain the domain name.The
mSubTypeLabelsis an array of strings representing sub-types associated with the service. Each array entry is a sub-type label. ThemSubTypeLabels can be NULL if there is no sub-type. Otherwise, the array length is specified bymSubTypeLabelsLength.ThemTxtDataandmTxtDataLengthspecify the encoded TXT data. ThemTxtDatacan be NULL ormTxtDataLengthcan be zero to specify an empty TXT data. In this case mDNS module will use a single zero byte[ 0 ]` as the TXT data.The
mPort,mWeight, andmPriorityspecify the service's parameters as specified in DNS SRV record.The
mTtlspecifies the TTL if non-zero. If zero, the mDNS module will use the default TTL of 120 seconds.Other fields in
aServicestructure are ignored in anotMdnsRegisterService()call.
This function can be called again for the same mServiceInstance and mServiceType to update a previously registered service entry, for example, to change the sub-types list, or update any parameter such as port, weight, priority, TTL, or host name. The mDNS module will send announcements for any changed info, e.g., will send "goodbye" announcements for any removed sub-types and announce any newly added sub-types.
Regarding the invocation of the aCallback, this function behaves in the same way as described in otMdnsRegisterHost().
otMdnsUnregisterService#
otError otMdnsUnregisterService (otInstance * aInstance, const otMdnsService * aService)
Unregisters a service on mDNS module.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsService * | [in] | aService | Information about the service to unregister. |
The fields in aService follow these rules:
The
mServiceInstancespecifies the service instance label. It is treated as a single DNS name label. It may contain dot.character which is allowed in a service instance label.The
mServiceTypespecifies the service type (e.g., "_tst._udp"). It is treated as multiple dot.separated labels. It MUST NOT contain the domain name.Other fields in
aServicestructure are ignored in anotMdnsUnregisterService()call.
If there is no previously registered service with the same name, no action is performed.
If there is a previously registered service with the same name, the mDNS module will send "goodbye" announcements for all related records.
otMdnsRegisterKey#
otError otMdnsRegisterKey (otInstance * aInstance, const otMdnsKey * aKey, otMdnsRequestId aRequestId, otMdnsRegisterCallback aCallback)
Registers or updates a key record on mDNS module.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsKey * | [in] | aKey | Information about the key record to register. |
| otMdnsRequestId | [in] | aRequestId | The ID associated with this request. |
| otMdnsRegisterCallback | [in] | aCallback | The callback function pointer to report the outcome (can be NULL if not needed). |
The fields in aKey follow these rules:
If the key is associated with a host entry, the
mNamefield specifies the host name and themServiceTypeMUST be NULL.If the key is associated with a service entry, the
mNamefiled specifies the service instance label (always treated as a single label) and themServiceTypefiled specifies the service type (e.g., "_tst._udp"). In this case the DNS name for key record is<mName>.<mServiceTye>.The
mKeyDatafield contains the key record's data withmKeyDataLengthas its length in byes.The
mTtlspecifies the TTL if non-zero. If zero, the mDNS module will use the default TTL of 120 seconds.Other fields in
aKeystructure are ignored in anotMdnsRegisterKey()call.
This function can be called again for the same name to updated a previously registered key entry, for example, to change the key data or TTL.
Regarding the invocation of the aCallback, this function behaves in the same way as described in otMdnsRegisterHost().
otMdnsUnregisterKey#
otError otMdnsUnregisterKey (otInstance * aInstance, const otMdnsKey * aKey)
Unregisters a key record on mDNS.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsKey * | [in] | aKey | Information about the key to unregister. |
The fields in aKey follow these rules:
If the key is associated with a host entry, the
mNamefield specifies the host name and themServiceTypeMUST be NULL.If the key is associated with a service entry, the
mNamefiled specifies the service instance label (always treated as a single label) and themServiceTypefiled specifies the service type (e.g., "_tst._udp"). In this case the DNS name for key record is<mName>.<mServiceTye>.Other fields in
aKeystructure are ignored in anotMdnsUnregisterKey()call.
If there is no previously registered key with the same name, no action is performed.
If there is a previously registered key with the same name, the mDNS module will send "goodbye" announcements for the key record.
otMdnsAllocateIterator#
otMdnsIterator * otMdnsAllocateIterator (otInstance * aInstance)
Allocates a new iterator.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
An allocated iterator must be freed by the caller using otMdnsFreeIterator().
Returns
A pointer to the allocated iterator, or
NULLif it fails to allocate.
otMdnsFreeIterator#
void otMdnsFreeIterator (otInstance * aInstance, otMdnsIterator * aIterator)
Frees a previously allocated iterator.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| otMdnsIterator * | [in] | aIterator | The iterator to free. |
otMdnsGetNextHost#
otError otMdnsGetNextHost (otInstance * aInstance, otMdnsIterator * aIterator, otMdnsHost * aHost, otMdnsEntryState * aState)
Iterates over registered host entries.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| otMdnsIterator * | [in] | aIterator | Pointer to the iterator. |
| otMdnsHost * | [out] | aHost | Pointer to an |
| otMdnsEntryState * | [out] | aState | Pointer to an |
On success, aHost is populated with information about the next host. Pointers within the otMdnsHost structure (like mName) remain valid until the next call to any OpenThread stack's public or platform API/callback.
otMdnsGetNextService#
otError otMdnsGetNextService (otInstance * aInstance, otMdnsIterator * aIterator, otMdnsService * aService, otMdnsEntryState * aState)
Iterates over registered service entries.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| otMdnsIterator * | [in] | aIterator | Pointer to the iterator to use. |
| otMdnsService * | [out] | aService | Pointer to an |
| otMdnsEntryState * | [out] | aState | Pointer to an |
On success, aService is populated with information about the next service . Pointers within the otMdnsService structure (like mServiceType, mSubTypeLabels) remain valid until the next call to any OpenThread stack's public or platform API/callback.
otMdnsGetNextKey#
otError otMdnsGetNextKey (otInstance * aInstance, otMdnsIterator * aIterator, otMdnsKey * aKey, otMdnsEntryState * aState)
Iterates over registered key entries.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| otMdnsIterator * | [in] | aIterator | Pointer to the iterator to use. |
| otMdnsKey * | [out] | aKey | Pointer to an |
| otMdnsEntryState * | [out] | aState | Pointer to an |
On success, aKey is populated with information about the next key. Pointers within the otMdnsKey structure (like mName) remain valid until the next call to any OpenThread stack's public or platform API/callback.
otMdnsStartBrowser#
otError otMdnsStartBrowser (otInstance * aInstance, const otMdnsBrowser * aBrowser)
Starts a service browser.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsBrowser * | [in] | aBrowser | The browser to be started. |
Initiates a continuous search for the specified mServiceType in aBrowser. For sub-type services, use mSubTypeLabel to define the sub-type, for base services, set mSubTypeLabel to NULL.
Discovered services are reported through the mCallback function in aBrowser. Services that have been removed are reported with a TTL value of zero. The callback may be invoked immediately with cached information (if available) and potentially before this function returns. When cached results are used, the reported TTL value will reflect the original TTL from the last received response.
Multiple browsers can be started for the same service, provided they use different callback functions.
otMdnsStopBrowser#
otError otMdnsStopBrowser (otInstance * aInstance, const otMdnsBrowser * aBroswer)
Stops a service browser.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsBrowser * | [in] | aBroswer | The browser to stop. |
No action is performed if no matching browser with the same service and callback is currently active.
otMdnsStartSrvResolver#
otError otMdnsStartSrvResolver (otInstance * aInstance, const otMdnsSrvResolver * aResolver)
Starts an SRV record resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsSrvResolver * | [in] | aResolver | The resolver to be started. |
Initiates a continuous SRV record resolver for the specified service in aResolver.
Discovered information is reported through the mCallback function in aResolver. When the service is removed it is reported with a TTL value of zero. In this case, mHostName may be NULL and other result fields (such as mPort) should be ignored.
The callback may be invoked immediately with cached information (if available) and potentially before this function returns. When cached result is used, the reported TTL value will reflect the original TTL from the last received response.
Multiple resolvers can be started for the same service, provided they use different callback functions.
otMdnsStopSrvResolver#
otError otMdnsStopSrvResolver (otInstance * aInstance, const otMdnsSrvResolver * aResolver)
Stops an SRV record resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsSrvResolver * | [in] | aResolver | The resolver to stop. |
No action is performed if no matching resolver with the same service and callback is currently active.
otMdnsStartTxtResolver#
otError otMdnsStartTxtResolver (otInstance * aInstance, const otMdnsTxtResolver * aResolver)
Starts a TXT record resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsTxtResolver * | [in] | aResolver | The resolver to be started. |
Initiates a continuous TXT record resolver for the specified service in aResolver.
Discovered information is reported through the mCallback function in aResolver. When the TXT record is removed it is reported with a TTL value of zero. In this case, mTxtData may be NULL, and other result fields (such as mTxtDataLength) should be ignored.
The callback may be invoked immediately with cached information (if available) and potentially before this function returns. When cached result is used, the reported TTL value will reflect the original TTL from the last received response.
Multiple resolvers can be started for the same service, provided they use different callback functions.
otMdnsStopTxtResolver#
otError otMdnsStopTxtResolver (otInstance * aInstance, const otMdnsTxtResolver * aResolver)
Stops a TXT record resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsTxtResolver * | [in] | aResolver | The resolver to stop. |
No action is performed if no matching resolver with the same service and callback is currently active.
otMdnsStartIp6AddressResolver#
otError otMdnsStartIp6AddressResolver (otInstance * aInstance, const otMdnsAddressResolver * aResolver)
Starts an IPv6 address resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsAddressResolver * | [in] | aResolver | The resolver to be started. |
Initiates a continuous IPv6 address resolver for the specified host name in aResolver.
Discovered addresses are reported through the mCallback function in aResolver. The callback is invoked whenever addresses are added or removed, providing an updated list. If all addresses are removed, the callback is invoked with an empty list (mAddresses will be NULL, and mAddressesLength will be zero).
The callback may be invoked immediately with cached information (if available) and potentially before this function returns. When cached result is used, the reported TTL values will reflect the original TTL from the last received response.
Multiple resolvers can be started for the same host name, provided they use different callback functions.
otMdnsStopIp6AddressResolver#
otError otMdnsStopIp6AddressResolver (otInstance * aInstance, const otMdnsAddressResolver * aResolver)
Stops an IPv6 address resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsAddressResolver * | [in] | aResolver | The resolver to stop. |
No action is performed if no matching resolver with the same host name and callback is currently active.
otMdnsStartIp4AddressResolver#
otError otMdnsStartIp4AddressResolver (otInstance * aInstance, const otMdnsAddressResolver * aResolver)
Starts an IPv4 address resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsAddressResolver * | [in] | aResolver | The resolver to be started. |
Initiates a continuous IPv4 address resolver for the specified host name in aResolver.
Discovered addresses are reported through the mCallback function in aResolver. The IPv4 addresses are represented using the IPv4-mapped IPv6 address format in mAddresses array. The callback is invoked whenever addresses are added or removed, providing an updated list. If all addresses are removed, the callback is invoked with an empty list (mAddresses will be NULL, and mAddressesLength will be zero).
The callback may be invoked immediately with cached information (if available) and potentially before this function returns. When cached result is used, the reported TTL values will reflect the original TTL from the last received response.
Multiple resolvers can be started for the same host name, provided they use different callback functions.
otMdnsStopIp4AddressResolver#
otError otMdnsStopIp4AddressResolver (otInstance * aInstance, const otMdnsAddressResolver * aResolver)
Stops an IPv4 address resolver.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | The OpenThread instance. |
| const otMdnsAddressResolver * | [in] | aResolver | The resolver to stop. |
No action is performed if no matching resolver with the same host name and callback is currently active.