summaryrefslogtreecommitdiff
path: root/src/network/dns_handler.hpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-02-27 12:16:09 +0100
committerFlorent Le Coz <louiz@louiz.org>2015-02-27 12:26:48 +0100
commitd600a2843f1dbe3b1ba2dead9a020cc73d7d10ae (patch)
treea34da2e3c617a39a73f716b9a5dddbdfbc510df6 /src/network/dns_handler.hpp
parent1028d4d549b517c5b42bb0c30a410d1ab43c4cf3 (diff)
downloadbiboumi-d600a2843f1dbe3b1ba2dead9a020cc73d7d10ae.tar.gz
biboumi-d600a2843f1dbe3b1ba2dead9a020cc73d7d10ae.tar.bz2
biboumi-d600a2843f1dbe3b1ba2dead9a020cc73d7d10ae.tar.xz
biboumi-d600a2843f1dbe3b1ba2dead9a020cc73d7d10ae.zip
Remove all the libs that are now in louloulibs
Diffstat (limited to 'src/network/dns_handler.hpp')
-rw-r--r--src/network/dns_handler.hpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/network/dns_handler.hpp b/src/network/dns_handler.hpp
deleted file mode 100644
index ec5b2fa..0000000
--- a/src/network/dns_handler.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef DNS_HANDLER_HPP_INCLUDED
-#define DNS_HANDLER_HPP_INCLUDED
-
-#include <config.h>
-#ifdef CARES_FOUND
-
-class TCPSocketHandler;
-class Poller;
-class DNSSocketHandler;
-
-# include <ares.h>
-# include <memory>
-# include <string>
-# include <list>
-
-void on_hostname4_resolved(void* arg, int status, int, struct hostent* hostent);
-void on_hostname6_resolved(void* arg, int status, int, struct hostent* hostent);
-
-/**
- * Class managing DNS resolution. It should only be statically instanciated
- * once in SocketHandler. It manages ares channel and calls various
- * functions of that library.
- */
-
-class DNSHandler
-{
-public:
- DNSHandler();
- ~DNSHandler() = default;
- void gethostbyname(const std::string& name, TCPSocketHandler* socket_handler,
- int family);
- /**
- * Call ares_fds to know what fd needs to be watched by the poller, create
- * or destroy DNSSocketHandlers depending on the result.
- */
- void watch_dns_sockets(std::shared_ptr<Poller>& poller);
- /**
- * Destroy and stop watching all the DNS sockets. Then de-init the channel
- * and library.
- */
- void destroy();
- ares_channel& get_channel();
-
- static DNSHandler instance;
-
-private:
- /**
- * The list of sockets that needs to be watched, according to the last
- * call to ares_fds. DNSSocketHandlers are added to it or removed from it
- * in the watch_dns_sockets() method
- */
- std::list<std::unique_ptr<DNSSocketHandler>> socket_handlers;
- ares_channel channel;
-
- DNSHandler(const DNSHandler&) = delete;
- DNSHandler(DNSHandler&&) = delete;
- DNSHandler& operator=(const DNSHandler&) = delete;
- DNSHandler& operator=(DNSHandler&&) = delete;
-};
-
-#endif /* CARES_FOUND */
-#endif /* DNS_HANDLER_HPP_INCLUDED */