mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[dns] simplify defines name and clean up (#3209)
This commit is contained in:
committed by
Jonathan Hui
parent
fe2a4974a6
commit
597a81fd0a
@@ -54,8 +54,8 @@ extern "C" {
|
||||
|
||||
#define OT_DNS_MAX_HOSTNAME_LENGTH 62 ///< Maximum allowed hostname length (maximum label size - 1 for compression).
|
||||
|
||||
#define OT_DNS_DEFAULT_DNS_SERVER_IP "2001:4860:4860::8888" ///< Defines default DNS Server address - Google DNS.
|
||||
#define OT_DNS_DEFAULT_DNS_SERVER_PORT 53 ///< Defines default DNS Server port.
|
||||
#define OT_DNS_DEFAULT_SERVER_IP "2001:4860:4860::8888" ///< Defines default DNS Server address - Google DNS.
|
||||
#define OT_DNS_DEFAULT_SERVER_PORT 53 ///< Defines default DNS Server port.
|
||||
|
||||
/**
|
||||
* This structure implements DNS Query parameters.
|
||||
|
||||
+2
-2
@@ -797,7 +797,7 @@ exit:
|
||||
void Interpreter::ProcessDns(int argc, char *argv[])
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
long port = OT_DNS_DEFAULT_DNS_SERVER_PORT;
|
||||
long port = OT_DNS_DEFAULT_SERVER_PORT;
|
||||
Ip6::MessageInfo messageInfo;
|
||||
otDnsQuery query;
|
||||
|
||||
@@ -820,7 +820,7 @@ void Interpreter::ProcessDns(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
// Use IPv6 address of default DNS server.
|
||||
SuccessOrExit(error = messageInfo.GetPeerAddr().FromString(OT_DNS_DEFAULT_DNS_SERVER_IP));
|
||||
SuccessOrExit(error = messageInfo.GetPeerAddr().FromString(OT_DNS_DEFAULT_SERVER_IP));
|
||||
}
|
||||
|
||||
if (argc > 3)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread UDP API.
|
||||
* This file implements the OpenThread DNSv6 API.
|
||||
*/
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
@@ -471,10 +471,7 @@ void Client::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessag
|
||||
|
||||
VerifyOrExit((message = FindRelatedQuery(responseHeader, queryMetadata)) != NULL);
|
||||
|
||||
if (responseHeader.GetResponseCode() != Header::kResponseSuccess)
|
||||
{
|
||||
ExitNow(error = OT_ERROR_FAILED);
|
||||
}
|
||||
VerifyOrExit(responseHeader.GetResponseCode() == Header::kResponseSuccess, error = OT_ERROR_FAILED);
|
||||
|
||||
// Parse and check the question section.
|
||||
SuccessOrExit(error = CompareQuestions(aMessage, *message, offset));
|
||||
|
||||
@@ -193,14 +193,6 @@ public:
|
||||
*/
|
||||
otError Query(const otDnsQuery *aQuery, otDnsResponseHandler aHandler, void *aContext);
|
||||
|
||||
/**
|
||||
* This method returns a port number used by DNS client.
|
||||
*
|
||||
* @returns A port number.
|
||||
*
|
||||
*/
|
||||
uint16_t GetPort(void) { return mSocket.GetSockName().mPort; };
|
||||
|
||||
private:
|
||||
/**
|
||||
* Retransmission parameters.
|
||||
|
||||
Reference in New Issue
Block a user