[ndnSIM] Problems

寸怡鹏 16120054 at bjtu.edu.cn
Fri May 12 22:34:47 PDT 2017


Thank for replaying.I have modified them,and I also modify the tlv.h(add a type "Digest"),but still have segment false ----- 研究生 下一代互联网国家工程实验室 北京交通大学 寸怡鹏 Mob: (+86) 13238752918 Email: cunyipeng at bjtu.edu.cn 在2017年05月12日 11:20,Spyridon (Spyros) Mastorakis 写道: Hi, you have to modify the wireEncode and wireDecode methods to encode/decode the newly added field in the appropriate way. Thanks, Spyridon (Spyros) Mastorakis Personal Website: http://cs.ucla.edu/~mastorakis/ Internet Research Laboratory Computer Science Department UCLA On May 9, 2017, at 7:00 PM, 16120054 at bjtu.edu.cn wrote: 16120054 at bjtu.edu.cn   发件人: 16120054 at bjtu.edu.cn 发送时间: 2017-05-10 09:29 收件人: nfd-dev 主题: Problems Hello!     I add a data parket field in the data.cpp ,such as   template<encoding::Tag TAG>size_t Data::wireEncode(EncodingImpl<TAG>& encoder, bool unsignedPortion/* = false*/) const {   size_t totalLength = 0;   // Data ::= DATA-TLV TLV-LENGTH   //            Name   //            MetaInfo   //            Content   //            Signature   //         Digest   // (reverse encoding)   if (!unsignedPortion && !m_signature)   {       BOOST_THROW_EXCEPTION(Error("Requested wire format, but data packet has not been signed yet"));   }   // Digest   totalLength += encoder.prependBlock(getDigest());   if (!unsignedPortion)   {       // SignatureValue       totalLength += encoder.prependBlock(m_signature.getValue());   }   // SignatureInfo   totalLength += encoder.prependBlock(m_signature.getInfo());   // Content   totalLength += encoder.prependBlock(getContent());   // MetaInfo   totalLength += getMetaInfo().wireEncode(encoder);   // Name   totalLength += getName().wireEncode(encoder);   if (!unsignedPortion)     {       totalLength += encoder.prependVarNumber(totalLength);       totalLength += encoder.prependVarNumber(tlv::Data);     }   return totalLength; }   const Block& Data::getDigest() const {   if (m_fullName1.empty())     m_fullName1 = makeEmptyBlock(tlv::Digest);   if (!m_fullName1.hasWire())     m_fullName1.encode();   return m_fullName1; } Data& Data::setDigest(const Block& fullname) {   onChanged();   if (fullname.type() == tlv::Digest)       m_fullName1 = fullname;   else {        m_fullName1 = Block(tlv::Digest, fullname);   }   return *this; } Data& Data::setDigest(const uint8_t* fullname, size_t fullnameLength) {    onChanged();    m_fullName1 = makeBinaryBlock(tlv::Digest, fullname, fullnameLength);    return *this;  }  But, program always shows that "terminated with signal SIGSEGV",I don't konw how to solve it. 研究生 下一代互联网国家工程实验室 北京交通大学 寸怡鹏 Mob: (+86) 13238752918 Email: cunyipeng at bjtu.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170513/11e32ea1/attachment-0001.html>


More information about the ndnSIM mailing list