core: slim down `common.hpp`
Change-Id: I875c35147edd2261fbaa24e809c170d5cd9b94d3
diff --git a/daemon/mgmt/command-authenticator.cpp b/daemon/mgmt/command-authenticator.cpp
index 17651e9..9d327a0 100644
--- a/daemon/mgmt/command-authenticator.cpp
+++ b/daemon/mgmt/command-authenticator.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -86,7 +86,7 @@
// SignerTag must be placed on the 'original Interest' in ValidationState to be available for
// InterestValidationSuccessCallback. The 'interest' parameter refers to a different instance
// which is copied into 'original Interest'.
- auto state1 = dynamic_pointer_cast<security::InterestValidationState>(state);
+ auto state1 = std::dynamic_pointer_cast<security::InterestValidationState>(state);
state1->getOriginalInterest().setTag(make_shared<SignerTag>(klName));
continueValidation(make_shared<security::CertificateRequest>(klName), state);
@@ -146,7 +146,7 @@
}
catch (const boost::property_tree::ptree_error&) {
NDN_THROW(ConfigFile::Error("'certfile' is missing under authorize[" +
- to_string(authSectionIndex) + "]"));
+ std::to_string(authSectionIndex) + "]"));
}
bool isAny = false;
@@ -162,7 +162,7 @@
cert = ndn::io::load<security::Certificate>(certfilePath.string());
if (cert == nullptr) {
NDN_THROW(ConfigFile::Error("cannot load certfile " + certfilePath.string() +
- " for authorize[" + to_string(authSectionIndex) + "]"));
+ " for authorize[" + std::to_string(authSectionIndex) + "]"));
}
}
@@ -172,7 +172,7 @@
}
catch (const boost::property_tree::ptree_error&) {
NDN_THROW(ConfigFile::Error("'privileges' is missing under authorize[" +
- to_string(authSectionIndex) + "]"));
+ std::to_string(authSectionIndex) + "]"));
}
if (privSection->empty()) {
@@ -183,7 +183,7 @@
auto found = m_validators.find(module);
if (found == m_validators.end()) {
NDN_THROW(ConfigFile::Error("unknown module '" + module +
- "' under authorize[" + to_string(authSectionIndex) + "]"));
+ "' under authorize[" + std::to_string(authSectionIndex) + "]"));
}
if (isDryRun) {
diff --git a/daemon/mgmt/cs-manager.cpp b/daemon/mgmt/cs-manager.cpp
index a88b40c..e203b45 100644
--- a/daemon/mgmt/cs-manager.cpp
+++ b/daemon/mgmt/cs-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,6 +29,8 @@
#include <ndn-cxx/mgmt/nfd/cs-info.hpp>
+#include <limits>
+
namespace nfd {
CsManager::CsManager(Cs& cs, const ForwarderCounters& fwCounters,
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index b7109fa..24bfd7f 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -36,6 +36,8 @@
#include <ndn-cxx/mgmt/nfd/face-query-filter.hpp>
#include <ndn-cxx/mgmt/nfd/face-status.hpp>
+#include <limits>
+
namespace nfd {
NFD_LOG_INIT(FaceManager);
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index db2e5aa..8e72b9a 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-2021, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,6 +30,8 @@
#include "face/face.hpp"
#include "face/face-system.hpp"
+#include <map>
+
namespace nfd {
/**
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 24b044b..9bbd545 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -65,7 +65,7 @@
NFD_LOG_DEBUG("fib/add-nexthop(" << prefix << ',' << faceId << ',' << cost <<
"): FAIL prefix-too-long");
return done(ControlResponse(414, "FIB entry prefix cannot exceed " +
- to_string(Fib::getMaxDepth()) + " components"));
+ std::to_string(Fib::getMaxDepth()) + " components"));
}
Face* face = m_faceTable.get(faceId);
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index d9b351a..a664c9e 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-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,6 +33,8 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
#include <ndn-cxx/mgmt/nfd/control-response.hpp>
+#include <functional>
+
namespace nfd {
using ndn::mgmt::Dispatcher;
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 7149680..b3d515c 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -119,7 +119,7 @@
NFD_LOG_DEBUG("Local fields enabled");
},
[] (const ControlResponse& res) {
- NDN_THROW(Error("Couldn't enable local fields (" + to_string(res.getCode()) +
+ NDN_THROW(Error("Couldn't enable local fields (" + std::to_string(res.getCode()) +
" " + res.getText() + ")"));
});
}
@@ -209,7 +209,7 @@
},
[=] (const ControlResponse& res) {
NDN_THROW(Error("Cannot add FIB entry " + topPrefix.toUri() + " (" +
- to_string(res.getCode()) + " " + res.getText() + ")"));
+ std::to_string(res.getCode()) + " " + res.getText() + ")"));
});
// add top prefix to the dispatcher without prefix registration
@@ -221,7 +221,7 @@
const ndn::mgmt::CommandContinuation& done)
{
if (parameters.getName().size() > Fib::getMaxDepth()) {
- done(ControlResponse(414, "Route prefix cannot exceed " + to_string(Fib::getMaxDepth()) +
+ done(ControlResponse(414, "Route prefix cannot exceed " + std::to_string(Fib::getMaxDepth()) +
" components"));
return;
}
diff --git a/daemon/mgmt/rib-manager.hpp b/daemon/mgmt/rib-manager.hpp
index 8589b0b..114a7c4 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-2023, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -252,7 +252,7 @@
ndn::ValidatorConfig m_paValidator;
bool m_isLocalhopEnabled;
- scheduler::ScopedEventId m_activeFaceFetchEvent;
+ ndn::scheduler::ScopedEventId m_activeFaceFetchEvent;
};
std::ostream&
diff --git a/daemon/mgmt/tables-config-section.cpp b/daemon/mgmt/tables-config-section.cpp
index f693a73..e98282c 100644
--- a/daemon/mgmt/tables-config-section.cpp
+++ b/daemon/mgmt/tables-config-section.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,6 +26,8 @@
#include "tables-config-section.hpp"
#include "fw/strategy.hpp"
+#include <map>
+
namespace nfd {
constexpr size_t DEFAULT_CS_MAX_PACKETS = 65536;