struct dns_ip4list
{
- in_addr ip;
+ insp_inaddr ip;
dns_ip4list *next;
};
class DNS : public Extensible
{
private:
- in_addr *binip;
+ insp_inaddr *binip;
char* result;
char localbuf[1024];
int t;
void dns_init();
int myfd;
void dns_init_2(const char* dnsserver);
- in_addr *dns_aton4(const char * const ipstring);
- char *dns_ntoa4(const in_addr * const ip);
+ insp_inaddr *dns_aton4(const char * const ipstring);
int dns_getip4(const char * const name);
int dns_getip4list(const char * const name);
- int dns_getname4(const in_addr * const ip);
+ int dns_getname4(const insp_inaddr * const ip);
char *dns_getresult(const int fd);
- in_addr *dns_aton4_s(const char * const ipstring, in_addr * const ip);
- char *dns_ntoa4_s(const in_addr * const ip, char * const result);
+ insp_inaddr *dns_aton4_s(const char * const ipstring, insp_inaddr * const ip);
char *dns_getresult_s(const int fd, char * const result);
- in_addr *dns_aton4_r(const char * const ipstring);
- char *dns_ntoa4_r(const in_addr * const ip);
+ insp_inaddr *dns_aton4_r(const char * const ipstring);
char *dns_getresult_r(const int fd);
public:
/** The default constructor uses dns addresses read from /etc/resolv.conf.
* @param dnsserver This optional parameter specifies an alterate nameserver to use.
* If it is not specified, or is an empty string, the value of ServerConfig::DNSServer
* is used instead.
- * @throw This class may throw an instance of ModuleException, in the event there are
- * no more file descriptors, or a similar hard error occurs such as the network being
- * down.
+ * @throw ModuleException This class may throw an instance of ModuleException, in the
+ * event there are no more file descriptors, or a similar hard error occurs such as
+ * the network being down.
*/
Resolver(const std::string &source, bool forward, const std::string &dnsserver);
/**
*/
bool dns_add_class(Resolver* r);
+void dns_close(int fd);
+
#ifdef THREADED_DNS
/** This is the handler function for multi-threaded DNS.
* It cannot be a class member as pthread will not let us