2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * In addition, for the avoidance of any doubt, permission is granted to
10 * link this program with OpenSSL and to (re)distribute the binaries
11 * produced as the result of such linking.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "sortlist.hh"
27 #include "filterpo.hh"
28 #include "validate.hh"
30 struct ProtobufExportConfig
32 std::set<uint16_t> exportTypes = { QType::A, QType::AAAA, QType::CNAME };
34 uint64_t maxQueuedEntries{100};
36 uint16_t reconnectWaitTime{1};
37 bool asyncConnect{false};
39 bool logQueries{true};
40 bool logResponses{true};
41 bool taggedOnly{false};
50 map<DNSName,dsmap_t> dsAnchors;
51 map<DNSName,std::string> negAnchors;
52 ProtobufExportConfig protobufExportConfig;
53 ProtobufExportConfig outgoingProtobufExportConfig;
54 /* we need to increment this every time the configuration
55 is reloaded, so we know if we need to reload the protobuf
57 uint64_t generation{0};
58 uint8_t protobufMaskV4{32};
59 uint8_t protobufMaskV6{128};
62 extern GlobalStateHolder<LuaConfigItems> g_luaconfs;
64 struct luaConfigDelayedThreads
66 std::vector<std::tuple<std::vector<ComboAddress>, boost::optional<DNSFilterEngine::Policy>, uint32_t, size_t, TSIGTriplet, size_t, ComboAddress, uint16_t, std::shared_ptr<SOARecordContent>, std::string> > rpzMasterThreads;
69 void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& delayedThreads);
70 void startLuaConfigDelayedThreads(const luaConfigDelayedThreads& delayedThreads, uint64_t generation);