[ndnSIM] How to add a tag to the data?

John Bennedict Lorenzo kzer95 at gmail.com
Mon Apr 17 11:24:05 PDT 2017


Hello,

I faced this a few days ago, here's a link that helped me:
https://lo.calho.st/networks/adding-custom-packet-fields
-to-packets-in-ndnsim-2-3-without-forking-the-entire-repository/

On Mon, Apr 17, 2017 at 7:11 AM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:

> Hi,
>
> I would suggest that you start with the basics of object oriented
> programming in C++ before using ndnSIM:
>
> https://www.tutorialspoint.com/cplusplus/cpp_object_oriented.htm
>
> Thanks,
>
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
>
> On Apr 15, 2017, at 12:08 AM, 黑客 <1602883373 at qq.com> wrote:
>
> FwcontentCopyTag  is Constructor tag  of me  ,but i can not add it to the
> data.
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Spyridon (Spyros) Mastorakis"<mastorakis at cs.ucla.edu>;
> *发送时间:* 2017年4月15日(星期六) 上午10:55
> *收件人:* "黑客"<1602883373 at qq.com>;
> *抄送:* "ndnsim"<ndnsim at lists.cs.ucla.edu>;
> *主题:* Re: [ndnSIM] How to add a tag to the data?
>
> Hi,
>
> I think I responded to your question yesterday too:
>
> Please take a look here:
>
> http://www.lists.cs.ucla.edu/pipermail/ndnsim/2016-December/003250.html
>
> Thanks,
>
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
>
> On Apr 14, 2017, at 6:15 PM, 黑客 <1602883373 at qq.com> wrote:
>
> I want to add a tag to the data before the producer sent data,for examole:
>
>
> void
> Producer::OnInterest(shared_ptr<const Interest> interest)
> {
>   App::OnInterest(interest); // tracing inside
>   NS_LOG_FUNCTION(this << interest);
>   if (!m_active)
>     return;
>   Name dataName(interest->getName());
>   auto data = make_shared<Data>();
>   data->setName(dataName);
>   data->setFreshnessPeriod(::ndn::time::milliseconds(m_freshne
> ss.GetMilliSeconds()));
>   data->setContent(make_shared< ::ndn::Buffer>(m_virtualPayloadSize));
>   Signature signature;
>     if (m_keyLocator.size() > 0) {
>     signatureInfo.setKeyLocator(m_keyLocator);
>   }
>   signature.setInfo(signatureInfo);
>   signature.setValue(::ndn::makeNonNegativeIntegerBlock(::ndn::tlv::SignatureValue,
> m_signature));
>   data->setSignature(signature);
>   NS_LOG_INFO("node(" << GetNode()->GetId() << ") responding with Data: "
> << data->getName());
>   data->wireEncode();
>   // FwcontentCopyTag contentCopyTag;
>  // data->GetPayload()->AddPacketTag(contentCopyTag);
>   m_transmittedDatas(data, this, m_face);
>   m_appLink->onReceiveData(*data);
>
>
> the red sentence is the question of me  ?  I want use that to add a tag
> ,but it is Useless;
> so, I want to consult a way to achieve my ideal. thankyou!
>
>
>
>
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170418/4c05b3f2/attachment.html>


More information about the ndnSIM mailing list