]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/DNS.3
Re-added the dot graphs again
[user/henk/code/inspircd.git] / docs / man / man3 / DNS.3
1 .TH "DNS" 3 "13 May 2005" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 DNS \- The DNS class allows fast nonblocking resolution of hostnames and ip addresses.  
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <dns.h>\fP
12 .PP
13 .SS "Public Member Functions"
14
15 .in +1c
16 .ti -1c
17 .RI "\fBDNS\fP ()"
18 .br
19 .RI "\fIThe default constructor uses dns addresses read from /etc/resolv.conf. \fP"
20 .ti -1c
21 .RI "\fBDNS\fP (std::string dnsserver)"
22 .br
23 .RI "\fIThis constructor accepts a dns server address. \fP"
24 .ti -1c
25 .RI "\fB~DNS\fP ()"
26 .br
27 .RI "\fIThe destructor frees all used structures. \fP"
28 .ti -1c
29 .RI "bool \fBReverseLookup\fP (std::string ip)"
30 .br
31 .RI "\fIThis method will start the reverse lookup of an ip given in dotted decimal format, e.g. \fP"
32 .ti -1c
33 .RI "bool \fBForwardLookup\fP (std::string host)"
34 .br
35 .RI "\fIThis method will start the forward lookup of a hostname, e.g. \fP"
36 .ti -1c
37 .RI "bool \fBHasResult\fP ()"
38 .br
39 .RI "\fIThis method will return true when the lookup is completed. \fP"
40 .ti -1c
41 .RI "std::string \fBGetResult\fP ()"
42 .br
43 .RI "\fIThis method returns the result of your query as a string, depending upon wether you called \fBDNS::ReverseLookup()\fP or \fBDNS::ForwardLookup\fP. \fP"
44 .ti -1c
45 .RI "int \fBGetFD\fP ()"
46 .br
47 .RI "\fIThis method returns the file handle used by the dns query socket or zero if the query is invalid for some reason, e.g. \fP"
48 .ti -1c
49 .RI "void \fBSetNS\fP (std::string dnsserver)"
50 .br
51 .in -1c
52 .SS "Private Member Functions"
53
54 .in +1c
55 .ti -1c
56 .RI "void \fBdns_init\fP ()"
57 .br
58 .ti -1c
59 .RI "void \fBdns_init_2\fP (const char *dnsserver)"
60 .br
61 .ti -1c
62 .RI "in_addr * \fBdns_aton4\fP (const char *const ipstring)"
63 .br
64 .ti -1c
65 .RI "char * \fBdns_ntoa4\fP (const in_addr *const ip)"
66 .br
67 .ti -1c
68 .RI "int \fBdns_getip4\fP (const char *const name)"
69 .br
70 .ti -1c
71 .RI "int \fBdns_getip4list\fP (const char *const name)"
72 .br
73 .ti -1c
74 .RI "int \fBdns_getname4\fP (const in_addr *const ip)"
75 .br
76 .ti -1c
77 .RI "char * \fBdns_getresult\fP (const int \fBfd\fP)"
78 .br
79 .ti -1c
80 .RI "in_addr * \fBdns_aton4_s\fP (const char *const ipstring, in_addr *const ip)"
81 .br
82 .ti -1c
83 .RI "char * \fBdns_ntoa4_s\fP (const in_addr *const ip, char *const \fBresult\fP)"
84 .br
85 .ti -1c
86 .RI "char * \fBdns_getresult_s\fP (const int \fBfd\fP, char *const \fBresult\fP)"
87 .br
88 .ti -1c
89 .RI "in_addr * \fBdns_aton4_r\fP (const char *const ipstring)"
90 .br
91 .ti -1c
92 .RI "char * \fBdns_ntoa4_r\fP (const in_addr *const ip)"
93 .br
94 .ti -1c
95 .RI "char * \fBdns_getresult_r\fP (const int \fBfd\fP)"
96 .br
97 .in -1c
98 .SS "Private Attributes"
99
100 .in +1c
101 .ti -1c
102 .RI "in_addr * \fBbinip\fP"
103 .br
104 .ti -1c
105 .RI "char * \fBresult\fP"
106 .br
107 .ti -1c
108 .RI "int \fBt\fP"
109 .br
110 .ti -1c
111 .RI "unsigned int \fBfd\fP"
112 .br
113 .in -1c
114 .SH "Detailed Description"
115 .PP 
116 The DNS class allows fast nonblocking resolution of hostnames and ip addresses. 
117
118 It is based heavily upon firedns by Ian Gulliver. 
119 .PP
120 Definition at line 35 of file dns.h.
121 .SH "Constructor & Destructor Documentation"
122 .PP 
123 .SS "DNS::DNS ()"
124 .PP
125 The default constructor uses dns addresses read from /etc/resolv.conf. Please note that it will re-read /etc/resolv.conf for each copy of the class you instantiate, causing disk access and slow lookups if you create a lot of them. Consider passing the constructor a server address as a parameter instead.
126 .SS "DNS::DNS (std::string dnsserver)"
127 .PP
128 This constructor accepts a dns server address. The address must be in dotted decimal form, e.g. 1.2.3.4.
129 .SS "DNS::~\fBDNS\fP ()"
130 .PP
131 The destructor frees all used structures. 
132 .SH "Member Function Documentation"
133 .PP 
134 .SS "in_addr* DNS::dns_aton4 (const char *const ipstring)\fC [private]\fP"
135 .PP
136 .SS "in_addr* DNS::dns_aton4_r (const char *const ipstring)\fC [private]\fP"
137 .PP
138 .SS "in_addr* DNS::dns_aton4_s (const char *const ipstring, in_addr *const ip)\fC [private]\fP"
139 .PP
140 .SS "int DNS::dns_getip4 (const char *const name)\fC [private]\fP"
141 .PP
142 .SS "int DNS::dns_getip4list (const char *const name)\fC [private]\fP"
143 .PP
144 .SS "int DNS::dns_getname4 (const in_addr *const ip)\fC [private]\fP"
145 .PP
146 .SS "char* DNS::dns_getresult (const int fd)\fC [private]\fP"
147 .PP
148 .SS "char* DNS::dns_getresult_r (const int fd)\fC [private]\fP"
149 .PP
150 .SS "char* DNS::dns_getresult_s (const int fd, char *const result)\fC [private]\fP"
151 .PP
152 .SS "void DNS::dns_init ()\fC [private]\fP"
153 .PP
154 .SS "void DNS::dns_init_2 (const char * dnsserver)\fC [private]\fP"
155 .PP
156 .SS "char* DNS::dns_ntoa4 (const in_addr *const ip)\fC [private]\fP"
157 .PP
158 .SS "char* DNS::dns_ntoa4_r (const in_addr *const ip)\fC [private]\fP"
159 .PP
160 .SS "char* DNS::dns_ntoa4_s (const in_addr *const ip, char *const result)\fC [private]\fP"
161 .PP
162 .SS "bool DNS::ForwardLookup (std::string host)"
163 .PP
164 This method will start the forward lookup of a hostname, e.g. www.inspircd.org, and returns true if the lookup was successfully initiated.
165 .SS "int DNS::GetFD ()"
166 .PP
167 This method returns the file handle used by the dns query socket or zero if the query is invalid for some reason, e.g. the dns server not responding.
168 .SS "std::string DNS::GetResult ()"
169 .PP
170 This method returns the result of your query as a string, depending upon wether you called \fBDNS::ReverseLookup()\fP or \fBDNS::ForwardLookup\fP. 
171 .SS "bool DNS::HasResult ()"
172 .PP
173 This method will return true when the lookup is completed. It uses poll internally to determine the status of the socket.
174 .SS "bool DNS::ReverseLookup (std::string ip)"
175 .PP
176 This method will start the reverse lookup of an ip given in dotted decimal format, e.g. 1.2.3.4, and returns true if the lookup was successfully initiated.
177 .SS "void DNS::SetNS (std::string dnsserver)"
178 .PP
179 .SH "Member Data Documentation"
180 .PP 
181 .SS "in_addr* \fBDNS::binip\fP\fC [private]\fP"
182 .PP
183 Definition at line 38 of file dns.h.
184 .SS "unsigned int \fBDNS::fd\fP\fC [private]\fP"
185 .PP
186 Definition at line 42 of file dns.h.
187 .SS "char* \fBDNS::result\fP\fC [private]\fP"
188 .PP
189 Definition at line 39 of file dns.h.
190 .SS "int \fBDNS::t\fP\fC [private]\fP"
191 .PP
192 Definition at line 40 of file dns.h.
193
194 .SH "Author"
195 .PP 
196 Generated automatically by Doxygen for InspIRCd from the source code.