[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] how to set the data in a packet?



You can read gaf code gaf/gaf.cc to find how data is set 

On Wed, 11 Apr 2001 lyang01@fiu.edu wrote:

> Hi, there,
> 
> IS there anyone knows how to set the data in a packet? 
> 
> In my simulation, I need set some data in a packet and then send the packet out. I derived my own agent from Agent class to take care of this. Before sending the 
> packet, the agent has to put some data in the packet. I used the following code to create a packet and allocate the size for its data:
> 
> Packet * pk = allocpkt();
> pk->allocdata(size); //size of the data that I want to send
> 
> but I didn't find the function to set the data in the packet. from the packet.h, I know that I can use pk->setdata(Appdata *d) to pass an pointer to an instance of Class Appdata. but in the creation of the instance, there is no function that I can call to set the actual data. 
> 
> does anyone have any ideas? Any information or hints will be greatly appreciated.
> 
> Thank you.
> 
> Li yang
> 
> 
> 
>