[ndnSIM] modification of 'OnInterest' in 'Producer' side
Alex Afanasyev
alexander.afanasyev at ucla.edu
Fri Jun 21 13:11:57 PDT 2013
Hi Amin,
You just add lines after line 122 in ndn-producer.cc with your custom settings to the created DATA packet. Like this:
header->SetName (Create<Name> (interest->GetName ()));
header->SetFreshness (m_freshness);
header->SetSignature (1);
If you want "signature" parameter to be configured in scenario, e.g., in this way:
ndn::AppHelper producerHelper ("ns3::ndn::Producer");
producerHelper.SetPrefix ("/prefix");
producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
producerHelper.SetAttribute ("Signature", StringValue("1"));
Then you would also need to make a couple of extra changes:
in ndn-producer.h
add new private variable
uint32_t m_signature;
in ndn-producer.cc in GetTypeId method (between line 66 and 67):
.AddAttribute ("Signature", "Fake signature",
UintegerValue (0),
MakeUintegerAccessor(&Producer::m_signature),
MakeUintegerChecker<uint32_t>())
And then on line 123, do something like:
header->SetSignature (m_signature);
---
Alex
On Jun 21, 2013, at 7:01 AM, Amin Karami <amin at ac.upc.edu> wrote:
> Hi,
> I am going to modify some fields in 'OnInterest' in side of the 'Producer'. e.g., signature of a specific content or freshness field of a specific content. I read this page to get more idea http://ndnsim.net/doxygen/ndn-producer_8cc_source.html
> But i could not understand how is it possible to implement in our scenarios?
>
> I appreciate in advance for any guidance in implementation
> Amin
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
More information about the ndnSIM
mailing list