blob: 031ccb8fef226207b5a97ac0255cd777373decb0 [file] [log] [blame]
Junxiao Shidf4b24e2016-07-14 21:41:43 +00001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shi71ff2312017-07-12 13:32:50 +00002/*
Davide Pesavento0f830802018-01-16 23:58:58 -05003 * Copyright (c) 2013-2018 Regents of the University of California.
Junxiao Shidf4b24e2016-07-14 21:41:43 +00004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20 */
21
22#include "name-component.hpp"
Junxiao Shi71ff2312017-07-12 13:32:50 +000023#include "name.hpp"
Junxiao Shi4053bd52018-08-16 13:39:25 -060024#include "util/string-helper.hpp"
Junxiao Shidf4b24e2016-07-14 21:41:43 +000025
26#include "boost-test.hpp"
Junxiao Shi4053bd52018-08-16 13:39:25 -060027#include <boost/algorithm/string/case_conv.hpp>
Junxiao Shidf4b24e2016-07-14 21:41:43 +000028#include <boost/mpl/vector.hpp>
29
30namespace ndn {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000031namespace name {
Junxiao Shidf4b24e2016-07-14 21:41:43 +000032namespace tests {
33
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000034BOOST_AUTO_TEST_SUITE(TestNameComponent)
Junxiao Shidf4b24e2016-07-14 21:41:43 +000035
36BOOST_AUTO_TEST_SUITE(Decode)
37
38BOOST_AUTO_TEST_CASE(Generic)
39{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000040 Component comp("0807 6E646E2D637878"_block);
41 BOOST_CHECK_EQUAL(comp.type(), tlv::GenericNameComponent);
42 BOOST_CHECK_EQUAL(comp.toUri(), "ndn-cxx");
43 BOOST_CHECK_EQUAL(Component::fromEscapedString("ndn-cxx"), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060044 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=ndn-cxx"), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000045
46 comp.wireDecode("0800"_block);
47 BOOST_CHECK_EQUAL(comp.toUri(), "...");
48 BOOST_CHECK_EQUAL(Component::fromEscapedString("..."), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060049 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=..."), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000050 BOOST_CHECK_EQUAL(Component::fromEscapedString(".%2E."), comp);
51
52 comp.wireDecode("0801 2E"_block);
53 BOOST_CHECK_EQUAL(comp.toUri(), "....");
54 BOOST_CHECK_EQUAL(Component::fromEscapedString("...."), comp);
55 BOOST_CHECK_EQUAL(Component::fromEscapedString("%2E..%2E"), comp);
56
57 comp.wireDecode("0803 2E412E"_block);
58 BOOST_CHECK_EQUAL(comp.toUri(), ".A.");
59 BOOST_CHECK_EQUAL(Component::fromEscapedString(".A."), comp);
60
61 comp.wireDecode("0807 666F6F25626172"_block);
62 BOOST_CHECK_EQUAL(comp.toUri(), "foo%25bar");
63 BOOST_CHECK_EQUAL(Component::fromEscapedString("foo%25bar"), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060064 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=foo%25bar"), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000065
66 comp.wireDecode("0804 2D2E5F7E"_block);
67 BOOST_CHECK_EQUAL(comp.toUri(), "-._~");
68 BOOST_CHECK_EQUAL(Component::fromEscapedString("-._~"), comp);
69
Junxiao Shid2e60632018-08-10 10:48:44 -060070 comp.wireDecode("0803 393D41"_block);
71 BOOST_CHECK_EQUAL(comp.toUri(), "9%3DA");
72 BOOST_CHECK_EQUAL(Component::fromEscapedString("9%3DA"), comp);
73
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000074 comp = Component(":/?#[]@");
75 BOOST_CHECK_EQUAL(comp.toUri(), "%3A%2F%3F%23%5B%5D%40");
76 BOOST_CHECK_EQUAL(Component::fromEscapedString("%3A%2F%3F%23%5B%5D%40"), comp);
77
78 BOOST_CHECK_THROW(Component::fromEscapedString(""), Component::Error);
79 BOOST_CHECK_THROW(Component::fromEscapedString("."), Component::Error);
80 BOOST_CHECK_THROW(Component::fromEscapedString(".."), Component::Error);
Junxiao Shidf4b24e2016-07-14 21:41:43 +000081}
82
Junxiao Shi4053bd52018-08-16 13:39:25 -060083static void
84testSha256(uint32_t type, const std::string& uriPrefix)
Junxiao Shidf4b24e2016-07-14 21:41:43 +000085{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000086 std::string hexLower = "28bad4b5275bd392dbb670c75cf0b66f13f7942b21e80f55c0e86b374753a548";
Junxiao Shi4053bd52018-08-16 13:39:25 -060087 std::string hexUpper = boost::to_upper_copy(hexLower);
88 std::string hexPct;
89 for (size_t i = 0; i < hexUpper.size(); i += 2) {
90 hexPct += "%" + hexUpper.substr(i, 2);
91 }
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000092
Junxiao Shi4053bd52018-08-16 13:39:25 -060093 Component comp(Block(type, fromHex(hexLower)));
94 BOOST_CHECK_EQUAL(comp.type(), type);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000095 BOOST_CHECK_EQUAL(comp.toUri(), uriPrefix + hexLower);
96 BOOST_CHECK_EQUAL(Component::fromEscapedString(uriPrefix + hexLower), comp);
97 BOOST_CHECK_EQUAL(Component::fromEscapedString(uriPrefix + hexUpper), comp);
Junxiao Shi4053bd52018-08-16 13:39:25 -060098 BOOST_CHECK_EQUAL(Component::fromEscapedString(to_string(type) + "=" + hexPct), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000099
Junxiao Shi4053bd52018-08-16 13:39:25 -0600100 BOOST_CHECK_THROW(comp.wireDecode(Block(type, fromHex("A791806951F25C4D"))), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000101 BOOST_CHECK_THROW(Component::fromEscapedString(uriPrefix), Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600102 BOOST_CHECK_THROW(Component::fromEscapedString(uriPrefix + "a791806951f25c4d"),
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000103 Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600104 BOOST_CHECK_THROW(Component::fromEscapedString(boost::to_upper_copy(uriPrefix) + hexLower),
105 Component::Error);
106}
107
108BOOST_AUTO_TEST_CASE(Digest)
109{
110 testSha256(tlv::ImplicitSha256DigestComponent, "sha256digest=");
111}
112
113BOOST_AUTO_TEST_CASE(Params)
114{
115 testSha256(tlv::ParametersSha256DigestComponent, "params-sha256=");
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000116}
117
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000118BOOST_AUTO_TEST_CASE(OtherType)
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000119{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000120 Component comp("0907 6E646E2D637878"_block);
121 BOOST_CHECK_EQUAL(comp.type(), 0x09);
122 BOOST_CHECK_EQUAL(comp.toUri(), "9=ndn-cxx");
123 BOOST_CHECK_EQUAL(Component::fromEscapedString("9=ndn-cxx"), comp);
124
125 comp.wireDecode("FDFFFF00"_block);
126 BOOST_CHECK_EQUAL(comp.type(), 0xFFFF);
127 BOOST_CHECK_EQUAL(comp.toUri(), "65535=...");
128 BOOST_CHECK_EQUAL(Component::fromEscapedString("65535=..."), comp);
129
130 comp.wireDecode("FD576501 2E"_block);
131 BOOST_CHECK_EQUAL(comp.type(), 0x5765);
132 BOOST_CHECK_EQUAL(comp.toUri(), "22373=....");
133 BOOST_CHECK_EQUAL(Component::fromEscapedString("22373=...."), comp);
134
135 BOOST_CHECK_THROW(Component::fromEscapedString("3="), Component::Error);
136 BOOST_CHECK_THROW(Component::fromEscapedString("3=."), Component::Error);
137 BOOST_CHECK_THROW(Component::fromEscapedString("3=.."), Component::Error);
138}
139
140BOOST_AUTO_TEST_CASE(InvalidType)
141{
142 Component comp;
143 BOOST_CHECK_THROW(comp.wireDecode("0001 80"_block), Component::Error);
144 BOOST_CHECK_THROW(comp.wireDecode("FE0001000001 80"_block), Component::Error);
145
146 BOOST_CHECK_THROW(Component::fromEscapedString("0=A"), Component::Error);
147 BOOST_CHECK_THROW(Component::fromEscapedString("65536=A"), Component::Error);
Junxiao Shid2e60632018-08-10 10:48:44 -0600148 BOOST_CHECK_THROW(Component::fromEscapedString("4294967296=A"), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000149 BOOST_CHECK_THROW(Component::fromEscapedString("-1=A"), Component::Error);
150 BOOST_CHECK_THROW(Component::fromEscapedString("+=A"), Component::Error);
151 BOOST_CHECK_THROW(Component::fromEscapedString("=A"), Component::Error);
152 BOOST_CHECK_THROW(Component::fromEscapedString("0x1=A"), Component::Error);
153 BOOST_CHECK_THROW(Component::fromEscapedString("Z=A"), Component::Error);
154 BOOST_CHECK_THROW(Component::fromEscapedString("09=A"), Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600155 BOOST_CHECK_THROW(Component::fromEscapedString("0x3=A"), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000156 BOOST_CHECK_THROW(Component::fromEscapedString("+9=A"), Component::Error);
Junxiao Shid2e60632018-08-10 10:48:44 -0600157 BOOST_CHECK_THROW(Component::fromEscapedString(" 9=A"), Component::Error);
158 BOOST_CHECK_THROW(Component::fromEscapedString("9 =A"), Component::Error);
159 BOOST_CHECK_THROW(Component::fromEscapedString("9.0=A"), Component::Error);
160 BOOST_CHECK_THROW(Component::fromEscapedString("9E0=A"), Component::Error);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000161}
162
163BOOST_AUTO_TEST_SUITE_END() // Decode
164
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000165BOOST_AUTO_TEST_CASE(Compare)
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000166{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000167 std::vector<Component> comps = {
168 Component("0120 0000000000000000000000000000000000000000000000000000000000000000"_block),
169 Component("0120 0000000000000000000000000000000000000000000000000000000000000001"_block),
170 Component("0120 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"_block),
Junxiao Shi4053bd52018-08-16 13:39:25 -0600171 Component("0220 0000000000000000000000000000000000000000000000000000000000000000"_block),
172 Component("0220 0000000000000000000000000000000000000000000000000000000000000001"_block),
173 Component("0220 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"_block),
174 Component(0x03),
175 Component("0301 44"_block),
176 Component("0301 46"_block),
177 Component("0302 4141"_block),
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000178 Component(),
179 Component("D"),
180 Component("F"),
181 Component("AA"),
182 Component(0x53B2),
183 Component("FD53B201 44"_block),
184 Component("FD53B201 46"_block),
185 Component("FD53B202 4141"_block),
186 };
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000187
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000188 for (size_t i = 0; i < comps.size(); ++i) {
189 for (size_t j = 0; j < comps.size(); ++j) {
190 Component lhs = comps[i];
191 Component rhs = comps[j];
192 BOOST_CHECK_EQUAL(lhs == rhs, i == j);
193 BOOST_CHECK_EQUAL(lhs != rhs, i != j);
194 BOOST_CHECK_EQUAL(lhs < rhs, i < j);
195 BOOST_CHECK_EQUAL(lhs <= rhs, i <= j);
196 BOOST_CHECK_EQUAL(lhs > rhs, i > j);
197 BOOST_CHECK_EQUAL(lhs >= rhs, i >= j);
198 }
199 }
Davide Pesavento08378cb2018-02-01 16:10:54 -0500200}
201
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000202BOOST_AUTO_TEST_SUITE(CreateFromIterators) // Bug 2490
203
204typedef boost::mpl::vector<
205 std::vector<uint8_t>,
206 std::list<uint8_t>,
207 std::vector<int8_t>,
208 std::list<int8_t>
209> ContainerTypes;
210
211BOOST_AUTO_TEST_CASE_TEMPLATE(ZeroOctet, T, ContainerTypes)
212{
213 T bytes;
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000214 Component c(bytes.begin(), bytes.end());
215 BOOST_CHECK_EQUAL(c.type(), tlv::GenericNameComponent);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000216 BOOST_CHECK_EQUAL(c.value_size(), 0);
217 BOOST_CHECK_EQUAL(c.size(), 2);
218}
219
220BOOST_AUTO_TEST_CASE_TEMPLATE(OneOctet, T, ContainerTypes)
221{
222 T bytes{1};
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000223 Component c(0x09, bytes.begin(), bytes.end());
224 BOOST_CHECK_EQUAL(c.type(), 0x09);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000225 BOOST_CHECK_EQUAL(c.value_size(), 1);
226 BOOST_CHECK_EQUAL(c.size(), 3);
227}
228
229BOOST_AUTO_TEST_CASE_TEMPLATE(FourOctets, T, ContainerTypes)
230{
231 T bytes{1, 2, 3, 4};
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000232 Component c(0xFCEC, bytes.begin(), bytes.end());
233 BOOST_CHECK_EQUAL(c.type(), 0xFCEC);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000234 BOOST_CHECK_EQUAL(c.value_size(), 4);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000235 BOOST_CHECK_EQUAL(c.size(), 8);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000236}
237
238BOOST_AUTO_TEST_SUITE_END() // CreateFromIterators
239
Junxiao Shi71ff2312017-07-12 13:32:50 +0000240BOOST_AUTO_TEST_SUITE(NamingConvention)
241
242template<typename ArgType>
243struct ConventionTest
244{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000245 function<Component(ArgType)> makeComponent;
246 function<ArgType(const Component&)> getValue;
Junxiao Shi71ff2312017-07-12 13:32:50 +0000247 function<Name&(Name&, ArgType)> append;
248 Name expected;
249 ArgType value;
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000250 function<bool(const Component&)> isComponent;
Junxiao Shi71ff2312017-07-12 13:32:50 +0000251};
252
253class NumberWithMarker
254{
255public:
256 ConventionTest<uint64_t>
257 operator()() const
258 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000259 return {bind(&Component::fromNumberWithMarker, 0xAA, _1),
260 bind(&Component::toNumberWithMarker, _1, 0xAA),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000261 bind(&Name::appendNumberWithMarker, _1, 0xAA, _2),
262 Name("/%AA%03%E8"),
263 1000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000264 bind(&Component::isNumberWithMarker, _1, 0xAA)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000265 }
266};
267
268class Segment
269{
270public:
271 ConventionTest<uint64_t>
272 operator()() const
273 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000274 return {&Component::fromSegment,
275 bind(&Component::toSegment, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000276 bind(&Name::appendSegment, _1, _2),
277 Name("/%00%27%10"),
278 10000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000279 bind(&Component::isSegment, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000280 }
281};
282
283class SegmentOffset
284{
285public:
286 ConventionTest<uint64_t>
287 operator()() const
288 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000289 return {&Component::fromSegmentOffset,
290 bind(&Component::toSegmentOffset, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000291 bind(&Name::appendSegmentOffset, _1, _2),
292 Name("/%FB%00%01%86%A0"),
293 100000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000294 bind(&Component::isSegmentOffset, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000295 }
296};
297
298class Version
299{
300public:
301 ConventionTest<uint64_t>
302 operator()() const
303 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000304 return {&Component::fromVersion,
305 bind(&Component::toVersion, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000306 [] (Name& name, uint64_t version) -> Name& { return name.appendVersion(version); },
307 Name("/%FD%00%0FB%40"),
308 1000000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000309 bind(&Component::isVersion, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000310 }
311};
312
313class Timestamp
314{
315public:
316 ConventionTest<time::system_clock::TimePoint>
317 operator()() const
318 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000319 return {&Component::fromTimestamp,
320 bind(&Component::toTimestamp, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000321 [] (Name& name, time::system_clock::TimePoint t) -> Name& { return name.appendTimestamp(t); },
322 Name("/%FC%00%04%7BE%E3%1B%00%00"),
Davide Pesavento0f830802018-01-16 23:58:58 -0500323 time::getUnixEpoch() + 14600_days, // 40 years
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000324 bind(&Component::isTimestamp, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000325 }
326};
327
328class SequenceNumber
329{
330public:
331 ConventionTest<uint64_t>
332 operator()() const
333 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000334 return {&Component::fromSequenceNumber,
335 bind(&Component::toSequenceNumber, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000336 bind(&Name::appendSequenceNumber, _1, _2),
337 Name("/%FE%00%98%96%80"),
338 10000000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000339 bind(&Component::isSequenceNumber, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000340 }
341};
342
343using ConventionTests = boost::mpl::vector<
344 NumberWithMarker,
345 Segment,
346 SegmentOffset,
347 Version,
348 Timestamp,
349 SequenceNumber
350>;
351
352BOOST_AUTO_TEST_CASE_TEMPLATE(Convention, T, ConventionTests)
353{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000354 Component invalidComponent1;
355 Component invalidComponent2("1234567890");
Junxiao Shi71ff2312017-07-12 13:32:50 +0000356
357 auto test = T()();
358
359 const Name& expected = test.expected;
360 BOOST_TEST_MESSAGE("Check " << expected[0].toUri());
361
362 BOOST_CHECK_EQUAL(expected[0].isGeneric(), true);
363
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000364 Component actualComponent = test.makeComponent(test.value);
Junxiao Shi71ff2312017-07-12 13:32:50 +0000365 BOOST_CHECK_EQUAL(actualComponent, expected[0]);
366
367 Name actualName;
368 test.append(actualName, test.value);
369 BOOST_CHECK_EQUAL(actualName, expected);
370
371 BOOST_CHECK_EQUAL(test.isComponent(expected[0]), true);
372 BOOST_CHECK_EQUAL(test.getValue(expected[0]), test.value);
373
374 BOOST_CHECK_EQUAL(test.isComponent(invalidComponent1), false);
375 BOOST_CHECK_EQUAL(test.isComponent(invalidComponent2), false);
376
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000377 BOOST_CHECK_THROW(test.getValue(invalidComponent1), Component::Error);
378 BOOST_CHECK_THROW(test.getValue(invalidComponent2), Component::Error);
Junxiao Shi71ff2312017-07-12 13:32:50 +0000379}
380
381BOOST_AUTO_TEST_SUITE_END() // NamingConvention
382
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000383BOOST_AUTO_TEST_SUITE_END() // TestNameComponent
384
385} // namespace tests
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000386} // namespace name
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000387} // namespace ndn