]>
Commit | Line | Data |
---|---|---|
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 | |
8 | ||
0d8612f2 BH |
9 | |
10 | This program is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with this program; if not, write to the Free Software | |
06bd9ccf | 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0d8612f2 BH |
18 | */ |
19 | ||
288f4aa9 BH |
20 | #ifndef PDNS_LWRES_HH |
21 | #define PDNS_LWRES_HH | |
0d8612f2 BH |
22 | #include <string> |
23 | #include <vector> | |
24 | #include <sys/types.h> | |
2353fffa | 25 | #include "misc.hh" |
996c89cc | 26 | #include "iputils.hh" |
0d8612f2 | 27 | #ifndef WIN32 |
0d8612f2 BH |
28 | # include <netdb.h> |
29 | # include <unistd.h> | |
30 | # include <sys/time.h> | |
31 | # include <sys/uio.h> | |
32 | # include <fcntl.h> | |
33 | # include <sys/socket.h> | |
34 | # include <netinet/in.h> | |
35 | # include <arpa/inet.h> | |
36 | # undef res_mkquery | |
37 | #endif // WIN32 | |
38 | ||
39 | #include "ahuexception.hh" | |
40 | #include "dns.hh" | |
41 | using namespace std; | |
42 | ||
787e5eab BH |
43 | int asendto(const char *data, int len, int flags, const ComboAddress& ip, uint16_t id, |
44 | const string& domain, uint16_t qtype, int* fd); | |
45 | int arecvfrom(char *data, int len, int flags, const ComboAddress& ip, int *d_len, uint16_t id, | |
f6c254c1 | 46 | const string& domain, uint16_t, int fd, unsigned int now); |
0d8612f2 BH |
47 | |
48 | class LWResException : public AhuException | |
49 | { | |
50 | public: | |
51 | LWResException(const string &reason) : AhuException(reason){} | |
52 | }; | |
53 | ||
54 | //! LWRes class | |
263f6a5a | 55 | class LWResult |
0d8612f2 BH |
56 | { |
57 | public: | |
0d8612f2 BH |
58 | typedef vector<DNSResourceRecord> res_t; |
59 | ||
263f6a5a | 60 | vector<DNSResourceRecord> d_result; |
0d8612f2 | 61 | int d_rcode; |
5c633640 | 62 | bool d_aabit, d_tcbit; |
092f210a | 63 | uint32_t d_usec; |
0d8612f2 BH |
64 | }; |
65 | ||
2188dcc3 | 66 | int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool doEDNS0, struct timeval* now, LWResult* res); |
263f6a5a | 67 | |
288f4aa9 | 68 | #endif // PDNS_LWRES_HH |