Really thanks for your suggestion!

But I'm sorry that  haven't mentioned that I have already modified
ns-packet.tcl.

And the packet type and the packet size are still can't set.

On the other hand, my another goal is use new packet header to assign a
variable

"execute_time" with a exeponential time in 0.25s .

And in my sendmsg function, there is a part of my code like

hdr_task *task= hdr_task::access(pkt);

task->execute_time=Random::exeponential(0.25);

printf("packet executime is %f",task->execute_time);


And it will result in Segment fault.

So I change the code like following

hdr_task *task= hdr_task::access(pkt);

task->execute_time=0.25;

printf("packet executime is %f",task->execute_time);


Then the all packet executime is 0.25 now and no Segment fault.

So I'm wonder that whether the new packet setting is fixed,for packet size ,
type , execute time ...etc

. And all packet will be sended following this setting.

If I change the execute_time every time when I invoked sendmsg , it will
result in Segment fault.

Or just my code have a problem in use memory ?

My code AgentCPU.cc and AgentCPU.h is embed in the mail.

Could someone give me some advising?

Any suggestion very be very thankful!!
AgentCPU.h
<http://network-simulator-ns-2.7690.n7.nabble.com/file/n28642/AgentCPU.h>  

AgentCPU.cc
<http://network-simulator-ns-2.7690.n7.nabble.com/file/n28642/AgentCPU.cc>  



--
View this message in context: 
http://network-simulator-ns-2.7690.n7.nabble.com/how-to-set-packet-type-tp28622p28642.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to