OpenZWave Library 1.6.1914
Loading...
Searching...
No Matches
DNSThread.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//
3// DNSThread.h
4//
5// Async DNS Lookups
6//
7// Copyright (c) 2016 Justin Hammond <justin@dynam.ac>
8//
9// SOFTWARE NOTICE AND LICENSE
10//
11// This file is part of OpenZWave.
12//
13// OpenZWave is free software: you can redistribute it and/or modify
14// it under the terms of the GNU Lesser General Public License as published
15// by the Free Software Foundation, either version 3 of the License,
16// or (at your option) any later version.
17//
18// OpenZWave is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU Lesser General Public License for more details.
22//
23// You should have received a copy of the GNU Lesser General Public License
24// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25//
26//-----------------------------------------------------------------------------
27
28#ifndef _DNSThread_H
29#define _DNSThread_H
30
31#include <string>
32#include <map>
33#include <list>
34
35#include "Defs.h"
36#include "Driver.h"
37#include "platform/Event.h"
38#include "platform/Mutex.h"
39#include "platform/TimeStamp.h"
40#include "platform/DNS.h"
41
42namespace OpenZWave
43{
44 namespace Internal
45 {
46 namespace Platform
47 {
48 class Event;
49 class Mutex;
50 class Thread;
51 }
52
54 {
56 };
57
58 struct DNSLookup
59 {
61 string lookup;
62 string result;
65
66 };
67
72 {
73 friend class OpenZWave::Driver;
74 private:
76 virtual ~DNSThread();
77
81 static void DNSThreadEntryPoint(Internal::Platform::Event* _exitEvent, void* _context);
85 void DNSThreadProc(Internal::Platform::Event* _exitEvent);
86
87 /* submit a Request to the DNS List */
88 bool sendRequest(DNSLookup *);
89
90 /* process the most recent request recieved */
91 void processResult();
92
93 Driver* m_driver;
94 Internal::Platform::Mutex* m_dnsMutex;
95 list<DNSLookup *> m_dnslist;
96 list<DNSLookup *> m_dnslistinprogress;
97 Internal::Platform::Event* m_dnsRequestEvent;
98 Internal::Platform::DNS m_dnsresolver;
99
100 };
101 /* class DNSThread */
102 } // namespace Internal
103} /* namespace OpenZWave */
104
105#endif
#define OPENZWAVE_EXPORT
Definition Defs.h:52
unsigned char uint8
Definition Defs.h:85
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition Driver.h:85
the DNSThread provides Async DNS lookups for checking revision numbers of Config Files against the of...
Definition DNSThread.h:72
Implements platform-independent DNS lookup Operations.
Definition DNS.h:59
Platform-independent definition of event objects.
Definition Event.h:45
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition Mutex.h:45
DNSError
Return codes for DNS lookups.
Definition DNS.h:48
LookupType
Definition DNSThread.h:54
@ DNS_Lookup_ConfigRevision
Definition DNSThread.h:55
Definition Bitfield.cpp:31
Definition DNSThread.h:59
string result
Definition DNSThread.h:62
LookupType type
Definition DNSThread.h:64
Internal::Platform::DNSError status
Definition DNSThread.h:63
uint8 NodeID
Definition DNSThread.h:60
string lookup
Definition DNSThread.h:61