Registers or updates a host on mDNS. The fields in @p aHost follow these rules: - The `mHostName` field specifies the host name to register (e.g., "myhost"). MUST NOT contain the domain name. - The `mAddresses` is array of IPv6 addresses to register with the host. `mAddressesLength` provides the number of entries in `mAddresses` array. - The `mAddresses` array can be empty with zero `mAddressesLength`. In this case, mDNS will treat it as if host is unregistered and stops advertising any addresses for this the host name. - The `mTtl` specifies the TTL if non-zero. If zero, the mDNS core will choose the default TTL of 120 seconds. - Other fields in @p aHost structure are ignored in an `otMdnsRegisterHost()` 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 @p aCallback with @p aRequestId as its input and one of the following `aError` inputs: - `OT_ERROR_NONE` indicates registration was successful. - `OT_ERROR_DULICATED` indicates 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 @p aCallback can be `NULL` if caller does not want to be notified of the outcome.
Unregisters a host on mDNS. The fields in @p aHost follow these rules: - The `mHostName` field specifies the host name to unregister (e.g., "myhost"). MUST NOT contain the domain name. - Other fields in @p aHost structure are ignored in an `otMdnsUnregisterHost()` 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.
Registers or updates a host on the infrastructure network's DNS-SD module. The @p aHost and all its contained information (strings and arrays) are only valid during this call. The platform MUST save a copy of the information if it wants to retain the information after returning from this function. The fields in @p aHost follow these rules: - The `mHostName` field specifies the host name to register. It is never NULL. - The `mAddresses` field is an array of IPv6 addresses to register with the host. `mAddressesLength` field provides the number of entries in `mAddresses` array. The platform implementation MUST not filter or remove any of addresses in the list. The OpenThread stack will already ensure that the given addresses are externally reachable. For example, when registering host from an SRP registration, link-local or mesh-local addresses associated with the host which are intended for use within Thread mesh are not included in `mAddresses` array passed to this API. The `mAddresses` array can be empty with zero `mAddressesLength`. In such a case, the platform MUST stop advertising any addresses for this host name on the infrastructure DNS-SD. - The `mTtl` field specifies the TTL if non-zero. If zero, the platform can choose the TTL to use. - The `mInfraIfIndex` field, if non-zero, specifies the infrastructure network interface index to use for this request. If zero, the platform implementation can decided the interface. Regarding the invocation of the @p aCallback and the reuse of the @p aRequestId, this function follows the same rules as described in `otPlatDnssdRegisterService()`. The OpenThread stack will not register the same host (with no changes) that was registered successfully earlier. Therefore, the platform implementation does not need to check for duplicate/same host and can assume that calls to this function are either registering a new entry or changing some parameter in a previously registered item. As a result, these changes always need to be synced on the infrastructure DNS-SD module.
Unregisters a host on the infrastructure network's DNS-SD module. The @p aHost and all its contained information (strings and arrays) are only valid during this call. The platform MUST save a copy of the information if it wants to retain the information after returning from this function. The fields in @p aHost follow these rules: - The `mHostName` field specifies the host name to unregister. It is never NULL. - The `mInfraIfIndex` field, if non-zero, specifies the infrastructure network interface index to use for this request. If zero, the platform implementation can decided the interface. - The rest of the fields in @p aHost structure MUST be ignored in `otPlatDnssdUnregisterHost()` call and may be set to zero by the OpenThread stack. Regarding the invocation of the @p aCallback and the reuse of the @p aRequestId, this function follows the same rules as described in `otPlatDnssdRegisterService()`. The OpenThread stack may request the unregistration of a host that was not previously registered, and the platform implementation MUST handle this case. In such a case, the platform can use either `OT_ERROR_NOT_FOUND` to indicate that there was no such registration, or `OT_ERROR_NONE` when invoking the @p aCallback function. OpenThread stack will handle either case correctly. When unregistering a host, the OpenThread stack will also unregister any previously registered services associated with the same host (by calling `otPlatDnssdUnregisterService()`). However, the platform implementation MAY assume that unregistering a host also unregisters all its associated services.
Iterates over registered host entries. Requires `OPENTHREAD_CONFIG_MULTICAST_DNS_ENTRY_ITERATION_API_ENABLE`. On success, @p 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.