ESP8266
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DNSServer Class Reference

Public Member Functions

 DNSServer ()
 
void processNextRequest ()
 
void setErrorReplyCode (const DNSReplyCode &replyCode)
 
void setTTL (const uint32_t &ttl)
 
bool start (const uint16_t &port, const String &domainName, const IPAddress &resolvedIP)
 
void stop ()
 

Private Member Functions

void downcaseAndRemoveWwwPrefix (String &domainName)
 
String getDomainNameWithoutWwwPrefix ()
 
bool requestIncludesOnlyOneQuestion ()
 
void replyWithIP ()
 
void replyWithCustomCode ()
 

Private Attributes

WiFiUDP _udp
 
uint16_t _port
 
String _domainName
 
unsigned char _resolvedIP [4]
 
int _currentPacketSize
 
unsigned char * _buffer
 
DNSHeader_dnsHeader
 
uint32_t _ttl
 
DNSReplyCode _errorReplyCode
 

Constructor & Destructor Documentation

DNSServer::DNSServer ( )

Member Function Documentation

void DNSServer::downcaseAndRemoveWwwPrefix ( String &  domainName)
private
String DNSServer::getDomainNameWithoutWwwPrefix ( )
private
void DNSServer::processNextRequest ( )
void DNSServer::replyWithCustomCode ( )
private
void DNSServer::replyWithIP ( )
private
bool DNSServer::requestIncludesOnlyOneQuestion ( )
private
void DNSServer::setErrorReplyCode ( const DNSReplyCode &  replyCode)
void DNSServer::setTTL ( const uint32_t &  ttl)
bool DNSServer::start ( const uint16_t &  port,
const String &  domainName,
const IPAddress resolvedIP 
)
void DNSServer::stop ( )

Member Data Documentation

unsigned char* DNSServer::_buffer
private
int DNSServer::_currentPacketSize
private
DNSHeader* DNSServer::_dnsHeader
private
String DNSServer::_domainName
private
DNSReplyCode DNSServer::_errorReplyCode
private
uint16_t DNSServer::_port
private
unsigned char DNSServer::_resolvedIP[4]
private
uint32_t DNSServer::_ttl
private
WiFiUDP DNSServer::_udp
private