build: prepend "NFD_" to various macro names to avoid conflicts
Change-Id: Icc370968e3d38fef80ece35a2aed56450f54b653
diff --git a/.waf-tools/websocket.py b/.waf-tools/websocket.py
index 1c5fef5..e2cba84 100644
--- a/.waf-tools/websocket.py
+++ b/.waf-tools/websocket.py
@@ -53,10 +53,10 @@
self.end_msg('.'.join(self.env.WEBSOCKET_VERSION))
+ self.env.append_unique('DEFINES', ['_WEBSOCKETPP_CPP11_STL_'])
self.env.INCLUDES_WEBSOCKET = websocketDir.parent.abspath()
self.env.HAVE_WEBSOCKET = True
self.define('HAVE_WEBSOCKET', 1)
- self.define('_WEBSOCKETPP_CPP11_STL_', 1)
except Errors.WafError as error:
if isMandatory:
diff --git a/core/common.hpp b/core/common.hpp
index 28db409..fe95d62 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,20 +28,20 @@
#include "core/config.hpp"
-#ifdef WITH_TESTS
-#define VIRTUAL_WITH_TESTS virtual
-#define PUBLIC_WITH_TESTS_ELSE_PROTECTED public
-#define PUBLIC_WITH_TESTS_ELSE_PRIVATE public
-#define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
-#define OVERRIDE_WITH_TESTS_ELSE_FINAL override
-#define FINAL_UNLESS_WITH_TESTS
+#ifdef NFD_WITH_TESTS
+#define NFD_VIRTUAL_WITH_TESTS virtual
+#define NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED public
+#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE public
+#define NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
+#define NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL override
+#define NFD_FINAL_UNLESS_WITH_TESTS
#else
-#define VIRTUAL_WITH_TESTS
-#define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
-#define PUBLIC_WITH_TESTS_ELSE_PRIVATE private
-#define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
-#define OVERRIDE_WITH_TESTS_ELSE_FINAL final
-#define FINAL_UNLESS_WITH_TESTS final
+#define NFD_VIRTUAL_WITH_TESTS
+#define NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
+#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE private
+#define NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE private
+#define NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL final
+#define NFD_FINAL_UNLESS_WITH_TESTS final
#endif
#include <cstddef>
diff --git a/daemon/common/global.cpp b/daemon/common/global.cpp
index a0fd88f..c54f043 100644
--- a/daemon/common/global.cpp
+++ b/daemon/common/global.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -50,7 +50,7 @@
return *g_scheduler;
}
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
void
resetGlobalIoService()
{
diff --git a/daemon/common/global.hpp b/daemon/common/global.hpp
index 1e1fce8..ccc5160 100644
--- a/daemon/common/global.hpp
+++ b/daemon/common/global.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019 Regents of the University of California,
+ * Copyright (c) 2014-2021 Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -61,7 +61,7 @@
void
runOnRibIoService(const std::function<void()>& f);
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
/** \brief Destroy the global io_service instance.
*
* It will be recreated at the next invocation of getGlobalIoService().
diff --git a/daemon/common/privilege-helper.cpp b/daemon/common/privilege-helper.cpp
index 293eb6f..eb8e608 100644
--- a/daemon/common/privilege-helper.cpp
+++ b/daemon/common/privilege-helper.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,18 +33,18 @@
NFD_LOG_INIT(PrivilegeHelper);
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
uid_t PrivilegeHelper::s_normalUid = ::geteuid();
gid_t PrivilegeHelper::s_normalGid = ::getegid();
uid_t PrivilegeHelper::s_privilegedUid = ::geteuid();
gid_t PrivilegeHelper::s_privilegedGid = ::getegid();
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
void
PrivilegeHelper::initialize(const std::string& userName, const std::string& groupName)
{
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
static const size_t MAX_GROUP_BUFFER_SIZE = 16384; // 16 KiB
static const size_t MAX_PASSWD_BUFFER_SIZE = 16384;
@@ -111,13 +111,13 @@
if (!userName.empty() || !groupName.empty()) {
throw Error("Dropping and raising privileges is not supported on this platform");
}
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
}
void
PrivilegeHelper::drop()
{
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
if (::geteuid() == s_normalUid && ::getegid() == s_normalGid)
return;
@@ -132,13 +132,13 @@
NFD_LOG_INFO("dropped to effective uid=" << ::geteuid() << " gid=" << ::getegid());
#else
NFD_LOG_WARN("Dropping privileges is not supported on this platform");
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
}
void
PrivilegeHelper::raise()
{
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
if (::geteuid() == s_privilegedUid && ::getegid() == s_privilegedGid)
return;
@@ -153,7 +153,7 @@
NFD_LOG_INFO("elevated to effective uid=" << ::geteuid() << " gid=" << ::getegid());
#else
NFD_LOG_WARN("Elevating privileges is not supported on this platform");
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
}
} // namespace nfd
diff --git a/daemon/common/privilege-helper.hpp b/daemon/common/privilege-helper.hpp
index 52daf84..f0eb3bd 100644
--- a/daemon/common/privilege-helper.hpp
+++ b/daemon/common/privilege-helper.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -71,7 +71,7 @@
{
raise();
try {
- f();
+ std::forward<F>(f)();
}
catch (...) {
drop();
@@ -80,18 +80,18 @@
drop();
}
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static void
raise();
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
static uid_t s_normalUid;
static gid_t s_normalGid;
static uid_t s_privilegedUid;
static gid_t s_privilegedGid;
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
};
} // namespace nfd
diff --git a/daemon/face/face-system.hpp b/daemon/face/face-system.hpp
index 84a2dce..3b2e3dc 100644
--- a/daemon/face/face-system.hpp
+++ b/daemon/face/face-system.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -100,7 +100,7 @@
bool isDryRun;
};
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
ProtocolFactoryCtorParams
makePFCtorParams();
@@ -109,7 +109,7 @@
processConfig(const ConfigSection& configSection, bool isDryRun,
const std::string& filename);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \brief config section name => protocol factory
*/
std::map<std::string, unique_ptr<ProtocolFactory>> m_factories;
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 8228885..0076f85 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
* LinkService is the upper part, which translates between network-layer packets
* and TLV blocks, and may provide additional services such as fragmentation and reassembly.
*/
-class Face FINAL_UNLESS_WITH_TESTS : public std::enable_shared_from_this<Face>, noncopyable
+class Face NFD_FINAL_UNLESS_WITH_TESTS : public std::enable_shared_from_this<Face>, noncopyable
{
public:
Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport);
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 7a1dd4f..7a86b09 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -93,8 +93,8 @@
/** \brief GenericLinkService is a LinkService that implements the NDNLPv2 protocol
* \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
*/
-class GenericLinkService FINAL_UNLESS_WITH_TESTS : public LinkService
- , protected virtual GenericLinkServiceCounters
+class GenericLinkService NFD_FINAL_UNLESS_WITH_TESTS : public LinkService
+ , protected virtual GenericLinkServiceCounters
{
public:
/** \brief Options that control the behavior of GenericLinkService
@@ -184,10 +184,10 @@
setOptions(const Options& options);
const Counters&
- getCounters() const OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ getCounters() const NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
ssize_t
- getEffectiveMtu() const OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ getEffectiveMtu() const NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
/** \brief Whether MTU can be overridden to the specified value
*
@@ -196,7 +196,7 @@
bool
canOverrideMtuTo(ssize_t mtu) const;
-PROTECTED_WITH_TESTS_ELSE_PRIVATE: // send path
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE: // send path
/** \brief request an IDLE packet to transmit pending service fields
*/
void
@@ -208,13 +208,13 @@
sendLpPacket(lp::Packet&& pkt);
void
- doSendInterest(const Interest& interest) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendInterest(const Interest& interest) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
void
- doSendData(const Data& data) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendData(const Data& data) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
void
- doSendNack(const ndn::lp::Nack& nack) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doSendNack(const ndn::lp::Nack& nack) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
/** \brief assign consecutive sequence numbers to LpPackets
*/
@@ -245,7 +245,7 @@
private: // receive path
void
- doReceivePacket(const Block& packet, const EndpointId& endpoint) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+ doReceivePacket(const Block& packet, const EndpointId& endpoint) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
/** \brief decode incoming network-layer packet
* \param netPkt reassembled network-layer packet
@@ -297,14 +297,14 @@
void
decodeNack(const Block& netPkt, const lp::Packet& firstPkt, const EndpointId& endpointId);
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
Options m_options;
LpFragmenter m_fragmenter;
LpReassembler m_reassembler;
LpReliability m_reliability;
lp::Sequence m_lastSeqNo;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/// Time to mark next packet due to send queue congestion
time::steady_clock::TimePoint m_nextMarkTime;
/// number of marked packets in the current incident of congestion
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index 1ea2b9a..4349fca 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -105,12 +105,12 @@
void
piggyback(lp::Packet& pkt, ssize_t mtu);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
class UnackedFrag;
class NetPkt;
using UnackedFrags = std::map<lp::Sequence, UnackedFrag>;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \brief assign TxSequence number to a fragment
* \param frag fragment to assign TxSequence to
* \return assigned TxSequence number
@@ -162,7 +162,7 @@
void
deleteUnackedFrag(UnackedFrags::iterator fragIt);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \brief contains a sent fragment that has not been acknowledged and associated data
*/
class UnackedFrag
@@ -200,7 +200,7 @@
tlv::sizeOfVarNumber(sizeof(lp::Sequence)) +
sizeof(lp::Sequence);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
Options m_options;
GenericLinkService* m_linkService;
UnackedFrags m_unackedFrags;
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index 0ea9687..ac66f36 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -150,7 +150,7 @@
else {
BOOST_ASSERT(localAddress.is_v6());
sock.set_option(boost::asio::ip::v6_only(true));
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
// To simplify unit tests, we bind to the "any" IPv6 address if the supplied multicast
// address lacks a scope id. Calling bind() without a scope id would otherwise fail.
if (multicastGroup.address().to_v6().scope_id() == 0)
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index 6297afd..be4a528 100644
--- a/daemon/face/netdev-bound.hpp
+++ b/daemon/face/netdev-bound.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -61,7 +61,7 @@
processConfig(OptionalConfigSection configSection,
FaceSystem::ConfigContext& context);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
struct Rule
{
std::vector<FaceUri> remotes;
@@ -71,7 +71,7 @@
Rule
parseRule(int index, const ConfigSection& confRule) const;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
const FaceSystem& m_faceSystem;
FaceCreatedCallback m_addFace;
shared_ptr<ndn::net::NetworkMonitor> m_netmon;
diff --git a/daemon/face/network-predicate.hpp b/daemon/face/network-predicate.hpp
index 27ac8b1..7f77486 100644
--- a/daemon/face/network-predicate.hpp
+++ b/daemon/face/network-predicate.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -79,7 +79,7 @@
void
parseList(std::set<std::string>& set, std::initializer_list<std::pair<std::string, std::string>> list);
-PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED:
std::set<std::string> m_whitelist;
std::set<std::string> m_blacklist;
};
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index dc4f3b8..1c81676 100644
--- a/daemon/face/null-transport.hpp
+++ b/daemon/face/null-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,7 @@
/** \brief A Transport that drops every packet.
*/
-class NullTransport FINAL_UNLESS_WITH_TESTS : public Transport
+class NullTransport NFD_FINAL_UNLESS_WITH_TESTS : public Transport
{
public:
explicit
@@ -44,14 +44,14 @@
protected:
void
- doClose() OVERRIDE_WITH_TESTS_ELSE_FINAL
+ doClose() NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL
{
setState(TransportState::CLOSED);
}
private:
void
- doSend(const Block&) OVERRIDE_WITH_TESTS_ELSE_FINAL
+ doSend(const Block&) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL
{
}
};
diff --git a/daemon/face/pcap-helper.hpp b/daemon/face/pcap-helper.hpp
index 5d239ce..1f08d85 100644
--- a/daemon/face/pcap-helper.hpp
+++ b/daemon/face/pcap-helper.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include "core/common.hpp"
-#ifndef HAVE_LIBPCAP
+#ifndef NFD_HAVE_LIBPCAP
#error "Cannot include this file when libpcap is not available"
#endif
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 0c22738..519d2dc 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -79,7 +79,7 @@
bool m_wantCongestionMarking = false;
std::map<tcp::Endpoint, shared_ptr<TcpChannel>> m_channels;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
IpAddressPredicate m_local;
};
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index a6a2048..c300eed 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -40,7 +40,7 @@
* state is set to DOWN, and the connection is retried periodically with exponential backoff
* until it is reestablished
*/
-class TcpTransport FINAL_UNLESS_WITH_TESTS : public StreamTransport<boost::asio::ip::tcp>
+class TcpTransport NFD_FINAL_UNLESS_WITH_TESTS : public StreamTransport<boost::asio::ip::tcp>
{
public:
TcpTransport(protocol::socket&& socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope);
@@ -61,17 +61,17 @@
void
handleError(const boost::system::error_code& error) final;
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
- VIRTUAL_WITH_TESTS void
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+ NFD_VIRTUAL_WITH_TESTS void
reconnect();
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
handleReconnect(const boost::system::error_code& error);
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
handleReconnectTimeout();
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \brief how long to wait before the first reconnection attempt after the TCP connection has been severed
*/
static time::milliseconds s_initialReconnectWait;
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index a52567a..1993143 100644
--- a/daemon/face/unix-stream-transport.hpp
+++ b/daemon/face/unix-stream-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include "stream-transport.hpp"
-#ifndef HAVE_UNIX_SOCKETS
+#ifndef NFD_HAVE_UNIX_SOCKETS
#error "Cannot include this file when UNIX sockets are not available"
#endif
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index c1b2805..1409289 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -74,7 +74,7 @@
void
listen(const FaceCreatedCallback& onFaceCreated);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/** \pre listen hasn't been invoked
*/
void
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
index 022682b..4815ed1 100644
--- a/daemon/face/websocketpp.hpp
+++ b/daemon/face/websocketpp.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,11 @@
#ifndef NFD_DAEMON_FACE_WEBSOCKETPP_HPP
#define NFD_DAEMON_FACE_WEBSOCKETPP_HPP
-#ifndef HAVE_WEBSOCKET
+#include "core/config.hpp"
+
+#ifndef NFD_HAVE_WEBSOCKET
#error "Cannot include this file when WebSocket support is disabled"
-#endif // HAVE_WEBSOCKET
+#endif
// suppress websocketpp warnings
#pragma GCC system_header
diff --git a/daemon/fw/best-route-strategy2.hpp b/daemon/fw/best-route-strategy2.hpp
index bcb994d..79c6c0d 100644
--- a/daemon/fw/best-route-strategy2.hpp
+++ b/daemon/fw/best-route-strategy2.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -68,7 +68,7 @@
afterReceiveNack(const FaceEndpoint& ingress, const lp::Nack& nack,
const shared_ptr<pit::Entry>& pitEntry) override;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static const time::milliseconds RETX_SUPPRESSION_INITIAL;
static const time::milliseconds RETX_SUPPRESSION_MAX;
RetxSuppressionExponential m_retxSuppression;
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index f736e0f..4bdd42a 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -54,7 +54,7 @@
explicit
Forwarder(FaceTable& faceTable);
- VIRTUAL_WITH_TESTS
+ NFD_VIRTUAL_WITH_TESTS
~Forwarder();
const ForwarderCounters&
@@ -165,76 +165,76 @@
return m_networkRegionTable;
}
-PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
/** \brief incoming Interest pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onIncomingInterest(const FaceEndpoint& ingress, const Interest& interest);
/** \brief Interest loop pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onInterestLoop(const FaceEndpoint& ingress, const Interest& interest);
/** \brief Content Store miss pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onContentStoreMiss(const FaceEndpoint& ingress,
const shared_ptr<pit::Entry>& pitEntry, const Interest& interest);
/** \brief Content Store hit pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onContentStoreHit(const FaceEndpoint& ingress, const shared_ptr<pit::Entry>& pitEntry,
const Interest& interest, const Data& data);
/** \brief outgoing Interest pipeline
* \return A pointer to the out-record created or nullptr if the Interest was dropped
*/
- VIRTUAL_WITH_TESTS pit::OutRecord*
+ NFD_VIRTUAL_WITH_TESTS pit::OutRecord*
onOutgoingInterest(const shared_ptr<pit::Entry>& pitEntry,
Face& egress, const Interest& interest);
/** \brief Interest finalize pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onInterestFinalize(const shared_ptr<pit::Entry>& pitEntry);
/** \brief incoming Data pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onIncomingData(const FaceEndpoint& ingress, const Data& data);
/** \brief Data unsolicited pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onDataUnsolicited(const FaceEndpoint& ingress, const Data& data);
/** \brief outgoing Data pipeline
* \return Whether the Data was transmitted (true) or dropped (false)
*/
- VIRTUAL_WITH_TESTS bool
+ NFD_VIRTUAL_WITH_TESTS bool
onOutgoingData(const Data& data, Face& egress);
/** \brief incoming Nack pipeline
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onIncomingNack(const FaceEndpoint& ingress, const lp::Nack& nack);
/** \brief outgoing Nack pipeline
* \return Whether the Nack was transmitted (true) or dropped (false)
*/
- VIRTUAL_WITH_TESTS bool
+ NFD_VIRTUAL_WITH_TESTS bool
onOutgoingNack(const shared_ptr<pit::Entry>& pitEntry,
Face& egress, const lp::NackHeader& nack);
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onDroppedInterest(const Face& egress, const Interest& interest);
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
onNewNextHop(const Name& prefix, const fib::NextHop& nextHop);
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
/** \brief set a new expiry timer (now + \p duration) on a PIT entry
*/
void
@@ -244,18 +244,18 @@
* \param upstream if null, insert Nonces from all out-records;
* if not null, insert Nonce only on the out-records of this face
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
insertDeadNonceList(pit::Entry& pitEntry, Face* upstream);
/** \brief call trigger (method) on the effective strategy of pitEntry
*/
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
virtual void
dispatchToStrategy(pit::Entry& pitEntry, std::function<void(fw::Strategy&)> trigger)
#else
template<class Function>
void
- dispatchToStrategy(pit::Entry& pitEntry, Function trigger)
+ dispatchToStrategy(pit::Entry& pitEntry, Function&& trigger)
#endif
{
trigger(m_strategyChoice.findEffectiveStrategy(pitEntry));
diff --git a/daemon/fw/multicast-strategy.hpp b/daemon/fw/multicast-strategy.hpp
index 711680a..3dd9f6c 100644
--- a/daemon/fw/multicast-strategy.hpp
+++ b/daemon/fw/multicast-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -57,7 +57,7 @@
friend ProcessNackTraits<MulticastStrategy>;
RetxSuppressionExponential m_retxSuppression;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static const time::milliseconds RETX_SUPPRESSION_INITIAL;
static const time::milliseconds RETX_SUPPRESSION_MAX;
};
diff --git a/daemon/fw/ncc-strategy.hpp b/daemon/fw/ncc-strategy.hpp
index dadbded..3ba5019 100644
--- a/daemon/fw/ncc-strategy.hpp
+++ b/daemon/fw/ncc-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -50,7 +50,7 @@
beforeSatisfyInterest(const shared_ptr<pit::Entry>& pitEntry,
const FaceEndpoint& ingress, const Data& data) override;
-PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED:
/// StrategyInfo on measurements::Entry
class MeasurementsEntryInfo : public StrategyInfo
{
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index aae3862..49b5b95 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,7 @@
namespace nfd {
namespace fw {
-/** \brief contains arbitrary information forwarding strategy places on table entries
+/** \brief Contains arbitrary information placed by the forwarding strategy on table entries
*/
class StrategyInfo
{
@@ -41,10 +41,7 @@
* \sa https://redmine.named-data.net/projects/nfd/wiki/StrategyInfoType
*/
static constexpr int
- getTypeId()
- {
- return <type-identifier>;
- }
+ getTypeId();
#endif
virtual
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 37b1553..571d7d1 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -257,7 +257,7 @@
* \param interest the Interest packet
* \return A pointer to the out-record created or nullptr if the Interest was dropped
*/
- VIRTUAL_WITH_TESTS pit::OutRecord*
+ NFD_VIRTUAL_WITH_TESTS pit::OutRecord*
sendInterest(const shared_ptr<pit::Entry>& pitEntry, Face& egress,
const Interest& interest);
@@ -267,7 +267,7 @@
* \param egress face through which to send out the Data
* \return Whether the Data was sent (true) or dropped (false)
*/
- VIRTUAL_WITH_TESTS bool
+ NFD_VIRTUAL_WITH_TESTS bool
sendData(const shared_ptr<pit::Entry>& pitEntry, const Data& data, Face& egress);
/** \brief Send a Data packet to all matched and qualified faces.
@@ -278,7 +278,7 @@
* \param inFace face on which the Data arrived
* \param data the Data packet
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
sendDataToAll(const shared_ptr<pit::Entry>& pitEntry, const Face& inFace, const Data& data);
/** \brief Schedule the PIT entry for immediate deletion.
@@ -287,7 +287,7 @@
* The strategy should invoke this function when it concludes that the Interest cannot
* be forwarded and it does not want to wait for responses from existing upstream nodes.
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
rejectPendingInterest(const shared_ptr<pit::Entry>& pitEntry)
{
this->setExpiryTimer(pitEntry, 0_ms);
@@ -302,7 +302,7 @@
* \param header the Nack header
* \return Whether the Nack was sent (true) or dropped (false)
*/
- VIRTUAL_WITH_TESTS bool
+ NFD_VIRTUAL_WITH_TESTS bool
sendNack(const shared_ptr<pit::Entry>& pitEntry, Face& egress,
const lp::NackHeader& header)
{
@@ -388,7 +388,7 @@
m_name = name;
}
-PUBLIC_WITH_TESTS_ELSE_PROTECTED: // setter
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // setter
/** \brief Set whether the afterNewNextHop trigger should be invoked for this strategy
*/
void
diff --git a/daemon/main.cpp b/daemon/main.cpp
index 47f7333..1b529fb 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -50,13 +50,13 @@
#include <ndn-cxx/util/ostream-joiner.hpp>
#include <ndn-cxx/version.hpp>
-#ifdef HAVE_LIBPCAP
+#ifdef NFD_HAVE_LIBPCAP
#include <pcap/pcap.h>
#endif
-#ifdef HAVE_SYSTEMD
+#ifdef NFD_HAVE_SYSTEMD
#include <systemd/sd-daemon.h>
#endif
-#ifdef HAVE_WEBSOCKET
+#ifdef NFD_HAVE_WEBSOCKET
#include <websocketpp/version.hpp>
#endif
@@ -180,7 +180,7 @@
static void
systemdNotify(const char* state)
{
-#ifdef HAVE_SYSTEMD
+#ifdef NFD_HAVE_SYSTEMD
sd_notify(0, state);
#endif
}
@@ -247,14 +247,14 @@
{
using namespace nfd;
- std::string configFile = DEFAULT_CONFIG_FILE;
+ std::string configFile = NFD_DEFAULT_CONFIG_FILE;
po::options_description description("Options");
description.add_options()
("help,h", "print this message and exit")
("version,V", "show version information and exit")
("config,c", po::value<std::string>(&configFile),
- "path to configuration file (default: " DEFAULT_CONFIG_FILE ")")
+ "path to configuration file (default: " NFD_DEFAULT_CONFIG_FILE ")")
("modules,m", "list available logging modules")
;
@@ -292,13 +292,13 @@
"." + to_string(BOOST_VERSION / 100 % 1000) +
"." + to_string(BOOST_VERSION % 100);
const std::string pcapBuildInfo =
-#ifdef HAVE_LIBPCAP
+#ifdef NFD_HAVE_LIBPCAP
"with " + std::string(pcap_lib_version());
#else
"without libpcap";
#endif
const std::string wsBuildInfo =
-#ifdef HAVE_WEBSOCKET
+#ifdef NFD_HAVE_WEBSOCKET
"with WebSocket++ version " + to_string(websocketpp::major_version) +
"." + to_string(websocketpp::minor_version) +
"." + to_string(websocketpp::patch_version);
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index 4e233cb..c1547c5 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -86,7 +86,7 @@
signal::ScopedConnection m_faceAddConn;
signal::ScopedConnection m_faceRemoveConn;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
std::map<FaceId, signal::ScopedConnection> m_faceStateChangeConn;
};
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index 2c963b1..e061217 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -71,7 +71,7 @@
ManagerBase(const std::string& module, Dispatcher& dispatcher,
CommandAuthenticator& authenticator);
-PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
// difference from mgmt::ControlCommand: accepts nfd::ControlParameters
using ControlCommandHandler = std::function<void(const ControlCommand& command,
const Name& prefix, const Interest& interest,
@@ -90,7 +90,7 @@
ndn::mgmt::PostNotification
registerNotificationStream(const std::string& verb);
-PUBLIC_WITH_TESTS_ELSE_PROTECTED: // helpers
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED: // helpers
/**
* @brief Extracts the requester from a ControlCommand request.
*
@@ -102,7 +102,7 @@
void
extractRequester(const Interest& interest, ndn::mgmt::AcceptContinuation accept);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/**
* @brief Returns an authorization function for a specific management module and verb.
*/
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index 51f9dfc..3b2e794 100644
--- a/daemon/mgmt/rib-manager.hpp
+++ b/daemon/mgmt/rib-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -229,7 +229,7 @@
void
onFetchActiveFacesFailure(uint32_t code, const std::string& reason);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
void
scheduleActiveFaceFetch(const time::seconds& timeToWait);
diff --git a/daemon/rib/fib-updater.hpp b/daemon/rib/fib-updater.hpp
index 518b9c7..52f3d74 100644
--- a/daemon/rib/fib-updater.hpp
+++ b/daemon/rib/fib-updater.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -54,7 +54,7 @@
FibUpdater(Rib& rib, ndn::nfd::Controller& controller);
- VIRTUAL_WITH_TESTS
+ NFD_VIRTUAL_WITH_TESTS
~FibUpdater() = default;
/** \brief computes FibUpdates using the provided RibUpdateBatch and then sends the
@@ -102,13 +102,13 @@
sendUpdatesForNonBatchFaceId(const FibUpdateSuccessCallback& onSuccess,
const FibUpdateFailureCallback& onFailure);
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
/** \brief sends a FibAddNextHopCommand to NFD using the parameters supplied by
* the passed update
*
* \param nTimeouts the number of times this FibUpdate has failed due to timeout
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
sendAddNextHopUpdate(const FibUpdate& update,
const FibUpdateSuccessCallback& onSuccess,
const FibUpdateFailureCallback& onFailure,
@@ -119,7 +119,7 @@
*
* \param nTimeouts the number of times this FibUpdate has failed due to timeout
*/
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
sendRemoveNextHopUpdate(const FibUpdate& update,
const FibUpdateSuccessCallback& onSuccess,
const FibUpdateFailureCallback& onFailure,
@@ -136,7 +136,7 @@
void
computeUpdatesForUnregistration(const RibUpdate& update);
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
/** \brief callback used by NfdController when a FibAddNextHopCommand or FibRemoveNextHopCommand
* is successful.
*
@@ -257,7 +257,7 @@
ndn::nfd::Controller& m_controller;
uint64_t m_batchFaceId;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
FibUpdateList m_updatesForBatchFaceId;
FibUpdateList m_updatesForNonBatchFaceId;
diff --git a/daemon/rib/rib.hpp b/daemon/rib/rib.hpp
index 010ea89..dbfdba8 100644
--- a/daemon/rib/rib.hpp
+++ b/daemon/rib/rib.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -160,7 +160,7 @@
onFibUpdateFailure(const Rib::UpdateFailureCallback& onFailure,
uint32_t code, const std::string& error);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
void
erase(const Name& prefix, const Route& route);
diff --git a/daemon/table/cs.hpp b/daemon/table/cs.hpp
index 88f171d..cf91e17 100644
--- a/daemon/table/cs.hpp
+++ b/daemon/table/cs.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -185,7 +185,7 @@
void
setPolicyImpl(unique_ptr<Policy> policy);
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
void
dump();
diff --git a/daemon/table/dead-nonce-list.hpp b/daemon/table/dead-nonce-list.hpp
index 5b49143..5322dd4 100644
--- a/daemon/table/dead-nonce-list.hpp
+++ b/daemon/table/dead-nonce-list.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -146,7 +146,7 @@
Queue& m_queue;
Hashtable& m_ht;
-PUBLIC_WITH_TESTS_ELSE_PRIVATE: // actual lifetime estimation and capacity control
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // actual lifetime estimation and capacity control
// ---- current capacity and hard limits
diff --git a/docs/doxygen.conf.in b/docs/doxygen.conf.in
index 06b4bd7..c931ea2 100644
--- a/docs/doxygen.conf.in
+++ b/docs/doxygen.conf.in
@@ -2057,12 +2057,12 @@
NFD_LOG_MEMBER_DECL_SPECIALIZED(x)= \
NFD_LOG_MEMBER_INIT(x,y)= \
NFD_LOG_MEMBER_INIT_SPECIALIZED(x,y)= \
- VIRTUAL_WITH_TESTS= \
- PUBLIC_WITH_TESTS_ELSE_PROTECTED=protected \
- PUBLIC_WITH_TESTS_ELSE_PRIVATE=private \
- PROTECTED_WITH_TESTS_ELSE_PRIVATE=private \
- OVERRIDE_WITH_TESTS_ELSE_FINAL=final \
- FINAL_UNLESS_WITH_TESTS=final
+ NFD_VIRTUAL_WITH_TESTS= \
+ NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED=protected \
+ NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE=private \
+ NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE=private \
+ NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL=final \
+ NFD_FINAL_UNLESS_WITH_TESTS=final
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
diff --git a/tests/daemon/common/privilege-helper.t.cpp b/tests/daemon/common/privilege-helper.t.cpp
index dcea7cb..c670a5f 100644
--- a/tests/daemon/common/privilege-helper.t.cpp
+++ b/tests/daemon/common/privilege-helper.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,7 +34,7 @@
BOOST_AUTO_TEST_CASE(DropRaise)
{
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
SKIP_IF_NOT_SUPERUSER();
// The following assumes that daemon:daemon is present on the test system
@@ -64,7 +64,7 @@
#else
BOOST_TEST_MESSAGE("Dropping/raising privileges not supported on this platform, skipping");
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
}
BOOST_AUTO_TEST_SUITE_END() // TestPrivilegeHelper
diff --git a/tests/daemon/mgmt/general-config-section.t.cpp b/tests/daemon/mgmt/general-config-section.t.cpp
index 5dbfc41..cad7834 100644
--- a/tests/daemon/mgmt/general-config-section.t.cpp
+++ b/tests/daemon/mgmt/general-config-section.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -46,14 +46,14 @@
setConfigFile(configFile);
}
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
~GeneralConfigSectionFixture()
{
// revert changes to s_normalUid/s_normalGid, if any
PrivilegeHelper::s_normalUid = ::geteuid();
PrivilegeHelper::s_normalGid = ::getegid();
}
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
protected:
ConfigFile configFile;
@@ -76,7 +76,7 @@
BOOST_CHECK_EQUAL(PrivilegeHelper::s_normalGid, PrivilegeHelper::s_privilegedGid);
}
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
BOOST_AUTO_TEST_CASE(UserConfig)
{
@@ -124,7 +124,7 @@
BOOST_CHECK_NE(PrivilegeHelper::s_normalGid, PrivilegeHelper::s_privilegedGid);
}
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
BOOST_AUTO_TEST_CASE(InvalidUserConfig)
{
diff --git a/tests/other/cs-benchmark.cpp b/tests/other/cs-benchmark.cpp
index e6948ed..26f5410 100644
--- a/tests/other/cs-benchmark.cpp
+++ b/tests/other/cs-benchmark.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
#include <iostream>
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
#include <valgrind/callgrind.h>
#endif
@@ -50,7 +50,7 @@
static time::microseconds
timedRun(const std::function<void()>& f)
{
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
CALLGRIND_START_INSTRUMENTATION;
#endif
@@ -58,7 +58,7 @@
f();
auto t2 = time::steady_clock::now();
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
CALLGRIND_STOP_INSTRUMENTATION;
#endif
diff --git a/tests/other/face-benchmark.cpp b/tests/other/face-benchmark.cpp
index 3bf5a14..9ee179f 100644
--- a/tests/other/face-benchmark.cpp
+++ b/tests/other/face-benchmark.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,7 @@
#include <fstream>
#include <iostream>
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
#include <valgrind/callgrind.h>
#endif
@@ -189,7 +189,7 @@
try {
nfd::tests::FaceBenchmark bench{argv[1]};
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
CALLGRIND_START_INSTRUMENTATION;
#endif
nfd::getGlobalIoService().run();
diff --git a/tests/other/pit-fib-benchmark.cpp b/tests/other/pit-fib-benchmark.cpp
index 41449c0..c6888d1 100644
--- a/tests/other/pit-fib-benchmark.cpp
+++ b/tests/other/pit-fib-benchmark.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,7 +29,7 @@
#include <iostream>
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
#include <valgrind/callgrind.h>
#endif
@@ -118,7 +118,7 @@
generatePacketsAndPopulateFib(nRoundTrip, nFibEntries, fibPrefixLength,
interestNameLength, dataNameLength);
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
CALLGRIND_START_INSTRUMENTATION;
#endif
@@ -142,7 +142,7 @@
auto t2 = time::steady_clock::now();
-#ifdef HAVE_VALGRIND
+#ifdef NFD_HAVE_VALGRIND
CALLGRIND_STOP_INSTRUMENTATION;
#endif
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index 9d4edbd..e25c6c9 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,7 +31,7 @@
#include <ndn-cxx/prefix-announcement.hpp>
-#ifdef HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#ifdef NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
#include <unistd.h>
#define SKIP_IF_NOT_SUPERUSER() \
do { \
@@ -42,7 +42,7 @@
} while (false)
#else
#define SKIP_IF_NOT_SUPERUSER()
-#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
+#endif // NFD_HAVE_PRIVILEGE_DROP_AND_ELEVATE
namespace nfd {
namespace tests {
diff --git a/tools/ndn-autoconfig/procedure.hpp b/tools/ndn-autoconfig/procedure.hpp
index 67e1209..7c52658 100644
--- a/tools/ndn-autoconfig/procedure.hpp
+++ b/tools/ndn-autoconfig/procedure.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,7 @@
#define NFD_TOOLS_NDN_AUTOCONFIG_PROCEDURE_HPP
#include "stage.hpp"
+
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/security/key-chain.hpp>
@@ -63,7 +64,7 @@
}
private:
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
makeStages(const Options& options);
void
@@ -79,7 +80,7 @@
*/
util::Signal<Procedure, bool> onComplete;
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
std::vector<unique_ptr<Stage>> m_stages;
private:
diff --git a/tools/nfdc/status-report.hpp b/tools/nfdc/status-report.hpp
index f88b175..ae5ecdc 100644
--- a/tools/nfdc/status-report.hpp
+++ b/tools/nfdc/status-report.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,6 +27,7 @@
#define NFD_TOOLS_NFDC_STATUS_REPORT_HPP
#include "module.hpp"
+
#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>
#include <ndn-cxx/security/validator.hpp>
@@ -55,7 +56,7 @@
class StatusReport : noncopyable
{
public:
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
virtual
~StatusReport() = default;
#endif
@@ -83,7 +84,7 @@
formatText(std::ostream& os) const;
private:
- VIRTUAL_WITH_TESTS void
+ NFD_VIRTUAL_WITH_TESTS void
processEvents(Face& face);
public:
diff --git a/wscript b/wscript
index 15cb62d..aef4320 100644
--- a/wscript
+++ b/wscript
@@ -1,6 +1,6 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
"""
-Copyright (c) 2014-2020, Regents of the University of California,
+Copyright (c) 2014-2021, Regents of the University of California,
Arizona Board of Regents,
Colorado State University,
University Pierre & Marie Curie, Sorbonne University,
@@ -144,7 +144,7 @@
# or conf.define_cond(). Everything that was added directly to conf.env.DEFINES
# will not appear in the config header, but will instead be passed directly to the
# compiler on the command line.
- conf.write_config_header('core/config.hpp')
+ conf.write_config_header('core/config.hpp', define_prefix='NFD_')
def build(bld):
versionhpp(bld)