<div dir="ltr">Dear ndnSim users and experts,<div> I'm trying to modify the caching strategy in a way that requires accessing the hopCount field in the data packet.</div><div><br></div><div>Below is my trial to access the hopCount field in data packet:</div><div><br></div><div>in content-store-impl.hpp (add method):</div><div><br></div><div><div>template<class Policy></div><div>bool</div><div>ContentStoreImpl<Policy>::Add(shared_ptr<const Data> data)</div><div>{</div><div> NS_LOG_FUNCTION(this << data->getName());</div><div><br></div><div> int TSB = 0;</div><div> auto TSBTag = data->getTag<lp::HopCountTag>();</div><div> if (TSBTag != nullptr) {</div><div> <span class="gmail-Apple-tab-span" style="white-space:pre"> </span> TSB = *TSBTag;</div><div> }</div><div> std::cout<<"in CS Impl, found HopCount = "<<TSB<<" \n";</div><div><br></div><div> Ptr<entry> newEntry = Create<entry>(this, data);</div><div> std::pair<typename super::iterator, bool> result = super::insert(data->getName(), newEntry);</div><div><br></div><div> if (result.first != super::end()) {</div><div> if (result.second) {</div><div> newEntry->SetTrie(result.first);</div><div><br></div><div> m_didAddEntry(newEntry);</div><div> std::cout<<"inside contentStoreImpl, new entry is added"<<"\n";</div><div> return true;</div><div> }</div><div> else {</div><div> // should we do anything?</div><div> // update payload? add new payload?</div><div> return false;</div><div> }</div><div> }</div><div> else</div><div> return false; // cannot insert entry</div><div>}</div><div><br></div><div>The problem is that, the pointer (TSBTag) is always null.</div><div><br></div><div>Is there any clue why is this happening? any suggestions how to get the hop count field of data packet from within the content-store-impl.hpp Add method.</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"> Regards<br>Amir I. Mohamad<br>Assistant Lecturer <br>Faculty of Computers & Information<br>IT Dept. Cairo University</div></div>
</div></div>
<br>
<br>