]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/lwres.hh
add OpenSSL exception to PowerDNS, Netherlabs, van Dijk and Hubert copyrights
[thirdparty/pdns.git] / pdns / lwres.hh
CommitLineData
0d8612f2
BH
1/*
2 PowerDNS Versatile Database Driven Nameserver
263f6a5a 3 Copyright (C) 2002 - 2007 PowerDNS.COM BV
0d8612f2
BH
4
5 This program is free software; you can redistribute it and/or modify
22dc646a
BH
6 it under the terms of the GNU General Public License version 2
7 as published by the Free Software Foundation
f782fe38
MH
8
9 Additionally, the license of this program contains a special
10 exception which allows to distribute the program in binary form when
11 it is linked against OpenSSL.
0d8612f2
BH
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
06bd9ccf 20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0d8612f2
BH
21*/
22
288f4aa9
BH
23#ifndef PDNS_LWRES_HH
24#define PDNS_LWRES_HH
0d8612f2
BH
25#include <string>
26#include <vector>
27#include <sys/types.h>
2353fffa 28#include "misc.hh"
996c89cc 29#include "iputils.hh"
76473b92
KM
30#include <netdb.h>
31#include <unistd.h>
32#include <sys/time.h>
33#include <sys/uio.h>
34#include <fcntl.h>
35#include <sys/socket.h>
36#include <netinet/in.h>
37#include <arpa/inet.h>
38#undef res_mkquery
0d8612f2 39
5c409fa2 40#include "pdnsexception.hh"
0d8612f2 41#include "dns.hh"
10f4eea8 42#include "namespaces.hh"
0d8612f2 43
787e5eab 44int asendto(const char *data, int len, int flags, const ComboAddress& ip, uint16_t id,
4957a608 45 const string& domain, uint16_t qtype, int* fd);
787e5eab 46int arecvfrom(char *data, int len, int flags, const ComboAddress& ip, int *d_len, uint16_t id,
4957a608 47 const string& domain, uint16_t, int fd, struct timeval* now);
0d8612f2 48
3f81d239 49class LWResException : public PDNSException
0d8612f2
BH
50{
51public:
3f81d239 52 LWResException(const string &reason) : PDNSException(reason){}
0d8612f2
BH
53};
54
55//! LWRes class
263f6a5a 56class LWResult
0d8612f2
BH
57{
58public:
0d8612f2
BH
59 typedef vector<DNSResourceRecord> res_t;
60
263f6a5a 61 vector<DNSResourceRecord> d_result;
0d8612f2 62 int d_rcode;
5c633640 63 bool d_aabit, d_tcbit;
092f210a 64 uint32_t d_usec;
81883dcc
BH
65 bool d_pingCorrect;
66 bool d_haveEDNS;
0d8612f2
BH
67};
68
c1d73d94 69int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, LWResult* res);
263f6a5a 70
288f4aa9 71#endif // PDNS_LWRES_HH