OpenZWave Library 1.6.0
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 class Event;
45 class Mutex;
46 class Controller;
47 class Thread;
48
49
52 };
53
54 struct DNSLookup {
56 string lookup;
57 string result;
60
61 };
62
63
68 {
69 friend class Driver;
70 private:
72 virtual ~DNSThread();
73
77 static void DNSThreadEntryPoint( Event* _exitEvent, void* _context );
81 void DNSThreadProc( Event* _exitEvent );
82
83 /* submit a Request to the DNS List */
84 bool sendRequest(DNSLookup *);
85
86 /* process the most recent request recieved */
87 void processResult();
88
89 Driver* m_driver;
90 Mutex* m_dnsMutex;
91 list<DNSLookup *> m_dnslist;
92 list<DNSLookup *> m_dnslistinprogress;
93 Event* m_dnsRequestEvent;
94 DNS m_dnsresolver;
95
96
97 }; /* class DNSThread */
98} /* namespace OpenZWave */
99
100
101#endif
#define OPENZWAVE_EXPORT
Definition: Defs.h:51
unsigned char uint8
Definition: Defs.h:89
the DNSThread provides Async DNS lookups for checking revision numbers of Config Files against the of...
Definition: DNSThread.h:68
Implements platform-independent DNS lookup Operations.
Definition: DNS.h:57
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition: Driver.h:65
Platform-independent definition of event objects.
Definition: Event.h:41
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition: Mutex.h:41
DNSError
Return codes for DNS lookups.
Definition: DNS.h:45
Definition: Bitfield.h:35
LookupType
Definition: DNSThread.h:50
@ DNS_Lookup_ConfigRevision
Definition: DNSThread.h:51
Definition: DNSThread.h:54
string lookup
Definition: DNSThread.h:56
string result
Definition: DNSThread.h:57
LookupType type
Definition: DNSThread.h:59
uint8 NodeID
Definition: DNSThread.h:55
DNSError status
Definition: DNSThread.h:58