/usr/include/svxlink/AsyncDnsLookup.h is in libasynccore-dev 15.11-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | /**
@file AsyncDnsLookup.h
@brief Contains a class for executing DNS queries
@author Tobias Blomberg
@date 2003-04-12
This file contains a class for executing DNS queries asynchronously. When
the answer arrives, a signal will be emitted. See the class documentation
for usage instructions.
\verbatim
Async - A library for programming event driven applications
Copyright (C) 2003 Tobias Blomberg
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\endverbatim
*/
/** @example AsyncDnsLookup_demo.cpp
An example of how to use the Async::DnsLookup class
*/
#ifndef ASYNC_DNS_LOOKUP_INCLUDED
#define ASYNC_DNS_LOOKUP_INCLUDED
/****************************************************************************
*
* System Includes
*
****************************************************************************/
#include <sigc++/sigc++.h>
#include <vector>
/****************************************************************************
*
* Project Includes
*
****************************************************************************/
#include <AsyncIpAddress.h>
/****************************************************************************
*
* Local Includes
*
****************************************************************************/
/****************************************************************************
*
* Forward declarations
*
****************************************************************************/
class DnsLookupWorker;
/****************************************************************************
*
* Namespace
*
****************************************************************************/
namespace Async
{
/****************************************************************************
*
* Defines & typedefs
*
****************************************************************************/
/****************************************************************************
*
* Exported Global Variables
*
****************************************************************************/
/****************************************************************************
*
* Class definitions
*
****************************************************************************/
/**
@brief A class for performing asynchronous DNS lookups
@author Tobias Blomberg
@date 2003-04-12
Use this class to make DNS lookups. Right now it only supports looking up
hostnames to find out what IP-addresses it maps to. An example usage can be seen
below.
\include AsyncDnsLookup_demo.cpp
*/
class DnsLookup : public sigc::trackable
{
public:
/**
* @brief Constructor
* @param label The label (hostname) to lookup
*/
DnsLookup(const std::string& label);
/**
* @brief Destructor
*/
~DnsLookup(void);
/**
* @brief Return the associated label
* @return Returns the label associated with this DNS lookup
*/
const std::string &label(void) const { return m_label; }
/**
* @brief Check if the DNS lookup is done or not
* @return Returns \em true if results are ready or \em false if not
*/
bool resultsAreReady(void) { return m_results_ready; }
/**
* @brief Return the addresses for the host in the query
* @return Return a stl vector which contains all the addresses
* associated with the hostname in the query.
* @pre The result is not available before the resultsReay signal
* has been emitted
*
* Use this function to retrieve all the IP-addresses associated with
* the hostname in the query. If the list is empty, the query has failed.
*/
std::vector<IpAddress> addresses(void);
/**
* @brief A signal to indicate that the query has been completed
* @param dns A reference to the DNS object associated with the query
*/
sigc::signal<void, DnsLookup&> resultsReady;
protected:
private:
DnsLookupWorker * m_worker;
std::string m_label;
bool m_results_ready;
void onResultsReady(void);
}; /* class DnsLookup */
} /* namespace */
#endif /* ASYNC_DNS_LOOKUP_INCLUDED */
/*
* This file has not been truncated
*/
|