Rename ndnputchunks to ndnserve
Change-Id: Id1cc90c91ec0778ec07495b364546b05464410c8
diff --git a/Dockerfile b/Dockerfile
index 3644452..a6ce73e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,7 +23,7 @@
mkdir -p /deps/debian
touch /deps/debian/control
cd /deps
- for binary in ndnget ndnputchunks ndnpeek ndnpoke ndnping ndnpingserver ndndump ndn-dissect; do
+ for binary in ndn-dissect ndndump ndnget ndnpeek ndnpoke ndnping ndnpingserver ndnserve; do
dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
done
@@ -32,14 +32,14 @@
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndn-tools
+COPY --link --from=build /usr/bin/ndn-dissect /usr/bin/
+COPY --link --from=build /usr/bin/ndndump /usr/bin/
COPY --link --from=build /usr/bin/ndnget /usr/bin/
-COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/
COPY --link --from=build /usr/bin/ndnpeek /usr/bin/
COPY --link --from=build /usr/bin/ndnpoke /usr/bin/
COPY --link --from=build /usr/bin/ndnping /usr/bin/
COPY --link --from=build /usr/bin/ndnpingserver /usr/bin/
-COPY --link --from=build /usr/bin/ndndump /usr/bin/
-COPY --link --from=build /usr/bin/ndn-dissect /usr/bin/
+COPY --link --from=build /usr/bin/ndnserve /usr/bin/
RUN --mount=from=build,source=/deps,target=/deps \
apt-get install -Uy --no-install-recommends \
diff --git a/README.md b/README.md
index ae8c62a..db379af 100644
--- a/README.md
+++ b/README.md
@@ -9,12 +9,13 @@
This repository contains a collection of basic tools for [Named Data Networking (NDN)](https://named-data.net/).
The tools currently included are:
-* [**peek**](tools/peek): transmit a single Interest/Data packet between a consumer
- and a producer
-* [**chunks**](tools/chunks): segmented file transfer between a consumer and a producer
-* [**ping**](tools/ping): test reachability between two NDN nodes
-* [**dump**](tools/dump): capture and analyze live traffic on an NDN network
-* [**dissect**](tools/dissect): inspect the TLV structure of an NDN packet
+* [**ndnpeek** and **ndnpoke**](tools/peek): transmit a single Interest/Data packet
+ between a consumer and a producer
+* [**ndnget**](tools/get) and [**ndnserve**](tools/serve): segmented file transfer
+ between a consumer and a producer
+* [**ndnping**](tools/ping): test reachability between two NDN nodes
+* [**ndndump**](tools/dump): capture and analyze live traffic on an NDN network
+* [**ndn-dissect**](tools/dissect): inspect the TLV structure of an NDN packet
* [**dissect-wireshark**](tools/dissect-wireshark): Wireshark extension to inspect
the TLV structure of NDN packets
diff --git a/manpages/conf.py b/manpages/conf.py
index cd318c1..95c4f8d 100644
--- a/manpages/conf.py
+++ b/manpages/conf.py
@@ -7,7 +7,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'NDN Essential Tools'
-copyright = 'Copyright © 2014-2024 Named Data Networking Project.'
+copyright = 'Copyright © 2014-2025 Named Data Networking Project.'
author = 'Named Data Networking Project'
# The short X.Y version.
@@ -39,11 +39,11 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
+ ('ndn-dissect', 'ndn-dissect', 'NDN packet format inspector', [], 1),
+ ('ndndump', 'ndndump', 'traffic analysis tool', [], 8),
('ndnpeek', 'ndnpeek', 'simple consumer to send one Interest and receive one Data', [], 1),
('ndnpoke', 'ndnpoke', 'simple producer to publish one Data', [], 1),
('ndnping', 'ndnping', 'reachability testing client', [], 1),
('ndnpingserver', 'ndnpingserver', 'reachability testing server', [], 1),
- ('ndnputchunks', 'ndnputchunks', 'producer program with content segmentation', [], 1),
- ('ndndump', 'ndndump', 'traffic analysis tool', [], 8),
- ('ndn-dissect', 'ndn-dissect', 'NDN packet format inspector', [], 1),
+ ('ndnserve', 'ndnserve', 'producer program with content segmentation', [], 1),
]
diff --git a/manpages/ndnputchunks.rst b/manpages/ndnserve.rst
similarity index 87%
rename from manpages/ndnputchunks.rst
rename to manpages/ndnserve.rst
index f002a78..d8c2df5 100644
--- a/manpages/ndnputchunks.rst
+++ b/manpages/ndnserve.rst
@@ -1,15 +1,15 @@
-ndnputchunks
-============
+ndnserve
+========
Synopsis
--------
-**ndnputchunks** [*option*]... *name*
+**ndnserve** [*option*]... *name*
Description
-----------
-:program:`ndnputchunks` is a producer program that reads a file from the standard input
+:program:`ndnserve` is a producer program that reads a file from the standard input
and makes it available as NDN Data segments.
Version and segment number components are appended to the specified *name* as needed,
@@ -77,11 +77,11 @@
The following command will publish the text of the GPL-3 license under the ``/localhost/demo/gpl3``
prefix::
- ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+ ndnserve /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
To see the published version, you can run the program with the **-p** option::
- ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+ ndnserve -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
This command will print the published version to the standard output.
@@ -90,7 +90,7 @@
For example, the following command will publish version 1615519151142 of ``/localhost/demo/gpl3``
using the "typed" naming convention::
- ndnputchunks -Nt /localhost/demo/gpl3/v=1615519151142 < /usr/share/common-licenses/GPL-3
+ ndnserve -Nt /localhost/demo/gpl3/v=1615519151142 < /usr/share/common-licenses/GPL-3
See Also
--------
diff --git a/tests/chunks/producer.t.cpp b/tests/serve/producer.t.cpp
similarity index 95%
rename from tests/chunks/producer.t.cpp
rename to tests/serve/producer.t.cpp
index 34e601b..e6f065e 100644
--- a/tests/chunks/producer.t.cpp
+++ b/tests/serve/producer.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2023, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -23,7 +23,7 @@
* @author Andrea Tosatto
*/
-#include "tools/chunks/putchunks/producer.hpp"
+#include "tools/serve/producer.hpp"
#include "tests/test-common.hpp"
#include "tests/io-fixture.hpp"
@@ -37,9 +37,9 @@
#include <cmath>
#include <sstream>
-namespace ndn::chunks::tests {
+namespace ndn::tests {
-using namespace ndn::tests;
+using namespace ndn::serve;
class ProducerFixture : public IoFixture, public KeyChainFixture
{
@@ -55,7 +55,7 @@
Name prefix = "/ndn/chunks/test";
Producer::Options options;
uint64_t version = 1449227841747;
- Name keyLocatorName = m_keyChain.createIdentity("/putchunks/producer")
+ Name keyLocatorName = m_keyChain.createIdentity("/ndnserve/producer")
.getDefaultKey().getDefaultCertificate().getName();
std::istringstream testString{
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget "
@@ -64,7 +64,7 @@
"sem. Nulla consequat massa Donec pede justo,"s};
};
-BOOST_AUTO_TEST_SUITE(Chunks)
+BOOST_AUTO_TEST_SUITE(Serve)
BOOST_FIXTURE_TEST_SUITE(TestProducer, ProducerFixture)
BOOST_AUTO_TEST_CASE(InputData)
@@ -214,6 +214,6 @@
}
BOOST_AUTO_TEST_SUITE_END() // TestProducer
-BOOST_AUTO_TEST_SUITE_END() // Chunks
+BOOST_AUTO_TEST_SUITE_END() // Serve
-} // namespace ndn::chunks::tests
+} // namespace ndn::tests
diff --git a/tools/chunks/README.md b/tools/chunks/README.md
deleted file mode 100644
index 2c68eed..0000000
--- a/tools/chunks/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# ndnputchunks
-
-**ndnputchunks** is a producer program that reads a file from the standard input, and makes
-it available as a set of NDN Data segments. It appends version and segment number components
-to the specified name as needed, according to the [NDN naming conventions](
-https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
-
-Files published by ndnputchunks can be fetched with [ndnget](../get/README.md).
-
-## Usage examples
-
-The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
-prefix:
-
- ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
-
-To find the published version you have to start ndnputchunks with the `-p` command line option,
-for example:
-
- ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
-
-This command will print the published version to standard output.
-
-To publish Data with a specific version, you need to append a version component to the end of the
-prefix. The version component must follow the aforementioned NDN naming conventions. For example,
-the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
-
- ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
-
-If the specified version component is not valid, ndnputchunks will exit with an error. If no version
-component is specified, one will be generated and appended to the name.
diff --git a/tools/chunks/wscript b/tools/chunks/wscript
deleted file mode 100644
index 31fddd1..0000000
--- a/tools/chunks/wscript
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-top = '../..'
-
-def build(bld):
- bld.objects(
- target='chunks-objects',
- source=bld.path.ant_glob('putchunks/*.cpp', excl='putchunks/main.cpp'),
- use='core-objects')
-
- bld.program(
- target=f'{top}/bin/ndnputchunks',
- name='ndnputchunks',
- source='putchunks/main.cpp',
- use='chunks-objects')
diff --git a/tools/serve/README.md b/tools/serve/README.md
new file mode 100644
index 0000000..acaab8f
--- /dev/null
+++ b/tools/serve/README.md
@@ -0,0 +1,31 @@
+# ndnserve
+
+**ndnserve** is a producer program that reads a file from the standard input, and makes it
+available as a set of NDN Data segments. It appends version and segment number components
+to the specified name as needed, according to the [NDN naming conventions](
+https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
+
+Files published by ndnserve can be fetched with [ndnget](../get/README.md).
+
+## Usage examples
+
+The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
+prefix:
+
+ ndnserve /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+
+To find the published version you have to start ndnserve with the `-p` command line option,
+for example:
+
+ ndnserve -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
+
+This command will print the published version to standard output.
+
+To publish Data with a specific version, you need to append a version component to the end of the
+prefix. The version component must follow the aforementioned NDN naming conventions. For example,
+the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
+
+ ndnserve -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
+
+If the specified version component is not valid, ndnserve will exit with an error. If no version
+component is specified, one will be generated and appended to the name.
diff --git a/tools/chunks/putchunks/main.cpp b/tools/serve/main.cpp
similarity index 95%
rename from tools/chunks/putchunks/main.cpp
rename to tools/serve/main.cpp
index 04bfec8..995d36e 100644
--- a/tools/chunks/putchunks/main.cpp
+++ b/tools/serve/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -36,7 +36,7 @@
#include <iostream>
-namespace ndn::chunks {
+namespace ndn::serve {
namespace po = boost::program_options;
@@ -68,7 +68,7 @@
"maximum chunk size, in bytes")
("naming-convention,N", po::value<std::string>(&nameConv),
"encoding convention to use for name components, either 'marker' or 'typed'")
- ("signing-info,S", po::value<std::string>(&signingStr), "see 'man ndnputchunks' for usage")
+ ("signing-info,S", po::value<std::string>(&signingStr), "see 'man ndnserve' for usage")
("print-data-version,p", po::bool_switch(&opts.wantShowVersion),
"print Data version to the standard output")
("quiet,q", po::bool_switch(&opts.isQuiet), "turn off all non-error output")
@@ -106,7 +106,7 @@
}
if (vm.count("version") > 0) {
- std::cout << "ndnputchunks " << tools::VERSION << "\n";
+ std::cout << "ndnserve " << tools::VERSION << "\n";
return 0;
}
@@ -164,10 +164,10 @@
return 0;
}
-} // namespace ndn::chunks
+} // namespace ndn::serve
int
main(int argc, char* argv[])
{
- return ndn::chunks::main(argc, argv);
+ return ndn::serve::main(argc, argv);
}
diff --git a/tools/chunks/putchunks/producer.cpp b/tools/serve/producer.cpp
similarity index 97%
rename from tools/chunks/putchunks/producer.cpp
rename to tools/serve/producer.cpp
index d9591d1..2c3ce8a 100644
--- a/tools/chunks/putchunks/producer.cpp
+++ b/tools/serve/producer.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -35,7 +35,7 @@
#include <iostream>
-namespace ndn::chunks {
+namespace ndn::serve {
Producer::Producer(const Name& prefix, Face& face, KeyChain& keyChain, std::istream& is,
const Options& opts)
@@ -158,4 +158,4 @@
}
}
-} // namespace ndn::chunks
+} // namespace ndn::serve
diff --git a/tools/chunks/putchunks/producer.hpp b/tools/serve/producer.hpp
similarity index 91%
rename from tools/chunks/putchunks/producer.hpp
rename to tools/serve/producer.hpp
index 46b25d9..48d19ca 100644
--- a/tools/chunks/putchunks/producer.hpp
+++ b/tools/serve/producer.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2024, Regents of the University of California,
+ * Copyright (c) 2016-2025, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -27,8 +27,8 @@
* @author Klaus Schneider
*/
-#ifndef NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
-#define NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
+#ifndef NDN_TOOLS_SERVE_PRODUCER_HPP
+#define NDN_TOOLS_SERVE_PRODUCER_HPP
#include "core/common.hpp"
@@ -37,7 +37,7 @@
#include <vector>
-namespace ndn::chunks {
+namespace ndn::serve {
/**
* @brief Segmented & versioned data publisher.
@@ -97,6 +97,6 @@
const Options m_options;
};
-} // namespace ndn::chunks
+} // namespace ndn::serve
-#endif // NDN_TOOLS_CHUNKS_PUTCHUNKS_PRODUCER_HPP
+#endif // NDN_TOOLS_SERVE_PRODUCER_HPP
diff --git a/tools/serve/wscript b/tools/serve/wscript
new file mode 100644
index 0000000..376f72c
--- /dev/null
+++ b/tools/serve/wscript
@@ -0,0 +1,17 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+top = '../..'
+
+def build(bld):
+ bld.objects(
+ target='serve-objects',
+ source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
+ use='core-objects')
+
+ bld.program(
+ target=f'{top}/bin/ndnserve',
+ name='ndnserve',
+ source='main.cpp',
+ use='serve-objects')
+
+ # backward compatibility
+ bld.symlink_as('${BINDIR}/ndnputchunks', 'ndnserve')