blob: 78613f18d936a138c593c0a1cb175c0e66c4ea35 [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
Davide Pesavento7e780642018-11-24 15:51:34 -050022#include "ndn-cxx/name-component.hpp"
23#include "ndn-cxx/name.hpp"
24#include "ndn-cxx/util/string-helper.hpp"
Junxiao Shidf4b24e2016-07-14 21:41:43 +000025
Davide Pesavento7e780642018-11-24 15:51:34 -050026#include "tests/boost-test.hpp"
27
Junxiao Shi4053bd52018-08-16 13:39:25 -060028#include <boost/algorithm/string/case_conv.hpp>
Junxiao Shidf4b24e2016-07-14 21:41:43 +000029#include <boost/mpl/vector.hpp>
30
31namespace ndn {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000032namespace name {
Junxiao Shidf4b24e2016-07-14 21:41:43 +000033namespace tests {
34
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000035BOOST_AUTO_TEST_SUITE(TestNameComponent)
Junxiao Shidf4b24e2016-07-14 21:41:43 +000036
37BOOST_AUTO_TEST_SUITE(Decode)
38
39BOOST_AUTO_TEST_CASE(Generic)
40{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000041 Component comp("0807 6E646E2D637878"_block);
42 BOOST_CHECK_EQUAL(comp.type(), tlv::GenericNameComponent);
43 BOOST_CHECK_EQUAL(comp.toUri(), "ndn-cxx");
44 BOOST_CHECK_EQUAL(Component::fromEscapedString("ndn-cxx"), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060045 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=ndn-cxx"), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000046
47 comp.wireDecode("0800"_block);
48 BOOST_CHECK_EQUAL(comp.toUri(), "...");
49 BOOST_CHECK_EQUAL(Component::fromEscapedString("..."), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060050 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=..."), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000051 BOOST_CHECK_EQUAL(Component::fromEscapedString(".%2E."), comp);
52
53 comp.wireDecode("0801 2E"_block);
54 BOOST_CHECK_EQUAL(comp.toUri(), "....");
55 BOOST_CHECK_EQUAL(Component::fromEscapedString("...."), comp);
56 BOOST_CHECK_EQUAL(Component::fromEscapedString("%2E..%2E"), comp);
57
58 comp.wireDecode("0803 2E412E"_block);
59 BOOST_CHECK_EQUAL(comp.toUri(), ".A.");
60 BOOST_CHECK_EQUAL(Component::fromEscapedString(".A."), comp);
61
62 comp.wireDecode("0807 666F6F25626172"_block);
63 BOOST_CHECK_EQUAL(comp.toUri(), "foo%25bar");
64 BOOST_CHECK_EQUAL(Component::fromEscapedString("foo%25bar"), comp);
Junxiao Shid2e60632018-08-10 10:48:44 -060065 BOOST_CHECK_EQUAL(Component::fromEscapedString("8=foo%25bar"), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000066
67 comp.wireDecode("0804 2D2E5F7E"_block);
68 BOOST_CHECK_EQUAL(comp.toUri(), "-._~");
69 BOOST_CHECK_EQUAL(Component::fromEscapedString("-._~"), comp);
70
Junxiao Shid2e60632018-08-10 10:48:44 -060071 comp.wireDecode("0803 393D41"_block);
72 BOOST_CHECK_EQUAL(comp.toUri(), "9%3DA");
73 BOOST_CHECK_EQUAL(Component::fromEscapedString("9%3DA"), comp);
74
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000075 comp = Component(":/?#[]@");
76 BOOST_CHECK_EQUAL(comp.toUri(), "%3A%2F%3F%23%5B%5D%40");
77 BOOST_CHECK_EQUAL(Component::fromEscapedString("%3A%2F%3F%23%5B%5D%40"), comp);
78
79 BOOST_CHECK_THROW(Component::fromEscapedString(""), Component::Error);
80 BOOST_CHECK_THROW(Component::fromEscapedString("."), Component::Error);
81 BOOST_CHECK_THROW(Component::fromEscapedString(".."), Component::Error);
Junxiao Shidf4b24e2016-07-14 21:41:43 +000082}
83
Junxiao Shi4053bd52018-08-16 13:39:25 -060084static void
85testSha256(uint32_t type, const std::string& uriPrefix)
Junxiao Shidf4b24e2016-07-14 21:41:43 +000086{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000087 std::string hexLower = "28bad4b5275bd392dbb670c75cf0b66f13f7942b21e80f55c0e86b374753a548";
Junxiao Shi4053bd52018-08-16 13:39:25 -060088 std::string hexUpper = boost::to_upper_copy(hexLower);
89 std::string hexPct;
90 for (size_t i = 0; i < hexUpper.size(); i += 2) {
91 hexPct += "%" + hexUpper.substr(i, 2);
92 }
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000093
Junxiao Shi4053bd52018-08-16 13:39:25 -060094 Component comp(Block(type, fromHex(hexLower)));
95 BOOST_CHECK_EQUAL(comp.type(), type);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +000096 BOOST_CHECK_EQUAL(comp.toUri(), uriPrefix + hexLower);
97 BOOST_CHECK_EQUAL(Component::fromEscapedString(uriPrefix + hexLower), comp);
98 BOOST_CHECK_EQUAL(Component::fromEscapedString(uriPrefix + hexUpper), comp);
Junxiao Shi4053bd52018-08-16 13:39:25 -060099 BOOST_CHECK_EQUAL(Component::fromEscapedString(to_string(type) + "=" + hexPct), comp);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000100
Junxiao Shi4053bd52018-08-16 13:39:25 -0600101 BOOST_CHECK_THROW(comp.wireDecode(Block(type, fromHex("A791806951F25C4D"))), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000102 BOOST_CHECK_THROW(Component::fromEscapedString(uriPrefix), Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600103 BOOST_CHECK_THROW(Component::fromEscapedString(uriPrefix + "a791806951f25c4d"),
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000104 Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600105 BOOST_CHECK_THROW(Component::fromEscapedString(boost::to_upper_copy(uriPrefix) + hexLower),
106 Component::Error);
107}
108
109BOOST_AUTO_TEST_CASE(Digest)
110{
111 testSha256(tlv::ImplicitSha256DigestComponent, "sha256digest=");
112}
113
114BOOST_AUTO_TEST_CASE(Params)
115{
116 testSha256(tlv::ParametersSha256DigestComponent, "params-sha256=");
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000117}
118
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000119BOOST_AUTO_TEST_CASE(OtherType)
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000120{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000121 Component comp("0907 6E646E2D637878"_block);
122 BOOST_CHECK_EQUAL(comp.type(), 0x09);
123 BOOST_CHECK_EQUAL(comp.toUri(), "9=ndn-cxx");
124 BOOST_CHECK_EQUAL(Component::fromEscapedString("9=ndn-cxx"), comp);
125
126 comp.wireDecode("FDFFFF00"_block);
127 BOOST_CHECK_EQUAL(comp.type(), 0xFFFF);
128 BOOST_CHECK_EQUAL(comp.toUri(), "65535=...");
129 BOOST_CHECK_EQUAL(Component::fromEscapedString("65535=..."), comp);
130
131 comp.wireDecode("FD576501 2E"_block);
132 BOOST_CHECK_EQUAL(comp.type(), 0x5765);
133 BOOST_CHECK_EQUAL(comp.toUri(), "22373=....");
134 BOOST_CHECK_EQUAL(Component::fromEscapedString("22373=...."), comp);
135
136 BOOST_CHECK_THROW(Component::fromEscapedString("3="), Component::Error);
137 BOOST_CHECK_THROW(Component::fromEscapedString("3=."), Component::Error);
138 BOOST_CHECK_THROW(Component::fromEscapedString("3=.."), Component::Error);
139}
140
141BOOST_AUTO_TEST_CASE(InvalidType)
142{
143 Component comp;
144 BOOST_CHECK_THROW(comp.wireDecode("0001 80"_block), Component::Error);
145 BOOST_CHECK_THROW(comp.wireDecode("FE0001000001 80"_block), Component::Error);
146
147 BOOST_CHECK_THROW(Component::fromEscapedString("0=A"), Component::Error);
148 BOOST_CHECK_THROW(Component::fromEscapedString("65536=A"), Component::Error);
Junxiao Shid2e60632018-08-10 10:48:44 -0600149 BOOST_CHECK_THROW(Component::fromEscapedString("4294967296=A"), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000150 BOOST_CHECK_THROW(Component::fromEscapedString("-1=A"), Component::Error);
151 BOOST_CHECK_THROW(Component::fromEscapedString("+=A"), Component::Error);
152 BOOST_CHECK_THROW(Component::fromEscapedString("=A"), Component::Error);
153 BOOST_CHECK_THROW(Component::fromEscapedString("0x1=A"), Component::Error);
154 BOOST_CHECK_THROW(Component::fromEscapedString("Z=A"), Component::Error);
155 BOOST_CHECK_THROW(Component::fromEscapedString("09=A"), Component::Error);
Junxiao Shi4053bd52018-08-16 13:39:25 -0600156 BOOST_CHECK_THROW(Component::fromEscapedString("0x3=A"), Component::Error);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000157 BOOST_CHECK_THROW(Component::fromEscapedString("+9=A"), Component::Error);
Junxiao Shid2e60632018-08-10 10:48:44 -0600158 BOOST_CHECK_THROW(Component::fromEscapedString(" 9=A"), Component::Error);
159 BOOST_CHECK_THROW(Component::fromEscapedString("9 =A"), Component::Error);
160 BOOST_CHECK_THROW(Component::fromEscapedString("9.0=A"), Component::Error);
161 BOOST_CHECK_THROW(Component::fromEscapedString("9E0=A"), Component::Error);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000162}
163
164BOOST_AUTO_TEST_SUITE_END() // Decode
165
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000166BOOST_AUTO_TEST_CASE(Compare)
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000167{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000168 std::vector<Component> comps = {
169 Component("0120 0000000000000000000000000000000000000000000000000000000000000000"_block),
170 Component("0120 0000000000000000000000000000000000000000000000000000000000000001"_block),
171 Component("0120 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"_block),
Junxiao Shi4053bd52018-08-16 13:39:25 -0600172 Component("0220 0000000000000000000000000000000000000000000000000000000000000000"_block),
173 Component("0220 0000000000000000000000000000000000000000000000000000000000000001"_block),
174 Component("0220 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"_block),
175 Component(0x03),
176 Component("0301 44"_block),
177 Component("0301 46"_block),
178 Component("0302 4141"_block),
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000179 Component(),
180 Component("D"),
181 Component("F"),
182 Component("AA"),
183 Component(0x53B2),
184 Component("FD53B201 44"_block),
185 Component("FD53B201 46"_block),
186 Component("FD53B202 4141"_block),
187 };
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000188
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000189 for (size_t i = 0; i < comps.size(); ++i) {
190 for (size_t j = 0; j < comps.size(); ++j) {
191 Component lhs = comps[i];
192 Component rhs = comps[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 BOOST_CHECK_EQUAL(lhs >= rhs, i >= j);
199 }
200 }
Davide Pesavento08378cb2018-02-01 16:10:54 -0500201}
202
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000203BOOST_AUTO_TEST_SUITE(CreateFromIterators) // Bug 2490
204
205typedef boost::mpl::vector<
206 std::vector<uint8_t>,
207 std::list<uint8_t>,
208 std::vector<int8_t>,
209 std::list<int8_t>
210> ContainerTypes;
211
212BOOST_AUTO_TEST_CASE_TEMPLATE(ZeroOctet, T, ContainerTypes)
213{
214 T bytes;
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000215 Component c(bytes.begin(), bytes.end());
216 BOOST_CHECK_EQUAL(c.type(), tlv::GenericNameComponent);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000217 BOOST_CHECK_EQUAL(c.value_size(), 0);
218 BOOST_CHECK_EQUAL(c.size(), 2);
219}
220
221BOOST_AUTO_TEST_CASE_TEMPLATE(OneOctet, T, ContainerTypes)
222{
223 T bytes{1};
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000224 Component c(0x09, bytes.begin(), bytes.end());
225 BOOST_CHECK_EQUAL(c.type(), 0x09);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000226 BOOST_CHECK_EQUAL(c.value_size(), 1);
227 BOOST_CHECK_EQUAL(c.size(), 3);
228}
229
230BOOST_AUTO_TEST_CASE_TEMPLATE(FourOctets, T, ContainerTypes)
231{
232 T bytes{1, 2, 3, 4};
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000233 Component c(0xFCEC, bytes.begin(), bytes.end());
234 BOOST_CHECK_EQUAL(c.type(), 0xFCEC);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000235 BOOST_CHECK_EQUAL(c.value_size(), 4);
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000236 BOOST_CHECK_EQUAL(c.size(), 8);
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000237}
238
239BOOST_AUTO_TEST_SUITE_END() // CreateFromIterators
240
Junxiao Shi71ff2312017-07-12 13:32:50 +0000241BOOST_AUTO_TEST_SUITE(NamingConvention)
242
243template<typename ArgType>
244struct ConventionTest
245{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000246 function<Component(ArgType)> makeComponent;
247 function<ArgType(const Component&)> getValue;
Junxiao Shi71ff2312017-07-12 13:32:50 +0000248 function<Name&(Name&, ArgType)> append;
249 Name expected;
250 ArgType value;
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000251 function<bool(const Component&)> isComponent;
Junxiao Shi71ff2312017-07-12 13:32:50 +0000252};
253
254class NumberWithMarker
255{
256public:
257 ConventionTest<uint64_t>
258 operator()() const
259 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000260 return {bind(&Component::fromNumberWithMarker, 0xAA, _1),
261 bind(&Component::toNumberWithMarker, _1, 0xAA),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000262 bind(&Name::appendNumberWithMarker, _1, 0xAA, _2),
263 Name("/%AA%03%E8"),
264 1000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000265 bind(&Component::isNumberWithMarker, _1, 0xAA)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000266 }
267};
268
269class Segment
270{
271public:
272 ConventionTest<uint64_t>
273 operator()() const
274 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000275 return {&Component::fromSegment,
276 bind(&Component::toSegment, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000277 bind(&Name::appendSegment, _1, _2),
278 Name("/%00%27%10"),
279 10000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000280 bind(&Component::isSegment, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000281 }
282};
283
284class SegmentOffset
285{
286public:
287 ConventionTest<uint64_t>
288 operator()() const
289 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000290 return {&Component::fromSegmentOffset,
291 bind(&Component::toSegmentOffset, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000292 bind(&Name::appendSegmentOffset, _1, _2),
293 Name("/%FB%00%01%86%A0"),
294 100000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000295 bind(&Component::isSegmentOffset, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000296 }
297};
298
299class Version
300{
301public:
302 ConventionTest<uint64_t>
303 operator()() const
304 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000305 return {&Component::fromVersion,
306 bind(&Component::toVersion, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000307 [] (Name& name, uint64_t version) -> Name& { return name.appendVersion(version); },
308 Name("/%FD%00%0FB%40"),
309 1000000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000310 bind(&Component::isVersion, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000311 }
312};
313
314class Timestamp
315{
316public:
317 ConventionTest<time::system_clock::TimePoint>
318 operator()() const
319 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000320 return {&Component::fromTimestamp,
321 bind(&Component::toTimestamp, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000322 [] (Name& name, time::system_clock::TimePoint t) -> Name& { return name.appendTimestamp(t); },
323 Name("/%FC%00%04%7BE%E3%1B%00%00"),
Davide Pesavento0f830802018-01-16 23:58:58 -0500324 time::getUnixEpoch() + 14600_days, // 40 years
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000325 bind(&Component::isTimestamp, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000326 }
327};
328
329class SequenceNumber
330{
331public:
332 ConventionTest<uint64_t>
333 operator()() const
334 {
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000335 return {&Component::fromSequenceNumber,
336 bind(&Component::toSequenceNumber, _1),
Junxiao Shi71ff2312017-07-12 13:32:50 +0000337 bind(&Name::appendSequenceNumber, _1, _2),
338 Name("/%FE%00%98%96%80"),
339 10000000,
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000340 bind(&Component::isSequenceNumber, _1)};
Junxiao Shi71ff2312017-07-12 13:32:50 +0000341 }
342};
343
344using ConventionTests = boost::mpl::vector<
345 NumberWithMarker,
346 Segment,
347 SegmentOffset,
348 Version,
349 Timestamp,
350 SequenceNumber
351>;
352
353BOOST_AUTO_TEST_CASE_TEMPLATE(Convention, T, ConventionTests)
354{
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000355 Component invalidComponent1;
356 Component invalidComponent2("1234567890");
Junxiao Shi71ff2312017-07-12 13:32:50 +0000357
358 auto test = T()();
359
360 const Name& expected = test.expected;
361 BOOST_TEST_MESSAGE("Check " << expected[0].toUri());
362
363 BOOST_CHECK_EQUAL(expected[0].isGeneric(), true);
364
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000365 Component actualComponent = test.makeComponent(test.value);
Junxiao Shi71ff2312017-07-12 13:32:50 +0000366 BOOST_CHECK_EQUAL(actualComponent, expected[0]);
367
368 Name actualName;
369 test.append(actualName, test.value);
370 BOOST_CHECK_EQUAL(actualName, expected);
371
372 BOOST_CHECK_EQUAL(test.isComponent(expected[0]), true);
373 BOOST_CHECK_EQUAL(test.getValue(expected[0]), test.value);
374
375 BOOST_CHECK_EQUAL(test.isComponent(invalidComponent1), false);
376 BOOST_CHECK_EQUAL(test.isComponent(invalidComponent2), false);
377
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000378 BOOST_CHECK_THROW(test.getValue(invalidComponent1), Component::Error);
379 BOOST_CHECK_THROW(test.getValue(invalidComponent2), Component::Error);
Junxiao Shi71ff2312017-07-12 13:32:50 +0000380}
381
382BOOST_AUTO_TEST_SUITE_END() // NamingConvention
383
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000384BOOST_AUTO_TEST_SUITE_END() // TestNameComponent
385
386} // namespace tests
Junxiao Shicf4ac5b2018-03-28 22:46:06 +0000387} // namespace name
Junxiao Shidf4b24e2016-07-14 21:41:43 +0000388} // namespace ndn