openthread_sys

Function otDnsClientResolveServiceAndHostAddress

Source
pub unsafe extern "C" fn otDnsClientResolveServiceAndHostAddress(
    aInstance: *mut otInstance,
    aInstanceLabel: *const c_char,
    aServiceName: *const c_char,
    aCallback: otDnsServiceCallback,
    aContext: *mut c_void,
    aConfig: *const otDnsQueryConfig,
) -> otError
Expand description

Starts a DNS service instance resolution for a given service instance, with a potential follow-up address resolution for the host name discovered for the service instance.

Is available when OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE is enabled.

The @p aConfig can be NULL. In this case the default config (from otDnsClientGetDefaultConfig()) will be used as the config for this query. In a non-NULL @p aConfig, some of the fields can be left unspecified (value zero). The unspecified fields are then replaced by the values from the default config. This function cannot be used with mServiceMode in DNS config set to OT_DNS_SERVICE_MODE_TXT (i.e., querying for TXT record only) and will return OT_ERROR_INVALID_ARGS.

Behaves similarly to otDnsClientResolveService() sending queries for SRV and TXT records. However, if the server/resolver does not provide AAAA/A records for the host name in the response to SRV query (in the Additional Data section), it will perform host name resolution (sending an AAAA query) for the discovered host name from the SRV record. The callback @p aCallback is invoked when responses for all queries are received (i.e., both service and host address resolutions are finished).

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aInstanceLabel The service instance label. @param[in] aServiceName The service name (together with @p aInstanceLabel form full instance name). @param[in] aCallback A function pointer that shall be called on response reception or time-out. @param[in] aContext A pointer to arbitrary context information. @param[in] aConfig A pointer to the config to use for this query.

@retval OT_ERROR_NONE Query sent successfully. @p aCallback will be invoked to report the status. @retval OT_ERROR_NO_BUFS Insufficient buffer to prepare and send query. @retval OT_ERROR_INVALID_ARGS @p aInstanceLabel is NULL, or @p aConfig is invalid.