[ndnSIM] How to add a tag to the data?
Spyridon (Spyros) Mastorakis
mastorakis at cs.ucla.edu
Fri Apr 14 19:55:05 PDT 2017
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 <http://www.lists.cs.ucla.edu/pipermail/ndnsim/2016-December/003250.html>
Thanks,
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <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_freshness.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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170414/cbdf7f8c/attachment.html>
More information about the ndnSIM
mailing list