Refactor and modernize namespace declarations
Move all unit tests to namespace nfd::tests
Delete unused header core/algorithm.hpp
Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/daemon/face/channel.cpp b/daemon/face/channel.cpp
index dd3b118..fa25405 100644
--- a/daemon/face/channel.cpp
+++ b/daemon/face/channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "channel.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Channel::~Channel() = default;
@@ -53,5 +52,4 @@
});
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index f486feb..8d624fb 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "channel-log.hpp"
#include "face-common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Represents a channel that listens on a local endpoint.
* \sa FaceSystem
@@ -99,7 +98,6 @@
void
connectFaceClosedSignal(Face& face, std::function<void()> f);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_CHANNEL_HPP
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index 950a49f..e053af2 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -32,8 +32,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
struct Unicast {};
struct Multicast {};
@@ -262,7 +261,6 @@
return 0;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_DATAGRAM_TRANSPORT_HPP
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 2509140..4d0adc3 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <pcap/pcap.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetChannel);
@@ -234,5 +233,4 @@
m_pcap.setPacketFilter(filter.data());
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-channel.hpp b/daemon/face/ethernet-channel.hpp
index 510b7aa..2096585 100644
--- a/daemon/face/ethernet-channel.hpp
+++ b/daemon/face/ethernet-channel.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing Ethernet-based channel to create faces
@@ -137,7 +136,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 4fea598..59f0c5c 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -30,8 +30,7 @@
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetFactory);
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory);
@@ -377,5 +376,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index 578a901..1d63397 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "ethernet-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for Ethernet
*/
@@ -128,7 +127,6 @@
signal::ScopedConnection m_netifAddConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
diff --git a/daemon/face/ethernet-protocol.cpp b/daemon/face/ethernet-protocol.cpp
index 0a0ebe1..24478f8 100644
--- a/daemon/face/ethernet-protocol.cpp
+++ b/daemon/face/ethernet-protocol.cpp
@@ -27,8 +27,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr)
@@ -57,5 +56,4 @@
return {eh, ""};
}
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
diff --git a/daemon/face/ethernet-protocol.hpp b/daemon/face/ethernet-protocol.hpp
index c9b9bdc..50b4ac5 100644
--- a/daemon/face/ethernet-protocol.hpp
+++ b/daemon/face/ethernet-protocol.hpp
@@ -31,15 +31,13 @@
#include <ndn-cxx/net/ethernet.hpp>
#include <net/ethernet.h>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
using namespace ndn::ethernet;
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr);
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
#endif // NFD_DAEMON_FACE_ETHERNET_PROTOCOL_HPP
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 568064b..53de0b7 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -33,8 +33,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetTransport);
@@ -230,5 +229,4 @@
doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-transport.hpp b/daemon/face/ethernet-transport.hpp
index 1379899..951d56a 100644
--- a/daemon/face/ethernet-transport.hpp
+++ b/daemon/face/ethernet-transport.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Base class for Ethernet-based Transports
@@ -113,7 +112,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/face-counters.cpp b/daemon/face/face-counters.cpp
index 275783f..ec8572e 100644
--- a/daemon/face/face-counters.cpp
+++ b/daemon/face/face-counters.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "face-counters.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
FaceCounters::FaceCounters(const LinkService::Counters& linkServiceCounters,
const Transport::Counters& transportCounters)
@@ -46,5 +45,4 @@
{
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face-counters.hpp b/daemon/face/face-counters.hpp
index bfe08bd..7d7cdc3 100644
--- a/daemon/face/face-counters.hpp
+++ b/daemon/face/face-counters.hpp
@@ -29,8 +29,7 @@
#include "link-service.hpp"
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief gives access to counters provided by Face
*
@@ -94,7 +93,6 @@
const Transport::Counters& m_transportCounters;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_FACE_COUNTERS_HPP
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index f86ea25..7ab9879 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -29,8 +29,7 @@
#include "common/global.hpp"
#include "fw/face-table.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(FaceSystem);
@@ -163,5 +162,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index cc606d0..7b15dc5 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -25,8 +25,7 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Face::Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport)
: afterReceiveInterest(service->afterReceiveInterest)
@@ -51,5 +50,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index a21aec2..ed19eec 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -30,8 +30,7 @@
#include <cmath>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(GenericLinkService);
@@ -507,5 +506,4 @@
this->receiveNack(nack, endpointId);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 0f589a3..be216a7 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -31,8 +31,7 @@
#include "lp-reassembler.hpp"
#include "lp-reliability.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by GenericLinkService
* \note The type name 'GenericLinkServiceCounters' is implementation detail.
@@ -325,7 +324,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
diff --git a/daemon/face/internal-face.cpp b/daemon/face/internal-face.cpp
index a7aa7fb..e899c5a 100644
--- a/daemon/face/internal-face.cpp
+++ b/daemon/face/internal-face.cpp
@@ -28,8 +28,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain)
@@ -49,5 +48,4 @@
return {face, clientFace};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-face.hpp b/daemon/face/internal-face.hpp
index 94e1960..6b27cfa 100644
--- a/daemon/face/internal-face.hpp
+++ b/daemon/face/internal-face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,10 @@
#define NFD_DAEMON_FACE_INTERNAL_FACE_HPP
#include "face.hpp"
+
#include <ndn-cxx/face.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief make a pair of forwarder-side face and client-side face
* that are connected with each other
@@ -45,7 +45,6 @@
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_FACE_HPP
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
index 8f9da71..2eeab51 100644
--- a/daemon/face/internal-transport.cpp
+++ b/daemon/face/internal-transport.cpp
@@ -26,8 +26,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT(InternalForwarderTransport, InternalForwarderTransport);
NFD_LOG_MEMBER_INIT(InternalClientTransport, InternalClientTransport);
@@ -123,5 +122,4 @@
m_forwarder->receivePacket(wire);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
index d729ecd..886af5c 100644
--- a/daemon/face/internal-transport.hpp
+++ b/daemon/face/internal-transport.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/transport/transport.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Abstracts a transport that can be paired with another.
*/
@@ -125,7 +124,6 @@
signal::ScopedConnection m_fwTransportStateConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
diff --git a/daemon/face/link-service.cpp b/daemon/face/link-service.cpp
index 6527dbd..d7233d0 100644
--- a/daemon/face/link-service.cpp
+++ b/daemon/face/link-service.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "link-service.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LinkService);
@@ -135,5 +134,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/link-service.hpp b/daemon/face/link-service.hpp
index e62c1a3..92645f4 100644
--- a/daemon/face/link-service.hpp
+++ b/daemon/face/link-service.hpp
@@ -30,8 +30,7 @@
#include "transport.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by LinkService
* \note The type name 'LinkServiceCounters' is implementation detail.
@@ -258,7 +257,6 @@
return os << FaceLogHelper<LinkService>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LINK_SERVICE_HPP
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 6b1755a..0243a48 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -28,8 +28,7 @@
#include <ndn-cxx/encoding/tlv.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpFragmenter);
@@ -153,5 +152,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index d98d752..8d24124 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief fragments network-layer packets into NDNLPv2 link-layer packets
* \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
@@ -80,7 +79,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpFragmenter>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index a4b255b..6c27d80 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -29,8 +29,7 @@
#include <numeric>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReassembler);
@@ -161,5 +160,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reassembler.hpp b/daemon/face/lp-reassembler.hpp
index 59db89b..8009c67 100644
--- a/daemon/face/lp-reassembler.hpp
+++ b/daemon/face/lp-reassembler.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Reassembles fragmented network-layer packets
@@ -149,7 +148,6 @@
return m_partialPackets.size();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_REASSEMBLER_HPP
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index b287bc3..a3d2596 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -28,8 +28,7 @@
#include "transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReliability);
@@ -426,5 +425,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index c83b0bc..17b2e44 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -34,8 +34,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class GenericLinkService;
@@ -221,7 +220,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpReliability>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_RELIABILITY_HPP
diff --git a/daemon/face/multicast-ethernet-transport.cpp b/daemon/face/multicast-ethernet-transport.cpp
index 5d34846..2068012 100644
--- a/daemon/face/multicast-ethernet-transport.cpp
+++ b/daemon/face/multicast-ethernet-transport.cpp
@@ -43,8 +43,7 @@
#endif
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(MulticastEthernetTransport);
@@ -146,5 +145,4 @@
NDN_THROW(Error("Failed to join multicast group"));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-ethernet-transport.hpp b/daemon/face/multicast-ethernet-transport.hpp
index 8c2ce91..27c195c 100644
--- a/daemon/face/multicast-ethernet-transport.hpp
+++ b/daemon/face/multicast-ethernet-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A multicast Transport that uses raw Ethernet II frames
@@ -57,7 +56,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index ac66f36..bb373fd 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,8 +37,7 @@
#include <sys/socket.h> // for setsockopt()
#endif // __linux__
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>), MulticastUdpTransport);
@@ -207,5 +206,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-udp-transport.hpp b/daemon/face/multicast-udp-transport.hpp
index 3e17dc9..b881e81 100644
--- a/daemon/face/multicast-udp-transport.hpp
+++ b/daemon/face/multicast-udp-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>));
@@ -94,7 +93,6 @@
protocol::socket m_sendSocket;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/netdev-bound.cpp b/daemon/face/netdev-bound.cpp
index b22bf62..3decef8 100644
--- a/daemon/face/netdev-bound.cpp
+++ b/daemon/face/netdev-bound.cpp
@@ -27,8 +27,7 @@
#include "face-system.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NetdevBound);
@@ -141,5 +140,4 @@
return rule;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index be4a528..7328342 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "protocol-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
class FaceSystem;
@@ -82,7 +81,6 @@
std::map<Key, shared_ptr<Face>> m_faces;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETDEV_BOUND_HPP
diff --git a/daemon/face/network-predicate.cpp b/daemon/face/network-predicate.cpp
index 07de63c..a13d886 100644
--- a/daemon/face/network-predicate.cpp
+++ b/daemon/face/network-predicate.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <fnmatch.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NetworkPredicateBase::NetworkPredicateBase()
{
@@ -227,5 +226,4 @@
[&address] (const auto& rule) { return doesAddressMatchRule(address, rule); });
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/network-predicate.hpp b/daemon/face/network-predicate.hpp
index 7f77486..2ea79d6 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class NetworkPredicateBase
{
@@ -130,7 +129,6 @@
isRuleValid(const std::string& key, const std::string& value) final;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP
diff --git a/daemon/face/null-face.cpp b/daemon/face/null-face.cpp
index 77178c6..b96db7c 100644
--- a/daemon/face/null-face.cpp
+++ b/daemon/face/null-face.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "null-link-service.hpp"
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
shared_ptr<Face>
makeNullFace(const FaceUri& uri)
@@ -39,5 +38,4 @@
make_unique<NullTransport>(uri, uri, ndn::nfd::FACE_SCOPE_LOCAL));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-face.hpp b/daemon/face/null-face.hpp
index a07b26c..b19bba6 100644
--- a/daemon/face/null-face.hpp
+++ b/daemon/face/null-face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,15 +28,14 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
-/** \return a Face that has no underlying transport and drops every packet
+/**
+ * \brief Returns a Face that has no underlying transport and drops every packet.
*/
shared_ptr<Face>
makeNullFace(const FaceUri& uri = FaceUri("null://"));
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_FACE_HPP
diff --git a/daemon/face/null-link-service.hpp b/daemon/face/null-link-service.hpp
index 2ae26ab..7ef2933 100644
--- a/daemon/face/null-link-service.hpp
+++ b/daemon/face/null-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "link-service.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A LinkService that drops every packet.
*/
@@ -57,7 +56,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_LINK_SERVICE_HPP
diff --git a/daemon/face/null-transport.cpp b/daemon/face/null-transport.cpp
index 912bf25..997238f 100644
--- a/daemon/face/null-transport.cpp
+++ b/daemon/face/null-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NullTransport);
@@ -43,5 +42,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index 1c81676..eea1559 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A Transport that drops every packet.
*/
@@ -56,7 +55,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_TRANSPORT_HPP
diff --git a/daemon/face/pcap-helper.cpp b/daemon/face/pcap-helper.cpp
index d481ac5..054eda2 100644
--- a/daemon/face/pcap-helper.cpp
+++ b/daemon/face/pcap-helper.cpp
@@ -35,8 +35,7 @@
#define PCAP_NETMASK_UNKNOWN 0xffffffff
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
PcapHelper::PcapHelper(const std::string& interfaceName)
: m_pcap(nullptr)
@@ -143,5 +142,4 @@
return {{packet, header->caplen}, ""};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/pcap-helper.hpp b/daemon/face/pcap-helper.hpp
index 30a8deb..41bf066 100644
--- a/daemon/face/pcap-helper.hpp
+++ b/daemon/face/pcap-helper.hpp
@@ -36,8 +36,7 @@
struct pcap;
typedef pcap pcap_t;
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Helper class for dealing with libpcap handles.
@@ -139,7 +138,6 @@
pcap_t* m_pcap;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_PCAP_HELPER_HPP
diff --git a/daemon/face/protocol-factory.cpp b/daemon/face/protocol-factory.cpp
index 5acb18f..1d70fda 100644
--- a/daemon/face/protocol-factory.cpp
+++ b/daemon/face/protocol-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
ProtocolFactory::Registry&
ProtocolFactory::getRegistry()
@@ -129,5 +128,4 @@
return {};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index fcc0418..4d02d15 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Parameters to ProtocolFactory constructor
*
@@ -248,8 +247,7 @@
shared_ptr<ndn::net::NetworkMonitor> netmon;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
/** \brief Registers a protocol factory
*
diff --git a/daemon/face/socket-utils.cpp b/daemon/face/socket-utils.cpp
index 5b38e40..8e3c5f1 100644
--- a/daemon/face/socket-utils.cpp
+++ b/daemon/face/socket-utils.cpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <sys/socket.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
ssize_t
getTxQueueLength(int fd)
@@ -53,5 +52,4 @@
return queueLength;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/socket-utils.hpp b/daemon/face/socket-utils.hpp
index 3929d8a..9efb389 100644
--- a/daemon/face/socket-utils.hpp
+++ b/daemon/face/socket-utils.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief obtain send queue length from a specified system socket
* \param fd file descriptor of the socket
@@ -42,7 +41,6 @@
ssize_t
getTxQueueLength(int fd);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_SOCKET_UTILS_HPP
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index c4ae849..ec33b26 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -32,8 +32,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Implements Transport for stream-based protocols.
*
@@ -333,7 +332,6 @@
return m_sendQueueBytes;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 2dd454d..be029d0 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -29,8 +29,7 @@
#include "tcp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(TcpChannel);
@@ -228,5 +227,4 @@
onConnectFailed(504, "Connection timed out");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index 19c714c..7193851 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace tcp {
+namespace nfd::tcp {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace tcp
+} // namespace nfd::tcp
-namespace face {
+namespace nfd::face {
using DetermineFaceScopeFromAddress = std::function<ndn::nfd::FaceScope(const boost::asio::ip::address& local,
const boost::asio::ip::address& remote)>;
@@ -133,7 +131,6 @@
DetermineFaceScopeFromAddress m_determineFaceScope;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 89e34d5..8ff04cc 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "tcp-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -223,5 +222,4 @@
return ndn::nfd::FACE_SCOPE_NON_LOCAL;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 212acbb..87ffae8 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "tcp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for TCP over IPv4 and IPv6
*/
@@ -83,7 +82,6 @@
IpAddressPredicate m_local;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp
index 466e2c6..0332c2f 100644
--- a/daemon/face/tcp-transport.cpp
+++ b/daemon/face/tcp-transport.cpp
@@ -31,8 +31,7 @@
#include <sys/ioctl.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>, TcpTransport);
@@ -192,5 +191,4 @@
StreamTransport::doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index 950d850..595e574 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -28,8 +28,7 @@
#include "stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>);
@@ -99,7 +98,6 @@
time::milliseconds m_nextReconnectWait;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index 467843e..44babbb 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "transport.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(Transport);
@@ -235,5 +234,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/transport.hpp b/daemon/face/transport.hpp
index 2725596..ed91cbc 100644
--- a/daemon/face/transport.hpp
+++ b/daemon/face/transport.hpp
@@ -29,8 +29,7 @@
#include "face-common.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Indicates the state of a transport.
*/
@@ -481,7 +480,6 @@
return os << FaceLogHelper<Transport>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TRANSPORT_HPP
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index 8804f06..4e91045 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -29,8 +29,7 @@
#include "unicast-udp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UdpChannel);
@@ -197,5 +196,4 @@
return {true, face};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index 25e735a..f4f53da 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing UDP-based channel to create faces
@@ -117,7 +116,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 9f43ad1..4feec76 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -31,8 +31,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
namespace net = ndn::net;
@@ -477,5 +476,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-factory.hpp b/daemon/face/udp-factory.hpp
index 28dbfaa..475621d 100644
--- a/daemon/face/udp-factory.hpp
+++ b/daemon/face/udp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "udp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for UDP over IPv4 and IPv6
*/
@@ -145,7 +144,6 @@
std::map<int, NetifConns> m_netifConns; // ifindex => signal connections
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_FACTORY_HPP
diff --git a/daemon/face/udp-protocol.cpp b/daemon/face/udp-protocol.cpp
index 0d842bc..bfddd43 100644
--- a/daemon/face/udp-protocol.cpp
+++ b/daemon/face/udp-protocol.cpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "udp-protocol.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
ssize_t
computeMtu(const Endpoint& localEndpoint)
@@ -43,5 +42,4 @@
return mtu;
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
diff --git a/daemon/face/udp-protocol.hpp b/daemon/face/udp-protocol.hpp
index 85a6a5f..ebd3dad 100644
--- a/daemon/face/udp-protocol.hpp
+++ b/daemon/face/udp-protocol.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
typedef boost::asio::ip::udp::endpoint Endpoint;
@@ -54,7 +53,6 @@
return {boost::asio::ip::address_v6::from_string("FF02::1234"), 56363};
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
#endif // NFD_DAEMON_FACE_UDP_PROTOCOL_HPP
diff --git a/daemon/face/unicast-ethernet-transport.cpp b/daemon/face/unicast-ethernet-transport.cpp
index 853ca55..3da0681 100644
--- a/daemon/face/unicast-ethernet-transport.cpp
+++ b/daemon/face/unicast-ethernet-transport.cpp
@@ -28,8 +28,7 @@
#include <cstdio> // for snprintf()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnicastEthernetTransport);
@@ -100,5 +99,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-ethernet-transport.hpp b/daemon/face/unicast-ethernet-transport.hpp
index 49c9d48..8078d44 100644
--- a/daemon/face/unicast-ethernet-transport.hpp
+++ b/daemon/face/unicast-ethernet-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A unicast Transport that uses raw Ethernet II frames
@@ -61,7 +60,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/unicast-udp-transport.cpp b/daemon/face/unicast-udp-transport.cpp
index 140f691..e0a0526 100644
--- a/daemon/face/unicast-udp-transport.cpp
+++ b/daemon/face/unicast-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,8 +34,7 @@
#include <sys/socket.h> // for setsockopt()
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>), UnicastUdpTransport);
@@ -115,5 +114,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-udp-transport.hpp b/daemon/face/unicast-udp-transport.hpp
index 991d561..7c96fef 100644
--- a/daemon/face/unicast-udp-transport.hpp
+++ b/daemon/face/unicast-udp-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "datagram-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>));
@@ -59,7 +58,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index 7fb828b..2526d45 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -32,8 +32,7 @@
#include <boost/filesystem.hpp>
#include <sys/stat.h> // for chmod()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamChannel);
@@ -148,5 +147,4 @@
accept(onFaceCreated, onAcceptFailed);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
index c65f784..0c2eb2e 100644
--- a/daemon/face/unix-stream-channel.hpp
+++ b/daemon/face/unix-stream-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace unix_stream {
+namespace nfd::unix_stream {
using Endpoint = boost::asio::local::stream_protocol::endpoint;
-} // namespace unix_stream
+} // namespace nfd::unix_stream
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing a local channel to create faces
@@ -114,7 +112,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index f024dc6..a275fde 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamFactory);
NFD_REGISTER_PROTOCOL_FACTORY(UnixStreamFactory);
@@ -109,5 +108,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
index 45be220..96ea3b1 100644
--- a/daemon/face/unix-stream-factory.hpp
+++ b/daemon/face/unix-stream-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "unix-stream-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for stream-oriented Unix sockets
*/
@@ -70,7 +69,6 @@
std::map<unix_stream::Endpoint, shared_ptr<UnixStreamChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
diff --git a/daemon/face/unix-stream-transport.cpp b/daemon/face/unix-stream-transport.cpp
index a051ca9..76652f3 100644
--- a/daemon/face/unix-stream-transport.cpp
+++ b/daemon/face/unix-stream-transport.cpp
@@ -25,8 +25,7 @@
#include "unix-stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>, UnixStreamTransport);
@@ -48,5 +47,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index 1993143..8ad8a46 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#error "Cannot include this file when UNIX sockets are not available"
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>);
@@ -47,7 +46,6 @@
UnixStreamTransport(protocol::socket&& socket);
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 2ee41cd..acc029e 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -29,8 +29,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketChannel);
@@ -162,5 +161,4 @@
NFD_LOG_CHAN_DEBUG("Started listening");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 52bf20f..d40bc70 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -29,13 +29,11 @@
#include "channel.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-
-namespace websocket {
+namespace nfd::websocket {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace websocket
+} // namespace nfd::websocket
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing WebSocket-based channel to create faces
@@ -111,7 +109,6 @@
time::milliseconds m_pingInterval;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 49e5740..069f137 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "websocket-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -132,5 +131,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
index 721a1eb..1da0f98 100644
--- a/daemon/face/websocket-factory.hpp
+++ b/daemon/face/websocket-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "websocket-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for WebSocket
*/
@@ -71,7 +70,6 @@
std::map<websocket::Endpoint, shared_ptr<WebSocketChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index 2d118ec..df7b36b 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -26,8 +26,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketTransport);
@@ -174,5 +173,4 @@
this->setState(TransportState::CLOSED);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-transport.hpp b/daemon/face/websocket-transport.hpp
index b71206a..4148872 100644
--- a/daemon/face/websocket-transport.hpp
+++ b/daemon/face/websocket-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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "transport.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by WebSocketTransport
* \note The type name 'WebSocketTransportCounters' is implementation detail.
@@ -107,7 +106,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_TRANSPORT_HPP
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
index 4815ed1..539d320 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,13 +41,11 @@
#include "websocketpp/config/asio_no_tls.hpp"
#include "websocketpp/server.hpp"
-namespace nfd {
-namespace websocket {
+namespace nfd::websocket {
-typedef websocketpp::client<websocketpp::config::asio_client> Client;
-typedef websocketpp::server<websocketpp::config::asio> Server;
+using Client = websocketpp::client<websocketpp::config::asio_client>;
+using Server = websocketpp::server<websocketpp::config::asio>;
-} // namespace websocket
-} // namespace nfd
+} // namespace nfd::websocket
#endif // NFD_DAEMON_FACE_WEBSOCKETPP_HPP