]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/rec-lua-conf.hh
poll events are bitmasks, not values
[thirdparty/pdns.git] / pdns / rec-lua-conf.hh
CommitLineData
12471842
PL
1/*
2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
4 *
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.
8 *
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.
12 *
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.
17 *
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.
21 */
684d5f6b 22#pragma once
0bd2e252
RG
23#include <set>
24
684d5f6b 25#include "sholder.hh"
26#include "sortlist.hh"
ad42489c 27#include "filterpo.hh"
52ad9eea 28#include "validate.hh"
ad42489c 29
63341e8d
RG
30struct ProtobufExportConfig
31{
0bd2e252 32 std::set<uint16_t> exportTypes = { QType::A, QType::AAAA, QType::CNAME };
b773359c 33 std::vector<ComboAddress> servers;
63341e8d
RG
34 uint64_t maxQueuedEntries{100};
35 uint16_t timeout{2};
36 uint16_t reconnectWaitTime{1};
37 bool asyncConnect{false};
38 bool enabled{false};
f1c7929a
RG
39 bool logQueries{true};
40 bool logResponses{true};
41 bool taggedOnly{false};
63341e8d
RG
42};
43
e4ae55e5
PL
44struct TrustAnchorFileInfo {
45 uint32_t interval{24};
46 std::string fname;
47};
48
684d5f6b 49class LuaConfigItems
50{
51public:
52 LuaConfigItems();
53 SortList sortlist;
ad42489c 54 DNSFilterEngine dfe;
e4ae55e5 55 TrustAnchorFileInfo trustAnchorFileInfo; // Used to update the Trust Anchors from file periodically
52ad9eea 56 map<DNSName,dsmap_t> dsAnchors;
1bd49828 57 map<DNSName,std::string> negAnchors;
13dacc77
RG
58 ProtobufExportConfig protobufExportConfig;
59 ProtobufExportConfig outgoingProtobufExportConfig;
63341e8d
RG
60 /* we need to increment this every time the configuration
61 is reloaded, so we know if we need to reload the protobuf
62 remote loggers */
63341e8d 63 uint64_t generation{0};
e1c8a4bb
RG
64 uint8_t protobufMaskV4{32};
65 uint8_t protobufMaskV6{128};
684d5f6b 66};
67
68extern GlobalStateHolder<LuaConfigItems> g_luaconfs;
e6ec15bf
RG
69
70struct luaConfigDelayedThreads
71{
d122dac0 72 std::vector<std::tuple<std::vector<ComboAddress>, boost::optional<DNSFilterEngine::Policy>, bool, uint32_t, size_t, TSIGTriplet, size_t, ComboAddress, uint16_t, std::shared_ptr<SOARecordContent>, std::string> > rpzMasterThreads;
e6ec15bf
RG
73};
74
75void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& delayedThreads);
76void startLuaConfigDelayedThreads(const luaConfigDelayedThreads& delayedThreads, uint64_t generation);
684d5f6b 77