<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydp7f32d398yahoo-style-wrap" style="font-family:times new roman, new york, times, serif;font-size:16px;"><div><div dir="ltr" data-setdir="false"><div><div><div dir="ltr">You can find Travis Mick's post on customizing NDN packets here:</div><div dir="ltr"><a shape="rect" class="ydpcb93d666yiv6436777714enhancr_card_5405121108" href="https://lo.calho.st/posts/ndnsim-custom-fields/" rel="nofollow" target="_blank">Adding custom fields to packets in ndnSIM 2.3 without forking the entire repository.</a></div><div><br clear="none"></div><div class="ydpcb93d666yiv6436777714ydpc80eb19ayahoo-link-enhancr-card ydpcb93d666yiv6436777714ydpc80eb19ayahoo-link-enhancr-not-allow-cover ydpcb93d666yiv6436777714ydpc80eb19aymail-preserve-class ydpcb93d666yiv6436777714ydpc80eb19aymail-preserve-style" id="ydpcb93d666yiv6436777714ydpc80eb19aenhancr_card_5405121108" style="max-width:400px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;position:relative;" data-url="https://lo.calho.st/posts/ndnsim-custom-fields/" data-type="YENHANCER" data-size="MEDIUM"><a shape="rect" class="ydpcb93d666yiv6436777714ydpc80eb19ayahoo-enhancr-cardlink" href="https://lo.calho.st/posts/ndnsim-custom-fields/" style="text-decoration-line:none !important;text-decoration-style:solid !important;text-decoration-color:currentcolor !important;color:rgb(0, 0, 0) !important;" rel="nofollow" target="_blank"><table class="ydpcb93d666yiv6436777714ydpc80eb19acard-wrapper ydpcb93d666yiv6436777714ydpc80eb19ayahoo-ignore-table" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400"><table class="ydpcb93d666yiv6436777714ydpc80eb19acard ydpcb93d666yiv6436777714ydpc80eb19ayahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1"><table class="ydpcb93d666yiv6436777714ydpc80eb19acard-info ydpcb93d666yiv6436777714ydpc80eb19ayahoo-ignore-table" style="background-color:rgb(255, 255, 255);background-repeat:repeat;background-attachment:scroll;background-image:none;background-size:auto;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0px 0px 2px 2px;border-top:1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"><br></td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;"><h2 class="ydpcb93d666yiv6436777714ydpc80eb19acard-title" style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;color:rgb(38, 40, 42);max-width:314px;">Adding custom fields to packets in ndnSIM 2.3 without forking the entire...</h2><p class="ydpcb93d666yiv6436777714ydpc80eb19acard-description" style="font-size:12px;line-height:16px;margin:0px;color:rgb(151, 155, 167);">The recommended way to build something on top of ndnSIM is to fork its scenario template repository and work ins...</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a><div class="ydpcb93d666card-controls-injection-wrapper" style="width: 100%; z-index: 3; min-height: 0px;"><div class="ydpcb93d666p_a ydpcb93d666T_6Fd5 ydpcb93d666R_6Fd5"><div class="ydpcb93d666I_ak5mD ydpcb93d666e_dRA ydpcb93d666j_2kgqsw ydpcb93d666P_wpoVE" style="z-index: 3;"><span></span></div></div></div></div></div><div><br clear="none"></div><div dir="ltr">I
 am sharing some of the similar modifications from Chinese portal which 
may need to be translated into English for better understanding.</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><a shape="rect" href="https://blog.csdn.net/m0_37313170/article/details/87904701" rel="nofollow" target="_blank">https://blog.csdn.net/m0_37313170/article/details/87904701</a></div><div dir="ltr"><br clear="none"></div><div dir="ltr"><a shape="rect" class="ydpcb93d666yiv6436777714enhancr_card_4570440210" href="https://blog.csdn.net/aladeen/article/details/78798093" rel="nofollow" target="_blank">[ndnSIM]在兴趣包或数据包中加入自定义字段_网络_aladeen的博客-CSDN博客</a></div><div><br clear="none"></div><div class="ydpcb93d666yiv6436777714ydp4c59e96yahoo-link-enhancr-card ydpcb93d666yiv6436777714ydp4c59e96yahoo-link-enhancr-not-allow-cover ydpcb93d666yiv6436777714ydp4c59e96ymail-preserve-class ydpcb93d666yiv6436777714ydp4c59e96ymail-preserve-style" id="ydpcb93d666yiv6436777714ydp4c59e96enhancr_card_4570440210" style="max-width: 400px; font-family: Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif; position: relative;" data-url="https://blog.csdn.net/aladeen/article/details/78798093" data-type="YENHANCER" data-size="MEDIUM"><a shape="rect" class="ydpcb93d666yiv6436777714ydp4c59e96yahoo-enhancr-cardlink" href="https://blog.csdn.net/aladeen/article/details/78798093" style="text-decoration-line:none !important;text-decoration-style:solid !important;text-decoration-color:currentcolor !important;color:rgb(0, 0, 0) !important;" rel="nofollow" target="_blank"><table class="ydpcb93d666yiv6436777714ydp4c59e96card-wrapper ydpcb93d666yiv6436777714ydp4c59e96yahoo-ignore-table" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400"><table class="ydpcb93d666yiv6436777714ydp4c59e96card ydpcb93d666yiv6436777714ydp4c59e96yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1"><table class="ydpcb93d666yiv6436777714ydp4c59e96card-info ydpcb93d666yiv6436777714ydp4c59e96yahoo-ignore-table" style="background-color:rgb(255, 255, 255);background-repeat:repeat;background-attachment:scroll;background-image:none;background-size:auto;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0px 0px 2px 2px;border-top:1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"><br></td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;"><h2 class="ydpcb93d666yiv6436777714ydp4c59e96card-title" style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;color:rgb(38, 40, 42);max-width:314px;">[ndnSIM]在兴趣包或数据包中加入自定义字段_网络_aladeen的博客-CSDN博客</h2><p class="ydpcb93d666yiv6436777714ydp4c59e96card-description" style="font-size:12px;line-height:16px;margin:0px;color:rgb(151, 155, 167);">先贴一个国外大神用的加Tag的方法: Adding custom fields to packets网络</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a><div class="ydpcb93d666card-controls-injection-wrapper" style="width: 100%; z-index: 3; min-height: 0px;"><div class="ydpcb93d666p_a ydpcb93d666T_6Fd5 ydpcb93d666R_6Fd5"><div class="ydpcb93d666I_ak5mD ydpcb93d666e_dRA ydpcb93d666j_2kgqsw ydpcb93d666P_wpoVE" style="z-index: 3;"><span></span></div></div></div></div><div><div><br clear="none"></div><div><br clear="none"></div></div></div></div><div><br></div><div class="ydp7f32d398signature">Kamrul Morshed<div>MS Student</div><div><br></div></div></div>
        <div><br></div><div><br></div>
        
        </div><div id="ydp29324a65yahoo_quoted_5104533102" class="ydp29324a65yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Wednesday, March 18, 2020, 7:07:27 PM GMT+8, Lynch Christopher <chlynch@tcd.ie> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="ydp29324a65yiv3605081710"><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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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" rel="nofollow" target="_blank">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;" rel="nofollow" target="_blank">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></div>_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" rel="nofollow" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="nofollow" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br></div>
            </div>
        </div></body></html>