Re: [ns] Help: accessing contents of data payload in NS2

2010-04-08 Thread Sidney Doria
There are many options to circunvent this issue and use packet payloads. Some more elegant, some less elegant. A more elegant is to use a new class inherited from AppData, ready to manipulate a real payload, and more, ready to manipulate real objects, or everything you want. (you must implement

Re: [ns] Help: accessing contents of data payload in NS2

2010-04-07 Thread MiLo_TUD
Oh, sorry. You used PacketData. But how did you wrote your payload to your packet ? I see, there's a problem. setdata(..) want a pointer to the class AppData. And you don't have direct access to the unsigned char* data_ of PacketData. So you can't create a new object with data inside. It is

Re: [ns] Help: accessing contents of data payload in NS2

2010-04-04 Thread MiLo_TUD
O S wrote: if((PacketData*)p-userdata()!=NULL) { PacketData* packdata = (PacketData*)p-userdata(); char* pdata = (char*)packdata-data(); printf(data = %c\n, pdata); } if (p-accessdata()!=NULL){ data_char = p-accessdata();

Re: [ns] Help: accessing contents of data payload in NS2

2010-04-02 Thread yogalakshmi balasubramaniam
Hi, I'm also want to know how to access the contents of the data payload. Please help me too.. -- Regards, yogalakshmi

[ns] Help: accessing contents of data payload in NS2

2010-04-01 Thread O S
Hi, I am trying to access the contents of the data payload of a packet in NS2 i.e. the actual bits of data. I have something like this: from packet.h, I can see that it has functions 'accessdata' and 'userdata' both of which return the data payload one way or another. But when I do this: