[ndnSIM] Getting Hop Count on Insert Method for New Custom Policy

Rizky Yanuar mryanuar21 at gmail.com
Thu Mar 16 17:24:57 PDT 2017


Hi Spyridon,

Thanks for the reply! I've tried the code and it passed the compiling
process, but everytime I check the hop count I always got 0 as the value.
I've checked the pointer and looks like it always get nullptr as its value.
Here is my code on the insert method:
shared_ptr<const Data> data = item->payload()->GetData();
    auto hopCountTag = data->getTag<lp::HopCountTag>();
    NS_LOG_DEBUG(hopCountTag); // it returns 0



On Fri, Mar 17, 2017 at 12:39 AM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:

> Hi,
>
> since the latest version of ndnSIM (v2.3), we do not use the NS3 packet
> tags for the hop count, but we rather use the LP tags implemented for the
> NDN Link Protocol (NDNLP):
>
> https://github.com/named-data-ndnSIM/ndnSIM/blob/master/
> apps/ndn-consumer.cpp#L227-L232
>
> Hope that this helps,
>
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
>
> On Mar 16, 2017, at 3:00 AM, Rizky Yanuar <mryanuar21 at gmail.com> wrote:
>
> Hello,
>
> I'm trying to get the hop count from a packet in a new custom policy based
> from existing policy (which is freshness-policy). I've tried using the
> example that's Alex mentioned in this mail: http://www.lists.cs.ucla.edu/
> pipermail/ndnsim/2016-February/002423.html
>
> However, on the compiling process I still got an error message:
>
> In file included from ../src/ndnSIM/model/cs/content-store-with-freshness.
> hpp:28:0,
>                  from ../src/ndnSIM/model/cs/content-store-with-freshness.
> cpp:20:
> ../src/ndnSIM/model/cs/custom-policies/freshness-policy.hpp: In member
> function ‘bool ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base,
> Container, Hook>::type::insert(typename ns3::ndn::ndnSIM::freshness_policy_traits::policy<Base,
> Container, Hook>::type::parent_trie::iterator)’:
> ../src/ndnSIM/model/cs/custom-policies/freshness-policy.hpp:114:27:
> error: expected unqualified-id before ‘typename’
>       auto dataTag = data->typename getTag<Ns3PacketTag>();
>                            ^
>
> I've tried remove the typename declaration and the <Ns3PacketTag> but I
> still failed on the compilation process. I'd greatly appreciate if anyone
> has any advice for this problem. Thank you very much.
>
> --
> *Muhamad Rizky Yanuar*
> *23515017*
> *mryanuar21 at gmail.com <mryanuar21 at gmail.com>*
>
>
>


-- 
*Muhamad Rizky Yanuar*
*23515017*
*mryanuar21 at gmail.com <mryanuar21 at gmail.com>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170317/8fb54bed/attachment-0001.html>


More information about the ndnSIM mailing list