ot::Dns::Client::Response class
Represents a DNS query response.
Syntax
class Response : public otDnsAddressResponse,
#if OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE
public otDnsBrowseResponse,
public otDnsServiceResponse,
#endif
public Clearable<Response>
{
friend class Client;
protected:
enum Section : uint8_t
{
kAnswerSection,
kAdditionalDataSection,
};
Response(void) { Clear(); }
Error GetName(char *aNameBuffer, uint16_t aNameBufferSize) const;
void SelectSection(Section aSection, uint16_t &aOffset, uint16_t &aNumRecord) const;
Error CheckForHostNameAlias(Section aSection, Name &aHostName) const;
Error FindHostAddress(Section aSection,
const Name &aHostName,
uint16_t aIndex,
Ip6::Address &aAddress,
uint32_t &aTtl) const;
#if OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE
Error FindARecord(Section aSection, const Name &aHostName, uint16_t aIndex, ARecord &aARecord) const;
#endif
#if OPENTHREAD_CONFIG_DNS_CLIENT_SERVICE_DISCOVERY_ENABLE
void InitServiceInfo(ServiceInfo &aServiceInfo) const;
Error ReadServiceInfo(Section aSection, const Name &aName, ServiceInfo &aServiceInfo) const;
Error ReadTxtRecord(Section aSection, const Name &aName, ServiceInfo &aServiceInfo) const;
#endif
void PopulateFrom(const Message &aMessage);
Instance *mInstance;
Query *mQuery;
const Message *mMessage;
Response *mNext;
uint16_t mAnswerOffset;
uint16_t mAnswerRecordCount;
uint16_t mAdditionalOffset;
uint16_t mAdditionalRecordCount;
#if OPENTHREAD_CONFIG_DNS_CLIENT_NAT64_ENABLE
bool mIp6QueryResponseRequiresNat64;
#endif
};
Fields
Methods
GetName() const
SelectSection() const
CheckForHostNameAlias() const
FindHostAddress() const
FindARecord() const
InitServiceInfo() const
ReadServiceInfo() const
ReadTxtRecord() const
PopulateFrom()