pub unsafe extern "C" fn otDnsClientResolveIp4Address(
aInstance: *mut otInstance,
aHostName: *const c_char,
aCallback: otDnsAddressCallback,
aContext: *mut c_void,
aConfig: *const otDnsQueryConfig,
) -> otError
Expand description
Sends an address resolution DNS query for A (IPv4) record(s) for a given host name.
Requires and is available when OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE
is enabled.
When a successful response is received, the addresses are returned from @p aCallback as NAT64 IPv6 translated versions of the IPv4 addresses from the query response.
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.
@param[in] aInstance A pointer to an OpenThread instance. @param[in] aHostName The host name for which to query the address (MUST NOT be NULL). @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 The host name is not valid format or NAT64 is not enabled in config. @retval OT_ERROR_INVALID_STATE Cannot send query since Thread interface is not up.