[ndnSIM] How to add a tag to the data?
黑客
1602883373 at qq.com
Fri Apr 14 18:15:23 PDT 2017
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/20170415/8da4c615/attachment.html>
More information about the ndnSIM
mailing list