<div dir="ltr">Hi all,<div><br></div><div>I'm aware that this has been asked many times before but I can't seem to figure out where I'm going wrong. I want to add a custom field to the data packet class to indicate whether a packet has been pushed.</div><div><br></div><div>I have performed the following steps</div><div><br></div><div>1. Add pushed member variable to data class with getter and setter methods</div><div>2. Add pushed member variable to meta-info class with getter and setter methods</div><div>3. Add new type to tlv.hpp for pushedData field.</div><div>3. Edit wireEncode and wireDecode functions in meta-info class to include encoding and decoding for new custom field. In this case, I use the prependEmptyBlock function from the blockHelper class.</div><div><br></div><div>My changes compile and run fine, but the freshnessPeriod field of the data packet class is now incorrect after decoding. values range anywhere between 0 to 5205428264770612480. Here are some debug lines.</div><div><br></div><div><i>"+24.571161426s 46 ndn.Producer:OnInterest(): [DEBUG] data freshness=1000 milliseconds"</i></div><div><i>"+24.572752627s 0 RepeatingConsumer:OnData(): [DEBUG] << D: /cam freshness=3856880632320 milliseconds"</i></div><div><i>"+24.738112185s 3 RepeatingConsumer:OnData(): [DEBUG] << D: /cam freshness=5205428264770612480 milliseconds"</i><br></div><div><i><br></i></div><div>Here are links to the relevant changes if interested:</div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/encoding/tlv.hpp#L88">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/encoding/tlv.hpp#L88</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L229">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L229</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L226">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/data.hpp#L222-L226</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.hpp#L225">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.hpp#L225</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L66-L72">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L66-L72</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L162-L165">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L162-L165</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225</a><br></div><div><a href="https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225">https://github.com/ChrisLynch96/ndn-cxx/blob/push-data/ndn-cxx/meta-info.cpp#L219-L225</a><br></div><div><br></div><div>I've come across these threads when searching for answers:</div><div><a href="https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005579.html">https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005579.html</a><br></div><div><a href="https://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-July/002044.html">https://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-July/002044.html</a><br></div><div><a href="https://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-November/004277.html">https://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-November/004277.html</a><br></div><div><a href="https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005577.html">https://www.lists.cs.ucla.edu/pipermail/ndnsim/2019-October/005577.html</a><br></div><div><br></div><div>I would note that <a href="https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/" style="white-space:pre-wrap">https://lo.calho.st/networks/adding-custom-packet-fields-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/</a> does not exist anymore.</div><div><br></div><div>Any help is greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Chris</div><div><br></div></div>