X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=include%2Fmodules%2Fdns.h;h=aa6092788e35a55e87e466875c7b7346e2af5836;hb=b4a174ee9c32d62ea6bf010e837e8c5b1c3d36a3;hp=3db651798e0028267b8f91279a353ab4dbb382ba;hpb=b2ac8cc0a6405946a388b80df3be21bc276a61f3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules/dns.h b/include/modules/dns.h index 3db651798..aa6092788 100644 --- a/include/modules/dns.h +++ b/include/modules/dns.h @@ -1,8 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2013 Adam - * Copyright (C) 2003-2013 Anope Team + * Copyright (C) 2017, 2019, 2021 Sadie Powell + * Copyright (C) 2014-2015 Attila Molnar + * Copyright (C) 2013, 2015-2016 Adam * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -56,6 +57,7 @@ namespace DNS enum Error { ERROR_NONE, + ERROR_DISABLED, ERROR_UNKNOWN, ERROR_UNLOADED, ERROR_TIMEDOUT, @@ -146,6 +148,7 @@ namespace DNS virtual void Process(Request* req) = 0; virtual void RemoveRequest(Request* req) = 0; virtual std::string GetErrorStr(Error) = 0; + virtual std::string GetTypeStr(QueryType) = 0; }; /** A DNS query. @@ -159,12 +162,12 @@ namespace DNS /* Use result cache if available */ bool use_cache; /* Request id */ - RequestId id; - /* Creator of this request */ + RequestId id; + /* Creator of this request */ Module* const creator; - Request(Manager* mgr, Module* mod, const std::string& addr, QueryType qt, bool usecache = true) - : Timer(ServerInstance->Config->ConfValue("dns")->getDuration("timeout", 5, 1)) + Request(Manager* mgr, Module* mod, const std::string& addr, QueryType qt, bool usecache = true, unsigned int timeout = 0) + : Timer(timeout ? timeout : ServerInstance->Config->ConfValue("dns")->getDuration("timeout", 5, 1)) , manager(mgr) , question(addr, qt) , use_cache(usecache) @@ -179,12 +182,12 @@ namespace DNS } /** Called when this request succeeds - * @param r The query sent back from the nameserver + * @param req The query sent back from the nameserver */ virtual void OnLookupComplete(const Query* req) = 0; /** Called when this request fails or times out. - * @param r The query sent back from the nameserver, check the error code. + * @param req The query sent back from the nameserver, check the error code. */ virtual void OnError(const Query* req) { }