friendev EtherDune TCP/IP library
/home/jander/temp/etherdune/DNS.h
Go to the documentation of this file.
1 // EtherDune DNS Service
2 // Author: Javier Peletier <jm@friendev.com>
3 // Summary: Implements the basics of DNS so as to resolve hostnames to IP addresses
4 //
5 // Copyright (c) 2015 All Rights Reserved, http://friendev.com
6 //
7 // This source is subject to the GPLv2 license.
8 // Please see the License.txt file for more information.
9 // All other rights reserved.
10 //
11 // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
12 // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13 // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
14 // PARTICULAR PURPOSE.
15 
43 
44 #ifndef __DNS__
45 #define __DNS__
46 
47 #include <ACross.h>
48 #include "UDPSocket.h"
49 
50 
51 class NetworkService;
52 class DNSClient : private UDPSocket
53 {
54  friend class NetworkService;
55 private:
56 
57  uint8_t timer;
58 
59  void onReceive(uint16_t len);
60  bool sendPacket();
61  void tick();
62  DNSClient();
63 
64 public:
65 
66  uint16_t resolve(const char* name);
67 
68 };
69 
70 
71 #endif
Implements the UDP protocol.
Definition: UDPSocket.h:34
virtual void tick()
This is a timer function that is called every NETWORK_TIMER_RESOLUTION milliseconds on every service...
uint16_t resolve(const char *name)
Resolves a host name to an IP address
Definition: DNS.cpp:45
EtherDune DNS Service.
Definition: DNS.h:52
friend class DNSClient
Abstract base class for any network service running in EtherDune.