WIZnetInterface using namespace

Dependents:   DualNetworkInterface-Basic

Fork of WIZnetInterface by WIZnet

Committer:
SteveKim
Date:
Tue Jul 14 10:16:16 2015 +0000
Revision:
20:3e61863c1f67
Parent:
Socket/DNSClient.h@0:6f28332c466f
Dual Network Interface for mbed;  - WIZwiki-W7500;  - ESP8266

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Soohwan Kim 0:6f28332c466f 1 // DNSClient.h 2013/4/5
Soohwan Kim 0:6f28332c466f 2 #pragma once
Soohwan Kim 0:6f28332c466f 3
SteveKim 20:3e61863c1f67 4 #include "UDPSocket.hpp"
SteveKim 20:3e61863c1f67 5
SteveKim 20:3e61863c1f67 6 namespace wiznet_space {
SteveKim 20:3e61863c1f67 7
Soohwan Kim 0:6f28332c466f 8 class DNSClient {
Soohwan Kim 0:6f28332c466f 9 public:
Soohwan Kim 0:6f28332c466f 10 DNSClient(const char* hostname = NULL);
Soohwan Kim 0:6f28332c466f 11 DNSClient(Endpoint* pHost);
Soohwan Kim 0:6f28332c466f 12 virtual ~DNSClient();
Soohwan Kim 0:6f28332c466f 13 bool lookup(const char* hostname = NULL);
Soohwan Kim 0:6f28332c466f 14 uint32_t ip;
Soohwan Kim 0:6f28332c466f 15 protected:
Soohwan Kim 0:6f28332c466f 16 void poll();
Soohwan Kim 0:6f28332c466f 17 void callback();
Soohwan Kim 0:6f28332c466f 18 int response(uint8_t buf[], int size);
Soohwan Kim 0:6f28332c466f 19 int query(uint8_t buf[], int size, const char* hostname);
Soohwan Kim 0:6f28332c466f 20 void resolve(const char* hostname);
Soohwan Kim 0:6f28332c466f 21 uint8_t m_id[2];
Soohwan Kim 0:6f28332c466f 22 Timer m_interval;
Soohwan Kim 0:6f28332c466f 23 int m_retry;
Soohwan Kim 0:6f28332c466f 24 const char* m_hostname;
Soohwan Kim 0:6f28332c466f 25 private:
Soohwan Kim 0:6f28332c466f 26 enum MyNetDnsState
Soohwan Kim 0:6f28332c466f 27 {
Soohwan Kim 0:6f28332c466f 28 MYNETDNS_START,
Soohwan Kim 0:6f28332c466f 29 MYNETDNS_PROCESSING, //Req has not completed
Soohwan Kim 0:6f28332c466f 30 MYNETDNS_NOTFOUND,
Soohwan Kim 0:6f28332c466f 31 MYNETDNS_ERROR,
Soohwan Kim 0:6f28332c466f 32 MYNETDNS_OK
Soohwan Kim 0:6f28332c466f 33 };
Soohwan Kim 0:6f28332c466f 34 MyNetDnsState m_state;
Soohwan Kim 0:6f28332c466f 35 UDPSocket *m_udp;
Soohwan Kim 0:6f28332c466f 36 };
Soohwan Kim 0:6f28332c466f 37
SteveKim 20:3e61863c1f67 38 }