<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">you will have to create methods to encode and decode the additional fields.</div><div class=""><br class=""></div><div class="">You can take a look here:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/named-data/ndn-cxx/blob/master/src/data.cpp#L50-L167" class="">https://github.com/named-data/ndn-cxx/blob/master/src/data.cpp#L50-L167</a></div><div class=""><a href="https://github.com/named-data/ndn-cxx/blob/master/src/interest.cpp#L215-L361" class="">https://github.com/named-data/ndn-cxx/blob/master/src/interest.cpp#L215-L361</a></div><div class=""><br class=""></div><div class="">Hope that this helps.</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div><div class=""><span class="" style="float: none; display: inline !important;"><br class=""></span></div></div></div><div class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Oct 10, 2016, at 3:11 AM, 황인찬 <<a href="mailto:neogeoss@ajou.ac.kr" class="">neogeoss@ajou.ac.kr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Dear NDN Sim users,</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">I have been trying to add an additional property to an Interest packet.</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">In NDN-cxx, there is Interest.cpp file that defines Interest encoding in Interest::wireEncode(EncodingI<wbr class="">mpl<TAG>& encoder)</span></p><div style="font-size: 14px; text-indent: 10pt;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">// Interest ::= INTEREST-TYPE TLV-LENGTH</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                Name</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                Selectors?</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                Nonce</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                InterestLifetime?</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                Link?</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                SelectedDelegation?</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">  //                ProducerUid? </span><span style="font-family:wingdings" lang="EN-US" class="">à .......................</span><span lang="EN-US" class=""> I added it.</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px;text-indent:9pt"><span lang="EN-US" class="">// (reverse encoding)</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">There is also a decoding scheme for it, Interest::wireDecode(const Block& wire) in the file.</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Although I added additional variables and its getter and setters to the Interest packet,</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">There is an error "Requested decoding of ControlResponse, but Block is of different type"</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">when I run it with after I add //totalLength += getProducerUid().wireEncode(en<wbr class="">coder); for wireEncode</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">//m_ProducerUid.wireDecode(m_w<wbr class="">ire.get(tlv::Name)); for wireDecode.</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">I am now trying to match block types equal, But I am stuck. Does anyone of you know about adding a new property to the Interest and data packet?</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Any comment will help</span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class=""><br class=""></span></p><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Here is the current code I have been working on is in "<a href="https://github.com/NDNUtils/NDNSIM" class="">https://github.com/NDNUtils/NDNSIM</a>"</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Best wishes,</span></p><div style="font-size: 14px;" class=""><span lang="EN-US" class=""> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal" style="font-size:14px"><span lang="EN-US" class="">Inchan Hwang</span></p></div></div></blockquote></div><br class=""></div></body></html>