]>
git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/version.cc
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.
27 #include "dnsbackend.hh"
29 #include <boost/algorithm/string/join.hpp>
31 static ProductType productType
;
33 string
compilerVersion()
35 #if defined(__clang__)
36 return string("clang " __clang_version__
);
37 #elif defined(__GNUC__)
38 return string("gcc " __VERSION__
);
39 #else // add other compilers here
40 return string("Unknown compiler");
44 // Human-readable product name
45 string
productName() {
46 switch (productType
) {
47 case ProductAuthoritative
:
48 return "PowerDNS Authoritative Server";
50 return "PowerDNS Recursor";
55 string
getPDNSVersion()
60 // REST API product type
61 string
productTypeApiType() {
62 switch (productType
) {
63 case ProductAuthoritative
:
64 return "authoritative";
71 void showProductVersion()
73 g_log
<<Logger::Warning
<<productName()<<" "<< VERSION
<< " (C) "
74 "PowerDNS.COM BV" << endl
;
75 g_log
<<Logger::Warning
<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
76 "Built using " << compilerVersion()
78 <<" on " __DATE__
" " __TIME__
" by " BUILD_HOST
81 g_log
<<Logger::Warning
<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
82 "This is free software, and you are welcome to redistribute it "
83 "according to the terms of the GPL version 2." << endl
;
86 void showBuildConfiguration()
88 g_log
<<Logger::Warning
<<"Features: "<<
92 #ifdef HAVE_BOOST_CONTEXT
95 #ifdef HAVE_LIBCRYPTO_ECDSA
98 #ifdef HAVE_LIBCRYPTO_ED25519
99 "libcrypto-ed25519 " <<
101 #ifdef HAVE_LIBCRYPTO_ED448
102 "libcrypto-ed448 " <<
104 #ifdef HAVE_LIBCRYPTO_EDDSA
105 "libcrypto-eddsa " <<
119 #ifdef HAVE_LUA_RECORDS
130 "dnstap-framestream " <<
132 #ifdef REMOTEBACKEND_ZEROMQ
133 "remotebackend-zeromq " <<
138 #ifdef HAVE_LIBSODIUM
144 #ifdef HAVE_DNS_OVER_TLS
147 #ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
150 #ifdef ENABLE_GSS_TSIG
159 g_log
<< Logger::Warning
<< "Built-in modules: " << PDNS_MODULES
<< endl
;
160 const auto& modules
= BackendMakers().getModules();
161 g_log
<< Logger::Warning
<< "Loaded modules: " << boost::join(modules
, " ") << endl
;
163 #ifdef PDNS_CONFIG_ARGS
164 #define double_escape(s) #s
165 #define escape_quotes(s) double_escape(s)
166 g_log
<<Logger::Warning
<<"Configured with: "<<escape_quotes(PDNS_CONFIG_ARGS
)<<endl
;
172 string
fullVersionString()
175 s
<<productName()<<" " VERSION
;
177 s
<<" (built " __DATE__
" " __TIME__
" by " BUILD_HOST
")";
182 void versionSetProduct(ProductType pt
)
187 ProductType
versionGetProduct()