#include <mutex>
#include <boost/utility.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
return false;
if (qtype == QType::SOA && rhs.qtype != QType::SOA)
return true;
- return tie(qtype, content, ttl) < tie(rhs.qtype, rhs.content, rhs.ttl);
+ return std::tie(qtype, content, ttl) < std::tie(rhs.qtype, rhs.content, rhs.ttl);
}
};
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <string>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include "statbag.hh"
#include "dnspcap.hh"
#include "dnsparser.hh"
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <map>
#include <set>
#include <fstream>
#include "dnspcap.hh"
#include "dnsrecords.hh"
#include "dnsparser.hh"
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <map>
#include <set>
#include <fstream>
string rcontent=toLower(rhs.content);
return
- tie(qname, qtype, lcontent, ttl) ==
- tie(rhs.qname, rhs.qtype, rcontent, rhs.ttl);
+ std::tie(qname, qtype, lcontent, ttl) ==
+ std::tie(rhs.qname, rhs.qtype, rcontent, rhs.ttl);
}
boilerplate_conv(A, conv.xfrIP(d_ip));
string d_key;
bool operator<(const DNSKEYRecordContent& rhs) const
{
- return tie(d_flags, d_protocol, d_algorithm, d_key) <
- tie(rhs.d_flags, rhs.d_protocol, rhs.d_algorithm, rhs.d_key);
+ return std::tie(d_flags, d_protocol, d_algorithm, d_key) <
+ std::tie(rhs.d_flags, rhs.d_protocol, rhs.d_algorithm, rhs.d_key);
}
};
if(typeid(*this) != typeid(rhs))
return false;
auto rrhs =dynamic_cast<const decltype(this)>(&rhs);
- return tie(d_tag, d_algorithm, d_digesttype, d_digest) ==
- tie(rrhs->d_tag, rrhs->d_algorithm, rrhs->d_digesttype, rrhs->d_digest);
+ return std::tie(d_tag, d_algorithm, d_digesttype, d_digest) ==
+ std::tie(rrhs->d_tag, rrhs->d_algorithm, rrhs->d_digesttype, rrhs->d_digest);
}
bool operator<(const DSRecordContent& rhs) const
{
- return tie(d_tag, d_algorithm, d_digesttype, d_digest) <
- tie(rhs.d_tag, rhs.d_algorithm, rhs.d_digesttype, rhs.d_digest);
+ return std::tie(d_tag, d_algorithm, d_digesttype, d_digest) <
+ std::tie(rhs.d_tag, rhs.d_algorithm, rhs.d_digesttype, rhs.d_digest);
}
includeboilerplate(DS)
#include "dnspcap.hh"
#include "dnsparser.hh"
#include "dnsname.hh"
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <map>
#include <set>
#include <fstream>
map<string, string> stormap;
while (std::getline(str, sline)) {
- tie(key,value) = splitField(sline, ':');
+ std::tie(key,value) = splitField(sline, ':');
boost::trim(value);
toLowerInPlace(key);
map<string, string> stormap;
while(std::getline(str, sline)) {
- tie(key,value)=splitField(sline, ':');
+ std::tie(key,value)=splitField(sline, ':');
boost::trim(value);
if(pdns_iequals(key,"algorithm")) {
algorithm = pdns_stou(value);
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include "dnssecinfra.hh"
d_lw->writeFunction("getStat", [](const std::string& str) {
uint64_t result = 0;
- boost::optional<uint64_t> value = getStatByName(str);
+ auto value = getStatByName(str);
if (value) {
result = *value;
}
#endif
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/multi_index/sequenced_index.hpp>
return SNMP_ERR_GENERR;
}
- boost::optional<uint64_t> value = getStatByName(it->second);
+ auto value = getStatByName(it->second);
if (value) {
return RecursorSNMPAgent::setCounter64Value(requests, *value);
}
#include <string>
#include <map>
+#include <optional>
#include <vector>
#include <inttypes.h>
#include <sys/un.h>
#include "dnsname.hh"
#include "sholder.hh"
#include <atomic>
-#include <boost/optional.hpp>
extern GlobalStateHolder<SuffixMatchNode> g_dontThrottleNames;
extern GlobalStateHolder<NetmaskGroup> g_dontThrottleNetmasks;
std::vector<ComboAddress>* pleaseGetTimeouts();
DNSName getRegisteredName(const DNSName& dom);
std::atomic<unsigned long>* getDynMetric(const std::string& str, const std::string& prometheusName);
-boost::optional<uint64_t> getStatByName(const std::string& name);
+std::optional<uint64_t> getStatByName(const std::string& name);
bool isStatDisabled(StatComponent component, const std::string& name);
void disableStat(StatComponent component, const string& name);
void disableStats(StatComponent component, const string& stats);
#include "recursor_cache.hh"
#include "syncres.hh"
#include "negcache.hh"
-#include <boost/function.hpp>
-#include <boost/optional.hpp>
-#include <boost/tuple/tuple.hpp>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
return ret.d_ptr;
}
-static boost::optional<uint64_t> get(const string& name)
+static std::optional<uint64_t> get(const string& name)
{
- boost::optional<uint64_t> ret;
+ std::optional<uint64_t> ret;
if (d_get32bitpointers.count(name))
return *d_get32bitpointers.find(name)->second;
return ret;
}
-boost::optional<uint64_t> getStatByName(const std::string& name)
+std::optional<uint64_t> getStatByName(const std::string& name)
{
return get(name);
}
string ret;
for (T i = begin; i != end; ++i) {
- boost::optional<uint64_t> num = get(*i);
+ std::optional<uint64_t> num = get(*i);
if (num)
ret += std::to_string(*num) + "\n";
else
return ret;
}
-typedef boost::function<vector<ComboAddress>*()> pleaseremotefunc_t;
-typedef boost::function<vector<pair<DNSName, uint16_t>>*()> pleasequeryfunc_t;
+typedef std::function<vector<ComboAddress>*()> pleaseremotefunc_t;
+typedef std::function<vector<pair<DNSName, uint16_t>>*()> pleasequeryfunc_t;
vector<ComboAddress>* pleaseGetRemotes()
{
return name;
}
-static string doGenericTopQueries(pleasequeryfunc_t func, boost::function<DNSName(const DNSName&)> filter = nopFilter)
+static string doGenericTopQueries(pleasequeryfunc_t func, std::function<DNSName(const DNSName&)> filter = nopFilter)
{
typedef pair<DNSName, uint16_t> query_t;
typedef map<query_t, int> counts_t;
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/optional.hpp>
/* we have nothing more specific for you */
break;
}
- auto key = boost::make_tuple(qname, qtype, boost::none, best);
+ auto key = std::make_tuple(qname, qtype, boost::none, best);
auto entry = map.d_map.find(key);
if (entry == map.d_map.end()) {
/* ecsIndex is not up-to-date */
}
/* we have nothing specific, let's see if we have a generic one */
- auto key = boost::make_tuple(qname, qtype, boost::none, Netmask());
+ auto key = std::make_tuple(qname, qtype, boost::none, Netmask());
auto entry = map.d_map.find(key);
if (entry != map.d_map.end()) {
if (entry->d_ttd > now) {
// We only store with a tag if we have an ednsmask and the tag is available
// We only store an ednsmask if we do not have a tag and we do have a mask.
- auto key = boost::make_tuple(qname, qt.getCode(), ednsmask ? routingTag : boost::none, (ednsmask && !routingTag) ? *ednsmask : Netmask());
+ auto key = std::make_tuple(qname, qt.getCode(), ednsmask ? routingTag : boost::none, (ednsmask && !routingTag) ? *ednsmask : Netmask());
bool isNew = false;
cache_t::iterator stored = map->d_map.find(key);
if (stored == map->d_map.end()) {
if (isNew || stored->d_ttd <= now) {
/* don't bother building an ecsIndex if we don't have any netmask-specific entries */
if (!routingTag && ednsmask && !ednsmask->empty()) {
- auto ecsIndexKey = boost::make_tuple(qname, qt.getCode());
+ auto ecsIndexKey = std::make_tuple(qname, qt.getCode());
auto ecsIndex = map->d_ecsIndex.find(ecsIndexKey);
if (ecsIndex == map->d_ecsIndex.end()) {
ecsIndex = map->d_ecsIndex.insert(ECSIndexEntry(qname, qt.getCode())).first;
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/version.hpp>
private:
struct CacheEntry
{
- CacheEntry(const boost::tuple<DNSName, QType, OptTag, Netmask>& key, bool auth) :
- d_qname(key.get<0>()), d_netmask(key.get<3>().getNormalized()), d_rtag(key.get<2>()), d_state(vState::Indeterminate), d_ttd(0), d_qtype(key.get<1>()), d_auth(auth), d_submitted(false)
+ CacheEntry(const std::tuple<DNSName, QType, OptTag, Netmask>& key, bool auth) :
+ d_qname(std::get<0>(key)), d_netmask(std::get<3>(key).getNormalized()), d_rtag(std::get<2>(key)), d_state(vState::Indeterminate), d_ttd(0), d_qtype(std::get<1>(key)), d_auth(auth), d_submitted(false)
{
}
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/tag.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include "dnsname.hh"
#include "qtype.hh"
if (line[0] == '#') // Comment line, skip to the next line
continue;
string domain, instructions;
- tie(domain, instructions) = splitField(line, '=');
+ std::tie(domain, instructions) = splitField(line, '=');
instructions = splitField(instructions, '#').first; // Remove EOL comments
boost::trim(domain);
boost::trim(instructions);
bool
dedupLessThan(const DNSZoneRecord& a, const DNSZoneRecord &b)
{
- return make_tuple(a.dr.d_content->getZoneRepresentation(), a.dr.d_ttl) < make_tuple(b.dr.d_content->getZoneRepresentation(), b.dr.d_ttl); // XXX SLOW SLOW SLOW
+ return std::make_tuple(a.dr.d_content->getZoneRepresentation(), a.dr.d_ttl) < std::make_tuple(b.dr.d_content->getZoneRepresentation(), b.dr.d_ttl); // XXX SLOW SLOW SLOW
}
bool dedupEqual(const DNSZoneRecord& a, const DNSZoneRecord &b)
{
- return make_tuple(a.dr.d_content->getZoneRepresentation(), a.dr.d_ttl) == make_tuple(b.dr.d_content->getZoneRepresentation(), b.dr.d_ttl); // XXX SLOW SLOW SLOW
+ return std::make_tuple(a.dr.d_content->getZoneRepresentation(), a.dr.d_ttl) == std::make_tuple(b.dr.d_content->getZoneRepresentation(), b.dr.d_ttl); // XXX SLOW SLOW SLOW
}
}
//! This is the 'out of band resolver', in other words, the authoritative server
void SyncRes::AuthDomain::addSOA(std::vector<DNSRecord>& records) const
{
- SyncRes::AuthDomain::records_t::const_iterator ziter = d_records.find(boost::make_tuple(getName(), QType::SOA));
+ SyncRes::AuthDomain::records_t::const_iterator ziter = d_records.find(std::make_tuple(getName(), QType::SOA));
if (ziter != d_records.end()) {
DNSRecord dr = *ziter;
dr.d_place = DNSResourceRecord::AUTHORITY;
DNSName wcarddomain(qname);
while(wcarddomain != getName() && wcarddomain.chopOff()) {
// cerr<<qname<<": trying '*."<<wcarddomain<<"' in "<<getName()<<endl;
- range = d_records.equal_range(boost::make_tuple(g_wildcarddnsname + wcarddomain));
+ range = d_records.equal_range(std::make_tuple(g_wildcarddnsname + wcarddomain));
if (range.first==range.second)
continue;
/* Nothing for this name, no wildcard, let's see if there is some NS */
DNSName nsdomain(qname);
while (nsdomain.chopOff() && nsdomain != getName()) {
- range = d_records.equal_range(boost::make_tuple(nsdomain,QType::NS));
+ range = d_records.equal_range(std::make_tuple(nsdomain,QType::NS));
if(range.first == range.second)
continue;
count++;
char tmp[26];
// remote IP, dns name, qtype, count, ttd
- fprintf(fp.get(), "%s\t%s\t%d\t%u\t%s", i.thing.get<0>().toString().c_str(), i.thing.get<1>().toLogString().c_str(), i.thing.get<2>(), i.count, ctime_r(&i.ttd, tmp));
+ fprintf(fp.get(), "%s\t%s\t%d\t%u\t%s", std::get<0>(i.thing).toString().c_str(), std::get<1>(i.thing).toLogString().c_str(), std::get<2>(i.thing), i.count, ctime_r(&i.ttd, tmp));
}
return count;
bool SyncRes::throttledOrBlocked(const std::string& prefix, const ComboAddress& remoteIP, const DNSName& qname, const QType qtype, bool pierceDontQuery)
{
- if(t_sstorage.throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(remoteIP, "", 0))) {
+ if(t_sstorage.throttle.shouldThrottle(d_now.tv_sec, std::make_tuple(remoteIP, g_rootdnsname, 0))) {
LOG(prefix<<qname<<": server throttled "<<endl);
s_throttledqueries++; d_throttledqueries++;
return true;
}
- else if(t_sstorage.throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()))) {
+ else if(t_sstorage.throttle.shouldThrottle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()))) {
LOG(prefix<<qname<<": query throttled "<<remoteIP.toString()<<", "<<qname<<"; "<<qtype<<endl);
s_throttledqueries++; d_throttledqueries++;
return true;
if (s_serverdownmaxfails > 0 && (auth != g_rootdnsname) && s_fails.lock()->incr(remoteIP, d_now) >= s_serverdownmaxfails) {
LOG(prefix<<qname<<": Max fails reached resolving on "<< remoteIP.toString() <<". Going full throttle for "<< s_serverdownthrottletime <<" seconds" <<endl);
// mark server as down
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, "", 0), s_serverdownthrottletime, 10000);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, g_rootdnsname, 0), s_serverdownthrottletime, 10000);
}
else if (resolveret == LWResult::Result::Timeout) {
// unreachable, 1 minute or 100 queries
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 100);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 60, 100);
}
else {
// timeout, 10 seconds or 5 queries
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 10, 5);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 10, 5);
}
}
if (doTCP) {
// we can be more heavy-handed over TCP
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 10);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 60, 10);
}
else {
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 10, 2);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 10, 2);
}
}
return false;
t_sstorage.nsSpeeds[nsName.empty()? DNSName(remoteIP.toStringWithPort()) : nsName].submit(remoteIP, 1000000, d_now); // 1 sec
}
else {
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 3);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 60, 3);
}
}
return false;
LOG(prefix<<qname<<": truncated bit set, over TCP?"<<endl);
if (!dontThrottle) {
/* let's treat that as a ServFail answer from this server */
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(remoteIP, qname, qtype.getCode()), 60, 3);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(remoteIP, qname, qtype.getCode()), 60, 3);
}
return false;
}
break;
}
/* was lame */
- t_sstorage.throttle.throttle(d_now.tv_sec, boost::make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100);
+ t_sstorage.throttle.throttle(d_now.tv_sec, std::make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100);
}
if (gotNewServers) {
#include "sstuff.hh"
#include "recursor_cache.hh"
#include "recpacketcache.hh"
-#include <boost/tuple/tuple.hpp>
#include <boost/optional.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include "mtasker.hh"
#include "iputils.hh"
#include "validate-recursor.hh"
};
typedef std::unordered_map<DNSName, AuthDomain> domainmap_t;
- typedef Throttle<boost::tuple<ComboAddress,DNSName,uint16_t> > throttle_t;
+ typedef Throttle<std::tuple<ComboAddress,DNSName,uint16_t> > throttle_t;
struct EDNSStatus {
EDNSStatus(const ComboAddress &arg) : address(arg) {}
}
static bool isThrottled(time_t now, const ComboAddress& server, const DNSName& target, uint16_t qtype)
{
- return t_sstorage.throttle.shouldThrottle(now, boost::make_tuple(server, target, qtype));
+ return t_sstorage.throttle.shouldThrottle(now, std::make_tuple(server, target, qtype));
}
static bool isThrottled(time_t now, const ComboAddress& server)
{
- return t_sstorage.throttle.shouldThrottle(now, boost::make_tuple(server, "", 0));
+ return t_sstorage.throttle.shouldThrottle(now, std::make_tuple(server, g_rootdnsname, 0));
}
static void doThrottle(time_t now, const ComboAddress& server, time_t duration, unsigned int tries)
{
- t_sstorage.throttle.throttle(now, boost::make_tuple(server, "", 0), duration, tries);
+ t_sstorage.throttle.throttle(now, std::make_tuple(server, g_rootdnsname, 0), duration, tries);
}
static uint64_t getFailedServersSize()
{
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/tuple/tuple.hpp>
#include "base32.hh"
BOOST_AUTO_TEST_SUITE(test_base32_cc)
BOOST_AUTO_TEST_CASE(test_base32_basic) {
- typedef boost::tuple<const std::string, const std::string> case_t;
+ typedef std::tuple<const std::string, const std::string> case_t;
typedef std::list<case_t> cases_t;
// RFC test vectors
for(const case_t& val : cases) {
std::string res;
- res = toBase32Hex(val.get<0>());
- BOOST_CHECK_EQUAL(res, val.get<1>());
- res = fromBase32Hex(val.get<1>());
- BOOST_CHECK_EQUAL(res, val.get<0>());
+ res = toBase32Hex(std::get<0>(val));
+ BOOST_CHECK_EQUAL(res, std::get<1>(val));
+ res = fromBase32Hex(std::get<1>(val));
+ BOOST_CHECK_EQUAL(res, std::get<0>(val));
}
};
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/tuple/tuple.hpp>
-
#include "base32.hh"
#include "base64.hh"
#include "dnsseckeeper.hh"
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/tuple/tuple.hpp>
#include <stdint.h>
#include <thread>
#include "misc.hh"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include "arguments.hh"
d_end = range.second;
}
else {
- auto range = idx.equal_range(boost::make_tuple(qdomain, qtype.getCode()));
+ auto range = idx.equal_range(std::make_tuple(qdomain, qtype.getCode()));
d_iter = range.first;
d_end = range.second;
}
bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector<std::string>& meta) override
{
const auto& idx = boost::multi_index::get<OrderedNameKindTag>(s_metadata.at(d_backendId));
- auto it = idx.find(boost::make_tuple(name, kind));
+ auto it = idx.find(std::make_tuple(name, kind));
if (it == idx.end()) {
/* funnily enough, we are expected to return true even though we might not know that zone */
return true;
bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector<std::string>& meta) override
{
auto& idx = boost::multi_index::get<OrderedNameKindTag>(s_metadata.at(d_backendId));
- auto it = idx.find(boost::make_tuple(name, kind));
+ auto it = idx.find(std::make_tuple(name, kind));
if (it == idx.end()) {
s_metadata.at(d_backendId).insert(SimpleMetaData(name, kind, meta));
return true;
}
auto& idx = records->get<OrderedNameTypeTag>();
- auto range = idx.equal_range(boost::make_tuple(best, QType::SOA));
+ auto range = idx.equal_range(std::make_tuple(best, QType::SOA));
if (range.first == range.second) {
return false;
}
{
// check that it has not been updated in the second backend
- const auto& it = SimpleBackend::s_metadata[2].find(boost::make_tuple(DNSName("powerdns.org."), "test-data-b"));
+ const auto& it = SimpleBackend::s_metadata[2].find(std::make_tuple(DNSName("powerdns.org."), "test-data-b"));
BOOST_REQUIRE(it != SimpleBackend::s_metadata[2].end());
BOOST_REQUIRE_EQUAL(it->d_values.size(), 2U);
BOOST_CHECK_EQUAL(it->d_values.at(0), "value1");
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/tuple/tuple.hpp>
#include <boost/iostreams/device/file.hpp>
#include "dns.hh"
#include "zoneparser-tng.hh"
*/
#pragma once
#include <map>
+#include <optional>
#include "webserver.hh"
void apiDiscovery(HttpRequest* req, HttpResponse* resp);
// To be provided by product code.
void productServerStatisticsFetch(std::map<string,string>& out);
-boost::optional<uint64_t> productServerStatisticsFetch(const std::string& name);
+std::optional<uint64_t> productServerStatisticsFetch(const std::string& name);
out["uptime"] = std::to_string(time(nullptr) - s_starttime);
}
-boost::optional<uint64_t> productServerStatisticsFetch(const std::string& name)
+std::optional<uint64_t> productServerStatisticsFetch(const std::string& name)
{
try {
// ::read() calls ::exists() which throws a PDNSException when the key does not exist
return S.read(name);
}
- catch(...) {
- return boost::none;
+ catch (...) {
+ return std::nullopt;
}
}
*/
#pragma once
#include <string>
-#include <tuple>
#include <map>
#include <time.h>
#include <pthread.h>
out.swap(ret);
}
-boost::optional<uint64_t> productServerStatisticsFetch(const std::string& name)
+std::optional<uint64_t> productServerStatisticsFetch(const std::string& name)
{
return getStatByName(name);
}