Dear Ns-3 users,
I am trying to serialize and deserialize the char* type by the following way but getting segmentation fault at the deserialize function. Could someone please help me out with it. I have highlighted the line where I am getting error.
void
GoosePduHeader::Serialize (Buffer::Iterator start) const
{
uint16_t x;
Buffer::Iterator i = start;
for (x=0;x<sizeof(this->msg->gocbRef);x++)
{
i.WriteU8 (this->msg->gocbRef[x]);
}
uint32_t
GoosePduHeader::Deserialize (Buffer::Iterator start)
{
uint16_t x;
Buffer::Iterator i = start;
{
for (x=0;x<sizeof(this->msg->gocbRef);x++)
{
this->msg->gocbRef[x]=i.ReadU8();
}
}
Error message:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5de52b5 in ns3::GoosePduHeader::Deserialize (this=0x65b150,
start=...) at ../src/applications/model/apdu.cc:362
362 this->msg->gocbRef[x]=i.ReadU8();
Thanks a lot in advance!
Regards,
Rex