Hi ns3-users
I tried to send a packet at HWMP level so i added a trailer having:
Ipv4Address address;
double timestamp;
TseHeader::GetSerializedSize (void) const
{
NS_LOG_FUNCTION (this);
return 8;
}
void
TseHeader::Serialize (Buffer::Iterator start) const
{
NS_LOG_FUNCTION (this << &start);
uint32_t data= address.Get();
start.WriteU32 (data);
start.WriteU32 (timestamp);
}
I added this code in Hwmp-protocol.cc:
Ptr<Packet> signal = Create<Packet> ();
SignalHeader header;
TseHeader content;
header.SetEntity(1);
header.SetMessageLength(header.GetMessageLength()+ 12);
timestamp = ((double)Simulator::Now().GetSeconds())-timestamp;
content.SetAddress(address);
content.SetTimeStamp(timestamp);
signal->AddHeader (header);
signal->AddTrailer(content);
QueuedPacket sin;
sin.pkt=signal;
sin.dst=dst;
m_rqueue.push_back(sin);
This line ( signal->AddTrailer(content);) generates often this error:
assert failed. cond="Check (m_current)", msg="You have attempted to write after the end of the available buffer space. This usually indicates that Header::GetSerializedSize returned a size which is too small compared to what Header::Serialize is actually using.", file=./ns3/buffer.h, line=871
terminate called without an active exception
Please help me to correct this error.