[Ndn-interest] [ndn-cxx][mini-NDN][General] Printing some information

bertolin at eurecom.fr bertolin at eurecom.fr
Mon Sep 12 07:13:37 PDT 2016


Good morning at all and thank you again for the help that I am  
receiving by your community.
I spent some time, without success, in trying to print the following  
information (I am working in miniNDN:

1) The Content of the Data.
If I print the packet, I obtain:
Name: /mat/try/normandie/%FC%00%05%3CO%E0%D0%FC%D7
MetaInfo: ContentType: 0, FreshnessPeriod: 10000 milliseconds
Content: (size: 6)
Signature: (type: 1, value_length: 256)

So I manage to play with the blocks and the buffers, but the  
documentation is not really verbose. However, I though to write:

	void onData(const Interest& interest, const Data& data) {
		log << "Data received correctly" << std::endl;
		log << data << endl;

		//take block
		ndn::Block x = data.getContent();

		//take buffer
		shared_ptr<const Buffer> buffer = x.getBuffer();

		//take string
		std::string content((char*)buffer.get(), 6);
		log << content << endl;
  	}

But on my log file I obtained just not-printable random characters!  
Where did I wrong?

2) the PIT table of a node. I did not find any with nfd-status and  
other commands. Is it possible in principle ?

3) Finallyh, I would like to concentrate here another question a bit  
different. Working with miniNDN, I would like to build the following  
topology:
Consume <-------> gateway <-------> Producer.
I already wrote my version of consumer and producer, with the callback  
onInterest, onData etc.. But with the gateway, conceptually how should  
I structure the program that works on this node?

Thank you for you help, I say it again it so I will not fill up the  
mailing list with just "thank you" answers :)
Matteo

-------------------------------------------------------------------------------
This message was sent using EURECOM Webmail: http://webmail.eurecom.fr





More information about the Ndn-interest mailing list