2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2013 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
6 * Copyright (C) 2013 Adam <Adam@anope.org>
7 * Copyright (C) 2012 Robby <robby@chatbelgie.be>
8 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
9 * Copyright (C) 2007, 2010 Craig Edwards <brain@inspircd.org>
10 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
12 * This file is part of InspIRCd. InspIRCd is free software: you can
13 * redistribute it and/or modify it under the terms of the GNU General Public
14 * License as published by the Free Software Foundation, version 2.
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "modules/dns.h"
34 /** Handle resolving of server IPs for the cache
36 class SecurityIPResolver : public DNS::Request
39 reference<Link> MyLink;
44 SecurityIPResolver(Module* me, DNS::Manager* mgr, const std::string& hostname, Link* x, DNS::QueryType qt);
45 void OnLookupComplete(const DNS::Query *r) CXX11_OVERRIDE;
46 void OnError(const DNS::Query *q) CXX11_OVERRIDE;
49 /** This class is used to resolve server hostnames during /connect and autoconnect.
50 * As of 1.1, the resolver system is separated out from BufferedSocket, so we must do this
51 * resolver step first ourselves if we need it. This is totally nonblocking, and will
52 * callback to OnLookupComplete or OnError when completed. Once it has completed we
53 * will have an IP address which we can then use to continue our connection.
55 class ServernameResolver : public DNS::Request
60 reference<Link> MyLink;
61 reference<Autoconnect> myautoconnect;
63 ServernameResolver(DNS::Manager* mgr, const std::string& hostname, Link* x, DNS::QueryType qt, Autoconnect* myac);
64 void OnLookupComplete(const DNS::Query *r) CXX11_OVERRIDE;
65 void OnError(const DNS::Query *q) CXX11_OVERRIDE;