tools: merge nfd-status into nfdc
nfd-status functionality is accessible through `nfdc legacy-nfd-status` subcommand,
and nfd-status is replaced with a shell script calling this subcommand.
refs #3749
Change-Id: Iab03f3bc9ddb4333a0b6ca5fb9c67f54e9960ab4
diff --git a/tests/tools/nfd-status/channel-module.t.cpp b/tests/tools/nfdc/channel-module.t.cpp
similarity index 93%
rename from tests/tools/nfd-status/channel-module.t.cpp
rename to tests/tools/nfdc/channel-module.t.cpp
index f524907..8624cd3 100644
--- a/tests/tools/nfd-status/channel-module.t.cpp
+++ b/tests/tools/nfdc/channel-module.t.cpp
@@ -23,16 +23,16 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/channel-module.hpp"
+#include "nfdc/channel-module.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestChannelModule, ModuleFixture<ChannelModule>)
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -67,9 +67,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestChannelModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/face-module.t.cpp b/tests/tools/nfdc/face-module.t.cpp
similarity index 96%
rename from tests/tools/nfd-status/face-module.t.cpp
rename to tests/tools/nfdc/face-module.t.cpp
index 292ccd8..6d316e6 100644
--- a/tests/tools/nfd-status/face-module.t.cpp
+++ b/tests/tools/nfdc/face-module.t.cpp
@@ -23,16 +23,16 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/face-module.hpp"
+#include "nfdc/face-module.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestFaceModule, ModuleFixture<FaceModule>)
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -138,9 +138,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestFaceModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/fib-module.t.cpp b/tests/tools/nfdc/fib-module.t.cpp
similarity index 95%
rename from tests/tools/nfd-status/fib-module.t.cpp
rename to tests/tools/nfdc/fib-module.t.cpp
index f509461..3ec3775 100644
--- a/tests/tools/nfd-status/fib-module.t.cpp
+++ b/tests/tools/nfdc/fib-module.t.cpp
@@ -23,16 +23,16 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/fib-module.hpp"
+#include "nfdc/fib-module.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestFibModule, ModuleFixture<FibModule>)
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -96,9 +96,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestFibModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/format-helpers.t.cpp b/tests/tools/nfdc/format-helpers.t.cpp
similarity index 92%
rename from tests/tools/nfd-status/format-helpers.t.cpp
rename to tests/tools/nfdc/format-helpers.t.cpp
index 01d7f47..f380544 100644
--- a/tests/tools/nfd-status/format-helpers.t.cpp
+++ b/tests/tools/nfdc/format-helpers.t.cpp
@@ -23,18 +23,18 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/format-helpers.hpp"
+#include "nfdc/format-helpers.hpp"
#include "tests/test-common.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
using boost::test_tools::output_test_stream;
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_AUTO_TEST_SUITE(TestFormatHelpers)
BOOST_AUTO_TEST_SUITE(Xml)
@@ -66,9 +66,9 @@
BOOST_AUTO_TEST_SUITE_END() // Text
BOOST_AUTO_TEST_SUITE_END() // TestFormatHelpers
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/forwarder-general-module.t.cpp b/tests/tools/nfdc/forwarder-general-module.t.cpp
similarity index 96%
rename from tests/tools/nfd-status/forwarder-general-module.t.cpp
rename to tests/tools/nfdc/forwarder-general-module.t.cpp
index e9c881b..d210dc7 100644
--- a/tests/tools/nfd-status/forwarder-general-module.t.cpp
+++ b/tests/tools/nfdc/forwarder-general-module.t.cpp
@@ -23,17 +23,17 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/forwarder-general-module.hpp"
+#include "nfdc/forwarder-general-module.hpp"
#include <ndn-cxx/security/signing-helpers.hpp>
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestForwarderGeneralModule, ModuleFixture<ForwarderGeneralModule>)
class MakeNfdIdCollector
@@ -148,9 +148,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestForwarderGeneralModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/module-fixture.hpp b/tests/tools/nfdc/module-fixture.hpp
similarity index 98%
rename from tests/tools/nfd-status/module-fixture.hpp
rename to tests/tools/nfdc/module-fixture.hpp
index 38d0d64..61f2295 100644
--- a/tests/tools/nfd-status/module-fixture.hpp
+++ b/tests/tools/nfdc/module-fixture.hpp
@@ -26,7 +26,7 @@
#ifndef NFD_TESTS_TOOLS_NFD_STATUS_MODULE_FIXTURE_HPP
#define NFD_TESTS_TOOLS_NFD_STATUS_MODULE_FIXTURE_HPP
-#include "nfd-status/module.hpp"
+#include "nfdc/module.hpp"
#include <ndn-cxx/security/validator-null.hpp>
#include <ndn-cxx/util/dummy-client-face.hpp>
@@ -35,7 +35,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
using namespace nfd::tests;
@@ -229,7 +229,7 @@
}
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/rib-module.t.cpp b/tests/tools/nfdc/rib-module.t.cpp
similarity index 96%
rename from tests/tools/nfd-status/rib-module.t.cpp
rename to tests/tools/nfdc/rib-module.t.cpp
index bfd663c..6088382 100644
--- a/tests/tools/nfd-status/rib-module.t.cpp
+++ b/tests/tools/nfdc/rib-module.t.cpp
@@ -23,16 +23,16 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/rib-module.hpp"
+#include "nfdc/rib-module.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestRibModule, ModuleFixture<RibModule>)
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -133,9 +133,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestRibModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
similarity index 96%
rename from tests/tools/nfd-status/status-report.t.cpp
rename to tests/tools/nfdc/status-report.t.cpp
index 309c83a..2d89868 100644
--- a/tests/tools/nfd-status/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/status-report.hpp"
+#include "nfdc/status-report.hpp"
#include "core/scheduler.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -165,7 +165,7 @@
};
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestStatusReport, StatusReportModulesFixture)
BOOST_AUTO_TEST_CASE(Normal)
@@ -212,9 +212,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestRibModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tests/tools/nfd-status/strategy-choice-module.t.cpp b/tests/tools/nfdc/strategy-choice-module.t.cpp
similarity index 93%
rename from tests/tools/nfd-status/strategy-choice-module.t.cpp
rename to tests/tools/nfdc/strategy-choice-module.t.cpp
index a41ba1f..68dee9f 100644
--- a/tests/tools/nfd-status/strategy-choice-module.t.cpp
+++ b/tests/tools/nfdc/strategy-choice-module.t.cpp
@@ -23,16 +23,16 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nfd-status/strategy-choice-module.hpp"
+#include "nfdc/strategy-choice-module.hpp"
#include "module-fixture.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace tests {
-BOOST_AUTO_TEST_SUITE(NfdStatus)
+BOOST_AUTO_TEST_SUITE(Nfdc)
BOOST_FIXTURE_TEST_SUITE(TestStrategyChoiceModule, ModuleFixture<StrategyChoiceModule>)
const std::string STATUS_XML = stripXmlSpaces(R"XML(
@@ -75,9 +75,9 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestStrategyChoiceModule
-BOOST_AUTO_TEST_SUITE_END() // NfdStatus
+BOOST_AUTO_TEST_SUITE_END() // Nfdc
} // namespace tests
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status.sh b/tools/nfd-status.sh
new file mode 100755
index 0000000..a63f5ca
--- /dev/null
+++ b/tools/nfd-status.sh
@@ -0,0 +1,2 @@
+#!@BASH@
+$(dirname "$0")/nfdc legacy-nfd-status "$@"
diff --git a/tools/nfd-status/channel-module.cpp b/tools/nfdc/channel-module.cpp
similarity index 97%
rename from tools/nfd-status/channel-module.cpp
rename to tools/nfdc/channel-module.cpp
index 4cd5484..af55d7b 100644
--- a/tools/nfd-status/channel-module.cpp
+++ b/tools/nfdc/channel-module.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
void
ChannelModule::fetchStatus(Controller& controller,
@@ -78,6 +78,6 @@
os << "\n";
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/channel-module.hpp b/tools/nfdc/channel-module.hpp
similarity index 92%
rename from tools/nfd-status/channel-module.hpp
rename to tools/nfdc/channel-module.hpp
index 1230554..e3486a1 100644
--- a/tools/nfd-status/channel-module.hpp
+++ b/tools/nfdc/channel-module.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_CHANNEL_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_CHANNEL_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_CHANNEL_MODULE_HPP
+#define NFD_TOOLS_NFDC_CHANNEL_MODULE_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::ChannelStatus;
@@ -70,8 +70,8 @@
std::vector<ChannelStatus> m_status;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_CHANNEL_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_CHANNEL_MODULE_HPP
diff --git a/tools/nfd-status/face-module.cpp b/tools/nfdc/face-module.cpp
similarity index 98%
rename from tools/nfd-status/face-module.cpp
rename to tools/nfdc/face-module.cpp
index 3ec0467..9c5e74c 100644
--- a/tools/nfd-status/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -48,7 +48,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
void
FaceModule::fetchStatus(Controller& controller,
@@ -149,6 +149,6 @@
os << "\n";
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/face-module.hpp b/tools/nfdc/face-module.hpp
similarity index 92%
rename from tools/nfd-status/face-module.hpp
rename to tools/nfdc/face-module.hpp
index 58bb5ee..3f8020f 100644
--- a/tools/nfd-status/face-module.hpp
+++ b/tools/nfdc/face-module.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_FACE_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_FACE_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_FACE_MODULE_HPP
+#define NFD_TOOLS_NFDC_FACE_MODULE_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::FaceStatus;
@@ -70,8 +70,8 @@
std::vector<FaceStatus> m_status;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_FACE_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_FACE_MODULE_HPP
diff --git a/tools/nfd-status/fib-module.cpp b/tools/nfdc/fib-module.cpp
similarity index 98%
rename from tools/nfd-status/fib-module.cpp
rename to tools/nfdc/fib-module.cpp
index a1c7f94..27d3922 100644
--- a/tools/nfd-status/fib-module.cpp
+++ b/tools/nfdc/fib-module.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
void
FibModule::fetchStatus(Controller& controller,
@@ -98,6 +98,6 @@
os << "\n";
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/fib-module.hpp b/tools/nfdc/fib-module.hpp
similarity index 92%
rename from tools/nfd-status/fib-module.hpp
rename to tools/nfdc/fib-module.hpp
index 353e594..2472bd5 100644
--- a/tools/nfd-status/fib-module.hpp
+++ b/tools/nfdc/fib-module.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_FIB_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_FIB_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_FIB_MODULE_HPP
+#define NFD_TOOLS_NFDC_FIB_MODULE_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::FibEntry;
using ndn::nfd::NextHopRecord;
@@ -71,8 +71,8 @@
std::vector<FibEntry> m_status;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_FIB_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_FIB_MODULE_HPP
diff --git a/tools/nfd-status/format-helpers.cpp b/tools/nfdc/format-helpers.cpp
similarity index 98%
rename from tools/nfd-status/format-helpers.cpp
rename to tools/nfdc/format-helpers.cpp
index c7e595b..3496104 100644
--- a/tools/nfd-status/format-helpers.cpp
+++ b/tools/nfdc/format-helpers.cpp
@@ -27,7 +27,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace xml {
@@ -123,6 +123,6 @@
} // namespace text
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/format-helpers.hpp b/tools/nfdc/format-helpers.hpp
similarity index 93%
rename from tools/nfd-status/format-helpers.hpp
rename to tools/nfdc/format-helpers.hpp
index f98d8f1..84efe7b 100644
--- a/tools/nfd-status/format-helpers.hpp
+++ b/tools/nfdc/format-helpers.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_FORMAT_HELPERS_HPP
-#define NFD_TOOLS_NFD_STATUS_FORMAT_HELPERS_HPP
+#ifndef NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP
+#define NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP
#include "core/common.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
namespace xml {
@@ -111,8 +111,8 @@
} // namespace text
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_FORMAT_HELPERS_HPP
+#endif // NFD_TOOLS_NFDC_FORMAT_HELPERS_HPP
diff --git a/tools/nfd-status/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
similarity index 98%
rename from tools/nfd-status/forwarder-general-module.cpp
rename to tools/nfdc/forwarder-general-module.cpp
index 41b715a..481fd40 100644
--- a/tools/nfd-status/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
ForwarderGeneralModule::ForwarderGeneralModule()
: m_nfdIdCollector(nullptr)
@@ -185,6 +185,6 @@
m_inner->validate(data, accepted, reject);
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/forwarder-general-module.hpp b/tools/nfdc/forwarder-general-module.hpp
similarity index 94%
rename from tools/nfd-status/forwarder-general-module.hpp
rename to tools/nfdc/forwarder-general-module.hpp
index a55bc21..9bcf929 100644
--- a/tools/nfd-status/forwarder-general-module.hpp
+++ b/tools/nfdc/forwarder-general-module.hpp
@@ -23,15 +23,15 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_FORWARDER_GENERAL_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_FORWARDER_GENERAL_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_FORWARDER_GENERAL_MODULE_HPP
+#define NFD_TOOLS_NFDC_FORWARDER_GENERAL_MODULE_HPP
#include "module.hpp"
#include <ndn-cxx/security/validator.hpp>
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::ForwarderStatus;
@@ -133,8 +133,8 @@
Name m_nfdId;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_FORWARDER_GENERAL_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_FORWARDER_GENERAL_MODULE_HPP
diff --git a/tools/nfdc/main.cpp b/tools/nfdc/main.cpp
index 7d9f763..aa5d7db 100644
--- a/tools/nfdc/main.cpp
+++ b/tools/nfdc/main.cpp
@@ -24,6 +24,7 @@
*/
#include "legacy-nfdc.hpp"
+#include "status-main.hpp"
#include "core/version.hpp"
#include <boost/lexical_cast.hpp>
@@ -83,16 +84,20 @@
return 0;
}
- if (!strcmp(argv[1], "-h")) {
+ if (strcmp(argv[1], "-h") == 0) {
usage(p.m_programName);
return 0;
}
- if (!strcmp(argv[1], "-V")) {
+ if (strcmp(argv[1], "-V") == 0) {
std::cout << NFD_VERSION_BUILD_STRING << std::endl;
return 0;
}
+ if (strcmp(argv[1], "legacy-nfd-status") == 0) {
+ return status_main(argc - 1, argv + 1);
+ }
+
::optind = 2; //start reading options from 2nd argument i.e. Command
int opt;
while ((opt = ::getopt(argc, argv, "ICc:e:o:P")) != -1) {
diff --git a/tools/nfd-status/module.hpp b/tools/nfdc/module.hpp
similarity index 93%
rename from tools/nfd-status/module.hpp
rename to tools/nfdc/module.hpp
index bf1b90c..f33afac 100644
--- a/tools/nfd-status/module.hpp
+++ b/tools/nfdc/module.hpp
@@ -23,15 +23,15 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_MODULE_HPP
+#define NFD_TOOLS_NFDC_MODULE_HPP
#include "core/common.hpp"
#include <ndn-cxx/management/nfd-controller.hpp>
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::Controller;
using ndn::nfd::CommandOptions;
@@ -73,8 +73,8 @@
formatStatusText(std::ostream& os) const = 0;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_MODULE_HPP
diff --git a/tools/nfd-status/rib-module.cpp b/tools/nfdc/rib-module.cpp
similarity index 98%
rename from tools/nfd-status/rib-module.cpp
rename to tools/nfdc/rib-module.cpp
index fe254cc..bf2da3d 100644
--- a/tools/nfd-status/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
void
RibModule::fetchStatus(Controller& controller,
@@ -128,6 +128,6 @@
os << "\n";
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/rib-module.hpp b/tools/nfdc/rib-module.hpp
similarity index 92%
rename from tools/nfd-status/rib-module.hpp
rename to tools/nfdc/rib-module.hpp
index 6a4ddd1..20e2144 100644
--- a/tools/nfd-status/rib-module.hpp
+++ b/tools/nfdc/rib-module.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_RIB_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_RIB_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_RIB_MODULE_HPP
+#define NFD_TOOLS_NFDC_RIB_MODULE_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::RibEntry;
using ndn::nfd::Route;
@@ -71,8 +71,8 @@
std::vector<RibEntry> m_status;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_RIB_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_RIB_MODULE_HPP
diff --git a/tools/nfd-status/main.cpp b/tools/nfdc/status-main.cpp
similarity index 96%
rename from tools/nfd-status/main.cpp
rename to tools/nfdc/status-main.cpp
index b43e4cc..c0d41b0 100644
--- a/tools/nfd-status/main.cpp
+++ b/tools/nfdc/status-main.cpp
@@ -40,7 +40,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
enum class OutputFormat
{
@@ -121,8 +121,8 @@
return std::make_tuple(-1, options);
}
-static int
-main(int argc, char** argv)
+int
+status_main(int argc, char** argv)
{
int exitCode = -1;
Options options;
@@ -188,12 +188,6 @@
return 0;
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-
-int
-main(int argc, char** argv)
-{
- return nfd::tools::nfd_status::main(argc, argv);
-}
diff --git a/tools/nfdc/status-main.hpp b/tools/nfdc/status-main.hpp
new file mode 100644
index 0000000..79ccece
--- /dev/null
+++ b/tools/nfdc/status-main.hpp
@@ -0,0 +1,42 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2016, Regents of the University of California,
+ * Arizona Board of Regents,
+ * Colorado State University,
+ * University Pierre & Marie Curie, Sorbonne University,
+ * Washington University in St. Louis,
+ * Beijing Institute of Technology,
+ * The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TOOLS_NFDC_STATUS_MAIN_HPP
+#define NFD_TOOLS_NFDC_STATUS_MAIN_HPP
+
+#include "module.hpp"
+
+namespace nfd {
+namespace tools {
+namespace nfdc {
+
+int
+status_main(int argc, char** argv);
+
+} // namespace nfdc
+} // namespace tools
+} // namespace nfd
+
+#endif // NFD_TOOLS_NFDC_STATUS_MAIN_HPP
diff --git a/tools/nfd-status/status-report.cpp b/tools/nfdc/status-report.cpp
similarity index 97%
rename from tools/nfd-status/status-report.cpp
rename to tools/nfdc/status-report.cpp
index ff04e1f..c687147 100644
--- a/tools/nfd-status/status-report.cpp
+++ b/tools/nfdc/status-report.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
uint32_t
StatusReport::collect(Face& face, KeyChain& keyChain, Validator& validator, const CommandOptions& options)
@@ -75,6 +75,6 @@
}
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/status-report.hpp b/tools/nfdc/status-report.hpp
similarity index 92%
rename from tools/nfd-status/status-report.hpp
rename to tools/nfdc/status-report.hpp
index 80aaee7..dea9b9f 100644
--- a/tools/nfd-status/status-report.hpp
+++ b/tools/nfdc/status-report.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_STATUS_REPORT_HPP
-#define NFD_TOOLS_NFD_STATUS_STATUS_REPORT_HPP
+#ifndef NFD_TOOLS_NFDC_STATUS_REPORT_HPP
+#define NFD_TOOLS_NFDC_STATUS_REPORT_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::Face;
using ndn::security::KeyChain;
@@ -78,8 +78,8 @@
std::vector<unique_ptr<Module>> sections;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_STATUS_REPORT_HPP
+#endif // NFD_TOOLS_NFDC_STATUS_REPORT_HPP
diff --git a/tools/nfd-status/strategy-choice-module.cpp b/tools/nfdc/strategy-choice-module.cpp
similarity index 97%
rename from tools/nfd-status/strategy-choice-module.cpp
rename to tools/nfdc/strategy-choice-module.cpp
index efdff50..c32b5aa 100644
--- a/tools/nfd-status/strategy-choice-module.cpp
+++ b/tools/nfdc/strategy-choice-module.cpp
@@ -28,7 +28,7 @@
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
void
StrategyChoiceModule::fetchStatus(Controller& controller,
@@ -80,6 +80,6 @@
<< "\n";
}
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
diff --git a/tools/nfd-status/strategy-choice-module.hpp b/tools/nfdc/strategy-choice-module.hpp
similarity index 91%
rename from tools/nfd-status/strategy-choice-module.hpp
rename to tools/nfdc/strategy-choice-module.hpp
index be84374..9c78eb7 100644
--- a/tools/nfd-status/strategy-choice-module.hpp
+++ b/tools/nfdc/strategy-choice-module.hpp
@@ -23,14 +23,14 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_TOOLS_NFD_STATUS_STARTEGY_CHOICE_MODULE_HPP
-#define NFD_TOOLS_NFD_STATUS_STARTEGY_CHOICE_MODULE_HPP
+#ifndef NFD_TOOLS_NFDC_STARTEGY_CHOICE_MODULE_HPP
+#define NFD_TOOLS_NFDC_STARTEGY_CHOICE_MODULE_HPP
#include "module.hpp"
namespace nfd {
namespace tools {
-namespace nfd_status {
+namespace nfdc {
using ndn::nfd::StrategyChoice;
@@ -70,8 +70,8 @@
std::vector<StrategyChoice> m_status;
};
-} // namespace nfd_status
+} // namespace nfdc
} // namespace tools
} // namespace nfd
-#endif // NFD_TOOLS_NFD_STATUS_STARTEGY_CHOICE_MODULE_HPP
+#endif // NFD_TOOLS_NFDC_STARTEGY_CHOICE_MODULE_HPP