<div dir="ltr"><div><div><div><b>wireDEcode (before nonce): </b><br><br> ////////////////////////////////////////<br> // Mateus UFBA-Brazil-2017<br> ////////////////////////////////////////<br> // NextForwarder<br> m_nextForwarder = m_wire.get(tlv::NextForwarder);<br> m_lastForwarder = m_wire.get(tlv::LastForwarder);<br><br> ////////////////////////////////////////<br> // END MATEUS<br> ////////////////////////////////////////<br><br></div><b>wireEncode:<br><br></b> //////////////////////////////////////////////////<br> // My modifications (Mateus)<br> //////////////////////////////////////////////////<br> getNextForwarder();<br> getLastForwarder();<br> totalLength += encoder.prependBlock(m_lastForwarder);<br> totalLength += encoder.prependBlock(m_nextForwarder);<br> //////////////////////////////////////////////////<br><br></div>I tried to copy the Nonce settings. <br><br></div>Thanks,<br><div><div><br><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-15 23:21 GMT-03:00 Spyridon (Spyros) Mastorakis <span dir="ltr"><<a href="mailto:mastorakis@cs.ucla.edu" target="_blank">mastorakis@cs.ucla.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>have you modified the wireEncode and wireDecode methods to encode/decode the field to/from wire format?</div><div><br></div><div>Thanks,</div><div><br><div>
<div><div><div><span style="float:none;display:inline!important">Spyridon (Spyros) Mastorakis</span><br><span style="float:none;display:inline!important">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" target="_blank">http://cs.ucla.edu/~<wbr>mastorakis/</a><br><span style="float:none;display:inline!important">Internet Research Laboratory</span><br><span style="float:none;display:inline!important">Computer Science Department</span><br><span style="float:none;display:inline!important">UCLA</span></div><div><br></div></div></div></div><div><div class="h5"><div><blockquote type="cite"><div>On Oct 15, 2017, at 4:28 PM, Mateus Sousa <<a href="mailto:mateus.aluufc@gmail.com" target="_blank">mateus.aluufc@gmail.com</a>> wrote:</div><br class="m_-1204199762260539453Apple-interchange-newline"><div><div dir="ltr">Hi all,<br><br>I added a new field to Interest packet by following the discussions: <a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-July/002044.html" target="_blank">http://www.lists.cs.ucla.edu/<wbr>pipermail/ndnsim/2015-July/<wbr>002044.html</a> and <a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-March/003481.html" target="_blank">http://www.lists.cs.ucla.edu/<wbr>pipermail/ndnsim/2017-March/<wbr>003481.html</a>.<br><br>I created the field "NextForwarder" to point what node is the next forwarder to the interest. This field should be updated at every node (here is the problem). <br><br>However, the alterations aren't persistent. The field value turns into "0" no matter what value I set.<br><br>Here goes my modifications:<br><br><b> src/Interest.cpp: </b><br> <br> Interest&<br> Interest::setNextForwarder(<wbr>uint32_t next) {<br> if (m_wire.hasWire() && m_nextForwarder.value_size() == sizeof(uint32_t)) {<br> std::memcpy(const_cast<uint8_<wbr>t*>(m_nextForwarder.value()), &next, sizeof(next));<br> }<br> else {<br> m_nextForwarder = makeBinaryBlock(tlv::<wbr>NextForwarder,<br> reinterpret_cast<const uint8_t*>(&next),<br> sizeof(next));<br> m_wire.reset();<br> }<br> return *this;<br>}<br><br>uint32_t<br>Interest::getNextForwarder() const{<br> if (!m_nextForwarder.hasWire())<br> const_cast<Interest*>(this)-><wbr>setNextForwarder(9999);<br><br> if (m_nextForwarder.value_size() == sizeof(uint32_t))<br> return *reinterpret_cast<const uint32_t*>(m_nextForwarder.<wbr>value());<br> else {<br> return readNonNegativeInteger(m_<wbr>nextForwarder);<br> }<br>}<br><br><br><b> encoding/tlv.h</b><br> NextForwarder = 33, // X- Mateus<br><br><br>Thanks in advance.<br></div><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>