AC_DEFUN([PDNS_CHECK_DNSTAP], [
- AC_REQUIRE([PDNS_WITH_PROTOBUF])
AC_MSG_CHECKING([whether we will have dnstap])
AC_ARG_ENABLE([dnstap],
AS_HELP_STRING([--enable-dnstap],[enable dnstap support @<:@default=$1@:>@]),
AS_IF([test x"$FSTRM_LIBS" = "x"], [
AC_MSG_ERROR([dnstap requested but libfstrm was not found])
])
- AS_IF([test "x$PROTOBUF_LIBS" = "x" -o x"$PROTOC" = "x"], [
- AC_MSG_ERROR([dnstap requested but protobuf was not found])
- ])
])
])
#include "ednssubnet.hh"
#include "query-local-address.hh"
-#ifdef HAVE_PROTOBUF
-
+#include "rec-protozero.hh"
#include "uuid-utils.hh"
#ifdef HAVE_FSTRM
#endif // HAVE_FSTRM
-static void logOutgoingQuery(const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, boost::optional<RecProtoBufMessage>& message, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, size_t bytes, boost::optional<Netmask>& srcmask)
+static void logOutgoingQuery(const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, size_t bytes, boost::optional<Netmask>& srcmask)
{
if (!outgoingLoggers) {
return;
return;
}
- message = RecProtoBufMessage(DNSProtoBufMessage::OutgoingQuery, uuid, nullptr, &ip, domain, type, QClass::IN, qid, doTCP, bytes);
- message->setServerIdentity(SyncRes::s_serverID);
+ static thread_local std::string buffer;
+ buffer.clear();
+ pdns::ProtoZero::Message m{buffer};
+ m.setType(3);
+ m.setMessageIdentity(uuid);
+ m.setSocketFamily(ip.sin4.sin_family);
+ m.setSocketProtocol(doTCP);
+ m.setTo(ip);
+ m.setInBytes(bytes);
+ m.setTime();
+ m.setId(qid);
+ m.setQuestion(domain, type, QClass::IN);
+ m.setToPort(ip.getPort());
+ m.setServerIdentity(SyncRes::s_serverID);
if (initialRequestId) {
- message->setInitialRequestID(*initialRequestId);
+ m.setInitialRequestID(*initialRequestId);
}
if (srcmask) {
- message->setEDNSSubnet(*srcmask);
+ m.setEDNSSubnet(*srcmask, 128);
}
-// cerr <<message.toDebugString()<<endl;
- std::string str;
- message->serialize(str);
-
for (auto& logger : *outgoingLoggers) {
if (logger->logQueries()) {
- logger->queueData(str);
+ logger->queueData(buffer);
}
}
}
-static void logIncomingResponse(const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, boost::optional<RecProtoBufMessage>& message, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, boost::optional<Netmask>& srcmask, size_t bytes, int rcode, const std::vector<DNSRecord>& records, const struct timeval& queryTime, const std::set<uint16_t>& exportTypes)
+static void logIncomingResponse(const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, boost::optional<const boost::uuids::uuid&> initialRequestId, const boost::uuids::uuid& uuid, const ComboAddress& ip, const DNSName& domain, int type, uint16_t qid, bool doTCP, boost::optional<Netmask>& srcmask, size_t bytes, int rcode, const std::vector<DNSRecord>& records, const struct timeval& queryTime, const std::set<uint16_t>& exportTypes)
{
if (!outgoingLoggers) {
return;
return;
}
- if (!message) {
- message = RecProtoBufMessage(DNSProtoBufMessage::IncomingResponse, uuid, nullptr, &ip, domain, type, QClass::IN, qid, doTCP, bytes);
- message->setServerIdentity(SyncRes::s_serverID);
-
- if (initialRequestId) {
- message->setInitialRequestID(*initialRequestId);
- }
+ static thread_local std::string buffer;
+ buffer.clear();
+ pdns::ProtoZero::RecMessage m{buffer};
+ m.setType(4);
+ m.setMessageIdentity(uuid);
+ m.setSocketFamily(ip.sin4.sin_family);
+ m.setSocketProtocol(doTCP);
+ m.setTo(ip);
+ m.setInBytes(bytes);
+ m.setTime();
+ m.setId(qid);
+ m.setQuestion(domain, type, QClass::IN);
+ m.setToPort(ip.getPort());
+ m.setServerIdentity(SyncRes::s_serverID);
- if (srcmask) {
- message->setEDNSSubnet(*srcmask);
- }
+ if (initialRequestId) {
+ m.setInitialRequestID(*initialRequestId);
}
- else {
- message->updateTime();
- message->setType(DNSProtoBufMessage::IncomingResponse);
- message->setBytes(bytes);
+
+ if (srcmask) {
+ m.setEDNSSubnet(*srcmask, 128);
}
- message->setQueryTime(queryTime.tv_sec, queryTime.tv_usec);
+ m.startResponse();
+ m.setQueryTime(queryTime.tv_sec, queryTime.tv_usec);
if (rcode == -1) {
- message->setNetworkErrorResponseCode();
+ m.setNetworkErrorResponseCode();
}
else {
- message->setResponseCode(rcode);
+ m.setResponseCode(rcode);
}
- message->addRRs(records, exportTypes);
-// cerr <<message.toDebugString()<<endl;
- std::string str;
- message->serialize(str);
+ for (const auto& record : records) {
+ m.addRR(record, exportTypes, false);
+ }
+ m.commitResponse();
for (auto& logger : *outgoingLoggers) {
if (logger->logResponses()) {
- logger->queueData(str);
+ logger->queueData(buffer);
}
}
}
-#endif /* HAVE_PROTOBUF */
/** lwr is only filled out in case 1 was returned, and even when returning 1 for 'success', lwr might contain DNS errors
Never throws!
dt.set();
*now=dt.getTimeval();
-#ifdef HAVE_PROTOBUF
boost::uuids::uuid uuid;
const struct timeval queryTime = *now;
- boost::optional<RecProtoBufMessage> pbMessage = boost::none;
if (outgoingLoggers) {
uuid = getUniqueID();
- logOutgoingQuery(outgoingLoggers, pbMessage, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, vpacket.size(), srcmask);
+ logOutgoingQuery(outgoingLoggers, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, vpacket.size(), srcmask);
}
-#endif /* HAVE_PROTOBUF */
+
#ifdef HAVE_FSTRM
if (isEnabledForQueries(fstrmLoggers)) {
logFstreamQuery(fstrmLoggers, queryTime, ip, doTCP, context ? context->d_auth : boost::none, vpacket);
*now=dt.getTimeval();
if (ret != LWResult::Result::Success) { // includes 'timeout'
-#ifdef HAVE_PROTOBUF
if (outgoingLoggers) {
- logIncomingResponse(outgoingLoggers, pbMessage, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, 0, -1, {}, queryTime, exportTypes);
+ logIncomingResponse(outgoingLoggers, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, 0, -1, {}, queryTime, exportTypes);
}
-#endif
return ret;
}
lwr->d_rcode=mdp.d_header.rcode;
if(mdp.d_header.rcode == RCode::FormErr && mdp.d_qname.empty() && mdp.d_qtype == 0 && mdp.d_qclass == 0) {
-#ifdef HAVE_PROTOBUF
if(outgoingLoggers) {
- logIncomingResponse(outgoingLoggers, pbMessage, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
+ logIncomingResponse(outgoingLoggers, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
}
-#endif
lwr->d_validpacket = true;
return LWResult::Result::Success; // this is "success", the error is set in lwr->d_rcode
}
}
}
-#ifdef HAVE_PROTOBUF
if(outgoingLoggers) {
- logIncomingResponse(outgoingLoggers, pbMessage, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
+ logIncomingResponse(outgoingLoggers, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
}
-#endif
lwr->d_validpacket = true;
return LWResult::Result::Success;
lwr->d_validpacket = false;
g_stats.serverParseError++;
-#ifdef HAVE_PROTOBUF
if(outgoingLoggers) {
- logIncomingResponse(outgoingLoggers, pbMessage, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
+ logIncomingResponse(outgoingLoggers, context ? context->d_initialRequestId : boost::none, uuid, ip, domain, type, qid, doTCP, srcmask, len, lwr->d_rcode, lwr->d_records, queryTime, exportTypes);
}
-#endif
return LWResult::Result::Success; // success - oddly enough
}
#endif /* NOD_ENABLED */
#include "query-local-address.hh"
-#include "rec-protobuf.hh"
#include "rec-snmp.hh"
#ifdef HAVE_SYSTEMD
#include "namespaces.hh"
-#ifdef HAVE_PROTOBUF
#include "uuid-utils.hh"
#include "rec-protozero.hh"
-#endif /* HAVE_PROTOBUF */
#include "xpf.hh"
static thread_local unsigned int t_id = 0;
static thread_local std::shared_ptr<Regex> t_traceRegex;
static thread_local std::unique_ptr<tcpClientCounts_t> t_tcpClientCounts;
-#ifdef HAVE_PROTOBUF
static thread_local std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>> t_protobufServers{nullptr};
static thread_local uint64_t t_protobufServersGeneration;
static thread_local std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>> t_outgoingProtobufServers{nullptr};
static thread_local uint64_t t_outgoingProtobufServersGeneration;
-#endif /* HAVE_PROTOBUF */
#ifdef HAVE_FSTRM
static thread_local std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>> t_frameStreamServers{nullptr};
d_local holds our own. */
ComboAddress d_local;
ComboAddress d_destination;
-#ifdef HAVE_PROTOBUF
boost::uuids::uuid d_uuid;
string d_requestorId;
string d_deviceId;
string d_deviceName;
struct timeval d_kernelTimestamp{0,0};
-#endif
std::string d_query;
std::unordered_set<std::string> d_policyTags;
std::string d_routingTag;
return "Exception making error message for exception";
}
-#ifdef HAVE_PROTOBUF
static void protobufLogQuery(uint8_t maskV4, uint8_t maskV6, const boost::uuids::uuid& uniqueId, const ComboAddress& remote, const ComboAddress& local, const Netmask& ednssubnet, bool tcp, uint16_t id, size_t len, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::unordered_set<std::string>& policyTags, const std::string& requestorId, const std::string& deviceId, const std::string& deviceName)
{
if (!t_protobufServers) {
server->queueData(msg);
}
}
-#endif
/**
* Chases the CNAME provided by the PolicyCustom RPZ policy.
return PolicyResult::NoAction;
}
-#ifdef HAVE_PROTOBUF
static std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>> startProtobufServers(const ProtobufExportConfig& config)
{
auto result = std::make_shared<std::vector<std::unique_ptr<RemoteLogger>>>();
return true;
}
#endif /* HAVE_FSTRM */
-#endif /* HAVE_PROTOBUF */
#ifdef NOD_ENABLED
static bool nodCheckNewDomain(const DNSName& dname)
// Used to tell syncres later on if we should apply NSDNAME and NSIP RPZ triggers for this query
bool wantsRPZ(true);
RecursorPacketCache::OptPBData pbDataForCache;
-#ifdef HAVE_PROTOBUF
pdns::ProtoZero::RecMessage pbMessage;
if (checkProtobufExport(luaconfsLocal)) {
pbMessage.reserve(128, 128); // It's a bit of a guess...
// RRSets added below
}
-#endif /* HAVE_PROTOBUF */
#ifdef HAVE_FSTRM
checkFrameStreamExport(luaconfsLocal);
}
sr.setDNSSECValidationRequested(g_dnssecmode == DNSSECMode::ValidateAll || g_dnssecmode==DNSSECMode::ValidateForLog || ((dc->d_mdp.d_header.ad || DNSSECOK) && g_dnssecmode==DNSSECMode::Process));
-#ifdef HAVE_PROTOBUF
sr.setInitialRequestId(dc->d_uuid);
sr.setOutgoingProtobufServers(t_outgoingProtobufServers);
-#endif
#ifdef HAVE_FSTRM
sr.setFrameStreamServers(t_frameStreamServers);
#endif
dq.currentRecords = &ret;
dq.dh = &dc->d_mdp.d_header;
dq.data = dc->d_data;
-#ifdef HAVE_PROTOBUF
dq.requestorId = dc->d_requestorId;
dq.deviceId = dc->d_deviceId;
dq.deviceName = dc->d_deviceName;
-#endif
dq.proxyProtocolValues = &dc->d_proxyProtocolValues;
dq.extendedErrorCode = &dc->d_extendedErrorCode;
dq.extendedErrorExtra = &dc->d_extendedErrorExtra;
}
#endif /* NOD ENABLED */
-#ifdef HAVE_PROTOBUF
if (t_protobufServers) {
pbMessage.addRR(*i, luaconfsLocal->protobufExportConfig.exportTypes, udr);
}
-#endif
}
if(needCommit)
pw.commit();
}
}
#endif /* NOD_ENABLED */
-#ifdef HAVE_PROTOBUF
if (t_protobufServers && !(luaconfsLocal->protobufExportConfig.taggedOnly && appliedPolicy.getName().empty() && dc->d_policyTags.empty())) {
// Start constructing embedded DNSResponse object
pbMessage.setResponseCode(pw.getHeader()->rcode);
protobufLogResponse(pbMessage);
}
}
-#endif /* HAVE_PROTOBUF */
+
if(!dc->d_tcp) {
struct msghdr msgh;
struct iovec iov;
string deviceId;
string deviceName;
bool logQuery = false;
-#ifdef HAVE_PROTOBUF
+
auto luaconfsLocal = g_luaconfs.getLocal();
if (checkProtobufExport(luaconfsLocal)) {
needECS = true;
}
logQuery = t_protobufServers && luaconfsLocal->protobufExportConfig.logQueries;
dc->d_logResponse = t_protobufServers && luaconfsLocal->protobufExportConfig.logResponses;
-#endif /* HAVE_PROTOBUF */
#ifdef HAVE_FSTRM
checkFrameStreamExport(luaconfsLocal);
const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(&conn->data[0]);
-#ifdef HAVE_PROTOBUF
if(t_protobufServers || t_outgoingProtobufServers) {
dc->d_requestorId = requestorId;
dc->d_deviceId = deviceId;
}
}
}
-#endif
+
if (t_pdl) {
if (t_pdl->ipfilter(dc->d_source, dc->d_destination, *dh)) {
if (!g_quiet) {
string routingTag;
bool logQuery = false;
bool logResponse = false;
-#ifdef HAVE_PROTOBUF
boost::uuids::uuid uniqueId;
auto luaconfsLocal = g_luaconfs.getLocal();
if (checkProtobufExport(luaconfsLocal)) {
}
logQuery = t_protobufServers && luaconfsLocal->protobufExportConfig.logQueries;
logResponse = t_protobufServers && luaconfsLocal->protobufExportConfig.logResponses;
-#endif
#ifdef HAVE_FSTRM
checkFrameStreamExport(luaconfsLocal);
#endif
bool cacheHit = false;
RecursorPacketCache::OptPBData pbData{boost::none};
-#ifdef HAVE_PROTOBUF
+
if (t_protobufServers) {
if (logQuery && !(luaconfsLocal->protobufExportConfig.taggedOnly && policyTags.empty())) {
protobufLogQuery(luaconfsLocal->protobufMaskV4, luaconfsLocal->protobufMaskV6, uniqueId, source, destination, ednssubnet.source, false, dh->id, question.size(), qname, qtype, qclass, policyTags, requestorId, deviceId, deviceName);
}
}
-#endif /* HAVE_PROTOBUF */
/* It might seem like a good idea to skip the packet cache lookup if we know that the answer is not cacheable,
but it means that the hash would not be computed. If some script decides at a later time to mark back the answer
t_bogusqueryring->push_back(make_pair(qname, qtype));
}
-#ifdef HAVE_PROTOBUF
- if(t_protobufServers && logResponse && !(luaconfsLocal->protobufExportConfig.taggedOnly && pbData && !pbData->d_tagged)) { // XXX
+ if (t_protobufServers && logResponse && !(luaconfsLocal->protobufExportConfig.taggedOnly && pbData && !pbData->d_tagged)) { // XXX
pdns::ProtoZero::RecMessage pbMessage(pbData ? pbData->d_message : "", pbData ? pbData->d_response : "", 64, 10); // The extra bytes we are going to add
if (pbData) {
// We take the inmutable string from the cache and are appending a few values
#endif
protobufLogResponse(pbMessage);
}
-#endif /* HAVE_PROTOBUF */
+
if(!g_quiet)
g_log<<Logger::Notice<<t_id<< " question answered from packet cache tag="<<ctag<<" from "<<source.toStringWithPort()<<(source != fromaddr ? " (via "+fromaddr.toStringWithPort()+")" : "")<<endl;
dc->d_followCNAMERecords = followCNAMEs;
dc->d_rcode = rcode;
dc->d_logResponse = logResponse;
-#ifdef HAVE_PROTOBUF
if (t_protobufServers || t_outgoingProtobufServers) {
dc->d_uuid = std::move(uniqueId);
}
dc->d_deviceId = deviceId;
dc->d_deviceName = deviceName;
dc->d_kernelTimestamp = tv;
-#endif
dc->d_proxyProtocolValues = std::move(proxyProtocolValues);
dc->d_routingTag = std::move(routingTag);
dc->d_extendedErrorCode = extendedErrorCode;
}
}
-#ifdef HAVE_PROTOBUF
- google::protobuf::ShutdownProtobufLibrary();
-#endif /* HAVE_PROTOBUF */
return ret;
}
MT=std::unique_ptr<MTasker<PacketID,string> >(new MTasker<PacketID,string>(::arg().asNum("stack-size")));
threadInfo.mt = MT.get();
-#ifdef HAVE_PROTOBUF
/* start protobuf export threads if needed */
auto luaconfsLocal = g_luaconfs.getLocal();
checkProtobufExport(luaconfsLocal);
checkOutgoingProtobufExport(luaconfsLocal);
-#endif /* HAVE_PROTOBUF */
#ifdef HAVE_FSTRM
checkFrameStreamExport(luaconfsLocal);
#endif
}
}
- void setInitialRequesId(const std::string& id)
+ void setInitialRequestID(const boost::uuids::uuid& uniqueId)
{
- if (!id.empty()) {
- d_message.add_string(16, id);
- }
+ d_message.add_bytes(16, reinterpret_cast<const char*>(uniqueId.begin()), uniqueId.size());
}
void setDeviceId(const std::string& id)
d_response.add_uint32(1, rcode);
}
+ void setNetworkErrorResponseCode()
+ {
+ /* special code meaning 'network error', like a timeout */
+ d_response.add_uint32(1, 65536);
+ }
+
void setAppliedPolicy(const std::string& policy)
{
d_response.add_string(3, policy);
}
}
-#if HAVE_PROTOBUF
typedef std::unordered_map<std::string, boost::variant<bool, uint64_t, std::string, std::vector<std::pair<int,std::string> > > > protobufOptions_t;
static void parseProtobufOptions(boost::optional<protobufOptions_t> vars, ProtobufExportConfig& config)
}
}
}
-#endif /* HAVE_PROTOBUF */
#ifdef HAVE_FSTRM
typedef std::unordered_map<std::string, boost::variant<bool, uint64_t, std::string, std::vector<std::pair<int,std::string> > > > frameStreamOptions_t;
updateTrustAnchorsFromFile(fnamearg, lci.dsAnchors);
});
-#if HAVE_PROTOBUF
Lua.writeFunction("setProtobufMasks", [&lci](const uint8_t maskV4, uint8_t maskV6) {
lci.protobufMaskV4 = maskV4;
lci.protobufMaskV6 = maskV6;
g_log<<Logger::Error<<"Only one outgoingProtobufServer() directive can be configured, we already have "<<lci.outgoingProtobufExportConfig.servers.at(0).toString()<<endl;
}
});
-#endif
#ifdef HAVE_FSTRM
Lua.writeFunction("dnstapFrameStreamServer", [&lci](boost::variant<const std::string, const std::unordered_map<int, std::string>> servers, boost::optional<frameStreamOptions_t> vars) {
d_hits++;
moveCacheItemToBack<SequencedTag>(d_packetCache, iter);
-#ifdef HAVE_PROTOBUF
+
if (pbdata != nullptr) {
if (iter->d_pbdata) {
*pbdata = iter->d_pbdata;
*pbdata = boost::none;
}
}
-#endif
+
return true;
}
else {
iter->d_ttd = now + ttl;
iter->d_creation = now;
iter->d_vstate = valState;
-#ifdef HAVE_PROTOBUF
+
if (pbdata) {
iter->d_pbdata = std::move(*pbdata);
}
-#endif
break;
}
e.d_creation = now;
e.d_tag = tag;
e.d_vstate = valState;
-#ifdef HAVE_PROTOBUF
+
if (pbdata) {
e.d_pbdata = std::move(*pbdata);
}
-#endif
+
d_packetCache.insert(e);
}
}
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include "rec-protobuf.hh"
-
using namespace ::boost::multi_index;
DNSName d_name;
mutable std::string d_packet; // "I know what I am doing"
mutable std::string d_query;
-#ifdef HAVE_PROTOBUF
mutable OptPBData d_pbdata;
-#endif
mutable time_t d_ttd;
mutable time_t d_creation; // so we can 'age' our packets
uint32_t d_qhash;
pdns_recursor.cc \
pdnsexception.hh \
pollmplexer.cc \
- protobuf.cc protobuf.hh \
protozero.cc protozero.hh \
proxy-protocol.cc proxy-protocol.hh \
pubsuffix.hh pubsuffix.cc \
rcpgenerator.cc rcpgenerator.hh \
rec-carbon.cc \
rec-lua-conf.hh rec-lua-conf.cc \
- rec-protobuf.cc rec-protobuf.hh \
rec-protozero.cc rec-protozero.hh \
rec-snmp.hh rec-snmp.cc \
rec_channel.cc rec_channel.hh rec_metrics.hh \
opensslsigners.cc opensslsigners.hh \
pdnsexception.hh \
pollmplexer.cc \
- protobuf.cc protobuf.hh \
qtype.cc qtype.hh \
query-local-address.hh query-local-address.cc \
rcpgenerator.cc \
- rec-protobuf.cc rec-protobuf.hh \
recpacketcache.cc recpacketcache.hh \
recursor_cache.cc recursor_cache.hh \
resolver.hh resolver.cc \
portsmplexer.cc
endif
-if HAVE_PROTOBUF
-if HAVE_PROTOC
-dnsmessage.pb.cc: dnsmessage.proto
- $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
-
-BUILT_SOURCES += dnsmessage.pb.cc
-pdns_recursor_LDADD += $(PROTOBUF_LIBS)
-nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
-nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
-
-pdns_recursor.$(OBJEXT): dnsmessage.pb.cc
-testrunner$(OBJEXT): dnsmessage.pb.cc
-
-testrunner_LDADD += $(PROTOBUF_LIBS)
-
-endif
-endif
-
if FSTRM
pdns_recursor_SOURCES += \
dnstap.cc dnstap.hh
PDNS_CHECK_CLOCK_GETTIME
-PDNS_WITH_PROTOBUF
-
BOOST_REQUIRE([1.42])
# Check against flat_set header that requires boost >= 1.48
[AC_MSG_NOTICE([ed448: yes])],
[AC_MSG_NOTICE([ed448: no])]
)
-AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"],
- [AC_MSG_NOTICE([Protobuf: yes])],
- [AC_MSG_NOTICE([Protobuf: no])]
-)
+
+AC_MSG_NOTICE([Protobuf: yes])
+
AS_IF([test "x$NET_SNMP_LIBS" != "x"],
[AC_MSG_NOTICE([SNMP: yes])],
[AC_MSG_NOTICE([SNMP: no])]
+++ /dev/null
-../../../m4/pdns_with_protobuf.m4
\ No newline at end of file
{
d_response = protozero::pbf_writer(d_rspbuf);
}
+
+ RecMessage(std::string& buffer): Message(buffer)
+ {
+ d_response = protozero::pbf_writer(buffer);
+ }
+
// Start a new messagebuf, containing separate data for the response part
RecMessage(std::string::size_type sz1, std::string::size_type sz2): RecMessage()
{
#include "config.h"
-#ifdef HAVE_PROTOBUF
#include <boost/uuid/uuid.hpp>
#include <boost/optional.hpp>
-#endif
struct ResolveContext {
ResolveContext()
ResolveContext(const ResolveContext& ctx) = delete;
ResolveContext & operator=(const ResolveContext&) = delete;
-#ifdef HAVE_PROTOBUF
boost::optional<const boost::uuids::uuid&> d_initialRequestId;
-#endif
#ifdef HAVE_FSTRM
boost::optional<const DNSName&> d_auth;
#endif
int EDNSLevel = 0;
auto luaconfsLocal = g_luaconfs.getLocal();
ResolveContext ctx;
-#ifdef HAVE_PROTOBUF
ctx.d_initialRequestId = d_initialRequestId;
-#endif
#ifdef HAVE_FSTRM
ctx.d_auth = auth;
#endif
#include "config.h"
#endif
-#ifdef HAVE_PROTOBUF
#include <boost/uuid/uuid.hpp>
#ifdef HAVE_FSTRM
#include "fstrm_logger.hh"
#endif /* HAVE_FSTRM */
-#endif
extern GlobalStateHolder<SuffixMatchNode> g_dontThrottleNames;
extern GlobalStateHolder<NetmaskGroup> g_dontThrottleNetmasks;
void setQuerySource(const ComboAddress& requestor, boost::optional<const EDNSSubnetOpts&> incomingECS);
-#ifdef HAVE_PROTOBUF
void setInitialRequestId(boost::optional<const boost::uuids::uuid&> initialRequestId)
{
d_initialRequestId = initialRequestId;
{
d_outgoingProtobufServers = servers;
}
-#endif
#ifdef HAVE_FSTRM
void setFrameStreamServers(std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>>& servers)
boost::optional<Netmask> d_outgoingECSNetwork;
std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>> d_outgoingProtobufServers{nullptr};
std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>> d_frameStreamServers{nullptr};
-#ifdef HAVE_PROTOBUF
boost::optional<const boost::uuids::uuid&> d_initialRequestId;
-#endif
asyncresolve_t d_asyncResolve{nullptr};
struct timeval d_now;
string d_prefix;
#ifdef HAVE_P11KIT1
"PKCS#11 " <<
#endif
-#ifdef HAVE_PROTOBUF
"protobuf " <<
-#endif
#ifdef HAVE_FSTRM
"dnstap-framestream " <<
#endif