openthread_sys

Function otDnsAddressResponseGetAddress

Source
pub unsafe extern "C" fn otDnsAddressResponseGetAddress(
    aResponse: *const otDnsAddressResponse,
    aIndex: u16,
    aAddress: *mut otIp6Address,
    aTtl: *mut u32,
) -> otError
Expand description

Gets an IPv6 address associated with an address resolution DNS response.

MUST only be used from otDnsAddressCallback.

The response may include multiple IPv6 address records. @p aIndex can be used to iterate through the list of addresses. Index zero gets the first address and so on. When we reach end of the list, OT_ERROR_NOT_FOUND is returned.

@param[in] aResponse A pointer to the response. @param[in] aIndex The address record index to retrieve. @param[out] aAddress A pointer to a IPv6 address to output the address (MUST NOT be NULL). @param[out] aTtl A pointer to an uint32_t to output TTL for the address. It can be NULL if caller does not want to get the TTL.

@retval OT_ERROR_NONE The address was read successfully. @retval OT_ERROR_NOT_FOUND No address record in @p aResponse at @p aIndex. @retval OT_ERROR_PARSE Could not parse the records in the @p aResponse. @retval OT_ERROR_INVALID_STATE No NAT64 prefix (applicable only when NAT64 is allowed).