]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/resolvers.h
Update copyright headers.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / resolvers.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
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 Robin Burchell <robin+git@viroteck.net>
11  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
12  *
13  * This file is part of InspIRCd.  InspIRCd is free software: you can
14  * redistribute it and/or modify it under the terms of the GNU General Public
15  * License as published by the Free Software Foundation, version 2.
16  *
17  * This program is distributed in the hope that it will be useful, but WITHOUT
18  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
20  * details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24  */
25
26
27 #pragma once
28
29 #include "inspircd.h"
30 #include "modules/dns.h"
31
32 #include "utils.h"
33 #include "link.h"
34
35 /** Handle resolving of server IPs for the cache
36  */
37 class SecurityIPResolver : public DNS::Request
38 {
39  private:
40         reference<Link> MyLink;
41         Module* mine;
42         std::string host;
43         DNS::QueryType query;
44  public:
45         SecurityIPResolver(Module* me, DNS::Manager* mgr, const std::string& hostname, Link* x, DNS::QueryType qt);
46         void OnLookupComplete(const DNS::Query *r) CXX11_OVERRIDE;
47         void OnError(const DNS::Query *q) CXX11_OVERRIDE;
48 };
49
50 /** This class is used to resolve server hostnames during /connect and autoconnect.
51  * As of 1.1, the resolver system is seperated out from BufferedSocket, so we must do this
52  * resolver step first ourselves if we need it. This is totally nonblocking, and will
53  * callback to OnLookupComplete or OnError when completed. Once it has completed we
54  * will have an IP address which we can then use to continue our connection.
55  */
56 class ServernameResolver : public DNS::Request
57 {
58  private:
59         DNS::QueryType query;
60         std::string host;
61         reference<Link> MyLink;
62         reference<Autoconnect> myautoconnect;
63  public:
64         ServernameResolver(DNS::Manager* mgr, const std::string& hostname, Link* x, DNS::QueryType qt, Autoconnect* myac);
65         void OnLookupComplete(const DNS::Query *r) CXX11_OVERRIDE;
66         void OnError(const DNS::Query *q) CXX11_OVERRIDE;
67 };