[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Packet creation
I want to create a Packet in a agent and send it.
I do the following
Packet *p = allocpkt( ) ; or Packet *p = Packet::alloc( );
hdr_cmn *hdrc = HDR_CMN(p);
hdrc->next_hop_ = MAC_BROADCAST;
hdrc->size( ) += IP_HDR_LEN;
target_->recv(p,(Handler *)0);
I tried to define many other parameters of common header.
But I always get a Segmentation Fault Error.
The packet type used is PT_MESSAGE ( when this agent is created I pass
PT_MESSAGE as parameter for Agent superclass).
Thank You
Madhan