[ndnSIM] Adding another "Name" type of field in Interest packet

Mudasir Qazi mudasirqazi00 at gmail.com
Sat May 26 05:10:48 PDT 2018


Hi,
I have tried adding another "Name" type of field in Interest packet. I have
done following steps:

*1: *Add private field in interest.hpp and write its getters and setters
(same as Name field already in Interest):
private: Name m_Name2;
public: const Name&
    getName2() const {
        return m_Name2;
    }
    Interest&
    setName2(const Name& name) {
        m_Name2 = name;
        m_wire.reset();
        return *this;
    }
*2:* Added value in tlv.hpp as Name2 = 40002
*3:* Added it in wireEncode and wireDecode method in interest.cpp class as:
*in wireEncode method:*
totalLength += getName2().wireEncode(encoder);
    totalLength += encoder.prependVarNumber(totalLength);
    totalLength += encoder.prependVarNumber(tlv::Name2);

*in wireDecode method:*
m_Name2.wireDecode(m_wire.get(tlv::Name2));

*Error:*
When I'm running scenario, its builds successfully. But after linking files
and before launching the simulator it gives following error:

terminate called after throwing an instance of
'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<ndn::Block::Error>
>'
  what():  (Block::get) Requested a non-existed type [10] from Block


*Please suggest a solution. Thank you very much.*


-- 
Regards,
Mudasir Qazi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180526/07f4106a/attachment.html>


More information about the ndnSIM mailing list