2 dns.h - dns library declarations based on firedns Copyright (C) 2002 Ian Gulliver
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of version 2 of the GNU General Public License as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <sys/types.h>
22 #include <sys/socket.h>
23 #include <netinet/in.h>
39 void dns_init_2(const char* dnsserver);
40 in_addr *dns_aton4(const char * const ipstring);
41 char *dns_ntoa4(const in_addr * const ip);
42 int dns_getip4(const char * const name);
43 int dns_getip4list(const char * const name);
44 int dns_getname4(const in_addr * const ip);
45 char *dns_getresult(const int fd);
46 in_addr *dns_aton4_s(const char * const ipstring, in_addr * const ip);
47 char *dns_ntoa4_s(const in_addr * const ip, char * const result);
48 char *dns_getresult_s(const int fd, char * const result);
49 in_addr *dns_aton4_r(const char * const ipstring);
50 char *dns_ntoa4_r(const in_addr * const ip);
51 char *dns_getresult_r(const int fd);
54 DNS(std::string dnsserver);
56 bool ReverseLookup(std::string ip);
57 bool ForwardLookup(std::string host);
59 std::string GetResult();