Dear All,
I have defined a new simple mac header class called AsimpleMacHeader which you can find in the attached files. I have defined m_source_addr and m_destination_addr and the corresponding set and get functions. I don't know why when I remove it from a packet, the destination address is different from what I had set. I even checked addheader and removeheader in the same place, and noticed that there is something wrong with using the removeheader function. For example, if you put the following inside your sources, you will see that the destination address is different from what you set:
AsimpleMacHeader hdrx;
hdrx.SetDestinationAddr (Mac48Address ("ff:ff:ff:ff:ff:ff"));
hdrx.SetSourceAddr (Mac48Address ("00:00:00:00:00:02"));
Ptr<Packet> newPacket0 = packet->Copy();
newPacket0->AddHeader(hdrx);
AsimpleMacHeader hdry;
uint32_t temp = newPacket0->RemoveHeader (hdry);
NS_LOG_INFO(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> temp = " << (long int ) temp << ", " << hdry.GetSourceAddr() << hdry.GetDestinationAddr());
(hdry.GetDestinationAddr() returns this address: 00:00:00:00:00:00)
I have not been able to find the reason. Could you please help me?
Thanks.
Tab