/usr/include/simgear/io/DNSClient.hxx is in libsimgear-dev 1:2018.1.1+dfsg-1.
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 | /**
* \file DNSClient.hxx - simple DNS resolver client for SimGear
*/
// Written by Torsten Dreyer
//
// Copyright (C) 2016 Torsten Dreyer - torsten (at) t3r (dot) de
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library 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
// Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
#ifndef SG_DNS_CLIENT_HXX
#define SG_DNS_CLIENT_HXX
#include <memory> // for std::unique_ptr
#include <string>
#include <vector>
#include <ctime> // for time_t
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/structure/event_mgr.hxx>
namespace simgear
{
namespace DNS
{
class Client;
class Request : public SGReferenced
{
public:
Request( const std::string & dn );
virtual ~Request();
std::string getDn() const { return _dn; }
int getType() const { return _type; }
bool isComplete() const { return _complete; }
bool isTimeout() const;
void setComplete( bool b = true ) { _complete = b; }
virtual void submit( Client * client) = 0;
std::string cname;
std::string qname;
unsigned ttl;
protected:
std::string _dn;
int _type;
bool _complete;
time_t _timeout_secs;
time_t _start;
};
typedef SGSharedPtr<Request> Request_ptr;
class NAPTRRequest : public Request
{
public:
NAPTRRequest( const std::string & dn );
virtual void submit( Client * client );
struct NAPTR : SGReferenced {
int order;
int preference;
std::string flags;
std::string service;
std::string regexp;
std::string replacement;
};
typedef SGSharedPtr<NAPTR> NAPTR_ptr;
typedef std::vector<NAPTR_ptr> NAPTR_list;
NAPTR_list entries;
std::string qflags;
std::string qservice;
};
class SRVRequest : public Request
{
public:
SRVRequest( const std::string & dn );
SRVRequest( const std::string & dn, const string & service, const string & protocol );
virtual void submit( Client * client );
struct SRV : SGReferenced {
int priority;
int weight;
int port;
std::string target;
};
typedef SGSharedPtr<SRV> SRV_ptr;
typedef std::vector<SRV_ptr> SRV_list;
SRV_list entries;
private:
std::string _service;
std::string _protocol;
};
class TXTRequest : public Request
{
public:
TXTRequest( const std::string & dn );
virtual void submit( Client * client );
typedef std::vector<string> TXT_list;
typedef std::map<std::string,std::string> TXT_Attribute_map;
TXT_list entries;
TXT_Attribute_map attributes;
};
class Client
{
public:
Client();
~Client();
void update(int waitTimeout = 0);
void makeRequest(const Request_ptr& r);
// void cancelRequest(const Request_ptr& r, std::string reason = std::string());
class ClientPrivate;
std::unique_ptr<ClientPrivate> d;
};
} // of namespace DNS
} // of namespace simgear
#endif // of SG_DNS_CLIENT_HXX
|