]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/resolvers.h
Only assign NewServices once the duplicate check is done.
[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 Dennis Friis <peavey@inspircd.org>
11  *
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.
15  *
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
19  * details.
20  *
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/>.
23  */
24
25
26 #pragma once
27
28 #include "inspircd.h"
29 #include "modules/dns.h"
30
31 #include "utils.h"
32 #include "link.h"
33
34 /** Handle resolving of server IPs for the cache
35  */
36 class SecurityIPResolver : public DNS::Request
37 {
38  private:
39         reference<Link> MyLink;
40         Module* mine;
41         std::string host;
42         DNS::QueryType query;
43  public:
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;
47 };
48
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.
54  */
55 class ServernameResolver : public DNS::Request
56 {
57  private:
58         DNS::QueryType query;
59         std::string host;
60         reference<Link> MyLink;
61         reference<Autoconnect> myautoconnect;
62  public:
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;
66 };