[ns] Allocate and send a packet in C++ level
Thu, 1 Mar 2001 18:17:47 -0800 (PST)
> Packet *new_pkt = Agent::allocpkt()
> I used Agent:: because I do that in the Queue class and not in the Agent
> class. Also, I changed the "allocpkt()" in the agent.h to public from
> protected and I included the "agent.h in the C++ function in which I give
You should read the implementations of Agent::allocpkt() and
Agent::initpkt() in agent.cc, then you'll see they need member variables
of an Agent object hence can't be made a static method.
If you want to create a packet without an agent, change the implementation
of allocpkt() in your own class. If you are not deriving your class from
Agent you have to copy/adapt allocpkt there.