OpenZWave Library
1.6.1914
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
src
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
42
namespace
OpenZWave
43
{
44
namespace
Internal
45
{
46
namespace
Platform
47
{
48
class
Event
;
49
class
Mutex
;
50
class
Thread
;
51
}
52
53
enum
LookupType
54
{
55
DNS_Lookup_ConfigRevision
= 1
56
};
57
58
struct
DNSLookup
59
{
60
uint8
NodeID
;
61
string
lookup
;
62
string
result
;
63
Internal::Platform::DNSError
status
;
64
LookupType
type
;
65
66
};
67
71
class
OPENZWAVE_EXPORT
DNSThread
72
{
73
friend
class
OpenZWave::Driver
;
74
private
:
75
DNSThread(
Driver
*);
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
DNS.h
Defs.h
OPENZWAVE_EXPORT
#define OPENZWAVE_EXPORT
Definition
Defs.h:52
uint8
unsigned char uint8
Definition
Defs.h:85
Driver.h
Event.h
Mutex.h
TimeStamp.h
OpenZWave::Driver
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition
Driver.h:85
OpenZWave::Internal::DNSThread::Driver
friend class OpenZWave::Driver
Definition
DNSThread.h:73
OpenZWave::Internal::Platform::DNS
Implements platform-independent DNS lookup Operations.
Definition
DNS.h:59
OpenZWave::Internal::Platform::Event
Platform-independent definition of event objects.
Definition
Event.h:45
OpenZWave::Internal::Platform::Mutex
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition
Mutex.h:45
OpenZWave::Internal::Platform::Thread
Implements a platform-independent thread management class.
Definition
Thread.h:48
OpenZWave::Internal::Platform::DNSError
DNSError
Return codes for DNS lookups.
Definition
DNS.h:48
OpenZWave::Internal::Platform
Definition
WakeUp.h:42
OpenZWave::Internal
Definition
Bitfield.cpp:33
OpenZWave::Internal::LookupType
LookupType
Definition
DNSThread.h:54
OpenZWave::Internal::DNS_Lookup_ConfigRevision
@ DNS_Lookup_ConfigRevision
Definition
DNSThread.h:55
OpenZWave
Definition
Bitfield.cpp:31
OpenZWave::Internal::DNSLookup
Definition
DNSThread.h:59
OpenZWave::Internal::DNSLookup::result
string result
Definition
DNSThread.h:62
OpenZWave::Internal::DNSLookup::type
LookupType type
Definition
DNSThread.h:64
OpenZWave::Internal::DNSLookup::status
Internal::Platform::DNSError status
Definition
DNSThread.h:63
OpenZWave::Internal::DNSLookup::NodeID
uint8 NodeID
Definition
DNSThread.h:60
OpenZWave::Internal::DNSLookup::lookup
string lookup
Definition
DNSThread.h:61
Generated on
for OpenZWave Library by
1.17.0