<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; ">Hi!<div><br></div><div>ndnSIM tracks the hop count in complimentary packet tag structure FwHopCountTag.  To create a policy, you will need to create a new "policy" header file (e.g., similar to lru-policy) and in insert method put something like this:</div><div><br></div><div><br></div><div>...</div><div><br></div><div><div>      inline bool</div><div>      insert (typename parent_trie::iterator item)</div><div>      {</div><div>        Ptr<const Packet> pkt = item->payload ()->GetPacket ();</div><div>        FwHopCountTag tag;</div><div>        pkt->PeekPacketTag (tag);</div><div><br></div><div>        if (tag.Get () == 3)</div><div>          {</div><div>            policy_container::push_back (*item);</div><div>            return true;</div><div>          }</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>else</div><div>          {</div><div>            return false;</div><div>          }</div><div>      </div><div>      }</div></div><div><br></div><div>...</div><div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Jul 21, 2013, at 2:19 AM, 陈胜蓝 <<a href="mailto:blindeafer@163.com">blindeafer@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; "><div style="line-height: 1.7; font-size: 14px; font-family: arial; ">Hi All,<div>I would like to implement a hopcount-based cache policy,it is that each node will cache a content with a particular hopcount number,such as 3.Before a content is going to be sent,the hopcount of a content will be set to be 0 if it is cached,</div><div>If I would modify the OnData() function?<span style="line-height: 1.7;">How can I implement the policy? </span></div><div><span style="line-height: 1.7;">Thank you</span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">Beat regards.</span></div></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></div></body></html>