[ndnSIM] Data Packet Payload

Spyridon (Spyros) Mastorakis spiros.mastorakis at gmail.com
Wed Jan 14 13:56:55 PST 2015


Hello Marco,

The payload of a Data packet is actually a NS-3 packet instance, which is included inside another NS-3 packet instance (i.e., the Data packet as a whole). In essence, you have a NS-3 packet instance inside another NS-3 packet instance. 

The most straightforward way that I can think right now is to convert the NS-3 packet to the corresponding Data packet and then use the GetPayload () method that returns a pointer to the NS-3 packet that contains the payload. Of course you can iterate over a buffer, but I really think that this is an extremely low level operation..

Hope that this helps.

--
Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
PhD Computer Science
UCLA




> On Jan 13, 2015, at 8:35 AM, Marco Ulgelmo <marco.ulgelmo at aol.com> wrote:
> 
> Hello,
> 
> Let’s assume I create a Data Packet invoking the Packet (const std::string &buffer) constructor.  I’d like to know if there is a straightforward method to read a Data Packet’s payload. Otherwise, is it possible to read it by using the iterators provided in the Buffer class? Specifically i’d need to read the payload as a string.
> 
> Thanks,
> 
> Marco
> _______________________________________________
> 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/20150114/d256bce9/attachment.html>


More information about the ndnSIM mailing list