[ndnSIM] m_delegation is empty while added delegation

Muhammad Hosain Abdollahi Sabet mhasabet at gmail.com
Thu Oct 20 10:40:31 PDT 2016


​Hi there,
Trying to *maybe* fix issue #3803
<https://redmine.named-data.net/issues/3803> I have modified Link::Link (
const Block &  block)
<http://ndnsim.net/2.1/doxygen/classndn_1_1Link.html#a0a49619a5844110df36006c2ae773b11>
to:

Link::Link(const Block& block)
> {
>   if(m_delegations.empty()){
>       BOOST_THROW_EXCEPTION(Error("Link object has no delegationName!"));
>   }
>   wireDecode(block);
> }
>
which works when there is no delegationName set. But the problem is with
this snippet:

    ndn::Name linkName = m_linkName;
>     linkName = linkName.appendVersion(m_version);
>     auto linkObject = make_shared< ::ndn::Link>(linkName);
>     linkObject->addDelegation(1,m_delegationName);
>     ndn::Signature sign;
>     ndn::SignatureInfo signInfo(static_cast<
> ::ndn::tlv::SignatureTypeValue>(255));
>     sign.setInfo(signInfo);
>
> sign.setValue(::ndn::nonNegativeIntegerBlock(::ndn::tlv::SignatureValue,
> 0));
>     linkObject->setSignature(sign);
>
>     Ptr<UniformRandomVariable> rand =
> CreateObject<UniformRandomVariable>();
>     interest->setNonce(rand->GetValue(0,
> std::numeric_limits<uint32_t>::max()));
>     interest->setInterestLifetime(ndn::time::seconds(2));
>
>     interest->setLink(linkObject->wireEncode());
>

having added some delegation in highlighted(yellow) line, again the red
line will end up

   what():  Link object has no delegationName!
>

I'm sure the yellow has entered an entry into m_delegation(I have tested it
in Link::encodeContent()).
Anyone has an idea how and where m_delegation got empty?

Thanks,
Sabet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161020/010b31dc/attachment.html>


More information about the ndnSIM mailing list