]>
Commit | Line | Data |
---|---|---|
e18dbde1 | 1 | /* |
12471842 PL |
2 | * This file is part of PowerDNS or dnsdist. |
3 | * Copyright -- PowerDNS.COM B.V. and its contributors | |
4 | * originally authored by Fredrik Danerklint | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of version 2 of the GNU General Public License as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * In addition, for the avoidance of any doubt, permission is granted to | |
11 | * link this program with OpenSSL and to (re)distribute the binaries | |
12 | * produced as the result of such linking. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
22 | */ | |
870a0fe4 AT |
23 | #ifdef HAVE_CONFIG_H |
24 | #include "config.h" | |
25 | #endif | |
e18dbde1 BH |
26 | #include "luabackend.hh" |
27 | #include "pdns/logger.hh" | |
28 | ||
29 | /* SECOND PART */ | |
30 | ||
31 | class LUAFactory : public BackendFactory | |
32 | { | |
33 | public: | |
34 | LUAFactory() : BackendFactory("lua") {} | |
35 | ||
36 | void declareArguments(const string &suffix="") | |
37 | { | |
38 | ||
39 | declare(suffix,"filename","Filename of the script for lua backend","powerdns-luabackend.lua"); | |
40 | declare(suffix,"logging-query","Logging of the LUA Backend","no"); | |
41 | ||
42 | } | |
43 | ||
44 | DNSBackend *make(const string &suffix="") | |
45 | { | |
46 | return new LUABackend(suffix); | |
47 | } | |
48 | ||
49 | }; | |
50 | ||
51 | /* THIRD PART */ | |
52 | ||
53 | class LUALoader | |
54 | { | |
55 | public: | |
56 | LUALoader() | |
57 | { | |
58 | BackendMakers().report(new LUAFactory); | |
59 | ||
e6a9dde5 | 60 | g_log << Logger::Info << "[luabackend] This is the lua backend version " VERSION |
5e6a3d93 PL |
61 | #ifndef REPRODUCIBLE |
62 | << " (" __DATE__ " " __TIME__ ")" | |
63 | #endif | |
64 | << " reporting" << endl; | |
e18dbde1 BH |
65 | } |
66 | }; | |
67 | ||
68 | static LUALoader luaLoader; |